From: Andrea Amorese
Date: Thu, 18 Nov 2021 10:36:03 +0000 (+0100)
Subject: Built motion from commit 9a7b0d36.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base//%22api/fax/attachments/%7B%7BfaxAttachment.id%7D%7D/%22?a=commitdiff_plain;h=e58ae4d63d78f20bc038215c454dc4494f5901ae;p=motion2.git
Built motion from commit 9a7b0d36.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 442bc53..f426408 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-18T10:01:35.597Z",
+ "time": "2021-11-18T10:19:34.421Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 3f968c2..aef026d 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-18T10:01:35.597Z",
+ "time": "2021-11-18T10:19:34.421Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 8548018..a6d102c 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 _0x1335=['integration','motionbar','urlForward','browser','bot','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','getDataValue','STRING','contactManager'];(function(_0x246c78,_0xf4afb9){var _0x3c24fe=function(_0x413dac){while(--_0x413dac){_0x246c78['push'](_0x246c78['shift']());}};_0x3c24fe(++_0xf4afb9);}(_0x1335,0x19c));var _0x5133=function(_0x26728f,_0x3271c3){_0x26728f=_0x26728f-0x0;var _0x4a7ece=_0x1335[_0x26728f];return _0x4a7ece;};'use strict';var Sequelize=require(_0x5133('0x0'));module[_0x5133('0x1')]={'name':{'type':Sequelize[_0x5133('0x2')],'get':function(_0x558871){return this[_0x5133('0x3')]('action');}},'action':{'type':Sequelize[_0x5133('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5133('0x5'),_0x5133('0x6'),_0x5133('0x7'),'jscripty',_0x5133('0x8'),_0x5133('0x9'),_0x5133('0xa'),'script']],'msg':_0x5133('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5133('0x4')](0x1000),'comment':_0x5133('0xc')},'data2':{'type':Sequelize[_0x5133('0x4')](0x1000),'comment':_0x5133('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x5133('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x5133('0xf')},'data5':{'type':Sequelize[_0x5133('0x4')](0x1000),'comments':_0x5133('0x10')},'data6':{'type':Sequelize[_0x5133('0x4')],'comments':_0x5133('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5133('0x12')}};
\ No newline at end of file
+var _0xfd48=['exports','VIRTUAL','getDataValue','action','contactManager','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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[body]'];(function(_0x4f85c5,_0x517e60){var _0x46fc5b=function(_0x23381a){while(--_0x23381a){_0x4f85c5['push'](_0x4f85c5['shift']());}};_0x46fc5b(++_0x517e60);}(_0xfd48,0x168));var _0x8fd4=function(_0x359684,_0x5b7f9a){_0x359684=_0x359684-0x0;var _0xc0aa53=_0xfd48[_0x359684];return _0xc0aa53;};'use strict';var Sequelize=require('sequelize');module[_0x8fd4('0x0')]={'name':{'type':Sequelize[_0x8fd4('0x1')],'get':function(_0x40a088){return this[_0x8fd4('0x2')](_0x8fd4('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8fd4('0x4'),'integration',_0x8fd4('0x5'),_0x8fd4('0x6'),_0x8fd4('0x7'),_0x8fd4('0x8'),_0x8fd4('0x9'),'script']],'msg':_0x8fd4('0xa')}},'comment':_0x8fd4('0xa')},'data1':{'type':Sequelize[_0x8fd4('0xb')](0x1000),'comment':_0x8fd4('0xc')},'data2':{'type':Sequelize[_0x8fd4('0xb')](0x1000),'comment':_0x8fd4('0xd')},'data3':{'type':Sequelize[_0x8fd4('0xb')](0x1000),'comment':_0x8fd4('0xe')},'data4':{'type':Sequelize[_0x8fd4('0xb')](0x1000),'comments':_0x8fd4('0xf')},'data5':{'type':Sequelize[_0x8fd4('0xb')](0x1000),'comments':_0x8fd4('0x10')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x8fd4('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index a222c80..043eabb 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 _0xa905=['desk.js','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','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','name','send','body','Action','find','catch','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x29ffcd,_0x1c064b){var _0x379fad=function(_0x56d4a0){while(--_0x56d4a0){_0x29ffcd['push'](_0x29ffcd['shift']());}};_0x379fad(++_0x1c064b);}(_0xa905,0x14d));var _0x5a90=function(_0x312fa0,_0x4190bf){_0x312fa0=_0x312fa0-0x0;var _0x53b926=_0xa905[_0x312fa0];return _0x53b926;};'use strict';var emlformat=require(_0x5a90('0x0'));var rimraf=require(_0x5a90('0x1'));var zipdir=require(_0x5a90('0x2'));var jsonpatch=require(_0x5a90('0x3'));var rp=require(_0x5a90('0x4'));var moment=require(_0x5a90('0x5'));var BPromise=require(_0x5a90('0x6'));var Mustache=require('mustache');var util=require(_0x5a90('0x7'));var path=require(_0x5a90('0x8'));var sox=require(_0x5a90('0x9'));var csv=require(_0x5a90('0xa'));var ejs=require(_0x5a90('0xb'));var fs=require('fs');var fs_extra=require(_0x5a90('0xc'));var _=require(_0x5a90('0xd'));var squel=require(_0x5a90('0xe'));var crypto=require(_0x5a90('0xf'));var jsforce=require(_0x5a90('0x10'));var deskjs=require(_0x5a90('0x11'));var toCsv=require(_0x5a90('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a90('0x12'));var authService=require(_0x5a90('0x13'));var qs=require(_0x5a90('0x14'));var as=require(_0x5a90('0x15'));var hardwareService=require(_0x5a90('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x5a90('0x17'));var config=require(_0x5a90('0x18'));var licenseUtil=require(_0x5a90('0x19'));var db=require(_0x5a90('0x1a'))['db'];function respondWithStatusCode(_0x12937b,_0x4c16c2){_0x4c16c2=_0x4c16c2||0xcc;return function(_0x2e2269){if(_0x2e2269){return _0x12937b[_0x5a90('0x1b')](_0x4c16c2);}return _0x12937b[_0x5a90('0x1c')](_0x4c16c2)[_0x5a90('0x1d')]();};}function respondWithResult(_0x556a2b,_0x3ff6b7){_0x3ff6b7=_0x3ff6b7||0xc8;return function(_0x454353){if(_0x454353){return _0x556a2b[_0x5a90('0x1c')](_0x3ff6b7)[_0x5a90('0x1e')](_0x454353);}};}function respondWithFilteredResult(_0x16940b,_0x35a209){return function(_0x1e1f7d){if(_0x1e1f7d){var _0x2b8833=typeof _0x35a209['offset']===_0x5a90('0x1f')&&typeof _0x35a209[_0x5a90('0x20')]===_0x5a90('0x1f');var _0x510f16=_0x1e1f7d[_0x5a90('0x21')];var _0x2e95e8=_0x2b8833?0x0:_0x35a209[_0x5a90('0x22')];var _0xd87d50=_0x2b8833?_0x1e1f7d[_0x5a90('0x21')]:_0x35a209[_0x5a90('0x22')]+_0x35a209['limit'];var _0x1ef751;if(_0xd87d50>=_0x510f16){_0xd87d50=_0x510f16;_0x1ef751=0xc8;}else{_0x1ef751=0xce;}_0x16940b[_0x5a90('0x1c')](_0x1ef751);return _0x16940b['set'](_0x5a90('0x23'),_0x2e95e8+'-'+_0xd87d50+'/'+_0x510f16)[_0x5a90('0x1e')](_0x1e1f7d);}return null;};}function patchUpdates(_0x38e326){return function(_0x4d981c){try{jsonpatch[_0x5a90('0x24')](_0x4d981c,_0x38e326,!![]);}catch(_0x26156d){return BPromise[_0x5a90('0x25')](_0x26156d);}return _0x4d981c[_0x5a90('0x26')]();};}function saveUpdates(_0x1dc4e4,_0x1c0905){return function(_0x40a721){if(_0x40a721){return _0x40a721[_0x5a90('0x27')](_0x1dc4e4)[_0x5a90('0x28')](function(_0x6791cf){return _0x6791cf;});}return null;};}function removeEntity(_0x26a90e,_0x3a0c92){return function(_0x308a92){if(_0x308a92){return _0x308a92['destroy']()[_0x5a90('0x28')](function(){_0x26a90e[_0x5a90('0x1c')](0xcc)[_0x5a90('0x1d')]();});}};}function handleEntityNotFound(_0x5f0f73,_0x3c2c43){return function(_0x2aee47){if(!_0x2aee47){_0x5f0f73[_0x5a90('0x1b')](0x194);}return _0x2aee47;};}function handleError(_0x3d195c,_0x52d4f1){_0x52d4f1=_0x52d4f1||0x1f4;return function(_0x1095e0){logger[_0x5a90('0x29')](_0x1095e0['stack']);if(_0x1095e0[_0x5a90('0x2a')]){delete _0x1095e0[_0x5a90('0x2a')];}_0x3d195c['status'](_0x52d4f1)[_0x5a90('0x2b')](_0x1095e0);};}exports['update']=function(_0x1d019f,_0xf49347){if(_0x1d019f[_0x5a90('0x2c')]['id']){delete _0x1d019f[_0x5a90('0x2c')]['id'];}return db[_0x5a90('0x2d')][_0x5a90('0x2e')]({'where':{'id':_0x1d019f['params']['id']}})[_0x5a90('0x28')](handleEntityNotFound(_0xf49347,null))[_0x5a90('0x28')](saveUpdates(_0x1d019f['body'],null))[_0x5a90('0x28')](respondWithResult(_0xf49347,null))[_0x5a90('0x2f')](handleError(_0xf49347,null));};exports[_0x5a90('0x30')]=function(_0x38bdc4,_0x4b1cc0){return db[_0x5a90('0x2d')]['find']({'where':{'id':_0x38bdc4[_0x5a90('0x31')]['id']}})['then'](handleEntityNotFound(_0x4b1cc0,null))[_0x5a90('0x28')](removeEntity(_0x4b1cc0,null))['catch'](handleError(_0x4b1cc0,null));};
\ No newline at end of file
+var _0xbcdd=['then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xbcdd,0xfb));var _0xdbcd=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0xbcdd[_0x39caaa];return _0x9b9c7d;};'use strict';var emlformat=require(_0xdbcd('0x0'));var rimraf=require(_0xdbcd('0x1'));var zipdir=require(_0xdbcd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbcd('0x3'));var moment=require(_0xdbcd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbcd('0x5'));var util=require('util');var path=require(_0xdbcd('0x6'));var sox=require(_0xdbcd('0x7'));var csv=require(_0xdbcd('0x8'));var ejs=require(_0xdbcd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbcd('0xa'));var squel=require(_0xdbcd('0xb'));var crypto=require(_0xdbcd('0xc'));var jsforce=require(_0xdbcd('0xd'));var deskjs=require(_0xdbcd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbcd('0xf'));var Papa=require(_0xdbcd('0x10'));var Redis=require(_0xdbcd('0x11'));var authService=require(_0xdbcd('0x12'));var qs=require(_0xdbcd('0x13'));var as=require(_0xdbcd('0x14'));var hardwareService=require(_0xdbcd('0x15'));var logger=require('../../config/logger')(_0xdbcd('0x16'));var utils=require(_0xdbcd('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdbcd('0x18'))['db'];function respondWithStatusCode(_0x5de907,_0x401482){_0x401482=_0x401482||0xcc;return function(_0x10d518){if(_0x10d518){return _0x5de907[_0xdbcd('0x19')](_0x401482);}return _0x5de907[_0xdbcd('0x1a')](_0x401482)[_0xdbcd('0x1b')]();};}function respondWithResult(_0xf513c3,_0x42f94a){_0x42f94a=_0x42f94a||0xc8;return function(_0x505f7f){if(_0x505f7f){return _0xf513c3['status'](_0x42f94a)[_0xdbcd('0x1c')](_0x505f7f);}};}function respondWithFilteredResult(_0x3b0154,_0x5b9798){return function(_0x50ec05){if(_0x50ec05){var _0x70330f=typeof _0x5b9798[_0xdbcd('0x1d')]==='undefined'&&typeof _0x5b9798[_0xdbcd('0x1e')]==='undefined';var _0x33ce99=_0x50ec05[_0xdbcd('0x1f')];var _0x19d44c=_0x70330f?0x0:_0x5b9798[_0xdbcd('0x1d')];var _0x5796aa=_0x70330f?_0x50ec05[_0xdbcd('0x1f')]:_0x5b9798[_0xdbcd('0x1d')]+_0x5b9798[_0xdbcd('0x1e')];var _0x4ca59a;if(_0x5796aa>=_0x33ce99){_0x5796aa=_0x33ce99;_0x4ca59a=0xc8;}else{_0x4ca59a=0xce;}_0x3b0154['status'](_0x4ca59a);return _0x3b0154[_0xdbcd('0x20')]('Content-Range',_0x19d44c+'-'+_0x5796aa+'/'+_0x33ce99)['json'](_0x50ec05);}return null;};}function patchUpdates(_0x448e9b){return function(_0x4ee4d5){try{jsonpatch[_0xdbcd('0x21')](_0x4ee4d5,_0x448e9b,!![]);}catch(_0x3592c5){return BPromise[_0xdbcd('0x22')](_0x3592c5);}return _0x4ee4d5[_0xdbcd('0x23')]();};}function saveUpdates(_0x3075a2,_0x58fca4){return function(_0x821135){if(_0x821135){return _0x821135[_0xdbcd('0x24')](_0x3075a2)[_0xdbcd('0x25')](function(_0x2d96fc){return _0x2d96fc;});}return null;};}function removeEntity(_0x26e4e6,_0x165193){return function(_0x4dc132){if(_0x4dc132){return _0x4dc132[_0xdbcd('0x26')]()[_0xdbcd('0x25')](function(){_0x26e4e6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ef5e9,_0x5b6361){return function(_0x42c5ae){if(!_0x42c5ae){_0x3ef5e9[_0xdbcd('0x19')](0x194);}return _0x42c5ae;};}function handleError(_0x134a5,_0xb3ac17){_0xb3ac17=_0xb3ac17||0x1f4;return function(_0x28e18e){logger[_0xdbcd('0x27')](_0x28e18e[_0xdbcd('0x28')]);if(_0x28e18e['name']){delete _0x28e18e[_0xdbcd('0x29')];}_0x134a5[_0xdbcd('0x1a')](_0xb3ac17)[_0xdbcd('0x2a')](_0x28e18e);};}exports[_0xdbcd('0x24')]=function(_0x3cefc3,_0x5c8517){if(_0x3cefc3[_0xdbcd('0x2b')]['id']){delete _0x3cefc3[_0xdbcd('0x2b')]['id'];}return db[_0xdbcd('0x2c')][_0xdbcd('0x2d')]({'where':{'id':_0x3cefc3[_0xdbcd('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5c8517,null))['then'](saveUpdates(_0x3cefc3[_0xdbcd('0x2b')],null))['then'](respondWithResult(_0x5c8517,null))[_0xdbcd('0x2f')](handleError(_0x5c8517,null));};exports[_0xdbcd('0x26')]=function(_0x2c18db,_0x3f046d){return db[_0xdbcd('0x2c')][_0xdbcd('0x2d')]({'where':{'id':_0x2c18db[_0xdbcd('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3f046d,null))[_0xdbcd('0x25')](removeEntity(_0x3f046d,null))[_0xdbcd('0x2f')](handleError(_0x3f046d,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index ea72d86..1a43d18 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 _0xd36f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xd36f,0x1a4));var _0xfd36=function(_0x30688d,_0x251a4e){_0x30688d=_0x30688d-0x0;var _0x2fb7ca=_0xd36f[_0x30688d];return _0x2fb7ca;};'use strict';var _=require(_0xfd36('0x0'));var util=require(_0xfd36('0x1'));var logger=require(_0xfd36('0x2'))(_0xfd36('0x3'));var moment=require(_0xfd36('0x4'));var BPromise=require(_0xfd36('0x5'));var rp=require(_0xfd36('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd36('0x7'));var config=require(_0xfd36('0x8'));var attributes=require(_0xfd36('0x9'));module[_0xfd36('0xa')]=function(_0x4e67e7,_0x1abaa8){return _0x4e67e7[_0xfd36('0xb')](_0xfd36('0xc'),attributes,{'tableName':_0xfd36('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11e9=['request-promise','path','exports','Action','util','api','bluebird'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x11e9,0x169));var _0x911e=function(_0x40752a,_0x28de97){_0x40752a=_0x40752a-0x0;var _0x28fc25=_0x11e9[_0x40752a];return _0x28fc25;};'use strict';var _=require('lodash');var util=require(_0x911e('0x0'));var logger=require('../../config/logger')(_0x911e('0x1'));var moment=require('moment');var BPromise=require(_0x911e('0x2'));var rp=require(_0x911e('0x3'));var fs=require('fs');var path=require(_0x911e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x911e('0x5')]=function(_0x47feaa,_0x1f73e8){return _0x47feaa['define'](_0x911e('0x6'),attributes,{'tableName':'tools_actions','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 f7629b8..dc26815 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x33335e,_0x188610){var _0x52a0ba=function(_0x14bcf2){while(--_0x14bcf2){_0x33335e['push'](_0x33335e['shift']());}};_0x52a0ba(++_0x188610);}(_0xabce,0x103));var _0xeabc=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xabce[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x1cb9,0x14e));var _0x91cb=function(_0x23e23a,_0x95e35f){_0x23e23a=_0x23e23a-0x0;var _0x57b50c=_0x1cb9[_0x23e23a];return _0x57b50c;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7ffda87..8fa7c48 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 _0x237c=['/:id','isAuthenticated','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','./action.controller','put'];(function(_0x1bfd43,_0x2b9d99){var _0x13fbc9=function(_0xb3fda){while(--_0xb3fda){_0x1bfd43['push'](_0x1bfd43['shift']());}};_0x13fbc9(++_0x2b9d99);}(_0x237c,0x94));var _0xc237=function(_0x48d2ea,_0x158ac3){_0x48d2ea=_0x48d2ea-0x0;var _0x18a8d5=_0x237c[_0x48d2ea];return _0x18a8d5;};'use strict';var multer=require(_0xc237('0x0'));var util=require('util');var path=require(_0xc237('0x1'));var timeout=require('connect-timeout');var express=require(_0xc237('0x2'));var router=express[_0xc237('0x3')]();var fs_extra=require(_0xc237('0x4'));var auth=require(_0xc237('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc237('0x6'));router[_0xc237('0x7')](_0xc237('0x8'),auth[_0xc237('0x9')](),controller[_0xc237('0xa')]);router[_0xc237('0xb')](_0xc237('0x8'),auth[_0xc237('0x9')](),controller[_0xc237('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x4e64=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3afa67,_0x3dc4a8){var _0x32d1da=function(_0x5943b2){while(--_0x5943b2){_0x3afa67['push'](_0x3afa67['shift']());}};_0x32d1da(++_0x3dc4a8);}(_0x4e64,0x12b));var _0x44e6=function(_0x55e2f4,_0x715c55){_0x55e2f4=_0x55e2f4-0x0;var _0x53e0f3=_0x4e64[_0x55e2f4];return _0x53e0f3;};'use strict';var multer=require(_0x44e6('0x0'));var util=require(_0x44e6('0x1'));var path=require(_0x44e6('0x2'));var timeout=require(_0x44e6('0x3'));var express=require(_0x44e6('0x4'));var router=express[_0x44e6('0x5')]();var fs_extra=require(_0x44e6('0x6'));var auth=require(_0x44e6('0x7'));var interaction=require(_0x44e6('0x8'));var config=require(_0x44e6('0x9'));var controller=require(_0x44e6('0xa'));router[_0x44e6('0xb')](_0x44e6('0xc'),auth[_0x44e6('0xd')](),controller[_0x44e6('0xe')]);router[_0x44e6('0xf')](_0x44e6('0xc'),auth[_0x44e6('0xd')](),controller['destroy']);module[_0x44e6('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 33dcc87..d9855a9 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 _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x25f895,_0x2539da){var _0x4fcfe2=function(_0x1ce114){while(--_0x1ce114){_0x25f895['push'](_0x25f895['shift']());}};_0x4fcfe2(++_0x2539da);}(_0x5496,0x175));var _0x6549=function(_0x590228,_0xb6c815){_0x590228=_0x590228-0x0;var _0x5bef73=_0x5496[_0x590228];return _0x5bef73;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5d58=['TEXT','STRING'];(function(_0x19d896,_0x78d074){var _0x538e49=function(_0x5449c6){while(--_0x5449c6){_0x19d896['push'](_0x19d896['shift']());}};_0x538e49(++_0x78d074);}(_0x5d58,0x187));var _0x85d5=function(_0x11cda2,_0x2124e5){_0x11cda2=_0x11cda2-0x0;var _0x4dfd78=_0x5d58[_0x11cda2];return _0x4dfd78;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 2e307b5..cf782f2 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 _0x7905=['COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','select','from','MetricId','groupBy','table','fullPath','%s-%s.%s','randomstring','generate','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','set','reject','save','destroy','then','get','CustomReports','UserProfileResource','error','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','AnalyticCustomReport','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join'];(function(_0x47fd57,_0x49920a){var _0x2af1fb=function(_0xc834ba){while(--_0xc834ba){_0x47fd57['push'](_0x47fd57['shift']());}};_0x2af1fb(++_0x49920a);}(_0x7905,0xf1));var _0x5790=function(_0x10ddbf,_0x553f5d){_0x10ddbf=_0x10ddbf-0x0;var _0x1fd81e=_0x7905[_0x10ddbf];return _0x1fd81e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5790('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5790('0x1'));var rp=require(_0x5790('0x2'));var moment=require(_0x5790('0x3'));var BPromise=require(_0x5790('0x4'));var Mustache=require(_0x5790('0x5'));var util=require(_0x5790('0x6'));var path=require(_0x5790('0x7'));var sox=require('sox');var csv=require(_0x5790('0x8'));var ejs=require(_0x5790('0x9'));var fs=require('fs');var fs_extra=require(_0x5790('0xa'));var _=require(_0x5790('0xb'));var squel=require(_0x5790('0xc'));var crypto=require(_0x5790('0xd'));var jsforce=require(_0x5790('0xe'));var deskjs=require(_0x5790('0xf'));var toCsv=require(_0x5790('0x8'));var querystring=require(_0x5790('0x10'));var Papa=require(_0x5790('0x11'));var Redis=require('ioredis');var authService=require(_0x5790('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5790('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5790('0x14'));var config=require(_0x5790('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5790('0x16'))['db'];var dbH=require('../../mysqldb')[_0x5790('0x17')];function respondWithStatusCode(_0x1782c7,_0x51aca8){_0x51aca8=_0x51aca8||0xcc;return function(_0xa605c6){if(_0xa605c6){return _0x1782c7[_0x5790('0x18')](_0x51aca8);}return _0x1782c7['status'](_0x51aca8)[_0x5790('0x19')]();};}function respondWithResult(_0x37dc51,_0x3178ab){_0x3178ab=_0x3178ab||0xc8;return function(_0x3f832b){if(_0x3f832b){return _0x37dc51[_0x5790('0x1a')](_0x3178ab)[_0x5790('0x1b')](_0x3f832b);}};}function respondWithFilteredResult(_0x46d1ca,_0x28776c){return function(_0xb43e24){if(_0xb43e24){var _0x4cfcc9=typeof _0x28776c[_0x5790('0x1c')]===_0x5790('0x1d')&&typeof _0x28776c[_0x5790('0x1e')]===_0x5790('0x1d');var _0x41f35d=_0xb43e24['count'];var _0x2c31c9=_0x4cfcc9?0x0:_0x28776c[_0x5790('0x1c')];var _0x2e1353=_0x4cfcc9?_0xb43e24['count']:_0x28776c[_0x5790('0x1c')]+_0x28776c[_0x5790('0x1e')];var _0xac6ff;if(_0x2e1353>=_0x41f35d){_0x2e1353=_0x41f35d;_0xac6ff=0xc8;}else{_0xac6ff=0xce;}_0x46d1ca[_0x5790('0x1a')](_0xac6ff);return _0x46d1ca[_0x5790('0x1f')]('Content-Range',_0x2c31c9+'-'+_0x2e1353+'/'+_0x41f35d)['json'](_0xb43e24);}return null;};}function patchUpdates(_0x1d509c){return function(_0x324f4e){try{jsonpatch['apply'](_0x324f4e,_0x1d509c,!![]);}catch(_0x2904a8){return BPromise[_0x5790('0x20')](_0x2904a8);}return _0x324f4e[_0x5790('0x21')]();};}function saveUpdates(_0xc057d2,_0x54325c){return function(_0x29d1be){if(_0x29d1be){return _0x29d1be['update'](_0xc057d2)['then'](function(_0x910b00){return _0x910b00;});}return null;};}function removeEntity(_0x17735e,_0x5053cc){return function(_0x3b1160){if(_0x3b1160){return _0x3b1160[_0x5790('0x22')]()[_0x5790('0x23')](function(){var _0x58fc69=_0x3b1160[_0x5790('0x24')]({'plain':!![]});var _0x1d19bb=_0x5790('0x25');return db[_0x5790('0x26')][_0x5790('0x22')]({'where':{'type':_0x1d19bb,'resourceId':_0x58fc69['id']}})[_0x5790('0x23')](function(){return _0x3b1160;});})[_0x5790('0x23')](function(){_0x17735e[_0x5790('0x1a')](0xcc)[_0x5790('0x19')]();});}};}function handleEntityNotFound(_0x342524,_0x6a3f48){return function(_0x3e1bc1){if(!_0x3e1bc1){_0x342524[_0x5790('0x18')](0x194);}return _0x3e1bc1;};}function handleError(_0x1f2edd,_0x54000d){_0x54000d=_0x54000d||0x1f4;return function(_0x31dcf1){logger[_0x5790('0x27')](_0x31dcf1['stack']);if(_0x31dcf1[_0x5790('0x28')]){delete _0x31dcf1[_0x5790('0x28')];}_0x1f2edd['status'](_0x54000d)['send'](_0x31dcf1);};}exports[_0x5790('0x29')]=function(_0x2dbdfa,_0x38748){var _0x4be8f4={},_0x456a87={},_0x5113b6={'count':0x0,'rows':[]};var _0x4d6293=_[_0x5790('0x2a')](db['AnalyticCustomReport']['rawAttributes'],function(_0x310512){return{'name':_0x310512[_0x5790('0x2b')],'type':_0x310512[_0x5790('0x2c')][_0x5790('0x2d')]};});_0x456a87[_0x5790('0x2e')]=_['map'](_0x4d6293,_0x5790('0x28'));_0x456a87[_0x5790('0x2f')]=_['keys'](_0x2dbdfa['query']);_0x456a87[_0x5790('0x30')]=_[_0x5790('0x31')](_0x456a87[_0x5790('0x2e')],_0x456a87[_0x5790('0x2f')]);_0x4be8f4[_0x5790('0x32')]=_['intersection'](_0x456a87[_0x5790('0x2e')],qs[_0x5790('0x33')](_0x2dbdfa[_0x5790('0x2f')][_0x5790('0x33')]));_0x4be8f4[_0x5790('0x32')]=_0x4be8f4[_0x5790('0x32')][_0x5790('0x34')]?_0x4be8f4[_0x5790('0x32')]:_0x456a87['model'];if(!_0x2dbdfa[_0x5790('0x2f')][_0x5790('0x35')](_0x5790('0x36'))){_0x4be8f4[_0x5790('0x1e')]=qs['limit'](_0x2dbdfa[_0x5790('0x2f')][_0x5790('0x1e')]);_0x4be8f4[_0x5790('0x1c')]=qs['offset'](_0x2dbdfa['query'][_0x5790('0x1c')]);}_0x4be8f4[_0x5790('0x37')]=qs[_0x5790('0x38')](_0x2dbdfa[_0x5790('0x2f')][_0x5790('0x38')]);_0x4be8f4[_0x5790('0x39')]=qs[_0x5790('0x30')](_[_0x5790('0x3a')](_0x2dbdfa[_0x5790('0x2f')],_0x456a87[_0x5790('0x30')]),_0x4d6293);if(_0x2dbdfa[_0x5790('0x2f')][_0x5790('0x3b')]){_0x4be8f4[_0x5790('0x39')]=_['merge'](_0x4be8f4[_0x5790('0x39')],{'$or':_['map'](_0x4d6293,function(_0x399318){if(_0x399318[_0x5790('0x2c')]!==_0x5790('0x3c')){var _0x35c422={};_0x35c422[_0x399318[_0x5790('0x28')]]={'$like':'%'+_0x2dbdfa['query']['filter']+'%'};return _0x35c422;}})});}_0x4be8f4=_[_0x5790('0x3d')]({},_0x4be8f4,_0x2dbdfa['options']);var _0x4d6092={'where':_0x4be8f4[_0x5790('0x39')]};return db['AnalyticCustomReport']['count'](_0x4d6092)[_0x5790('0x23')](function(_0x1d4a02){_0x5113b6[_0x5790('0x3e')]=_0x1d4a02;if(_0x2dbdfa[_0x5790('0x2f')][_0x5790('0x3f')]){_0x4be8f4[_0x5790('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5790('0x41')](_0x4be8f4);})['then'](function(_0x5a2298){_0x5113b6[_0x5790('0x42')]=_0x5a2298;return _0x5113b6;})[_0x5790('0x23')](respondWithFilteredResult(_0x38748,_0x4be8f4))[_0x5790('0x43')](handleError(_0x38748,null));};exports[_0x5790('0x44')]=function(_0x20e7f6,_0x17cf16){var _0x570507={'raw':![],'where':{'id':_0x20e7f6[_0x5790('0x45')]['id']}},_0xaff9f9={};_0xaff9f9['model']=_[_0x5790('0x46')](db[_0x5790('0x47')]['rawAttributes']);_0xaff9f9['query']=_['keys'](_0x20e7f6['query']);_0xaff9f9[_0x5790('0x30')]=_[_0x5790('0x31')](_0xaff9f9['model'],_0xaff9f9[_0x5790('0x2f')]);_0x570507[_0x5790('0x32')]=_['intersection'](_0xaff9f9[_0x5790('0x2e')],qs[_0x5790('0x33')](_0x20e7f6[_0x5790('0x2f')][_0x5790('0x33')]));_0x570507[_0x5790('0x32')]=_0x570507['attributes'][_0x5790('0x34')]?_0x570507[_0x5790('0x32')]:_0xaff9f9[_0x5790('0x2e')];if(_0x20e7f6['query'][_0x5790('0x3f')]){_0x570507[_0x5790('0x40')]=[{'all':!![]}];}_0x570507=_[_0x5790('0x3d')]({},_0x570507,_0x20e7f6[_0x5790('0x48')]);return db['AnalyticCustomReport']['find'](_0x570507)[_0x5790('0x23')](handleEntityNotFound(_0x17cf16,null))[_0x5790('0x23')](respondWithResult(_0x17cf16,null))[_0x5790('0x43')](handleError(_0x17cf16,null));};exports['create']=function(_0x2f6f46,_0x34e612){return db[_0x5790('0x47')][_0x5790('0x49')](_0x2f6f46[_0x5790('0x4a')],{})[_0x5790('0x23')](function(_0x21ec98){var _0x42466b=_0x2f6f46[_0x5790('0x4b')][_0x5790('0x24')]({'plain':!![]});if(!_0x42466b)throw new Error(_0x5790('0x4c'));if(_0x42466b[_0x5790('0x4d')]===_0x5790('0x4b')){var _0x239590=_0x21ec98[_0x5790('0x24')]({'plain':!![]});var _0x4e8142='Reports';return db[_0x5790('0x4e')][_0x5790('0x4f')]({'where':{'name':_0x4e8142,'userProfileId':_0x42466b[_0x5790('0x50')]},'raw':!![]})[_0x5790('0x23')](function(_0x1ad59d){if(_0x1ad59d&&_0x1ad59d[_0x5790('0x51')]===0x0){return db[_0x5790('0x26')][_0x5790('0x49')]({'name':_0x239590['name'],'resourceId':_0x239590['id'],'type':_0x5790('0x25'),'sectionId':_0x1ad59d['id']},{})[_0x5790('0x23')](function(){return _0x21ec98;});}else{return _0x21ec98;}})[_0x5790('0x43')](function(_0x27d45d){logger[_0x5790('0x27')](_0x5790('0x52'),_0x27d45d);throw _0x27d45d;});}return _0x21ec98;})[_0x5790('0x23')](respondWithResult(_0x34e612,0xc9))['catch'](handleError(_0x34e612,null));};exports['update']=function(_0x47db98,_0x5b2389){if(_0x47db98[_0x5790('0x4a')]['id']){delete _0x47db98[_0x5790('0x4a')]['id'];}return db[_0x5790('0x47')]['find']({'where':{'id':_0x47db98[_0x5790('0x45')]['id']}})[_0x5790('0x23')](handleEntityNotFound(_0x5b2389,null))[_0x5790('0x23')](saveUpdates(_0x47db98[_0x5790('0x4a')],null))[_0x5790('0x23')](respondWithResult(_0x5b2389,null))[_0x5790('0x43')](handleError(_0x5b2389,null));};exports[_0x5790('0x22')]=function(_0x4d9aa8,_0x4ccf81){return db[_0x5790('0x47')][_0x5790('0x4f')]({'where':{'id':_0x4d9aa8[_0x5790('0x45')]['id']}})[_0x5790('0x23')](handleEntityNotFound(_0x4ccf81,null))[_0x5790('0x23')](removeEntity(_0x4ccf81,null))[_0x5790('0x43')](handleError(_0x4ccf81,null));};exports['preview']=function(_0x23a7b3,_0x212fdc){var _0x2d9fc5=0xa;var _0x497bd4=[_0x5790('0x53'),_0x5790('0x54'),_0x5790('0x55'),_0x5790('0x56')];var _0x54d3e1={'SUM':'SUM(%s)','COUNT':_0x5790('0x57'),'COUNT DISTINCT':_0x5790('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5790('0x59'),'GROUP_CONCAT ASC':_0x5790('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f4575={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5790('0x5b'),'HOUR':_0x5790('0x5c'),'ROUND':_0x5790('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1259d6=function(_0x1a5772){return!_[_0x5790('0x5e')]([_0x5790('0x5f'),_0x5790('0x60'),_0x5790('0x61'),_0x5790('0x62')],_0x1a5772);};var _0x545016=function(_0x4a1d7d){if(!_0x4a1d7d||!_0x4a1d7d[_0x5790('0x63')][_0x5790('0x34')]){return'';}for(var _0xe1880f='(',_0x3f2979=0x0;_0x3f2979<_0x4a1d7d[_0x5790('0x63')]['length'];_0x3f2979+=0x1){_0x3f2979>0x0&&(_0xe1880f+='\x20'+_0x4a1d7d[_0x5790('0x64')]+'\x20');_0xe1880f+=_0x4a1d7d[_0x5790('0x63')][_0x3f2979][_0x5790('0x65')]?_0x545016(_0x4a1d7d[_0x5790('0x63')][_0x3f2979][_0x5790('0x65')]):_0x4a1d7d[_0x5790('0x63')][_0x3f2979][_0x5790('0x66')]+'\x20'+_0x4a1d7d[_0x5790('0x63')][_0x3f2979]['condition']+(_0x1259d6(_0x4a1d7d[_0x5790('0x63')][_0x3f2979][_0x5790('0x67')])?'\x20'+_0x4a1d7d[_0x5790('0x63')][_0x3f2979][_0x5790('0x68')]:'');}return _0xe1880f+')';};var _0x1f3d31={'where':{'id':_0x23a7b3[_0x5790('0x45')]['id']}},_0x421864,_0xc83fe4,_0x291f17,_0x3125af,_0x331c0f;_0x1f3d31=_[_0x5790('0x3d')]({},_0x1f3d31,_0x23a7b3[_0x5790('0x48')]);return db[_0x5790('0x47')][_0x5790('0x4f')](_0x1f3d31)[_0x5790('0x23')](function(_0x26db28){if(_0x26db28){_0x421864=_0x26db28;return _0x26db28[_0x5790('0x69')]();}return null;})[_0x5790('0x23')](function(_0x4559be){if(_0x4559be){if(!_0x4559be['length']){throw new db[(_0x5790('0x6a'))][(_0x5790('0x6b'))](_0x5790('0x6c'),0x193);}_0xc83fe4=_0x4559be;return db[_0x5790('0x6d')][_0x5790('0x41')]({'raw':!![]});}return null;})[_0x5790('0x23')](function(_0x322e24){if(_0x322e24){_0x291f17=_[_0x5790('0x6e')](_0x322e24,'id');var _0x4ba58d;var _0x784ee9=squel['select']();_0x784ee9['from'](_0x421864['table']);for(var _0x417e31=0x0;_0x417e31<_0xc83fe4[_0x5790('0x34')];_0x417e31+=0x1){_0x4ba58d=_0xc83fe4[_0x417e31]['MetricId']?_0x291f17[_0xc83fe4[_0x417e31]['MetricId']][_0x5790('0x6f')]:_0xc83fe4[_0x417e31][_0x5790('0x66')];_0x4ba58d=_0xc83fe4[_0x417e31][_0x5790('0x70')]?_[_0x5790('0x71')](_0x54d3e1[_0xc83fe4[_0x417e31][_0x5790('0x70')]],'%s',_0x4ba58d):_0x4ba58d;_0x4ba58d=_0xc83fe4[_0x417e31][_0x5790('0x72')]?_[_0x5790('0x71')](_0x1f4575[_0xc83fe4[_0x417e31][_0x5790('0x72')]],'%s',_0x4ba58d):_0x4ba58d;if(_0xc83fe4[_0x417e31]['groupBy']){_0x784ee9[_0x5790('0x65')](_0x4ba58d);}_0xc83fe4[_0x417e31][_0x5790('0x73')]&&_0x784ee9[_0x5790('0x37')](_0x4ba58d,_0xc83fe4[_0x417e31][_0x5790('0x73')]===_0x5790('0x74')?![]:!![]);_0x784ee9[_0x5790('0x66')](_0x4ba58d,_0xc83fe4[_0x417e31][_0x5790('0x75')]||_0x4ba58d);}if(_0x421864[_0x5790('0x76')]){_0x421864['joins']=JSON[_0x5790('0x77')](_0x421864[_0x5790('0x76')]);for(var _0x8d7acb=0x0;_0x8d7acb<_0x421864[_0x5790('0x76')][_0x5790('0x34')];_0x8d7acb+=0x1){if(_0x421864['joins'][_0x8d7acb][_0x5790('0x2c')]&&_['includes'](_0x497bd4,_0x421864[_0x5790('0x76')][_0x8d7acb][_0x5790('0x2c')])&&_0x421864[_0x5790('0x76')][_0x8d7acb][_0x5790('0x78')]&&_0x421864[_0x5790('0x76')][_0x8d7acb][_0x5790('0x79')]&&_0x421864[_0x5790('0x76')][_0x8d7acb][_0x5790('0x7a')]){_0x784ee9[_0x421864[_0x5790('0x76')][_0x8d7acb]['type']](_0x421864[_0x5790('0x76')][_0x8d7acb][_0x5790('0x79')],null,util['format'](_0x5790('0x7b'),_0x421864['table'],_0x421864[_0x5790('0x76')][_0x8d7acb][_0x5790('0x78')],_0x421864[_0x5790('0x76')][_0x8d7acb][_0x5790('0x79')],_0x421864[_0x5790('0x76')][_0x8d7acb]['foreignKey']));}}}if(_0x421864[_0x5790('0x7c')]){_0x421864[_0x5790('0x7c')]=JSON[_0x5790('0x77')](_0x421864[_0x5790('0x7c')]);_0x784ee9[_0x5790('0x39')](_0x545016(_0x421864[_0x5790('0x7c')][_0x5790('0x65')]));}_0x331c0f=_0x784ee9[_0x5790('0x7d')]();_0x784ee9[_0x5790('0x1e')](_0x2d9fc5);_0x784ee9[_0x5790('0x1c')](0x0);logger[_0x5790('0x7e')](_0x5790('0x7f'),_0x784ee9[_0x5790('0x80')]());return dbH[_0x5790('0x81')]['query'](_0x784ee9['toString'](),{'type':dbH[_0x5790('0x81')][_0x5790('0x82')][_0x5790('0x83')]});}})[_0x5790('0x23')](respondWithResult(_0x212fdc,null))[_0x5790('0x43')](handleError(_0x212fdc,null));};function runReport(_0x535c7e,_0x47cfb9,_0x5443a5){var _0x284252=_0x47cfb9[_0x5790('0x28')];var _0x3cfdb1=0xa;var _0x28a35d=['join',_0x5790('0x54'),'right_join','cross_join'];var _0x3fb581={'SUM':_0x5790('0x84'),'COUNT':_0x5790('0x57'),'COUNT DISTINCT':_0x5790('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5790('0x59'),'GROUP_CONCAT ASC':_0x5790('0x5a'),'GROUP_CONCAT DESC':_0x5790('0x85')};var _0x4c8d21={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5790('0x5b'),'HOUR':_0x5790('0x5c'),'ROUND':_0x5790('0x5d'),'UNIX_TIMESTAMP':_0x5790('0x86')};var _0x17295e=function(_0x29662f){return!_['includes']([_0x5790('0x5f'),_0x5790('0x60'),_0x5790('0x61'),'IS\x20NOT\x20EMPTY'],_0x29662f);};var _0x41d848=function(_0x36ce7b){if(!_0x36ce7b||!_0x36ce7b['rules'][_0x5790('0x34')]){return'';}for(var _0x31d9c5='(',_0x553caa=0x0;_0x553caa<_0x36ce7b['rules'][_0x5790('0x34')];_0x553caa+=0x1){_0x553caa>0x0&&(_0x31d9c5+='\x20'+_0x36ce7b[_0x5790('0x64')]+'\x20');_0x31d9c5+=_0x36ce7b[_0x5790('0x63')][_0x553caa]['group']?_0x41d848(_0x36ce7b[_0x5790('0x63')][_0x553caa][_0x5790('0x65')]):_0x36ce7b[_0x5790('0x63')][_0x553caa]['field']+'\x20'+_0x36ce7b[_0x5790('0x63')][_0x553caa][_0x5790('0x67')]+(_0x17295e(_0x36ce7b['rules'][_0x553caa]['condition'])?'\x20'+_0x36ce7b[_0x5790('0x63')][_0x553caa][_0x5790('0x68')]:'');}return _0x31d9c5+')';};var _0x38fa3c={'where':{'id':_0x535c7e['id']}},_0x5dd16c,_0x1c5069,_0x5bb5e4,_0xdce048,_0x31c096;_0x38fa3c=_[_0x5790('0x3d')]({},_0x38fa3c,_0x5443a5);return db['AnalyticCustomReport'][_0x5790('0x4f')](_0x38fa3c)[_0x5790('0x23')](function(_0x2bcee7){if(_0x2bcee7){_0x5dd16c=_0x2bcee7;return _0x2bcee7['getFields']();}return null;})[_0x5790('0x23')](function(_0x55bad7){if(_0x55bad7){if(!_0x55bad7[_0x5790('0x34')]){throw new db[(_0x5790('0x6a'))][(_0x5790('0x6b'))](_0x5790('0x6c'),0x193);}_0x1c5069=_0x55bad7;return db[_0x5790('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x271ef3){if(_0x271ef3){_0x5bb5e4=_[_0x5790('0x6e')](_0x271ef3,'id');var _0x3ba158;var _0x170a26=squel[_0x5790('0x87')]();_0x170a26[_0x5790('0x88')](_0x5dd16c['table']);for(var _0xa070c8=0x0;_0xa070c8<_0x1c5069[_0x5790('0x34')];_0xa070c8+=0x1){_0x3ba158=_0x1c5069[_0xa070c8][_0x5790('0x89')]?_0x5bb5e4[_0x1c5069[_0xa070c8]['MetricId']][_0x5790('0x6f')]:_0x1c5069[_0xa070c8][_0x5790('0x66')];_0x3ba158=_0x1c5069[_0xa070c8]['function']?_[_0x5790('0x71')](_0x3fb581[_0x1c5069[_0xa070c8][_0x5790('0x70')]],'%s',_0x3ba158):_0x3ba158;_0x3ba158=_0x1c5069[_0xa070c8][_0x5790('0x72')]?_['replace'](_0x4c8d21[_0x1c5069[_0xa070c8][_0x5790('0x72')]],'%s',_0x3ba158):_0x3ba158;if(_0x1c5069[_0xa070c8][_0x5790('0x8a')]){_0x170a26['group'](_0x3ba158);}_0x1c5069[_0xa070c8][_0x5790('0x73')]&&_0x170a26[_0x5790('0x37')](_0x3ba158,_0x1c5069[_0xa070c8][_0x5790('0x73')]===_0x5790('0x74')?![]:!![]);_0x170a26[_0x5790('0x66')](_0x3ba158,_0x1c5069[_0xa070c8][_0x5790('0x75')]||_0x3ba158);}if(_0x5dd16c[_0x5790('0x76')]){_0x5dd16c[_0x5790('0x76')]=JSON[_0x5790('0x77')](_0x5dd16c[_0x5790('0x76')]);for(var _0xb7ffd7=0x0;_0xb7ffd7<_0x5dd16c['joins'][_0x5790('0x34')];_0xb7ffd7+=0x1){if(_0x5dd16c[_0x5790('0x76')][_0xb7ffd7][_0x5790('0x2c')]&&_[_0x5790('0x5e')](_0x28a35d,_0x5dd16c[_0x5790('0x76')][_0xb7ffd7][_0x5790('0x2c')])&&_0x5dd16c[_0x5790('0x76')][_0xb7ffd7][_0x5790('0x78')]&&_0x5dd16c['joins'][_0xb7ffd7]['foreignTable']&&_0x5dd16c['joins'][_0xb7ffd7][_0x5790('0x7a')]){_0x170a26[_0x5dd16c[_0x5790('0x76')][_0xb7ffd7][_0x5790('0x2c')]](_0x5dd16c[_0x5790('0x76')][_0xb7ffd7]['foreignTable'],null,util[_0x5790('0x72')](_0x5790('0x7b'),_0x5dd16c[_0x5790('0x8b')],_0x5dd16c[_0x5790('0x76')][_0xb7ffd7]['parentKey'],_0x5dd16c['joins'][_0xb7ffd7][_0x5790('0x79')],_0x5dd16c['joins'][_0xb7ffd7][_0x5790('0x7a')]));}}}if(_0x5dd16c[_0x5790('0x7c')]){_0x5dd16c['conditions']=JSON[_0x5790('0x77')](_0x5dd16c['conditions']);_0x170a26[_0x5790('0x39')](_0x41d848(_0x5dd16c[_0x5790('0x7c')][_0x5790('0x65')]));}_0x31c096=_0x170a26[_0x5790('0x7d')]();_0x170a26[_0x5790('0x1e')](_0x3cfdb1);_0x170a26[_0x5790('0x1c')](0x0);return;}})[_0x5790('0x23')](function(){if(_0x47cfb9['output']==='web'){return null;}var _0xfae991=_[_0x5790('0x3d')](_0x47cfb9,{'name':_0x47cfb9[_0x5790('0x8c')]||_0x47cfb9[_0x5790('0x28')]||_0x5dd16c['name'],'basename':_0x284252,'savename':util[_0x5790('0x72')](_0x5790('0x8d'),_0x47cfb9['name']||_0x5dd16c[_0x5790('0x28')],require(_0x5790('0x8e'))[_0x5790('0x8f')](0x4),_0x47cfb9[_0x5790('0x90')]||'csv'),'reportId':_0x5dd16c['id'],'reportType':_0x5790('0x91')});return db[_0x5790('0x92')][_0x5790('0x49')](_0xfae991,{'raw':!![]});})[_0x5790('0x23')](function(_0x655559){if(_0x5dd16c[_0x5790('0x8b')]==='cdr'){_0x31c096['where'](_0x5dd16c[_0x5790('0x8b')]+_0x5790('0x93'),_0x47cfb9['startDate'],_0x47cfb9[_0x5790('0x94')]);}else{_0x31c096[_0x5790('0x39')](_0x5dd16c[_0x5790('0x8b')]+_0x5790('0x95'),_0x47cfb9['startDate'],_0x47cfb9[_0x5790('0x94')]);}if(_0x655559){logger[_0x5790('0x96')](_0x5790('0x97'),_0x31c096[_0x5790('0x80')]());require(_0x5790('0x98'))[_0x5790('0x99')](path[_0x5790('0x53')](__dirname,_0x5790('0x9a'),_0x655559[_0x5790('0x90')]),[_0x655559['id'],_0x31c096[_0x5790('0x80')](),path[_0x5790('0x53')](__dirname,_0x5790('0x9b'),_0x655559[_0x5790('0x9c')]),_0x284252]);return _0x655559;}else{var _0x349c63=squel['select']();_0x349c63[_0x5790('0x88')]('('+_0x31c096[_0x5790('0x80')]()+')',_0x5790('0x9d'));_0x349c63[_0x5790('0x66')](_0x5790('0x9e'),_0x5790('0x3e'));_0x31c096[_0x5790('0x1e')](_0x47cfb9[_0x5790('0x1e')]||_0x3cfdb1);_0x31c096['offset'](_0x47cfb9[_0x5790('0x1c')]||0x0);return dbH[_0x5790('0x81')][_0x5790('0x2f')](_0x349c63[_0x5790('0x80')](),{'type':dbH[_0x5790('0x81')][_0x5790('0x82')][_0x5790('0x83')]})['then'](function(_0x239afd){if(!_0x239afd['length']){_0xdce048=0x0;}else{_0xdce048=_0x239afd[0x0]['count']||0x0;}return dbH[_0x5790('0x81')]['query'](_0x31c096[_0x5790('0x80')](),{'type':dbH[_0x5790('0x81')][_0x5790('0x82')][_0x5790('0x83')]});})[_0x5790('0x23')](function(_0x3b9a0d){return{'rows':_0x3b9a0d||[],'count':_0xdce048};});}});}exports[_0x5790('0x9f')]=function(_0x1fd2e6,_0x156e0f){return runReport(_0x1fd2e6[_0x5790('0x45')],_0x1fd2e6[_0x5790('0x2f')],_0x1fd2e6[_0x5790('0x48')])[_0x5790('0x23')](respondWithResult(_0x156e0f,null))[_0x5790('0x43')](handleError(_0x156e0f,null));};exports[_0x5790('0xa0')]=runReport;exports[_0x5790('0x2f')]=function(_0x4473a4,_0x39c689){var _0x78d0bf=0xa;var _0x44fdf1=[_0x5790('0x53'),'left_join',_0x5790('0x55'),_0x5790('0x56')];var _0x3b5e8b={'SUM':_0x5790('0x84'),'COUNT':_0x5790('0x57'),'COUNT DISTINCT':_0x5790('0x58'),'MAX':'MAX(%s)','MIN':_0x5790('0xa1'),'AVG':_0x5790('0xa2'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5790('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x31986d={'SEC_TO_TIME':_0x5790('0xa3'),'DATE':_0x5790('0x5b'),'HOUR':_0x5790('0x5c'),'ROUND':_0x5790('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x11f7ce=function(_0x498233){return!_[_0x5790('0x5e')]([_0x5790('0x5f'),_0x5790('0x60'),_0x5790('0x61'),_0x5790('0x62')],_0x498233);};var _0x35802a=function(_0xaa4c72){if(!_0xaa4c72||!_0xaa4c72[_0x5790('0x63')][_0x5790('0x34')]){return'';}for(var _0x2c9491='(',_0x557def=0x0;_0x557def<_0xaa4c72['rules'][_0x5790('0x34')];_0x557def+=0x1){_0x557def>0x0&&(_0x2c9491+='\x20'+_0xaa4c72[_0x5790('0x64')]+'\x20');_0x2c9491+=_0xaa4c72['rules'][_0x557def][_0x5790('0x65')]?_0x35802a(_0xaa4c72[_0x5790('0x63')][_0x557def]['group']):_0xaa4c72['rules'][_0x557def][_0x5790('0x66')]+'\x20'+_0xaa4c72[_0x5790('0x63')][_0x557def][_0x5790('0x67')]+(_0x11f7ce(_0xaa4c72[_0x5790('0x63')][_0x557def][_0x5790('0x67')])?'\x20'+_0xaa4c72[_0x5790('0x63')][_0x557def]['value']:'');}return _0x2c9491+')';};var _0x57873c={'where':{'id':_0x4473a4[_0x5790('0x45')]['id']}},_0x3777aa,_0x3b763b,_0x2904d5,_0x48c33c,_0x41c559;_0x57873c=_[_0x5790('0x3d')]({},_0x57873c,_0x4473a4[_0x5790('0x48')]);return db[_0x5790('0x47')]['find'](_0x57873c)['then'](function(_0x1bd772){if(_0x1bd772){_0x3777aa=_0x1bd772;return _0x1bd772[_0x5790('0x69')]();}return null;})['then'](function(_0x26b0b9){if(_0x26b0b9){if(!_0x26b0b9['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5790('0x6c'),0x193);}_0x3b763b=_0x26b0b9;return db[_0x5790('0x6d')][_0x5790('0x41')]({'raw':!![]});}return null;})[_0x5790('0x23')](function(_0xdd21e0){if(_0xdd21e0){_0x2904d5=_[_0x5790('0x6e')](_0xdd21e0,'id');var _0xbb60e;var _0x899a89=squel[_0x5790('0x87')]();_0x899a89['from'](_0x3777aa[_0x5790('0x8b')]);for(var _0x342a24=0x0;_0x342a24<_0x3b763b['length'];_0x342a24+=0x1){_0xbb60e=_0x3b763b[_0x342a24][_0x5790('0x89')]?_0x2904d5[_0x3b763b[_0x342a24][_0x5790('0x89')]][_0x5790('0x6f')]:_0x3b763b[_0x342a24]['field'];_0xbb60e=_0x3b763b[_0x342a24][_0x5790('0x70')]?_[_0x5790('0x71')](_0x3b5e8b[_0x3b763b[_0x342a24][_0x5790('0x70')]],'%s',_0xbb60e):_0xbb60e;_0xbb60e=_0x3b763b[_0x342a24][_0x5790('0x72')]?_[_0x5790('0x71')](_0x31986d[_0x3b763b[_0x342a24][_0x5790('0x72')]],'%s',_0xbb60e):_0xbb60e;if(_0x3b763b[_0x342a24][_0x5790('0x8a')]){_0x899a89['group'](_0xbb60e);}_0x3b763b[_0x342a24][_0x5790('0x73')]&&_0x899a89['order'](_0xbb60e,_0x3b763b[_0x342a24][_0x5790('0x73')]===_0x5790('0x74')?![]:!![]);_0x899a89[_0x5790('0x66')](_0xbb60e,_0x3b763b[_0x342a24][_0x5790('0x75')]||_0xbb60e);}if(_0x3777aa[_0x5790('0x76')]){_0x3777aa[_0x5790('0x76')]=JSON[_0x5790('0x77')](_0x3777aa[_0x5790('0x76')]);for(var _0xd3446b=0x0;_0xd3446b<_0x3777aa[_0x5790('0x76')][_0x5790('0x34')];_0xd3446b+=0x1){if(_0x3777aa[_0x5790('0x76')][_0xd3446b]['type']&&_['includes'](_0x44fdf1,_0x3777aa[_0x5790('0x76')][_0xd3446b]['type'])&&_0x3777aa[_0x5790('0x76')][_0xd3446b][_0x5790('0x78')]&&_0x3777aa[_0x5790('0x76')][_0xd3446b][_0x5790('0x79')]&&_0x3777aa[_0x5790('0x76')][_0xd3446b][_0x5790('0x7a')]){_0x899a89[_0x3777aa[_0x5790('0x76')][_0xd3446b][_0x5790('0x2c')]](_0x3777aa[_0x5790('0x76')][_0xd3446b][_0x5790('0x79')],null,util[_0x5790('0x72')](_0x5790('0x7b'),_0x3777aa[_0x5790('0x8b')],_0x3777aa['joins'][_0xd3446b][_0x5790('0x78')],_0x3777aa[_0x5790('0x76')][_0xd3446b][_0x5790('0x79')],_0x3777aa[_0x5790('0x76')][_0xd3446b][_0x5790('0x7a')]));}}}if(_0x3777aa['conditions']){_0x3777aa[_0x5790('0x7c')]=JSON[_0x5790('0x77')](_0x3777aa[_0x5790('0x7c')]);_0x899a89[_0x5790('0x39')](_0x35802a(_0x3777aa['conditions'][_0x5790('0x65')]));}_0x41c559=_0x899a89[_0x5790('0x7d')]();_0x899a89[_0x5790('0x1e')](_0x78d0bf);_0x899a89[_0x5790('0x1c')](0x0);logger[_0x5790('0x7e')]('Limited\x20Query:',_0x899a89['toString']());return dbH[_0x5790('0x81')]['query'](_0x899a89['toString'](),{'type':dbH[_0x5790('0x81')][_0x5790('0x82')][_0x5790('0x83')]});}})['then'](function(){return{'sql':_0x41c559['toString']()};})[_0x5790('0x23')](respondWithResult(_0x39c689,null))[_0x5790('0x43')](handleError(_0x39c689,null));};
\ No newline at end of file
+var _0x697e=['value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','cross_join','SUM(%s)','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL','operator','Please\x20insert\x20at\x20least\x20one\x20field','replace','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','runReport','UNIX_TIMESTAMP(%s)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','CustomReports','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition'];(function(_0x488de5,_0x12b79c){var _0x2be753=function(_0x183b7f){while(--_0x183b7f){_0x488de5['push'](_0x488de5['shift']());}};_0x2be753(++_0x12b79c);}(_0x697e,0xe4));var _0xe697=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x697e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe697('0x0'));var zipdir=require(_0xe697('0x1'));var jsonpatch=require(_0xe697('0x2'));var rp=require(_0xe697('0x3'));var moment=require(_0xe697('0x4'));var BPromise=require(_0xe697('0x5'));var Mustache=require(_0xe697('0x6'));var util=require(_0xe697('0x7'));var path=require(_0xe697('0x8'));var sox=require('sox');var csv=require(_0xe697('0x9'));var ejs=require(_0xe697('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe697('0xb'));var squel=require('squel');var crypto=require(_0xe697('0xc'));var jsforce=require(_0xe697('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe697('0x9'));var querystring=require(_0xe697('0xe'));var Papa=require(_0xe697('0xf'));var Redis=require(_0xe697('0x10'));var authService=require(_0xe697('0x11'));var qs=require(_0xe697('0x12'));var as=require(_0xe697('0x13'));var hardwareService=require(_0xe697('0x14'));var logger=require(_0xe697('0x15'))(_0xe697('0x16'));var utils=require(_0xe697('0x17'));var config=require(_0xe697('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe697('0x19'))['db'];var dbH=require(_0xe697('0x19'))[_0xe697('0x1a')];function respondWithStatusCode(_0x2dd32a,_0x69c810){_0x69c810=_0x69c810||0xcc;return function(_0x19ff29){if(_0x19ff29){return _0x2dd32a[_0xe697('0x1b')](_0x69c810);}return _0x2dd32a[_0xe697('0x1c')](_0x69c810)[_0xe697('0x1d')]();};}function respondWithResult(_0x598b31,_0x81fabf){_0x81fabf=_0x81fabf||0xc8;return function(_0x565a6b){if(_0x565a6b){return _0x598b31[_0xe697('0x1c')](_0x81fabf)[_0xe697('0x1e')](_0x565a6b);}};}function respondWithFilteredResult(_0x5738e7,_0x4eb137){return function(_0xec84d3){if(_0xec84d3){var _0x49d8b4=typeof _0x4eb137[_0xe697('0x1f')]===_0xe697('0x20')&&typeof _0x4eb137['limit']===_0xe697('0x20');var _0x2473a7=_0xec84d3[_0xe697('0x21')];var _0x1f0307=_0x49d8b4?0x0:_0x4eb137[_0xe697('0x1f')];var _0x17b988=_0x49d8b4?_0xec84d3[_0xe697('0x21')]:_0x4eb137['offset']+_0x4eb137['limit'];var _0x43a0e0;if(_0x17b988>=_0x2473a7){_0x17b988=_0x2473a7;_0x43a0e0=0xc8;}else{_0x43a0e0=0xce;}_0x5738e7[_0xe697('0x1c')](_0x43a0e0);return _0x5738e7[_0xe697('0x22')](_0xe697('0x23'),_0x1f0307+'-'+_0x17b988+'/'+_0x2473a7)['json'](_0xec84d3);}return null;};}function patchUpdates(_0x4a858b){return function(_0x5aeb5a){try{jsonpatch[_0xe697('0x24')](_0x5aeb5a,_0x4a858b,!![]);}catch(_0x1927e4){return BPromise[_0xe697('0x25')](_0x1927e4);}return _0x5aeb5a[_0xe697('0x26')]();};}function saveUpdates(_0x4150d1,_0x5b6dca){return function(_0x356ef4){if(_0x356ef4){return _0x356ef4['update'](_0x4150d1)[_0xe697('0x27')](function(_0xba473e){return _0xba473e;});}return null;};}function removeEntity(_0x2a3868,_0x2f6175){return function(_0x5e03e9){if(_0x5e03e9){return _0x5e03e9[_0xe697('0x28')]()['then'](function(){var _0x438ff5=_0x5e03e9['get']({'plain':!![]});var _0x532c5e=_0xe697('0x29');return db['UserProfileResource'][_0xe697('0x28')]({'where':{'type':_0x532c5e,'resourceId':_0x438ff5['id']}})[_0xe697('0x27')](function(){return _0x5e03e9;});})['then'](function(){_0x2a3868[_0xe697('0x1c')](0xcc)[_0xe697('0x1d')]();});}};}function handleEntityNotFound(_0x115a7e,_0x7ecb78){return function(_0x59fb4a){if(!_0x59fb4a){_0x115a7e[_0xe697('0x1b')](0x194);}return _0x59fb4a;};}function handleError(_0x4a4749,_0x4ec17e){_0x4ec17e=_0x4ec17e||0x1f4;return function(_0x2d6f49){logger[_0xe697('0x2a')](_0x2d6f49['stack']);if(_0x2d6f49['name']){delete _0x2d6f49[_0xe697('0x2b')];}_0x4a4749['status'](_0x4ec17e)[_0xe697('0x2c')](_0x2d6f49);};}exports[_0xe697('0x2d')]=function(_0x2c3275,_0x497b97){var _0x7a5f83={},_0x9dd700={},_0x47db2e={'count':0x0,'rows':[]};var _0xc0f994=_[_0xe697('0x2e')](db[_0xe697('0x2f')][_0xe697('0x30')],function(_0x512124){return{'name':_0x512124[_0xe697('0x31')],'type':_0x512124[_0xe697('0x32')][_0xe697('0x33')]};});_0x9dd700['model']=_[_0xe697('0x2e')](_0xc0f994,_0xe697('0x2b'));_0x9dd700[_0xe697('0x34')]=_[_0xe697('0x35')](_0x2c3275[_0xe697('0x34')]);_0x9dd700[_0xe697('0x36')]=_[_0xe697('0x37')](_0x9dd700[_0xe697('0x38')],_0x9dd700[_0xe697('0x34')]);_0x7a5f83['attributes']=_[_0xe697('0x37')](_0x9dd700[_0xe697('0x38')],qs[_0xe697('0x39')](_0x2c3275['query']['fields']));_0x7a5f83[_0xe697('0x3a')]=_0x7a5f83[_0xe697('0x3a')][_0xe697('0x3b')]?_0x7a5f83['attributes']:_0x9dd700[_0xe697('0x38')];if(!_0x2c3275['query']['hasOwnProperty']('nolimit')){_0x7a5f83[_0xe697('0x3c')]=qs['limit'](_0x2c3275[_0xe697('0x34')][_0xe697('0x3c')]);_0x7a5f83[_0xe697('0x1f')]=qs[_0xe697('0x1f')](_0x2c3275[_0xe697('0x34')]['offset']);}_0x7a5f83[_0xe697('0x3d')]=qs[_0xe697('0x3e')](_0x2c3275[_0xe697('0x34')][_0xe697('0x3e')]);_0x7a5f83[_0xe697('0x3f')]=qs[_0xe697('0x36')](_[_0xe697('0x40')](_0x2c3275[_0xe697('0x34')],_0x9dd700[_0xe697('0x36')]),_0xc0f994);if(_0x2c3275[_0xe697('0x34')][_0xe697('0x41')]){_0x7a5f83[_0xe697('0x3f')]=_['merge'](_0x7a5f83[_0xe697('0x3f')],{'$or':_[_0xe697('0x2e')](_0xc0f994,function(_0x425e77){if(_0x425e77[_0xe697('0x32')]!==_0xe697('0x42')){var _0x654af7={};_0x654af7[_0x425e77['name']]={'$like':'%'+_0x2c3275[_0xe697('0x34')]['filter']+'%'};return _0x654af7;}})});}_0x7a5f83=_[_0xe697('0x43')]({},_0x7a5f83,_0x2c3275[_0xe697('0x44')]);var _0x21846c={'where':_0x7a5f83[_0xe697('0x3f')]};return db['AnalyticCustomReport'][_0xe697('0x21')](_0x21846c)[_0xe697('0x27')](function(_0x2940c4){_0x47db2e['count']=_0x2940c4;if(_0x2c3275['query'][_0xe697('0x45')]){_0x7a5f83[_0xe697('0x46')]=[{'all':!![]}];}return db[_0xe697('0x2f')][_0xe697('0x47')](_0x7a5f83);})['then'](function(_0x3e2e25){_0x47db2e[_0xe697('0x48')]=_0x3e2e25;return _0x47db2e;})[_0xe697('0x27')](respondWithFilteredResult(_0x497b97,_0x7a5f83))[_0xe697('0x49')](handleError(_0x497b97,null));};exports[_0xe697('0x4a')]=function(_0xf424af,_0x51affb){var _0x8eb562={'raw':![],'where':{'id':_0xf424af[_0xe697('0x4b')]['id']}},_0x33b907={};_0x33b907['model']=_['keys'](db[_0xe697('0x2f')][_0xe697('0x30')]);_0x33b907[_0xe697('0x34')]=_[_0xe697('0x35')](_0xf424af[_0xe697('0x34')]);_0x33b907['filters']=_['intersection'](_0x33b907[_0xe697('0x38')],_0x33b907[_0xe697('0x34')]);_0x8eb562[_0xe697('0x3a')]=_[_0xe697('0x37')](_0x33b907[_0xe697('0x38')],qs['fields'](_0xf424af['query']['fields']));_0x8eb562[_0xe697('0x3a')]=_0x8eb562[_0xe697('0x3a')]['length']?_0x8eb562[_0xe697('0x3a')]:_0x33b907[_0xe697('0x38')];if(_0xf424af['query'][_0xe697('0x45')]){_0x8eb562[_0xe697('0x46')]=[{'all':!![]}];}_0x8eb562=_['merge']({},_0x8eb562,_0xf424af[_0xe697('0x44')]);return db[_0xe697('0x2f')][_0xe697('0x4c')](_0x8eb562)[_0xe697('0x27')](handleEntityNotFound(_0x51affb,null))['then'](respondWithResult(_0x51affb,null))[_0xe697('0x49')](handleError(_0x51affb,null));};exports[_0xe697('0x4d')]=function(_0x1d903b,_0x5698b6){return db[_0xe697('0x2f')]['create'](_0x1d903b[_0xe697('0x4e')],{})['then'](function(_0x5dc76d){var _0x228a57=_0x1d903b[_0xe697('0x4f')][_0xe697('0x50')]({'plain':!![]});if(!_0x228a57)throw new Error(_0xe697('0x51'));if(_0x228a57[_0xe697('0x52')]===_0xe697('0x4f')){var _0xe1db1=_0x5dc76d['get']({'plain':!![]});var _0x4c0365=_0xe697('0x53');return db[_0xe697('0x54')][_0xe697('0x4c')]({'where':{'name':_0x4c0365,'userProfileId':_0x228a57[_0xe697('0x55')]},'raw':!![]})['then'](function(_0x169a52){if(_0x169a52&&_0x169a52[_0xe697('0x56')]===0x0){return db['UserProfileResource'][_0xe697('0x4d')]({'name':_0xe1db1[_0xe697('0x2b')],'resourceId':_0xe1db1['id'],'type':_0xe697('0x29'),'sectionId':_0x169a52['id']},{})[_0xe697('0x27')](function(){return _0x5dc76d;});}else{return _0x5dc76d;}})[_0xe697('0x49')](function(_0x302481){logger[_0xe697('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x302481);throw _0x302481;});}return _0x5dc76d;})[_0xe697('0x27')](respondWithResult(_0x5698b6,0xc9))[_0xe697('0x49')](handleError(_0x5698b6,null));};exports['update']=function(_0x2a3d6b,_0x65c359){if(_0x2a3d6b[_0xe697('0x4e')]['id']){delete _0x2a3d6b[_0xe697('0x4e')]['id'];}return db[_0xe697('0x2f')][_0xe697('0x4c')]({'where':{'id':_0x2a3d6b[_0xe697('0x4b')]['id']}})[_0xe697('0x27')](handleEntityNotFound(_0x65c359,null))['then'](saveUpdates(_0x2a3d6b[_0xe697('0x4e')],null))['then'](respondWithResult(_0x65c359,null))[_0xe697('0x49')](handleError(_0x65c359,null));};exports[_0xe697('0x28')]=function(_0x194bc8,_0x455ab6){return db[_0xe697('0x2f')][_0xe697('0x4c')]({'where':{'id':_0x194bc8['params']['id']}})[_0xe697('0x27')](handleEntityNotFound(_0x455ab6,null))[_0xe697('0x27')](removeEntity(_0x455ab6,null))[_0xe697('0x49')](handleError(_0x455ab6,null));};exports['preview']=function(_0x5184cc,_0x4b0d22){var _0x1146dd=0xa;var _0x5d90f4=[_0xe697('0x57'),_0xe697('0x58'),_0xe697('0x59'),'cross_join'];var _0x15ff42={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe697('0x5a'),'MAX':'MAX(%s)','MIN':_0xe697('0x5b'),'AVG':_0xe697('0x5c'),'GROUP_CONCAT':_0xe697('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe697('0x5e')};var _0x3075ee={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe697('0x5f'),'HOUR':_0xe697('0x60'),'ROUND':_0xe697('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x516848=function(_0x54868){return!_[_0xe697('0x62')]([_0xe697('0x63'),'IS\x20NOT\x20NULL',_0xe697('0x64'),_0xe697('0x65')],_0x54868);};var _0x17c5da=function(_0x2b204d){if(!_0x2b204d||!_0x2b204d['rules'][_0xe697('0x3b')]){return'';}for(var _0x11fcb4='(',_0x41d08d=0x0;_0x41d08d<_0x2b204d['rules'][_0xe697('0x3b')];_0x41d08d+=0x1){_0x41d08d>0x0&&(_0x11fcb4+='\x20'+_0x2b204d['operator']+'\x20');_0x11fcb4+=_0x2b204d[_0xe697('0x66')][_0x41d08d][_0xe697('0x67')]?_0x17c5da(_0x2b204d[_0xe697('0x66')][_0x41d08d][_0xe697('0x67')]):_0x2b204d[_0xe697('0x66')][_0x41d08d][_0xe697('0x68')]+'\x20'+_0x2b204d[_0xe697('0x66')][_0x41d08d][_0xe697('0x69')]+(_0x516848(_0x2b204d[_0xe697('0x66')][_0x41d08d][_0xe697('0x69')])?'\x20'+_0x2b204d[_0xe697('0x66')][_0x41d08d][_0xe697('0x6a')]:'');}return _0x11fcb4+')';};var _0x23ac5d={'where':{'id':_0x5184cc[_0xe697('0x4b')]['id']}},_0x476a65,_0x1ad3b7,_0x29a086,_0x39d43c,_0x2ef190;_0x23ac5d=_['merge']({},_0x23ac5d,_0x5184cc[_0xe697('0x44')]);return db['AnalyticCustomReport'][_0xe697('0x4c')](_0x23ac5d)['then'](function(_0x14fdda){if(_0x14fdda){_0x476a65=_0x14fdda;return _0x14fdda[_0xe697('0x6b')]();}return null;})[_0xe697('0x27')](function(_0x5b3d3f){if(_0x5b3d3f){if(!_0x5b3d3f[_0xe697('0x3b')]){throw new db[(_0xe697('0x6c'))][(_0xe697('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1ad3b7=_0x5b3d3f;return db[_0xe697('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xe697('0x27')](function(_0x539029){if(_0x539029){_0x29a086=_[_0xe697('0x6f')](_0x539029,'id');var _0x2f98fe;var _0x9b7964=squel[_0xe697('0x70')]();_0x9b7964[_0xe697('0x71')](_0x476a65[_0xe697('0x72')]);for(var _0x2d3544=0x0;_0x2d3544<_0x1ad3b7[_0xe697('0x3b')];_0x2d3544+=0x1){_0x2f98fe=_0x1ad3b7[_0x2d3544][_0xe697('0x73')]?_0x29a086[_0x1ad3b7[_0x2d3544][_0xe697('0x73')]][_0xe697('0x74')]:_0x1ad3b7[_0x2d3544]['field'];_0x2f98fe=_0x1ad3b7[_0x2d3544][_0xe697('0x75')]?_['replace'](_0x15ff42[_0x1ad3b7[_0x2d3544]['function']],'%s',_0x2f98fe):_0x2f98fe;_0x2f98fe=_0x1ad3b7[_0x2d3544][_0xe697('0x76')]?_['replace'](_0x3075ee[_0x1ad3b7[_0x2d3544][_0xe697('0x76')]],'%s',_0x2f98fe):_0x2f98fe;if(_0x1ad3b7[_0x2d3544][_0xe697('0x77')]){_0x9b7964['group'](_0x2f98fe);}_0x1ad3b7[_0x2d3544]['orderBy']&&_0x9b7964[_0xe697('0x3d')](_0x2f98fe,_0x1ad3b7[_0x2d3544][_0xe697('0x78')]===_0xe697('0x79')?![]:!![]);_0x9b7964[_0xe697('0x68')](_0x2f98fe,_0x1ad3b7[_0x2d3544][_0xe697('0x7a')]||_0x2f98fe);}if(_0x476a65[_0xe697('0x7b')]){_0x476a65[_0xe697('0x7b')]=JSON[_0xe697('0x7c')](_0x476a65[_0xe697('0x7b')]);for(var _0x21aaef=0x0;_0x21aaef<_0x476a65[_0xe697('0x7b')][_0xe697('0x3b')];_0x21aaef+=0x1){if(_0x476a65['joins'][_0x21aaef][_0xe697('0x32')]&&_[_0xe697('0x62')](_0x5d90f4,_0x476a65['joins'][_0x21aaef][_0xe697('0x32')])&&_0x476a65['joins'][_0x21aaef][_0xe697('0x7d')]&&_0x476a65[_0xe697('0x7b')][_0x21aaef][_0xe697('0x7e')]&&_0x476a65[_0xe697('0x7b')][_0x21aaef][_0xe697('0x7f')]){_0x9b7964[_0x476a65[_0xe697('0x7b')][_0x21aaef][_0xe697('0x32')]](_0x476a65[_0xe697('0x7b')][_0x21aaef][_0xe697('0x7e')],null,util[_0xe697('0x76')](_0xe697('0x80'),_0x476a65[_0xe697('0x72')],_0x476a65['joins'][_0x21aaef]['parentKey'],_0x476a65['joins'][_0x21aaef][_0xe697('0x7e')],_0x476a65['joins'][_0x21aaef][_0xe697('0x7f')]));}}}if(_0x476a65[_0xe697('0x81')]){_0x476a65[_0xe697('0x81')]=JSON[_0xe697('0x7c')](_0x476a65[_0xe697('0x81')]);_0x9b7964['where'](_0x17c5da(_0x476a65[_0xe697('0x81')][_0xe697('0x67')]));}_0x2ef190=_0x9b7964['clone']();_0x9b7964[_0xe697('0x3c')](_0x1146dd);_0x9b7964['offset'](0x0);logger[_0xe697('0x82')](_0xe697('0x83'),_0x9b7964['toString']());return dbH[_0xe697('0x84')][_0xe697('0x34')](_0x9b7964[_0xe697('0x85')](),{'type':dbH[_0xe697('0x84')][_0xe697('0x86')][_0xe697('0x87')]});}})[_0xe697('0x27')](respondWithResult(_0x4b0d22,null))[_0xe697('0x49')](handleError(_0x4b0d22,null));};function runReport(_0x4e956c,_0x3462f3,_0x49db15){var _0x54281b=_0x3462f3[_0xe697('0x2b')];var _0x3065fd=0xa;var _0xdacac8=[_0xe697('0x57'),_0xe697('0x58'),_0xe697('0x59'),_0xe697('0x88')];var _0x56884d={'SUM':_0xe697('0x89'),'COUNT':_0xe697('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xe697('0x5b'),'AVG':_0xe697('0x5c'),'GROUP_CONCAT':_0xe697('0x5d'),'GROUP_CONCAT ASC':_0xe697('0x8b'),'GROUP_CONCAT DESC':_0xe697('0x5e')};var _0x154146={'SEC_TO_TIME':_0xe697('0x8c'),'DATE':_0xe697('0x5f'),'HOUR':_0xe697('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x458707=function(_0x22ae46){return!_[_0xe697('0x62')](['IS\x20NULL',_0xe697('0x8d'),_0xe697('0x64'),_0xe697('0x65')],_0x22ae46);};var _0x3f9a2a=function(_0x1476bd){if(!_0x1476bd||!_0x1476bd[_0xe697('0x66')][_0xe697('0x3b')]){return'';}for(var _0x134d91='(',_0x3bac68=0x0;_0x3bac68<_0x1476bd[_0xe697('0x66')][_0xe697('0x3b')];_0x3bac68+=0x1){_0x3bac68>0x0&&(_0x134d91+='\x20'+_0x1476bd[_0xe697('0x8e')]+'\x20');_0x134d91+=_0x1476bd[_0xe697('0x66')][_0x3bac68][_0xe697('0x67')]?_0x3f9a2a(_0x1476bd[_0xe697('0x66')][_0x3bac68][_0xe697('0x67')]):_0x1476bd[_0xe697('0x66')][_0x3bac68][_0xe697('0x68')]+'\x20'+_0x1476bd['rules'][_0x3bac68][_0xe697('0x69')]+(_0x458707(_0x1476bd['rules'][_0x3bac68][_0xe697('0x69')])?'\x20'+_0x1476bd[_0xe697('0x66')][_0x3bac68][_0xe697('0x6a')]:'');}return _0x134d91+')';};var _0x11eeec={'where':{'id':_0x4e956c['id']}},_0x21633e,_0x6df532,_0x2f5392,_0x5a80d9,_0x2d63b2;_0x11eeec=_['merge']({},_0x11eeec,_0x49db15);return db[_0xe697('0x2f')][_0xe697('0x4c')](_0x11eeec)[_0xe697('0x27')](function(_0x225915){if(_0x225915){_0x21633e=_0x225915;return _0x225915[_0xe697('0x6b')]();}return null;})[_0xe697('0x27')](function(_0x26a241){if(_0x26a241){if(!_0x26a241[_0xe697('0x3b')]){throw new db[(_0xe697('0x6c'))][(_0xe697('0x6d'))](_0xe697('0x8f'),0x193);}_0x6df532=_0x26a241;return db[_0xe697('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x143c13){if(_0x143c13){_0x2f5392=_[_0xe697('0x6f')](_0x143c13,'id');var _0x46c78f;var _0x1756e0=squel[_0xe697('0x70')]();_0x1756e0['from'](_0x21633e[_0xe697('0x72')]);for(var _0x2b2e23=0x0;_0x2b2e23<_0x6df532[_0xe697('0x3b')];_0x2b2e23+=0x1){_0x46c78f=_0x6df532[_0x2b2e23][_0xe697('0x73')]?_0x2f5392[_0x6df532[_0x2b2e23]['MetricId']][_0xe697('0x74')]:_0x6df532[_0x2b2e23][_0xe697('0x68')];_0x46c78f=_0x6df532[_0x2b2e23][_0xe697('0x75')]?_[_0xe697('0x90')](_0x56884d[_0x6df532[_0x2b2e23][_0xe697('0x75')]],'%s',_0x46c78f):_0x46c78f;_0x46c78f=_0x6df532[_0x2b2e23][_0xe697('0x76')]?_[_0xe697('0x90')](_0x154146[_0x6df532[_0x2b2e23][_0xe697('0x76')]],'%s',_0x46c78f):_0x46c78f;if(_0x6df532[_0x2b2e23]['groupBy']){_0x1756e0[_0xe697('0x67')](_0x46c78f);}_0x6df532[_0x2b2e23]['orderBy']&&_0x1756e0[_0xe697('0x3d')](_0x46c78f,_0x6df532[_0x2b2e23][_0xe697('0x78')]===_0xe697('0x79')?![]:!![]);_0x1756e0[_0xe697('0x68')](_0x46c78f,_0x6df532[_0x2b2e23][_0xe697('0x7a')]||_0x46c78f);}if(_0x21633e[_0xe697('0x7b')]){_0x21633e[_0xe697('0x7b')]=JSON[_0xe697('0x7c')](_0x21633e['joins']);for(var _0x5932fb=0x0;_0x5932fb<_0x21633e[_0xe697('0x7b')][_0xe697('0x3b')];_0x5932fb+=0x1){if(_0x21633e[_0xe697('0x7b')][_0x5932fb][_0xe697('0x32')]&&_[_0xe697('0x62')](_0xdacac8,_0x21633e[_0xe697('0x7b')][_0x5932fb]['type'])&&_0x21633e['joins'][_0x5932fb]['parentKey']&&_0x21633e['joins'][_0x5932fb]['foreignTable']&&_0x21633e[_0xe697('0x7b')][_0x5932fb]['foreignKey']){_0x1756e0[_0x21633e[_0xe697('0x7b')][_0x5932fb][_0xe697('0x32')]](_0x21633e[_0xe697('0x7b')][_0x5932fb][_0xe697('0x7e')],null,util['format'](_0xe697('0x80'),_0x21633e[_0xe697('0x72')],_0x21633e['joins'][_0x5932fb]['parentKey'],_0x21633e[_0xe697('0x7b')][_0x5932fb][_0xe697('0x7e')],_0x21633e[_0xe697('0x7b')][_0x5932fb][_0xe697('0x7f')]));}}}if(_0x21633e['conditions']){_0x21633e['conditions']=JSON[_0xe697('0x7c')](_0x21633e['conditions']);_0x1756e0[_0xe697('0x3f')](_0x3f9a2a(_0x21633e[_0xe697('0x81')]['group']));}_0x2d63b2=_0x1756e0[_0xe697('0x91')]();_0x1756e0[_0xe697('0x3c')](_0x3065fd);_0x1756e0[_0xe697('0x1f')](0x0);return;}})[_0xe697('0x27')](function(){if(_0x3462f3[_0xe697('0x92')]===_0xe697('0x93')){return null;}var _0x1ba5c4=_[_0xe697('0x43')](_0x3462f3,{'name':_0x3462f3[_0xe697('0x94')]||_0x3462f3[_0xe697('0x2b')]||_0x21633e[_0xe697('0x2b')],'basename':_0x54281b,'savename':util['format'](_0xe697('0x95'),_0x3462f3[_0xe697('0x2b')]||_0x21633e[_0xe697('0x2b')],require(_0xe697('0x96'))['generate'](0x4),_0x3462f3[_0xe697('0x92')]||_0xe697('0x97')),'reportId':_0x21633e['id'],'reportType':_0xe697('0x98')});return db[_0xe697('0x99')][_0xe697('0x4d')](_0x1ba5c4,{'raw':!![]});})[_0xe697('0x27')](function(_0x4aef4){if(_0x21633e[_0xe697('0x72')]===_0xe697('0x9a')){_0x2d63b2['where'](_0x21633e[_0xe697('0x72')]+_0xe697('0x9b'),_0x3462f3['startDate'],_0x3462f3[_0xe697('0x9c')]);}else{_0x2d63b2[_0xe697('0x3f')](_0x21633e['table']+_0xe697('0x9d'),_0x3462f3[_0xe697('0x9e')],_0x3462f3['endDate']);}if(_0x4aef4){logger[_0xe697('0x9f')](_0xe697('0xa0'),_0x2d63b2[_0xe697('0x85')]());require(_0xe697('0xa1'))[_0xe697('0xa2')](path[_0xe697('0x57')](__dirname,'../../components/export/',_0x4aef4[_0xe697('0x92')]),[_0x4aef4['id'],_0x2d63b2[_0xe697('0x85')](),path[_0xe697('0x57')](__dirname,_0xe697('0xa3'),_0x4aef4[_0xe697('0xa4')]),_0x54281b]);return _0x4aef4;}else{var _0x2bd15b=squel[_0xe697('0x70')]();_0x2bd15b[_0xe697('0x71')]('('+_0x2d63b2[_0xe697('0x85')]()+')','countTable');_0x2bd15b[_0xe697('0x68')]('COUNT(*)',_0xe697('0x21'));_0x2d63b2['limit'](_0x3462f3[_0xe697('0x3c')]||_0x3065fd);_0x2d63b2[_0xe697('0x1f')](_0x3462f3['offset']||0x0);return dbH['sequelize'][_0xe697('0x34')](_0x2bd15b['toString'](),{'type':dbH['sequelize'][_0xe697('0x86')]['SELECT']})[_0xe697('0x27')](function(_0x41c0e3){if(!_0x41c0e3['length']){_0x5a80d9=0x0;}else{_0x5a80d9=_0x41c0e3[0x0][_0xe697('0x21')]||0x0;}return dbH[_0xe697('0x84')][_0xe697('0x34')](_0x2d63b2[_0xe697('0x85')](),{'type':dbH[_0xe697('0x84')]['QueryTypes'][_0xe697('0x87')]});})[_0xe697('0x27')](function(_0x441a52){return{'rows':_0x441a52||[],'count':_0x5a80d9};});}});}exports['run']=function(_0x2aae42,_0x29be13){return runReport(_0x2aae42[_0xe697('0x4b')],_0x2aae42[_0xe697('0x34')],_0x2aae42[_0xe697('0x44')])[_0xe697('0x27')](respondWithResult(_0x29be13,null))[_0xe697('0x49')](handleError(_0x29be13,null));};exports[_0xe697('0xa5')]=runReport;exports[_0xe697('0x34')]=function(_0x3d7fd2,_0x46004e){var _0x45e7b7=0xa;var _0x59d1fd=[_0xe697('0x57'),_0xe697('0x58'),_0xe697('0x59'),'cross_join'];var _0x59b83f={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe697('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xe697('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe697('0x8b'),'GROUP_CONCAT DESC':_0xe697('0x5e')};var _0x4598e3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xe697('0x5f'),'HOUR':_0xe697('0x60'),'ROUND':_0xe697('0x61'),'UNIX_TIMESTAMP':_0xe697('0xa6')};var _0x124dc6=function(_0x23f3c0){return!_[_0xe697('0x62')]([_0xe697('0x63'),_0xe697('0x8d'),_0xe697('0x64'),_0xe697('0x65')],_0x23f3c0);};var _0x5ec00a=function(_0x1be2bd){if(!_0x1be2bd||!_0x1be2bd[_0xe697('0x66')][_0xe697('0x3b')]){return'';}for(var _0x185a99='(',_0x1ecf61=0x0;_0x1ecf61<_0x1be2bd[_0xe697('0x66')]['length'];_0x1ecf61+=0x1){_0x1ecf61>0x0&&(_0x185a99+='\x20'+_0x1be2bd[_0xe697('0x8e')]+'\x20');_0x185a99+=_0x1be2bd[_0xe697('0x66')][_0x1ecf61]['group']?_0x5ec00a(_0x1be2bd['rules'][_0x1ecf61][_0xe697('0x67')]):_0x1be2bd[_0xe697('0x66')][_0x1ecf61][_0xe697('0x68')]+'\x20'+_0x1be2bd[_0xe697('0x66')][_0x1ecf61][_0xe697('0x69')]+(_0x124dc6(_0x1be2bd[_0xe697('0x66')][_0x1ecf61][_0xe697('0x69')])?'\x20'+_0x1be2bd[_0xe697('0x66')][_0x1ecf61][_0xe697('0x6a')]:'');}return _0x185a99+')';};var _0x58feb9={'where':{'id':_0x3d7fd2[_0xe697('0x4b')]['id']}},_0x4ef691,_0x30e126,_0x25fd4e,_0x2859f0,_0x24ca63;_0x58feb9=_[_0xe697('0x43')]({},_0x58feb9,_0x3d7fd2[_0xe697('0x44')]);return db[_0xe697('0x2f')][_0xe697('0x4c')](_0x58feb9)[_0xe697('0x27')](function(_0x5c2955){if(_0x5c2955){_0x4ef691=_0x5c2955;return _0x5c2955[_0xe697('0x6b')]();}return null;})[_0xe697('0x27')](function(_0x2febd1){if(_0x2febd1){if(!_0x2febd1[_0xe697('0x3b')]){throw new db[(_0xe697('0x6c'))][(_0xe697('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x30e126=_0x2febd1;return db[_0xe697('0x6e')][_0xe697('0x47')]({'raw':!![]});}return null;})[_0xe697('0x27')](function(_0x441e1c){if(_0x441e1c){_0x25fd4e=_[_0xe697('0x6f')](_0x441e1c,'id');var _0x5da63a;var _0x36290e=squel[_0xe697('0x70')]();_0x36290e[_0xe697('0x71')](_0x4ef691['table']);for(var _0x3a2cc6=0x0;_0x3a2cc6<_0x30e126['length'];_0x3a2cc6+=0x1){_0x5da63a=_0x30e126[_0x3a2cc6][_0xe697('0x73')]?_0x25fd4e[_0x30e126[_0x3a2cc6][_0xe697('0x73')]][_0xe697('0x74')]:_0x30e126[_0x3a2cc6][_0xe697('0x68')];_0x5da63a=_0x30e126[_0x3a2cc6]['function']?_[_0xe697('0x90')](_0x59b83f[_0x30e126[_0x3a2cc6][_0xe697('0x75')]],'%s',_0x5da63a):_0x5da63a;_0x5da63a=_0x30e126[_0x3a2cc6][_0xe697('0x76')]?_[_0xe697('0x90')](_0x4598e3[_0x30e126[_0x3a2cc6][_0xe697('0x76')]],'%s',_0x5da63a):_0x5da63a;if(_0x30e126[_0x3a2cc6][_0xe697('0x77')]){_0x36290e[_0xe697('0x67')](_0x5da63a);}_0x30e126[_0x3a2cc6]['orderBy']&&_0x36290e[_0xe697('0x3d')](_0x5da63a,_0x30e126[_0x3a2cc6]['orderBy']==='DESC'?![]:!![]);_0x36290e[_0xe697('0x68')](_0x5da63a,_0x30e126[_0x3a2cc6][_0xe697('0x7a')]||_0x5da63a);}if(_0x4ef691['joins']){_0x4ef691[_0xe697('0x7b')]=JSON[_0xe697('0x7c')](_0x4ef691[_0xe697('0x7b')]);for(var _0x40d994=0x0;_0x40d994<_0x4ef691[_0xe697('0x7b')]['length'];_0x40d994+=0x1){if(_0x4ef691[_0xe697('0x7b')][_0x40d994][_0xe697('0x32')]&&_[_0xe697('0x62')](_0x59d1fd,_0x4ef691[_0xe697('0x7b')][_0x40d994][_0xe697('0x32')])&&_0x4ef691['joins'][_0x40d994]['parentKey']&&_0x4ef691[_0xe697('0x7b')][_0x40d994][_0xe697('0x7e')]&&_0x4ef691[_0xe697('0x7b')][_0x40d994]['foreignKey']){_0x36290e[_0x4ef691[_0xe697('0x7b')][_0x40d994][_0xe697('0x32')]](_0x4ef691['joins'][_0x40d994][_0xe697('0x7e')],null,util[_0xe697('0x76')](_0xe697('0x80'),_0x4ef691[_0xe697('0x72')],_0x4ef691[_0xe697('0x7b')][_0x40d994][_0xe697('0x7d')],_0x4ef691[_0xe697('0x7b')][_0x40d994][_0xe697('0x7e')],_0x4ef691[_0xe697('0x7b')][_0x40d994][_0xe697('0x7f')]));}}}if(_0x4ef691[_0xe697('0x81')]){_0x4ef691[_0xe697('0x81')]=JSON[_0xe697('0x7c')](_0x4ef691[_0xe697('0x81')]);_0x36290e[_0xe697('0x3f')](_0x5ec00a(_0x4ef691[_0xe697('0x81')][_0xe697('0x67')]));}_0x24ca63=_0x36290e[_0xe697('0x91')]();_0x36290e[_0xe697('0x3c')](_0x45e7b7);_0x36290e[_0xe697('0x1f')](0x0);logger[_0xe697('0x82')](_0xe697('0x83'),_0x36290e[_0xe697('0x85')]());return dbH[_0xe697('0x84')][_0xe697('0x34')](_0x36290e[_0xe697('0x85')](),{'type':dbH[_0xe697('0x84')][_0xe697('0x86')][_0xe697('0x87')]});}})[_0xe697('0x27')](function(){return{'sql':_0x24ca63[_0xe697('0x85')]()};})['then'](respondWithResult(_0x46004e,null))[_0xe697('0x49')](handleError(_0x46004e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 85a6ebe..8703b82 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 _0x03fc=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x574e92,_0x5c61e8){var _0x32207c=function(_0x333c8e){while(--_0x333c8e){_0x574e92['push'](_0x574e92['shift']());}};_0x32207c(++_0x5c61e8);}(_0x03fc,0x1b7));var _0xc03f=function(_0x21b14f,_0x3ed9b9){_0x21b14f=_0x21b14f-0x0;var _0x4c0fd0=_0x03fc[_0x21b14f];return _0x4c0fd0;};'use strict';var _=require(_0xc03f('0x0'));var util=require('util');var logger=require(_0xc03f('0x1'))(_0xc03f('0x2'));var moment=require(_0xc03f('0x3'));var BPromise=require(_0xc03f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc03f('0x5'));var rimraf=require('rimraf');var config=require(_0xc03f('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xc03f('0x7')]=function(_0x3b23cc,_0x7bf33){return _0x3b23cc[_0xc03f('0x8')](_0xc03f('0x9'),attributes,{'tableName':_0xc03f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7557=['request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','bluebird'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x7557,0x167));var _0x7755=function(_0xa41fd3,_0x55742e){_0xa41fd3=_0xa41fd3-0x0;var _0x46f2d3=_0x7557[_0xa41fd3];return _0x46f2d3;};'use strict';var _=require(_0x7755('0x0'));var util=require(_0x7755('0x1'));var logger=require(_0x7755('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7755('0x3'));var rp=require(_0x7755('0x4'));var fs=require('fs');var path=require(_0x7755('0x5'));var rimraf=require(_0x7755('0x6'));var config=require(_0x7755('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x7755('0x8')]=function(_0x4a59fd,_0x3ddfa4){return _0x4a59fd['define'](_0x7755('0x9'),attributes,{'tableName':_0x7755('0xa'),'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 c350c75..703d8b9 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 _0x8eaf=['request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x8eaf,0x80));var _0xf8ea=function(_0x32aac9,_0x5eb63d){_0x32aac9=_0x32aac9-0x0;var _0x51bafd=_0x8eaf[_0x32aac9];return _0x51bafd;};'use strict';var _=require(_0xf8ea('0x0'));var util=require(_0xf8ea('0x1'));var moment=require(_0xf8ea('0x2'));var BPromise=require(_0xf8ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8ea('0x5'));var logger=require(_0xf8ea('0x6'))('rpc');var config=require(_0xf8ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf8ea('0x8')][_0xf8ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x596eb1,_0x27b4bd,_0x173d67){return new BPromise(function(_0x379f04,_0x17fe4d){return client[_0xf8ea('0xa')](_0x596eb1,_0x173d67)[_0xf8ea('0xb')](function(_0x55d452){logger[_0xf8ea('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27b4bd,_0xf8ea('0xd'));logger[_0xf8ea('0xe')](_0xf8ea('0xf'),_0x27b4bd,_0xf8ea('0xd'),JSON[_0xf8ea('0x10')](_0x55d452));if(_0x55d452[_0xf8ea('0x11')]){if(_0x55d452[_0xf8ea('0x11')][_0xf8ea('0x12')]===0x1f4){logger[_0xf8ea('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27b4bd,_0x55d452[_0xf8ea('0x11')]['message']);return _0x17fe4d(_0x55d452['error'][_0xf8ea('0x13')]);}logger[_0xf8ea('0x11')](_0xf8ea('0x14'),_0x27b4bd,_0x55d452[_0xf8ea('0x11')][_0xf8ea('0x13')]);return _0x379f04(_0x55d452['error'][_0xf8ea('0x13')]);}else{logger['info'](_0xf8ea('0x14'),_0x27b4bd,_0xf8ea('0xd'));_0x379f04(_0x55d452[_0xf8ea('0x15')][_0xf8ea('0x13')]);}})[_0xf8ea('0x16')](function(_0x4dd8c6){logger[_0xf8ea('0x11')](_0xf8ea('0x14'),_0x27b4bd,_0x4dd8c6);_0x17fe4d(_0x4dd8c6);});});}
\ No newline at end of file
+var _0x5caa=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0x5caa,0x181));var _0xa5ca=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0x5caa[_0x3d00db];return _0x41f115;};'use strict';var _=require(_0xa5ca('0x0'));var util=require('util');var moment=require(_0xa5ca('0x1'));var BPromise=require(_0xa5ca('0x2'));var rs=require(_0xa5ca('0x3'));var fs=require('fs');var Redis=require(_0xa5ca('0x4'));var db=require(_0xa5ca('0x5'))['db'];var utils=require(_0xa5ca('0x6'));var logger=require(_0xa5ca('0x7'))('rpc');var config=require(_0xa5ca('0x8'));var jayson=require(_0xa5ca('0x9'));var client=jayson[_0xa5ca('0xa')][_0xa5ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194f75,_0x2cfcd4,_0x43e3fb){return new BPromise(function(_0x536924,_0x36ddfe){return client[_0xa5ca('0xc')](_0x194f75,_0x43e3fb)[_0xa5ca('0xd')](function(_0x57d976){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2cfcd4,_0xa5ca('0xe'));logger['debug'](_0xa5ca('0xf'),_0x2cfcd4,_0xa5ca('0xe'),JSON[_0xa5ca('0x10')](_0x57d976));if(_0x57d976[_0xa5ca('0x11')]){if(_0x57d976[_0xa5ca('0x11')][_0xa5ca('0x12')]===0x1f4){logger[_0xa5ca('0x11')](_0xa5ca('0x13'),_0x2cfcd4,_0x57d976[_0xa5ca('0x11')]['message']);return _0x36ddfe(_0x57d976[_0xa5ca('0x11')][_0xa5ca('0x14')]);}logger[_0xa5ca('0x11')](_0xa5ca('0x13'),_0x2cfcd4,_0x57d976['error'][_0xa5ca('0x14')]);return _0x536924(_0x57d976['error'][_0xa5ca('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2cfcd4,'request\x20sent');_0x536924(_0x57d976[_0xa5ca('0x15')][_0xa5ca('0x14')]);}})[_0xa5ca('0x16')](function(_0xb3f5f7){logger[_0xa5ca('0x11')](_0xa5ca('0x13'),_0x2cfcd4,_0xb3f5f7);_0x36ddfe(_0xb3f5f7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 2ac634e..bab0b34 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 _0x36c8=['Router','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','query','create','put','update','delete','exports','multer','util','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36c8,0x1ad));var _0x836c=function(_0x25a23f,_0x41d099){_0x25a23f=_0x25a23f-0x0;var _0x18643c=_0x36c8[_0x25a23f];return _0x18643c;};'use strict';var multer=require(_0x836c('0x0'));var util=require(_0x836c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x836c('0x2'));var router=express[_0x836c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x836c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x836c('0x5'));router[_0x836c('0x6')]('/',auth[_0x836c('0x7')](),controller['index']);router['get'](_0x836c('0x8'),auth[_0x836c('0x7')](),controller[_0x836c('0x9')]);router[_0x836c('0x6')](_0x836c('0xa'),auth['isAuthenticated'](),controller['preview']);router[_0x836c('0x6')](_0x836c('0xb'),auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth[_0x836c('0x7')](),controller[_0x836c('0xc')]);router['post']('/',auth[_0x836c('0x7')](),controller[_0x836c('0xd')]);router[_0x836c('0xe')](_0x836c('0x8'),auth[_0x836c('0x7')](),controller[_0x836c('0xf')]);router[_0x836c('0x10')](_0x836c('0x8'),auth[_0x836c('0x7')](),controller['destroy']);module[_0x836c('0x11')]=router;
\ No newline at end of file
+var _0x5d85=['show','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','isAuthenticated'];(function(_0x14a4d0,_0x4c7068){var _0x18c8ab=function(_0x10bd3b){while(--_0x10bd3b){_0x14a4d0['push'](_0x14a4d0['shift']());}};_0x18c8ab(++_0x4c7068);}(_0x5d85,0x191));var _0x55d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5d85[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x55d8('0x0'));var util=require(_0x55d8('0x1'));var path=require(_0x55d8('0x2'));var timeout=require(_0x55d8('0x3'));var express=require(_0x55d8('0x4'));var router=express[_0x55d8('0x5')]();var fs_extra=require(_0x55d8('0x6'));var auth=require(_0x55d8('0x7'));var interaction=require(_0x55d8('0x8'));var config=require(_0x55d8('0x9'));var controller=require(_0x55d8('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x55d8('0xb')]);router[_0x55d8('0xc')](_0x55d8('0xd'),auth[_0x55d8('0xe')](),controller[_0x55d8('0xf')]);router['get'](_0x55d8('0x10'),auth['isAuthenticated'](),controller['preview']);router[_0x55d8('0xc')](_0x55d8('0x11'),auth['isAuthenticated'](),controller[_0x55d8('0x12')]);router[_0x55d8('0xc')](_0x55d8('0x13'),auth[_0x55d8('0xe')](),controller[_0x55d8('0x14')]);router['post']('/',auth[_0x55d8('0xe')](),controller[_0x55d8('0x15')]);router[_0x55d8('0x16')](_0x55d8('0xd'),auth[_0x55d8('0xe')](),controller[_0x55d8('0x17')]);router[_0x55d8('0x18')]('/:id',auth[_0x55d8('0xe')](),controller[_0x55d8('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 5f2d1bd..34aff26 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 _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x4ad095,_0x5f4d18){var _0x168ddf=function(_0x3600af){while(--_0x3600af){_0x4ad095['push'](_0x4ad095['shift']());}};_0x168ddf(++_0x5f4d18);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x18c61b,_0x129781){var _0x1ffb5c=function(_0x2447ff){while(--_0x2447ff){_0x18c61b['push'](_0x18c61b['shift']());}};_0x1ffb5c(++_0x129781);}(_0xeda8,0x104));var _0x8eda=function(_0x3b8ffc,_0x44dc0e){_0x3b8ffc=_0x3b8ffc-0x0;var _0x1e3489=_0xeda8[_0x3b8ffc];return _0x1e3489;};'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 2dcf098..8dcab31 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 _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x4bf564,_0x72673f){var _0x158b46=function(_0x45106c){while(--_0x45106c){_0x4bf564['push'](_0x4bf564['shift']());}};_0x158b46(++_0x72673f);}(_0x4975,0x86));var _0x5497=function(_0x3beb14,_0x5035fe){_0x3beb14=_0x3beb14-0x0;var _0x38e7f5=_0x4975[_0x3beb14];return _0x38e7f5;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
+var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x1508e9,_0x5dfaec){var _0x5a0bf5=function(_0x1e2a64){while(--_0x1e2a64){_0x1508e9['push'](_0x1508e9['shift']());}};_0x5a0bf5(++_0x5dfaec);}(_0x4819,0xcd));var _0x9481=function(_0x17db61,_0x364236){_0x17db61=_0x17db61-0x0;var _0x7ac96b=_0x4819[_0x17db61];return _0x7ac96b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 8d7d29f..6762643 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 _0xb1b1=['moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x184ec8,_0xf0c34e){var _0x4ed9af=function(_0x4731e7){while(--_0x4731e7){_0x184ec8['push'](_0x184ec8['shift']());}};_0x4ed9af(++_0xf0c34e);}(_0xb1b1,0xa5));var _0x1b1b=function(_0x574ca8,_0x4d3709){_0x574ca8=_0x574ca8-0x0;var _0x37545d=_0xb1b1[_0x574ca8];return _0x37545d;};'use strict';var _=require(_0x1b1b('0x0'));var util=require(_0x1b1b('0x1'));var logger=require(_0x1b1b('0x2'))(_0x1b1b('0x3'));var moment=require(_0x1b1b('0x4'));var BPromise=require(_0x1b1b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b1b('0x6'));var rimraf=require(_0x1b1b('0x7'));var config=require(_0x1b1b('0x8'));var attributes=require(_0x1b1b('0x9'));module['exports']=function(_0x5a2545,_0x38b6fa){return _0x5a2545[_0x1b1b('0xa')](_0x1b1b('0xb'),attributes,{'tableName':_0x1b1b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ec6=['api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger'];(function(_0x14c36a,_0x312762){var _0x396f70=function(_0x9f0d39){while(--_0x9f0d39){_0x14c36a['push'](_0x14c36a['shift']());}};_0x396f70(++_0x312762);}(_0x4ec6,0x1ab));var _0x64ec=function(_0xdd2162,_0x40d338){_0xdd2162=_0xdd2162-0x0;var _0x428d83=_0x4ec6[_0xdd2162];return _0x428d83;};'use strict';var _=require('lodash');var util=require(_0x64ec('0x0'));var logger=require(_0x64ec('0x1'))(_0x64ec('0x2'));var moment=require(_0x64ec('0x3'));var BPromise=require(_0x64ec('0x4'));var rp=require(_0x64ec('0x5'));var fs=require('fs');var path=require(_0x64ec('0x6'));var rimraf=require(_0x64ec('0x7'));var config=require('../../config/environment');var attributes=require(_0x64ec('0x8'));module['exports']=function(_0x3be8e4,_0x4e8ca4){return _0x3be8e4['define'](_0x64ec('0x9'),attributes,{'tableName':_0x64ec('0xa'),'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 1e61775..7ee6771 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 _0x7a56=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4b8fc7,_0x5022fc){var _0x249f4a=function(_0x1b25d4){while(--_0x1b25d4){_0x4b8fc7['push'](_0x4b8fc7['shift']());}};_0x249f4a(++_0x5022fc);}(_0x7a56,0x1a6));var _0x67a5=function(_0x9f4c61,_0x249fcc){_0x9f4c61=_0x9f4c61-0x0;var _0x32166f=_0x7a56[_0x9f4c61];return _0x32166f;};'use strict';var _=require(_0x67a5('0x0'));var util=require('util');var moment=require(_0x67a5('0x1'));var BPromise=require(_0x67a5('0x2'));var rs=require(_0x67a5('0x3'));var fs=require('fs');var Redis=require(_0x67a5('0x4'));var db=require(_0x67a5('0x5'))['db'];var utils=require(_0x67a5('0x6'));var logger=require('../../config/logger')(_0x67a5('0x7'));var config=require(_0x67a5('0x8'));var jayson=require(_0x67a5('0x9'));var client=jayson['client'][_0x67a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16b4aa,_0x4c85f1,_0x19aab4){return new BPromise(function(_0x274f8a,_0x28b73d){return client[_0x67a5('0xb')](_0x16b4aa,_0x19aab4)[_0x67a5('0xc')](function(_0x3e357f){logger[_0x67a5('0xd')](_0x67a5('0xe'),_0x4c85f1,_0x67a5('0xf'));logger[_0x67a5('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4c85f1,_0x67a5('0xf'),JSON[_0x67a5('0x11')](_0x3e357f));if(_0x3e357f[_0x67a5('0x12')]){if(_0x3e357f[_0x67a5('0x12')]['code']===0x1f4){logger[_0x67a5('0x12')](_0x67a5('0xe'),_0x4c85f1,_0x3e357f[_0x67a5('0x12')][_0x67a5('0x13')]);return _0x28b73d(_0x3e357f['error'][_0x67a5('0x13')]);}logger['error'](_0x67a5('0xe'),_0x4c85f1,_0x3e357f[_0x67a5('0x12')][_0x67a5('0x13')]);return _0x274f8a(_0x3e357f[_0x67a5('0x12')][_0x67a5('0x13')]);}else{logger[_0x67a5('0xd')](_0x67a5('0xe'),_0x4c85f1,_0x67a5('0xf'));_0x274f8a(_0x3e357f[_0x67a5('0x14')]['message']);}})['catch'](function(_0x4fae74){logger['error'](_0x67a5('0xe'),_0x4c85f1,_0x4fae74);_0x28b73d(_0x4fae74);});});}
\ No newline at end of file
+var _0x859d=['lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5b97a3,_0xdd8f3c){var _0x2f3472=function(_0x208b6b){while(--_0x208b6b){_0x5b97a3['push'](_0x5b97a3['shift']());}};_0x2f3472(++_0xdd8f3c);}(_0x859d,0x160));var _0xd859=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x859d[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0xd859('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd859('0x1'));var fs=require('fs');var Redis=require(_0xd859('0x2'));var db=require(_0xd859('0x3'))['db'];var utils=require(_0xd859('0x4'));var logger=require(_0xd859('0x5'))('rpc');var config=require(_0xd859('0x6'));var jayson=require(_0xd859('0x7'));var client=jayson[_0xd859('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34ec67,_0x4ecbdf,_0x2348e2){return new BPromise(function(_0x25cf6b,_0x10c885){return client[_0xd859('0x9')](_0x34ec67,_0x2348e2)[_0xd859('0xa')](function(_0x503367){logger[_0xd859('0xb')](_0xd859('0xc'),_0x4ecbdf,_0xd859('0xd'));logger[_0xd859('0xe')](_0xd859('0xf'),_0x4ecbdf,_0xd859('0xd'),JSON[_0xd859('0x10')](_0x503367));if(_0x503367[_0xd859('0x11')]){if(_0x503367['error'][_0xd859('0x12')]===0x1f4){logger[_0xd859('0x11')](_0xd859('0xc'),_0x4ecbdf,_0x503367[_0xd859('0x11')]['message']);return _0x10c885(_0x503367['error'][_0xd859('0x13')]);}logger[_0xd859('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ecbdf,_0x503367['error']['message']);return _0x25cf6b(_0x503367[_0xd859('0x11')]['message']);}else{logger[_0xd859('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ecbdf,_0xd859('0xd'));_0x25cf6b(_0x503367[_0xd859('0x14')][_0xd859('0x13')]);}})[_0xd859('0x15')](function(_0x2efc9a){logger['error'](_0xd859('0xc'),_0x4ecbdf,_0x2efc9a);_0x10c885(_0x2efc9a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 6a5a3b7..3e06f4b 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 _0x8de8=['show','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated'];(function(_0x4f51f9,_0x5d5613){var _0x533984=function(_0x578319){while(--_0x578319){_0x4f51f9['push'](_0x4f51f9['shift']());}};_0x533984(++_0x5d5613);}(_0x8de8,0x19d));var _0x88de=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8de8[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x88de('0x0'));var util=require('util');var path=require(_0x88de('0x1'));var timeout=require(_0x88de('0x2'));var express=require(_0x88de('0x3'));var router=express['Router']();var fs_extra=require(_0x88de('0x4'));var auth=require(_0x88de('0x5'));var interaction=require(_0x88de('0x6'));var config=require(_0x88de('0x7'));var controller=require(_0x88de('0x8'));router[_0x88de('0x9')]('/',auth['isAuthenticated'](),controller[_0x88de('0xa')]);router[_0x88de('0x9')]('/:id',auth[_0x88de('0xb')](),controller[_0x88de('0xc')]);router[_0x88de('0x9')]('/:id/preview',auth[_0x88de('0xb')](),controller['preview']);router[_0x88de('0x9')](_0x88de('0xd'),auth['isAuthenticated'](),controller[_0x88de('0xe')]);router[_0x88de('0x9')](_0x88de('0xf'),auth[_0x88de('0xb')](),controller[_0x88de('0x10')]);router[_0x88de('0x11')]('/',auth[_0x88de('0xb')](),controller[_0x88de('0x12')]);router[_0x88de('0x13')](_0x88de('0x14'),auth[_0x88de('0xb')](),controller[_0x88de('0x15')]);router[_0x88de('0x16')](_0x88de('0x14'),auth[_0x88de('0xb')](),controller[_0x88de('0x17')]);module[_0x88de('0x18')]=router;
\ No newline at end of file
+var _0x1805=['preview','/:id/query','post','create','put','update','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x235499,_0x5cbe87){var _0x11f7e5=function(_0x540a78){while(--_0x540a78){_0x235499['push'](_0x235499['shift']());}};_0x11f7e5(++_0x5cbe87);}(_0x1805,0x1bf));var _0x5180=function(_0x5718e8,_0x1f861f){_0x5718e8=_0x5718e8-0x0;var _0xd7a6ae=_0x1805[_0x5718e8];return _0xd7a6ae;};'use strict';var multer=require('multer');var util=require(_0x5180('0x0'));var path=require(_0x5180('0x1'));var timeout=require(_0x5180('0x2'));var express=require('express');var router=express[_0x5180('0x3')]();var fs_extra=require(_0x5180('0x4'));var auth=require(_0x5180('0x5'));var interaction=require(_0x5180('0x6'));var config=require(_0x5180('0x7'));var controller=require(_0x5180('0x8'));router[_0x5180('0x9')]('/',auth[_0x5180('0xa')](),controller[_0x5180('0xb')]);router[_0x5180('0x9')](_0x5180('0xc'),auth[_0x5180('0xa')](),controller[_0x5180('0xd')]);router['get'](_0x5180('0xe'),auth[_0x5180('0xa')](),controller[_0x5180('0xf')]);router[_0x5180('0x9')]('/:id/run',auth[_0x5180('0xa')](),controller['run']);router[_0x5180('0x9')](_0x5180('0x10'),auth[_0x5180('0xa')](),controller['query']);router[_0x5180('0x11')]('/',auth[_0x5180('0xa')](),controller[_0x5180('0x12')]);router[_0x5180('0x13')](_0x5180('0xc'),auth[_0x5180('0xa')](),controller[_0x5180('0x14')]);router['delete'](_0x5180('0xc'),auth[_0x5180('0xa')](),controller['destroy']);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 4e7580c..e6d689c 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 _0x5b77=['csv','DATE','Loading','manual','UNSIGNED','moment','STRING','ENUM','pdf'];(function(_0xa35521,_0x57e641){var _0x163a84=function(_0x3dffb8){while(--_0x3dffb8){_0xa35521['push'](_0xa35521['shift']());}};_0x163a84(++_0x57e641);}(_0x5b77,0x16d));var _0x75b7=function(_0x5e66ee,_0x253816){_0x5e66ee=_0x5e66ee-0x0;var _0x2ee916=_0x5b77[_0x5e66ee];return _0x2ee916;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x75b7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x75b7('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x75b7('0x2')]('csv',_0x75b7('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0x75b7('0x4')},'savename':{'type':Sequelize[_0x75b7('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x75b7('0x5')]},'endDate':{'type':Sequelize[_0x75b7('0x5')]},'status':{'type':Sequelize[_0x75b7('0x1')],'defaultValue':_0x75b7('0x6')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0x75b7('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x75b7('0x8')]},'reportType':{'type':Sequelize[_0x75b7('0x1')]}};
\ No newline at end of file
+var _0xf5cc=['UNSIGNED','sequelize','exports','STRING','ENUM','pdf','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x5cc276,_0x147a8a){var _0x4604a0=function(_0x63d9a1){while(--_0x63d9a1){_0x5cc276['push'](_0x5cc276['shift']());}};_0x4604a0(++_0x147a8a);}(_0xf5cc,0x91));var _0xcf5c=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xf5cc[_0xe39824];return _0x4bc31e;};'use strict';var Sequelize=require(_0xcf5c('0x0'));var moment=require('moment');module[_0xcf5c('0x1')]={'name':{'type':Sequelize[_0xcf5c('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xcf5c('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xcf5c('0x3')]('csv',_0xcf5c('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xcf5c('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xcf5c('0x6')]},'endDate':{'type':Sequelize[_0xcf5c('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xcf5c('0x7')},'type':{'type':Sequelize[_0xcf5c('0x3')](_0xcf5c('0x8'),_0xcf5c('0x9')),'allowNull':![],'defaultValue':_0xcf5c('0x8')},'reportId':{'type':Sequelize[_0xcf5c('0xa')](0xb)[_0xcf5c('0xb')]},'reportType':{'type':Sequelize[_0xcf5c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 71ab1dd..60e585c 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 _0x02d4=['undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','length','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0xf5d574,_0x116b8e){var _0x352179=function(_0x2e469a){while(--_0x2e469a){_0xf5d574['push'](_0xf5d574['shift']());}};_0x352179(++_0x116b8e);}(_0x02d4,0x10c));var _0x402d=function(_0xfe4643,_0x319959){_0xfe4643=_0xfe4643-0x0;var _0x22f100=_0x02d4[_0xfe4643];return _0x22f100;};'use strict';var emlformat=require(_0x402d('0x0'));var rimraf=require(_0x402d('0x1'));var zipdir=require(_0x402d('0x2'));var jsonpatch=require(_0x402d('0x3'));var rp=require(_0x402d('0x4'));var moment=require(_0x402d('0x5'));var BPromise=require(_0x402d('0x6'));var Mustache=require(_0x402d('0x7'));var util=require(_0x402d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x402d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x402d('0xa'));var _=require(_0x402d('0xb'));var squel=require('squel');var crypto=require(_0x402d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x402d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x402d('0xe'));var Papa=require('papaparse');var Redis=require(_0x402d('0xf'));var authService=require(_0x402d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x402d('0x11'));var hardwareService=require(_0x402d('0x12'));var logger=require('../../config/logger')(_0x402d('0x13'));var utils=require('../../config/utils');var config=require(_0x402d('0x14'));var licenseUtil=require(_0x402d('0x15'));var db=require(_0x402d('0x16'))['db'];function respondWithStatusCode(_0x33f121,_0x42a821){_0x42a821=_0x42a821||0xcc;return function(_0x1bec0b){if(_0x1bec0b){return _0x33f121['sendStatus'](_0x42a821);}return _0x33f121[_0x402d('0x17')](_0x42a821)[_0x402d('0x18')]();};}function respondWithResult(_0x34b3e4,_0x1fec7a){_0x1fec7a=_0x1fec7a||0xc8;return function(_0x4411a9){if(_0x4411a9){return _0x34b3e4[_0x402d('0x17')](_0x1fec7a)[_0x402d('0x19')](_0x4411a9);}};}function respondWithFilteredResult(_0x238b47,_0x49c57b){return function(_0x4ef506){if(_0x4ef506){var _0x196580=typeof _0x49c57b['offset']===_0x402d('0x1a')&&typeof _0x49c57b[_0x402d('0x1b')]===_0x402d('0x1a');var _0x32539f=_0x4ef506[_0x402d('0x1c')];var _0x37ffaf=_0x196580?0x0:_0x49c57b[_0x402d('0x1d')];var _0x3753a9=_0x196580?_0x4ef506[_0x402d('0x1c')]:_0x49c57b[_0x402d('0x1d')]+_0x49c57b[_0x402d('0x1b')];var _0x52c9fc;if(_0x3753a9>=_0x32539f){_0x3753a9=_0x32539f;_0x52c9fc=0xc8;}else{_0x52c9fc=0xce;}_0x238b47['status'](_0x52c9fc);return _0x238b47[_0x402d('0x1e')](_0x402d('0x1f'),_0x37ffaf+'-'+_0x3753a9+'/'+_0x32539f)[_0x402d('0x19')](_0x4ef506);}return null;};}function patchUpdates(_0x51a135){return function(_0x45df72){try{jsonpatch[_0x402d('0x20')](_0x45df72,_0x51a135,!![]);}catch(_0x5ebd2e){return BPromise[_0x402d('0x21')](_0x5ebd2e);}return _0x45df72['save']();};}function saveUpdates(_0x5b473d,_0x565de2){return function(_0x4759cd){if(_0x4759cd){return _0x4759cd['update'](_0x5b473d)[_0x402d('0x22')](function(_0x5b8172){return _0x5b8172;});}return null;};}function removeEntity(_0x33d322,_0x202c74){return function(_0x3148d8){if(_0x3148d8){return _0x3148d8[_0x402d('0x23')]()['then'](function(){var _0x3ab49c=_0x3148d8[_0x402d('0x24')]({'plain':!![]});var _0x57847e=_0x402d('0x25');return db[_0x402d('0x26')][_0x402d('0x23')]({'where':{'type':_0x57847e,'resourceId':_0x3ab49c['id']}})['then'](function(){return _0x3148d8;});})[_0x402d('0x22')](function(){_0x33d322[_0x402d('0x17')](0xcc)[_0x402d('0x18')]();});}};}function handleEntityNotFound(_0x9c7ba5,_0x1b6dae){return function(_0x41ba4f){if(!_0x41ba4f){_0x9c7ba5[_0x402d('0x27')](0x194);}return _0x41ba4f;};}function handleError(_0x57b51d,_0x31c999){_0x31c999=_0x31c999||0x1f4;return function(_0x4002d2){logger['error'](_0x4002d2['stack']);if(_0x4002d2[_0x402d('0x28')]){delete _0x4002d2[_0x402d('0x28')];}_0x57b51d['status'](_0x31c999)[_0x402d('0x29')](_0x4002d2);};}exports['index']=function(_0x2f405e,_0x27813b){var _0x2b895d={},_0x422362={},_0x212831={'count':0x0,'rows':[]};var _0x313cdb=_[_0x402d('0x2a')](db[_0x402d('0x2b')][_0x402d('0x2c')],function(_0x4dda71){return{'name':_0x4dda71[_0x402d('0x2d')],'type':_0x4dda71[_0x402d('0x2e')][_0x402d('0x2f')]};});_0x422362[_0x402d('0x30')]=_[_0x402d('0x2a')](_0x313cdb,'name');_0x422362[_0x402d('0x31')]=_['keys'](_0x2f405e[_0x402d('0x31')]);_0x422362['filters']=_['intersection'](_0x422362['model'],_0x422362['query']);_0x2b895d[_0x402d('0x32')]=_[_0x402d('0x33')](_0x422362[_0x402d('0x30')],qs[_0x402d('0x34')](_0x2f405e[_0x402d('0x31')][_0x402d('0x34')]));_0x2b895d['attributes']=_0x2b895d[_0x402d('0x32')]['length']?_0x2b895d[_0x402d('0x32')]:_0x422362[_0x402d('0x30')];if(!_0x2f405e[_0x402d('0x31')][_0x402d('0x35')](_0x402d('0x36'))){_0x2b895d[_0x402d('0x1b')]=qs[_0x402d('0x1b')](_0x2f405e[_0x402d('0x31')]['limit']);_0x2b895d[_0x402d('0x1d')]=qs[_0x402d('0x1d')](_0x2f405e[_0x402d('0x31')][_0x402d('0x1d')]);}_0x2b895d[_0x402d('0x37')]=qs[_0x402d('0x38')](_0x2f405e['query'][_0x402d('0x38')]);_0x2b895d['where']=qs['filters'](_[_0x402d('0x39')](_0x2f405e['query'],_0x422362[_0x402d('0x3a')]),_0x313cdb);if(_0x2f405e[_0x402d('0x31')][_0x402d('0x3b')]){_0x2b895d[_0x402d('0x3c')]=_[_0x402d('0x3d')](_0x2b895d['where'],{'$or':_[_0x402d('0x2a')](_0x313cdb,function(_0x439845){if(_0x439845[_0x402d('0x2e')]!==_0x402d('0x3e')){var _0x22fcd5={};_0x22fcd5[_0x439845['name']]={'$like':'%'+_0x2f405e[_0x402d('0x31')][_0x402d('0x3b')]+'%'};return _0x22fcd5;}})});}_0x2b895d=_['merge']({},_0x2b895d,_0x2f405e['options']);var _0x3cda2c={'where':_0x2b895d[_0x402d('0x3c')]};return db[_0x402d('0x2b')][_0x402d('0x1c')](_0x3cda2c)[_0x402d('0x22')](function(_0xd49cc9){_0x212831[_0x402d('0x1c')]=_0xd49cc9;if(_0x2f405e[_0x402d('0x31')][_0x402d('0x3f')]){_0x2b895d[_0x402d('0x40')]=[{'all':!![]}];}return db[_0x402d('0x2b')][_0x402d('0x41')](_0x2b895d);})[_0x402d('0x22')](function(_0x520b9f){_0x212831[_0x402d('0x42')]=_0x520b9f;return _0x212831;})[_0x402d('0x22')](respondWithFilteredResult(_0x27813b,_0x2b895d))['catch'](handleError(_0x27813b,null));};exports[_0x402d('0x43')]=function(_0x2ef6ae,_0x5165a5){var _0x504252={'raw':!![],'where':{'id':_0x2ef6ae[_0x402d('0x44')]['id']}},_0x4e1db9={};_0x4e1db9[_0x402d('0x30')]=_[_0x402d('0x45')](db[_0x402d('0x2b')]['rawAttributes']);_0x4e1db9[_0x402d('0x31')]=_[_0x402d('0x45')](_0x2ef6ae[_0x402d('0x31')]);_0x4e1db9[_0x402d('0x3a')]=_[_0x402d('0x33')](_0x4e1db9[_0x402d('0x30')],_0x4e1db9[_0x402d('0x31')]);_0x504252[_0x402d('0x32')]=_[_0x402d('0x33')](_0x4e1db9[_0x402d('0x30')],qs[_0x402d('0x34')](_0x2ef6ae[_0x402d('0x31')]['fields']));_0x504252[_0x402d('0x32')]=_0x504252[_0x402d('0x32')][_0x402d('0x46')]?_0x504252['attributes']:_0x4e1db9['model'];if(_0x2ef6ae[_0x402d('0x31')][_0x402d('0x3f')]){_0x504252[_0x402d('0x40')]=[{'all':!![]}];}_0x504252=_['merge']({},_0x504252,_0x2ef6ae[_0x402d('0x47')]);return db[_0x402d('0x2b')][_0x402d('0x48')](_0x504252)[_0x402d('0x22')](handleEntityNotFound(_0x5165a5,null))[_0x402d('0x22')](respondWithResult(_0x5165a5,null))[_0x402d('0x49')](handleError(_0x5165a5,null));};exports[_0x402d('0x4a')]=function(_0x2370ca,_0x1af4cc){return db[_0x402d('0x2b')][_0x402d('0x4a')](_0x2370ca[_0x402d('0x4b')],{})[_0x402d('0x22')](function(_0x575906){var _0x376016=_0x2370ca['user'][_0x402d('0x24')]({'plain':!![]});if(!_0x376016)throw new Error(_0x402d('0x4c'));if(_0x376016[_0x402d('0x4d')]===_0x402d('0x4e')){var _0xbed40b=_0x575906[_0x402d('0x24')]({'plain':!![]});var _0x444294=_0x402d('0x25');return db['UserProfileSection'][_0x402d('0x48')]({'where':{'name':_0x444294,'userProfileId':_0x376016[_0x402d('0x4f')]},'raw':!![]})[_0x402d('0x22')](function(_0x11e18e){if(_0x11e18e&&_0x11e18e[_0x402d('0x50')]===0x0){return db[_0x402d('0x26')][_0x402d('0x4a')]({'name':_0xbed40b[_0x402d('0x28')],'resourceId':_0xbed40b['id'],'type':_0x11e18e[_0x402d('0x28')],'sectionId':_0x11e18e['id']},{})[_0x402d('0x22')](function(){return _0x575906;});}else{return _0x575906;}})[_0x402d('0x49')](function(_0x157d59){logger[_0x402d('0x51')](_0x402d('0x52'),_0x157d59);throw _0x157d59;});}return _0x575906;})['then'](respondWithResult(_0x1af4cc,0xc9))[_0x402d('0x49')](handleError(_0x1af4cc,null));};exports[_0x402d('0x53')]=function(_0x5b8074,_0x1d84d0){if(_0x5b8074[_0x402d('0x4b')]['id']){delete _0x5b8074[_0x402d('0x4b')]['id'];}return db['AnalyticExtractedReport'][_0x402d('0x48')]({'where':{'id':_0x5b8074[_0x402d('0x44')]['id']}})[_0x402d('0x22')](handleEntityNotFound(_0x1d84d0,null))['then'](saveUpdates(_0x5b8074['body'],null))[_0x402d('0x22')](respondWithResult(_0x1d84d0,null))[_0x402d('0x49')](handleError(_0x1d84d0,null));};exports[_0x402d('0x23')]=function(_0x3be87a,_0x293206){return db['AnalyticExtractedReport'][_0x402d('0x48')]({'where':{'id':_0x3be87a[_0x402d('0x44')]['id']}})[_0x402d('0x22')](handleEntityNotFound(_0x293206,null))['then'](removeEntity(_0x293206,null))[_0x402d('0x49')](handleError(_0x293206,null));};exports['download']=function(_0x19f682,_0x1fc4f1,_0x57eae9){return db[_0x402d('0x2b')][_0x402d('0x48')]({'where':{'id':_0x19f682[_0x402d('0x44')]['id']},'attributes':[_0x402d('0x28'),_0x402d('0x54'),'savename','output'],'raw':!![]})[_0x402d('0x22')](handleEntityNotFound(_0x1fc4f1,null))[_0x402d('0x22')](function(_0x5314ee){if(_0x5314ee){if(!fs[_0x402d('0x55')](path[_0x402d('0x56')](config[_0x402d('0x57')],_0x402d('0x58'),_0x5314ee[_0x402d('0x59')]))){throw new db['Sequelize'][(_0x402d('0x5a'))](_0x402d('0x5b'));}if(_0x19f682[_0x402d('0x31')][_0x402d('0x5c')]){return _0x1fc4f1[_0x402d('0x27')](0xc8);}return _0x1fc4f1[_0x402d('0x5d')](path[_0x402d('0x56')](config[_0x402d('0x57')],'server/files/reports',_0x5314ee[_0x402d('0x59')]),util[_0x402d('0x5e')](_0x402d('0x5f'),_0x5314ee[_0x402d('0x54')]||_0x5314ee['name'],_0x5314ee[_0x402d('0x60')][_0x402d('0x61')]()));}})[_0x402d('0x49')](handleError(_0x1fc4f1,null));};
\ No newline at end of file
+var _0xf25b=['user','UserProfileSection','userProfileId','autoAssociation','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','findAll','rows','catch','show','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x510fba,_0x3238c8){var _0x1ba091=function(_0x228f30){while(--_0x228f30){_0x510fba['push'](_0x510fba['shift']());}};_0x1ba091(++_0x3238c8);}(_0xf25b,0xd6));var _0xbf25=function(_0x1138b7,_0x32a90a){_0x1138b7=_0x1138b7-0x0;var _0x5505bf=_0xf25b[_0x1138b7];return _0x5505bf;};'use strict';var emlformat=require(_0xbf25('0x0'));var rimraf=require(_0xbf25('0x1'));var zipdir=require(_0xbf25('0x2'));var jsonpatch=require(_0xbf25('0x3'));var rp=require(_0xbf25('0x4'));var moment=require(_0xbf25('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbf25('0x6'));var util=require('util');var path=require(_0xbf25('0x7'));var sox=require(_0xbf25('0x8'));var csv=require('to-csv');var ejs=require(_0xbf25('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf25('0xa'));var squel=require(_0xbf25('0xb'));var crypto=require(_0xbf25('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf25('0xd'));var toCsv=require(_0xbf25('0xe'));var querystring=require(_0xbf25('0xf'));var Papa=require(_0xbf25('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbf25('0x11'));var as=require(_0xbf25('0x12'));var hardwareService=require(_0xbf25('0x13'));var logger=require(_0xbf25('0x14'))(_0xbf25('0x15'));var utils=require(_0xbf25('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbf25('0x17'));var db=require(_0xbf25('0x18'))['db'];function respondWithStatusCode(_0x1a928e,_0x51d389){_0x51d389=_0x51d389||0xcc;return function(_0x1f0309){if(_0x1f0309){return _0x1a928e[_0xbf25('0x19')](_0x51d389);}return _0x1a928e[_0xbf25('0x1a')](_0x51d389)[_0xbf25('0x1b')]();};}function respondWithResult(_0xde77e3,_0xf331da){_0xf331da=_0xf331da||0xc8;return function(_0x5089dd){if(_0x5089dd){return _0xde77e3['status'](_0xf331da)[_0xbf25('0x1c')](_0x5089dd);}};}function respondWithFilteredResult(_0x4da93c,_0x11d166){return function(_0x4697ff){if(_0x4697ff){var _0x2b8ce1=typeof _0x11d166[_0xbf25('0x1d')]===_0xbf25('0x1e')&&typeof _0x11d166[_0xbf25('0x1f')]==='undefined';var _0xa7f8ea=_0x4697ff['count'];var _0x5506ba=_0x2b8ce1?0x0:_0x11d166['offset'];var _0x496768=_0x2b8ce1?_0x4697ff[_0xbf25('0x20')]:_0x11d166[_0xbf25('0x1d')]+_0x11d166[_0xbf25('0x1f')];var _0x36b8a9;if(_0x496768>=_0xa7f8ea){_0x496768=_0xa7f8ea;_0x36b8a9=0xc8;}else{_0x36b8a9=0xce;}_0x4da93c[_0xbf25('0x1a')](_0x36b8a9);return _0x4da93c['set']('Content-Range',_0x5506ba+'-'+_0x496768+'/'+_0xa7f8ea)[_0xbf25('0x1c')](_0x4697ff);}return null;};}function patchUpdates(_0x5cb47e){return function(_0x3be18a){try{jsonpatch[_0xbf25('0x21')](_0x3be18a,_0x5cb47e,!![]);}catch(_0xe6f64b){return BPromise[_0xbf25('0x22')](_0xe6f64b);}return _0x3be18a['save']();};}function saveUpdates(_0x457f4d,_0x1abf2d){return function(_0x213b87){if(_0x213b87){return _0x213b87[_0xbf25('0x23')](_0x457f4d)[_0xbf25('0x24')](function(_0x28885e){return _0x28885e;});}return null;};}function removeEntity(_0xbe3523,_0x2364ed){return function(_0x30c3d0){if(_0x30c3d0){return _0x30c3d0[_0xbf25('0x25')]()['then'](function(){var _0x4326eb=_0x30c3d0[_0xbf25('0x26')]({'plain':!![]});var _0x31e23b=_0xbf25('0x27');return db[_0xbf25('0x28')][_0xbf25('0x25')]({'where':{'type':_0x31e23b,'resourceId':_0x4326eb['id']}})[_0xbf25('0x24')](function(){return _0x30c3d0;});})[_0xbf25('0x24')](function(){_0xbe3523[_0xbf25('0x1a')](0xcc)[_0xbf25('0x1b')]();});}};}function handleEntityNotFound(_0x38bba4,_0x22b94a){return function(_0x6a635c){if(!_0x6a635c){_0x38bba4[_0xbf25('0x19')](0x194);}return _0x6a635c;};}function handleError(_0x326660,_0x227664){_0x227664=_0x227664||0x1f4;return function(_0x5abaae){logger[_0xbf25('0x29')](_0x5abaae[_0xbf25('0x2a')]);if(_0x5abaae[_0xbf25('0x2b')]){delete _0x5abaae[_0xbf25('0x2b')];}_0x326660['status'](_0x227664)[_0xbf25('0x2c')](_0x5abaae);};}exports['index']=function(_0x56cfd8,_0x574f58){var _0x5ec770={},_0x5200a9={},_0x47b489={'count':0x0,'rows':[]};var _0x2ee63b=_[_0xbf25('0x2d')](db[_0xbf25('0x2e')][_0xbf25('0x2f')],function(_0x547922){return{'name':_0x547922[_0xbf25('0x30')],'type':_0x547922[_0xbf25('0x31')]['key']};});_0x5200a9[_0xbf25('0x32')]=_[_0xbf25('0x2d')](_0x2ee63b,_0xbf25('0x2b'));_0x5200a9['query']=_[_0xbf25('0x33')](_0x56cfd8['query']);_0x5200a9[_0xbf25('0x34')]=_[_0xbf25('0x35')](_0x5200a9[_0xbf25('0x32')],_0x5200a9[_0xbf25('0x36')]);_0x5ec770['attributes']=_[_0xbf25('0x35')](_0x5200a9[_0xbf25('0x32')],qs[_0xbf25('0x37')](_0x56cfd8[_0xbf25('0x36')]['fields']));_0x5ec770[_0xbf25('0x38')]=_0x5ec770[_0xbf25('0x38')][_0xbf25('0x39')]?_0x5ec770[_0xbf25('0x38')]:_0x5200a9['model'];if(!_0x56cfd8['query'][_0xbf25('0x3a')]('nolimit')){_0x5ec770[_0xbf25('0x1f')]=qs[_0xbf25('0x1f')](_0x56cfd8['query']['limit']);_0x5ec770[_0xbf25('0x1d')]=qs[_0xbf25('0x1d')](_0x56cfd8[_0xbf25('0x36')]['offset']);}_0x5ec770[_0xbf25('0x3b')]=qs[_0xbf25('0x3c')](_0x56cfd8[_0xbf25('0x36')][_0xbf25('0x3c')]);_0x5ec770['where']=qs['filters'](_[_0xbf25('0x3d')](_0x56cfd8[_0xbf25('0x36')],_0x5200a9[_0xbf25('0x34')]),_0x2ee63b);if(_0x56cfd8[_0xbf25('0x36')]['filter']){_0x5ec770[_0xbf25('0x3e')]=_['merge'](_0x5ec770[_0xbf25('0x3e')],{'$or':_[_0xbf25('0x2d')](_0x2ee63b,function(_0x470bce){if(_0x470bce['type']!==_0xbf25('0x3f')){var _0x4af67a={};_0x4af67a[_0x470bce[_0xbf25('0x2b')]]={'$like':'%'+_0x56cfd8['query'][_0xbf25('0x40')]+'%'};return _0x4af67a;}})});}_0x5ec770=_[_0xbf25('0x41')]({},_0x5ec770,_0x56cfd8[_0xbf25('0x42')]);var _0x3442c8={'where':_0x5ec770['where']};return db[_0xbf25('0x2e')][_0xbf25('0x20')](_0x3442c8)['then'](function(_0x1027e8){_0x47b489['count']=_0x1027e8;if(_0x56cfd8[_0xbf25('0x36')]['includeAll']){_0x5ec770['include']=[{'all':!![]}];}return db[_0xbf25('0x2e')][_0xbf25('0x43')](_0x5ec770);})['then'](function(_0x5064c2){_0x47b489[_0xbf25('0x44')]=_0x5064c2;return _0x47b489;})[_0xbf25('0x24')](respondWithFilteredResult(_0x574f58,_0x5ec770))[_0xbf25('0x45')](handleError(_0x574f58,null));};exports[_0xbf25('0x46')]=function(_0x3de74e,_0x239836){var _0x464954={'raw':!![],'where':{'id':_0x3de74e[_0xbf25('0x47')]['id']}},_0x4c4b35={};_0x4c4b35[_0xbf25('0x32')]=_['keys'](db[_0xbf25('0x2e')][_0xbf25('0x2f')]);_0x4c4b35[_0xbf25('0x36')]=_[_0xbf25('0x33')](_0x3de74e[_0xbf25('0x36')]);_0x4c4b35['filters']=_[_0xbf25('0x35')](_0x4c4b35[_0xbf25('0x32')],_0x4c4b35[_0xbf25('0x36')]);_0x464954[_0xbf25('0x38')]=_[_0xbf25('0x35')](_0x4c4b35['model'],qs['fields'](_0x3de74e['query']['fields']));_0x464954[_0xbf25('0x38')]=_0x464954[_0xbf25('0x38')][_0xbf25('0x39')]?_0x464954[_0xbf25('0x38')]:_0x4c4b35[_0xbf25('0x32')];if(_0x3de74e[_0xbf25('0x36')]['includeAll']){_0x464954[_0xbf25('0x48')]=[{'all':!![]}];}_0x464954=_['merge']({},_0x464954,_0x3de74e[_0xbf25('0x42')]);return db[_0xbf25('0x2e')][_0xbf25('0x49')](_0x464954)[_0xbf25('0x24')](handleEntityNotFound(_0x239836,null))[_0xbf25('0x24')](respondWithResult(_0x239836,null))[_0xbf25('0x45')](handleError(_0x239836,null));};exports[_0xbf25('0x4a')]=function(_0x5a933b,_0x3bd760){return db[_0xbf25('0x2e')][_0xbf25('0x4a')](_0x5a933b['body'],{})[_0xbf25('0x24')](function(_0x5828dd){var _0x47388d=_0x5a933b['user'][_0xbf25('0x26')]({'plain':!![]});if(!_0x47388d)throw new Error(_0xbf25('0x4b'));if(_0x47388d[_0xbf25('0x4c')]===_0xbf25('0x4d')){var _0x5b6511=_0x5828dd[_0xbf25('0x26')]({'plain':!![]});var _0x167c42=_0xbf25('0x27');return db[_0xbf25('0x4e')][_0xbf25('0x49')]({'where':{'name':_0x167c42,'userProfileId':_0x47388d[_0xbf25('0x4f')]},'raw':!![]})[_0xbf25('0x24')](function(_0x113e56){if(_0x113e56&&_0x113e56[_0xbf25('0x50')]===0x0){return db[_0xbf25('0x28')][_0xbf25('0x4a')]({'name':_0x5b6511['name'],'resourceId':_0x5b6511['id'],'type':_0x113e56[_0xbf25('0x2b')],'sectionId':_0x113e56['id']},{})[_0xbf25('0x24')](function(){return _0x5828dd;});}else{return _0x5828dd;}})[_0xbf25('0x45')](function(_0x260c2b){logger[_0xbf25('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x260c2b);throw _0x260c2b;});}return _0x5828dd;})['then'](respondWithResult(_0x3bd760,0xc9))[_0xbf25('0x45')](handleError(_0x3bd760,null));};exports['update']=function(_0x54a39b,_0x4968ab){if(_0x54a39b['body']['id']){delete _0x54a39b[_0xbf25('0x51')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x54a39b[_0xbf25('0x47')]['id']}})[_0xbf25('0x24')](handleEntityNotFound(_0x4968ab,null))[_0xbf25('0x24')](saveUpdates(_0x54a39b[_0xbf25('0x51')],null))[_0xbf25('0x24')](respondWithResult(_0x4968ab,null))[_0xbf25('0x45')](handleError(_0x4968ab,null));};exports['destroy']=function(_0x27d080,_0x1c8680){return db[_0xbf25('0x2e')]['find']({'where':{'id':_0x27d080['params']['id']}})[_0xbf25('0x24')](handleEntityNotFound(_0x1c8680,null))[_0xbf25('0x24')](removeEntity(_0x1c8680,null))[_0xbf25('0x45')](handleError(_0x1c8680,null));};exports['download']=function(_0x394866,_0x35fc87,_0x245ed7){return db[_0xbf25('0x2e')][_0xbf25('0x49')]({'where':{'id':_0x394866['params']['id']},'attributes':['name',_0xbf25('0x52'),_0xbf25('0x53'),_0xbf25('0x54')],'raw':!![]})[_0xbf25('0x24')](handleEntityNotFound(_0x35fc87,null))[_0xbf25('0x24')](function(_0x4edc7d){if(_0x4edc7d){if(!fs[_0xbf25('0x55')](path[_0xbf25('0x56')](config[_0xbf25('0x57')],_0xbf25('0x58'),_0x4edc7d[_0xbf25('0x53')]))){throw new db[(_0xbf25('0x59'))][(_0xbf25('0x5a'))](_0xbf25('0x5b'));}if(_0x394866['query'][_0xbf25('0x5c')]){return _0x35fc87[_0xbf25('0x19')](0xc8);}return _0x35fc87[_0xbf25('0x5d')](path[_0xbf25('0x56')](config[_0xbf25('0x57')],'server/files/reports',_0x4edc7d[_0xbf25('0x53')]),util[_0xbf25('0x5e')](_0xbf25('0x5f'),_0x4edc7d[_0xbf25('0x52')]||_0x4edc7d['name'],_0x4edc7d['output'][_0xbf25('0x60')]()));}})[_0xbf25('0x45')](handleError(_0x35fc87,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 6b9369b..588cde7 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 _0x47e4=['rimraf','../../config/environment','exports','define','AnalyticExtractedReport','util','api','moment','bluebird','path'];(function(_0x55458d,_0x2518d9){var _0x7adcf0=function(_0x57baf7){while(--_0x57baf7){_0x55458d['push'](_0x55458d['shift']());}};_0x7adcf0(++_0x2518d9);}(_0x47e4,0x131));var _0x447e=function(_0x407654,_0x275ae3){_0x407654=_0x407654-0x0;var _0x521dbd=_0x47e4[_0x407654];return _0x521dbd;};'use strict';var _=require('lodash');var util=require(_0x447e('0x0'));var logger=require('../../config/logger')(_0x447e('0x1'));var moment=require(_0x447e('0x2'));var BPromise=require(_0x447e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x447e('0x4'));var rimraf=require(_0x447e('0x5'));var config=require(_0x447e('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x447e('0x7')]=function(_0x5b80d0,_0x175ec4){return _0x5b80d0[_0x447e('0x8')](_0x447e('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xffba=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0xffba,0x12d));var _0xaffb=function(_0x15258e,_0x3cb2df){_0x15258e=_0x15258e-0x0;var _0x33731e=_0xffba[_0x15258e];return _0x33731e;};'use strict';var _=require(_0xaffb('0x0'));var util=require(_0xaffb('0x1'));var logger=require(_0xaffb('0x2'))('api');var moment=require(_0xaffb('0x3'));var BPromise=require(_0xaffb('0x4'));var rp=require(_0xaffb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaffb('0x6'));var config=require(_0xaffb('0x7'));var attributes=require(_0xaffb('0x8'));module['exports']=function(_0x440045,_0x598c72){return _0x440045[_0xaffb('0x9')](_0xaffb('0xa'),attributes,{'tableName':_0xaffb('0xb'),'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 d061081..f687104 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 _0xe98d=['ioredis','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','bluebird'];(function(_0x1f69bc,_0xaffd71){var _0x1ac3c5=function(_0x3cd005){while(--_0x3cd005){_0x1f69bc['push'](_0x1f69bc['shift']());}};_0x1ac3c5(++_0xaffd71);}(_0xe98d,0x1d9));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xde98('0x0'));var util=require(_0xde98('0x1'));var moment=require('moment');var BPromise=require(_0xde98('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde98('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xde98('0x4'));var client=jayson[_0xde98('0x5')][_0xde98('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5d694e,_0x5bfa36,_0xa1faeb){return new BPromise(function(_0x29af38,_0x34b771){return client['request'](_0x5d694e,_0xa1faeb)[_0xde98('0x7')](function(_0x43396a){logger[_0xde98('0x8')](_0xde98('0x9'),_0x5bfa36,'request\x20sent');logger[_0xde98('0xa')](_0xde98('0xb'),_0x5bfa36,_0xde98('0xc'),JSON['stringify'](_0x43396a));if(_0x43396a[_0xde98('0xd')]){if(_0x43396a[_0xde98('0xd')][_0xde98('0xe')]===0x1f4){logger[_0xde98('0xd')](_0xde98('0x9'),_0x5bfa36,_0x43396a['error'][_0xde98('0xf')]);return _0x34b771(_0x43396a[_0xde98('0xd')][_0xde98('0xf')]);}logger[_0xde98('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bfa36,_0x43396a[_0xde98('0xd')]['message']);return _0x29af38(_0x43396a[_0xde98('0xd')][_0xde98('0xf')]);}else{logger['info'](_0xde98('0x9'),_0x5bfa36,_0xde98('0xc'));_0x29af38(_0x43396a['result'][_0xde98('0xf')]);}})[_0xde98('0x10')](function(_0x4f3199){logger[_0xde98('0xd')](_0xde98('0x9'),_0x5bfa36,_0x4f3199);_0x34b771(_0x4f3199);});});}
\ No newline at end of file
+var _0xf1fd=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch'];(function(_0x5c528b,_0xfb69d3){var _0xfee9c5=function(_0x527ff1){while(--_0x527ff1){_0x5c528b['push'](_0x5c528b['shift']());}};_0xfee9c5(++_0xfb69d3);}(_0xf1fd,0x1e4));var _0xdf1f=function(_0x46e064,_0x2ed17b){_0x46e064=_0x46e064-0x0;var _0x49340e=_0xf1fd[_0x46e064];return _0x49340e;};'use strict';var _=require(_0xdf1f('0x0'));var util=require(_0xdf1f('0x1'));var moment=require('moment');var BPromise=require(_0xdf1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf1f('0x3'))['db'];var utils=require(_0xdf1f('0x4'));var logger=require(_0xdf1f('0x5'))(_0xdf1f('0x6'));var config=require(_0xdf1f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdf1f('0x8')][_0xdf1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4748b3,_0x42eff0,_0x1eaca0){return new BPromise(function(_0xde00c9,_0x5ba304){return client[_0xdf1f('0xa')](_0x4748b3,_0x1eaca0)[_0xdf1f('0xb')](function(_0x3d3102){logger[_0xdf1f('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x42eff0,_0xdf1f('0xd'));logger[_0xdf1f('0xe')](_0xdf1f('0xf'),_0x42eff0,_0xdf1f('0xd'),JSON[_0xdf1f('0x10')](_0x3d3102));if(_0x3d3102[_0xdf1f('0x11')]){if(_0x3d3102[_0xdf1f('0x11')]['code']===0x1f4){logger[_0xdf1f('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x42eff0,_0x3d3102[_0xdf1f('0x11')]['message']);return _0x5ba304(_0x3d3102[_0xdf1f('0x11')][_0xdf1f('0x12')]);}logger[_0xdf1f('0x11')](_0xdf1f('0x13'),_0x42eff0,_0x3d3102[_0xdf1f('0x11')]['message']);return _0xde00c9(_0x3d3102[_0xdf1f('0x11')][_0xdf1f('0x12')]);}else{logger[_0xdf1f('0xc')](_0xdf1f('0x13'),_0x42eff0,'request\x20sent');_0xde00c9(_0x3d3102[_0xdf1f('0x14')][_0xdf1f('0x12')]);}})[_0xdf1f('0x15')](function(_0x29a9b2){logger[_0xdf1f('0x11')](_0xdf1f('0x13'),_0x42eff0,_0x29a9b2);_0x5ba304(_0x29a9b2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index d05538b..56c91f0 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 _0x10ea=['../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','put','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x5bff0,_0x20716d){var _0x3ead2e=function(_0x14f592){while(--_0x14f592){_0x5bff0['push'](_0x5bff0['shift']());}};_0x3ead2e(++_0x20716d);}(_0x10ea,0x1d6));var _0xa10e=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x10ea[_0x4fdc46];return _0x2c178a;};'use strict';var multer=require(_0xa10e('0x0'));var util=require('util');var path=require(_0xa10e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa10e('0x2')]();var fs_extra=require(_0xa10e('0x3'));var auth=require(_0xa10e('0x4'));var interaction=require(_0xa10e('0x5'));var config=require('../../config/environment');var controller=require(_0xa10e('0x6'));router[_0xa10e('0x7')]('/',auth['isAuthenticated'](),controller[_0xa10e('0x8')]);router[_0xa10e('0x7')](_0xa10e('0x9'),auth[_0xa10e('0xa')](),controller[_0xa10e('0xb')]);router[_0xa10e('0x7')](_0xa10e('0xc'),auth[_0xa10e('0xa')](),controller[_0xa10e('0xd')]);router[_0xa10e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa10e('0xf')]('/:id',auth[_0xa10e('0xa')](),controller[_0xa10e('0x10')]);router['delete'](_0xa10e('0x9'),auth['isAuthenticated'](),controller[_0xa10e('0x11')]);module[_0xa10e('0x12')]=router;
\ No newline at end of file
+var _0xd72a=['post','put','delete','destroy','multer','util','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download'];(function(_0x58f19a,_0x563605){var _0x583d60=function(_0x571bbf){while(--_0x571bbf){_0x58f19a['push'](_0x58f19a['shift']());}};_0x583d60(++_0x563605);}(_0xd72a,0x8c));var _0xad72=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xd72a[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0xad72('0x0'));var util=require(_0xad72('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xad72('0x2'));var auth=require(_0xad72('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xad72('0x4'));var controller=require(_0xad72('0x5'));router[_0xad72('0x6')]('/',auth[_0xad72('0x7')](),controller[_0xad72('0x8')]);router[_0xad72('0x6')](_0xad72('0x9'),auth[_0xad72('0x7')](),controller[_0xad72('0xa')]);router[_0xad72('0x6')](_0xad72('0xb'),auth[_0xad72('0x7')](),controller[_0xad72('0xc')]);router[_0xad72('0xd')]('/',auth[_0xad72('0x7')](),controller['create']);router[_0xad72('0xe')](_0xad72('0x9'),auth[_0xad72('0x7')](),controller['update']);router[_0xad72('0xf')]('/:id',auth[_0xad72('0x7')](),controller[_0xad72('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e5c1ef3..1e01776 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 _0xa0ce=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1890a8,_0x42a2b2){var _0x420c6d=function(_0x2baa82){while(--_0x2baa82){_0x1890a8['push'](_0x1890a8['shift']());}};_0x420c6d(++_0x42a2b2);}(_0xa0ce,0x119));var _0xea0c=function(_0x1f25c3,_0x456922){_0x1f25c3=_0x1f25c3-0x0;var _0x41be15=_0xa0ce[_0x1f25c3];return _0x41be15;};'use strict';var Sequelize=require(_0xea0c('0x0'));module[_0xea0c('0x1')]={'field':{'type':Sequelize[_0xea0c('0x2')]},'alias':{'type':Sequelize[_0xea0c('0x3')]},'function':{'type':Sequelize[_0xea0c('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xea0c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xea0c('0x3')]},'custom':{'type':Sequelize[_0xea0c('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfd8a=['STRING','BOOLEAN','exports'];(function(_0x50aa77,_0x1a574d){var _0x32df06=function(_0x704d40){while(--_0x704d40){_0x50aa77['push'](_0x50aa77['shift']());}};_0x32df06(++_0x1a574d);}(_0xfd8a,0x80));var _0xafd8=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0xfd8a[_0x5db657];return _0x2d6e70;};'use strict';var Sequelize=require('sequelize');module[_0xafd8('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xafd8('0x1')]},'function':{'type':Sequelize[_0xafd8('0x1')]},'format':{'type':Sequelize[_0xafd8('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xafd8('0x1')]},'custom':{'type':Sequelize[_0xafd8('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 774b562..64f6868 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 _0x11fc=['stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','AnalyticFieldReport','rawAttributes','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','params','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','offset','limit','undefined','count','Content-Range','reject','update','destroy'];(function(_0x50f4e1,_0x487c31){var _0x464661=function(_0x1ef8b6){while(--_0x1ef8b6){_0x50f4e1['push'](_0x50f4e1['shift']());}};_0x464661(++_0x487c31);}(_0x11fc,0x187));var _0xc11f=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x11fc[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc11f('0x0'));var zipdir=require(_0xc11f('0x1'));var jsonpatch=require(_0xc11f('0x2'));var rp=require(_0xc11f('0x3'));var moment=require('moment');var BPromise=require(_0xc11f('0x4'));var Mustache=require(_0xc11f('0x5'));var util=require(_0xc11f('0x6'));var path=require(_0xc11f('0x7'));var sox=require(_0xc11f('0x8'));var csv=require(_0xc11f('0x9'));var ejs=require(_0xc11f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc11f('0xb'));var squel=require(_0xc11f('0xc'));var crypto=require('crypto');var jsforce=require(_0xc11f('0xd'));var deskjs=require(_0xc11f('0xe'));var toCsv=require(_0xc11f('0x9'));var querystring=require(_0xc11f('0xf'));var Papa=require(_0xc11f('0x10'));var Redis=require(_0xc11f('0x11'));var authService=require(_0xc11f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc11f('0x13'));var hardwareService=require(_0xc11f('0x14'));var logger=require(_0xc11f('0x15'))(_0xc11f('0x16'));var utils=require(_0xc11f('0x17'));var config=require(_0xc11f('0x18'));var licenseUtil=require(_0xc11f('0x19'));var db=require(_0xc11f('0x1a'))['db'];function respondWithStatusCode(_0x4b6c6f,_0x6054bc){_0x6054bc=_0x6054bc||0xcc;return function(_0x348a09){if(_0x348a09){return _0x4b6c6f[_0xc11f('0x1b')](_0x6054bc);}return _0x4b6c6f[_0xc11f('0x1c')](_0x6054bc)[_0xc11f('0x1d')]();};}function respondWithResult(_0x3277bc,_0x465ca0){_0x465ca0=_0x465ca0||0xc8;return function(_0x52c3c4){if(_0x52c3c4){return _0x3277bc[_0xc11f('0x1c')](_0x465ca0)[_0xc11f('0x1e')](_0x52c3c4);}};}function respondWithFilteredResult(_0x893f97,_0x89a7fa){return function(_0x5540c8){if(_0x5540c8){var _0x1c6ded=typeof _0x89a7fa[_0xc11f('0x1f')]==='undefined'&&typeof _0x89a7fa[_0xc11f('0x20')]===_0xc11f('0x21');var _0x58b50c=_0x5540c8[_0xc11f('0x22')];var _0x32951a=_0x1c6ded?0x0:_0x89a7fa[_0xc11f('0x1f')];var _0x1b0d43=_0x1c6ded?_0x5540c8[_0xc11f('0x22')]:_0x89a7fa['offset']+_0x89a7fa[_0xc11f('0x20')];var _0x14470b;if(_0x1b0d43>=_0x58b50c){_0x1b0d43=_0x58b50c;_0x14470b=0xc8;}else{_0x14470b=0xce;}_0x893f97['status'](_0x14470b);return _0x893f97['set'](_0xc11f('0x23'),_0x32951a+'-'+_0x1b0d43+'/'+_0x58b50c)[_0xc11f('0x1e')](_0x5540c8);}return null;};}function patchUpdates(_0x32dd76){return function(_0x2935ef){try{jsonpatch['apply'](_0x2935ef,_0x32dd76,!![]);}catch(_0x313775){return BPromise[_0xc11f('0x24')](_0x313775);}return _0x2935ef['save']();};}function saveUpdates(_0x1b9c69,_0x35e316){return function(_0x202dfe){if(_0x202dfe){return _0x202dfe[_0xc11f('0x25')](_0x1b9c69)['then'](function(_0x1b76a8){return _0x1b76a8;});}return null;};}function removeEntity(_0x427d50,_0xf11ed4){return function(_0x47511e){if(_0x47511e){return _0x47511e[_0xc11f('0x26')]()['then'](function(){_0x427d50[_0xc11f('0x1c')](0xcc)[_0xc11f('0x1d')]();});}};}function handleEntityNotFound(_0xb732b3,_0x51520c){return function(_0x51bb5c){if(!_0x51bb5c){_0xb732b3[_0xc11f('0x1b')](0x194);}return _0x51bb5c;};}function handleError(_0x59aca7,_0x1da2e9){_0x1da2e9=_0x1da2e9||0x1f4;return function(_0x763d3b){logger['error'](_0x763d3b[_0xc11f('0x27')]);if(_0x763d3b[_0xc11f('0x28')]){delete _0x763d3b[_0xc11f('0x28')];}_0x59aca7[_0xc11f('0x1c')](_0x1da2e9)[_0xc11f('0x29')](_0x763d3b);};}exports[_0xc11f('0x2a')]=function(_0x583f63,_0x433717){var _0x245ee8={},_0x23cc6e={},_0xd1db78={'count':0x0,'rows':[]};var _0x2cd5f7=_[_0xc11f('0x2b')](db['AnalyticFieldReport']['rawAttributes'],function(_0xf246a6){return{'name':_0xf246a6[_0xc11f('0x2c')],'type':_0xf246a6[_0xc11f('0x2d')][_0xc11f('0x2e')]};});_0x23cc6e[_0xc11f('0x2f')]=_[_0xc11f('0x2b')](_0x2cd5f7,_0xc11f('0x28'));_0x23cc6e[_0xc11f('0x30')]=_[_0xc11f('0x31')](_0x583f63[_0xc11f('0x30')]);_0x23cc6e[_0xc11f('0x32')]=_[_0xc11f('0x33')](_0x23cc6e[_0xc11f('0x2f')],_0x23cc6e[_0xc11f('0x30')]);_0x245ee8[_0xc11f('0x34')]=_[_0xc11f('0x33')](_0x23cc6e['model'],qs['fields'](_0x583f63[_0xc11f('0x30')][_0xc11f('0x35')]));_0x245ee8[_0xc11f('0x34')]=_0x245ee8['attributes'][_0xc11f('0x36')]?_0x245ee8[_0xc11f('0x34')]:_0x23cc6e['model'];if(!_0x583f63[_0xc11f('0x30')][_0xc11f('0x37')](_0xc11f('0x38'))){_0x245ee8[_0xc11f('0x20')]=qs[_0xc11f('0x20')](_0x583f63[_0xc11f('0x30')][_0xc11f('0x20')]);_0x245ee8['offset']=qs[_0xc11f('0x1f')](_0x583f63[_0xc11f('0x30')][_0xc11f('0x1f')]);}_0x245ee8[_0xc11f('0x39')]=qs[_0xc11f('0x3a')](_0x583f63[_0xc11f('0x30')]['sort']);_0x245ee8[_0xc11f('0x3b')]=qs[_0xc11f('0x32')](_[_0xc11f('0x3c')](_0x583f63['query'],_0x23cc6e[_0xc11f('0x32')]),_0x2cd5f7);if(_0x583f63[_0xc11f('0x30')][_0xc11f('0x3d')]){_0x245ee8[_0xc11f('0x3b')]=_[_0xc11f('0x3e')](_0x245ee8[_0xc11f('0x3b')],{'$or':_['map'](_0x2cd5f7,function(_0x14b9db){if(_0x14b9db[_0xc11f('0x2d')]!==_0xc11f('0x3f')){var _0x2de0d1={};_0x2de0d1[_0x14b9db[_0xc11f('0x28')]]={'$like':'%'+_0x583f63[_0xc11f('0x30')]['filter']+'%'};return _0x2de0d1;}})});}_0x245ee8=_[_0xc11f('0x3e')]({},_0x245ee8,_0x583f63[_0xc11f('0x40')]);var _0x4b8976={'where':_0x245ee8[_0xc11f('0x3b')]};return db['AnalyticFieldReport'][_0xc11f('0x22')](_0x4b8976)[_0xc11f('0x41')](function(_0x4c476b){_0xd1db78[_0xc11f('0x22')]=_0x4c476b;if(_0x583f63[_0xc11f('0x30')][_0xc11f('0x42')]){_0x245ee8[_0xc11f('0x43')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xc11f('0x44')](_0x245ee8);})[_0xc11f('0x41')](function(_0x203915){_0xd1db78['rows']=_0x203915;return _0xd1db78;})[_0xc11f('0x41')](respondWithFilteredResult(_0x433717,_0x245ee8))[_0xc11f('0x45')](handleError(_0x433717,null));};exports[_0xc11f('0x46')]=function(_0x2a2113,_0x3faa29){var _0x287551={'raw':![],'where':{'id':_0x2a2113['params']['id']}},_0x10d6c2={};_0x10d6c2[_0xc11f('0x2f')]=_['keys'](db[_0xc11f('0x47')][_0xc11f('0x48')]);_0x10d6c2[_0xc11f('0x30')]=_[_0xc11f('0x31')](_0x2a2113[_0xc11f('0x30')]);_0x10d6c2[_0xc11f('0x32')]=_[_0xc11f('0x33')](_0x10d6c2[_0xc11f('0x2f')],_0x10d6c2[_0xc11f('0x30')]);_0x287551[_0xc11f('0x34')]=_['intersection'](_0x10d6c2[_0xc11f('0x2f')],qs[_0xc11f('0x35')](_0x2a2113[_0xc11f('0x30')][_0xc11f('0x35')]));_0x287551['attributes']=_0x287551[_0xc11f('0x34')]['length']?_0x287551[_0xc11f('0x34')]:_0x10d6c2[_0xc11f('0x2f')];if(_0x2a2113[_0xc11f('0x30')][_0xc11f('0x42')]){_0x287551[_0xc11f('0x43')]=[{'all':!![]}];}_0x287551=_['merge']({},_0x287551,_0x2a2113[_0xc11f('0x40')]);return db[_0xc11f('0x47')][_0xc11f('0x49')](_0x287551)[_0xc11f('0x41')](handleEntityNotFound(_0x3faa29,null))[_0xc11f('0x41')](respondWithResult(_0x3faa29,null))[_0xc11f('0x45')](handleError(_0x3faa29,null));};exports['create']=function(_0x5ba790,_0x1360db){return db[_0xc11f('0x47')][_0xc11f('0x4a')](_0x5ba790['body'],{})[_0xc11f('0x41')](respondWithResult(_0x1360db,0xc9))[_0xc11f('0x45')](handleError(_0x1360db,null));};exports[_0xc11f('0x4b')]=function(_0x486a8b,_0x4a3c93){return db[_0xc11f('0x47')][_0xc11f('0x4b')](_0x486a8b[_0xc11f('0x4c')],{'raw':![],'individualHooks':!![]})[_0xc11f('0x41')](respondWithResult(_0x4a3c93,0xc9))[_0xc11f('0x45')](handleError(_0x4a3c93,null));};exports[_0xc11f('0x25')]=function(_0x51e753,_0x861223){if(_0x51e753[_0xc11f('0x4c')]['id']){delete _0x51e753['body']['id'];}return db[_0xc11f('0x47')][_0xc11f('0x49')]({'where':{'id':_0x51e753['params']['id']}})['then'](handleEntityNotFound(_0x861223,null))['then'](saveUpdates(_0x51e753[_0xc11f('0x4c')],null))[_0xc11f('0x41')](respondWithResult(_0x861223,null))[_0xc11f('0x45')](handleError(_0x861223,null));};exports[_0xc11f('0x26')]=function(_0x3d4d0b,_0x43fd74){return db['AnalyticFieldReport'][_0xc11f('0x49')]({'where':{'id':_0x3d4d0b['params']['id']}})['then'](handleEntityNotFound(_0x43fd74,null))[_0xc11f('0x41')](removeEntity(_0x43fd74,null))[_0xc11f('0x45')](handleError(_0x43fd74,null));};exports[_0xc11f('0x4d')]=function(_0x368538,_0x558283){return db['AnalyticFieldReport'][_0xc11f('0x26')]({'where':{'id':_0x368538[_0xc11f('0x30')][_0xc11f('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xc11f('0x41')](respondWithResult(_0x558283,0xcc))['catch'](handleError(_0x558283,null));};exports[_0xc11f('0x4f')]=function(_0x5e8339,_0x90f389,_0x141060){return db[_0xc11f('0x50')][_0xc11f('0x51')]({'where':{'id':_0x5e8339['params']['id']}})[_0xc11f('0x41')](handleEntityNotFound(_0x90f389,null))[_0xc11f('0x41')](function(_0x1e3344){if(_0x1e3344){return db[_0xc11f('0x52')][_0xc11f('0x53')](function(_0xd2fd31){return db[_0xc11f('0x47')][_0xc11f('0x26')]({'where':{'CustomReportId':_0x5e8339[_0xc11f('0x54')]['id']},'transaction':_0xd2fd31})[_0xc11f('0x41')](function(_0x2b9c8f){var _0x2ee3e8=_[_0xc11f('0x2b')](_0x5e8339[_0xc11f('0x4c')],function(_0x2b3508){delete _0x2b3508['id'];_0x2b3508[_0xc11f('0x55')]=_0x5e8339['params']['id'];return _0x2b3508;});return db[_0xc11f('0x47')][_0xc11f('0x4b')](_0x2ee3e8,{'transaction':_0xd2fd31});});})['then'](function(){return db[_0xc11f('0x47')][_0xc11f('0x44')]({'where':{'CustomReportId':_0x5e8339[_0xc11f('0x54')]['id']}});});}})[_0xc11f('0x41')](respondWithResult(_0x90f389,null))[_0xc11f('0x45')](handleError(_0x90f389,null));};
\ No newline at end of file
+var _0x4094=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','model','map','keys','query','filters','intersection','fields','attributes','order','sort','pick','where','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','create','bulkCreate','body','find','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3bf8d1,_0x3ca6aa){var _0x4098a6=function(_0x431085){while(--_0x431085){_0x3bf8d1['push'](_0x3bf8d1['shift']());}};_0x4098a6(++_0x3ca6aa);}(_0x4094,0x174));var _0x4409=function(_0xd1e00,_0x473f3e){_0xd1e00=_0xd1e00-0x0;var _0x231430=_0x4094[_0xd1e00];return _0x231430;};'use strict';var emlformat=require(_0x4409('0x0'));var rimraf=require(_0x4409('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4409('0x2'));var moment=require(_0x4409('0x3'));var BPromise=require(_0x4409('0x4'));var Mustache=require(_0x4409('0x5'));var util=require(_0x4409('0x6'));var path=require(_0x4409('0x7'));var sox=require(_0x4409('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4409('0x9'));var _=require(_0x4409('0xa'));var squel=require(_0x4409('0xb'));var crypto=require(_0x4409('0xc'));var jsforce=require(_0x4409('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4409('0xe'));var Papa=require(_0x4409('0xf'));var Redis=require(_0x4409('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4409('0x11'));var hardwareService=require(_0x4409('0x12'));var logger=require('../../config/logger')(_0x4409('0x13'));var utils=require('../../config/utils');var config=require(_0x4409('0x14'));var licenseUtil=require(_0x4409('0x15'));var db=require(_0x4409('0x16'))['db'];function respondWithStatusCode(_0x1e65fc,_0x59e36e){_0x59e36e=_0x59e36e||0xcc;return function(_0x1a5e26){if(_0x1a5e26){return _0x1e65fc[_0x4409('0x17')](_0x59e36e);}return _0x1e65fc[_0x4409('0x18')](_0x59e36e)[_0x4409('0x19')]();};}function respondWithResult(_0xe58267,_0x12736c){_0x12736c=_0x12736c||0xc8;return function(_0x4474f9){if(_0x4474f9){return _0xe58267[_0x4409('0x18')](_0x12736c)[_0x4409('0x1a')](_0x4474f9);}};}function respondWithFilteredResult(_0x5eb71e,_0x9e31a3){return function(_0x43888d){if(_0x43888d){var _0x429e99=typeof _0x9e31a3[_0x4409('0x1b')]===_0x4409('0x1c')&&typeof _0x9e31a3['limit']==='undefined';var _0xd8594d=_0x43888d[_0x4409('0x1d')];var _0x6b893f=_0x429e99?0x0:_0x9e31a3[_0x4409('0x1b')];var _0x24acf7=_0x429e99?_0x43888d['count']:_0x9e31a3[_0x4409('0x1b')]+_0x9e31a3[_0x4409('0x1e')];var _0x3f70da;if(_0x24acf7>=_0xd8594d){_0x24acf7=_0xd8594d;_0x3f70da=0xc8;}else{_0x3f70da=0xce;}_0x5eb71e['status'](_0x3f70da);return _0x5eb71e[_0x4409('0x1f')](_0x4409('0x20'),_0x6b893f+'-'+_0x24acf7+'/'+_0xd8594d)[_0x4409('0x1a')](_0x43888d);}return null;};}function patchUpdates(_0x3d8481){return function(_0x2e4c4f){try{jsonpatch[_0x4409('0x21')](_0x2e4c4f,_0x3d8481,!![]);}catch(_0x547dcf){return BPromise['reject'](_0x547dcf);}return _0x2e4c4f[_0x4409('0x22')]();};}function saveUpdates(_0x921ae3,_0x25908a){return function(_0x1160d7){if(_0x1160d7){return _0x1160d7[_0x4409('0x23')](_0x921ae3)['then'](function(_0x404131){return _0x404131;});}return null;};}function removeEntity(_0x206f1a,_0x1dc713){return function(_0x5a6343){if(_0x5a6343){return _0x5a6343['destroy']()[_0x4409('0x24')](function(){_0x206f1a['status'](0xcc)[_0x4409('0x19')]();});}};}function handleEntityNotFound(_0x5acb31,_0x130d6c){return function(_0x2eae7f){if(!_0x2eae7f){_0x5acb31[_0x4409('0x17')](0x194);}return _0x2eae7f;};}function handleError(_0x4a0803,_0x2890b1){_0x2890b1=_0x2890b1||0x1f4;return function(_0x559fe3){logger[_0x4409('0x25')](_0x559fe3[_0x4409('0x26')]);if(_0x559fe3['name']){delete _0x559fe3[_0x4409('0x27')];}_0x4a0803['status'](_0x2890b1)[_0x4409('0x28')](_0x559fe3);};}exports[_0x4409('0x29')]=function(_0x5a3857,_0x105676){var _0x52b072={},_0x19f800={},_0x5142cc={'count':0x0,'rows':[]};var _0x327315=_['map'](db[_0x4409('0x2a')][_0x4409('0x2b')],function(_0x140ad8){return{'name':_0x140ad8['fieldName'],'type':_0x140ad8['type']['key']};});_0x19f800[_0x4409('0x2c')]=_[_0x4409('0x2d')](_0x327315,_0x4409('0x27'));_0x19f800['query']=_[_0x4409('0x2e')](_0x5a3857[_0x4409('0x2f')]);_0x19f800[_0x4409('0x30')]=_['intersection'](_0x19f800[_0x4409('0x2c')],_0x19f800[_0x4409('0x2f')]);_0x52b072['attributes']=_[_0x4409('0x31')](_0x19f800[_0x4409('0x2c')],qs[_0x4409('0x32')](_0x5a3857[_0x4409('0x2f')][_0x4409('0x32')]));_0x52b072['attributes']=_0x52b072['attributes']['length']?_0x52b072[_0x4409('0x33')]:_0x19f800[_0x4409('0x2c')];if(!_0x5a3857['query']['hasOwnProperty']('nolimit')){_0x52b072[_0x4409('0x1e')]=qs[_0x4409('0x1e')](_0x5a3857[_0x4409('0x2f')][_0x4409('0x1e')]);_0x52b072[_0x4409('0x1b')]=qs[_0x4409('0x1b')](_0x5a3857['query']['offset']);}_0x52b072[_0x4409('0x34')]=qs[_0x4409('0x35')](_0x5a3857[_0x4409('0x2f')]['sort']);_0x52b072['where']=qs[_0x4409('0x30')](_[_0x4409('0x36')](_0x5a3857['query'],_0x19f800[_0x4409('0x30')]),_0x327315);if(_0x5a3857[_0x4409('0x2f')]['filter']){_0x52b072[_0x4409('0x37')]=_[_0x4409('0x38')](_0x52b072[_0x4409('0x37')],{'$or':_[_0x4409('0x2d')](_0x327315,function(_0x1810b7){if(_0x1810b7[_0x4409('0x39')]!=='VIRTUAL'){var _0x46104a={};_0x46104a[_0x1810b7[_0x4409('0x27')]]={'$like':'%'+_0x5a3857[_0x4409('0x2f')][_0x4409('0x3a')]+'%'};return _0x46104a;}})});}_0x52b072=_[_0x4409('0x38')]({},_0x52b072,_0x5a3857[_0x4409('0x3b')]);var _0x2d2ead={'where':_0x52b072[_0x4409('0x37')]};return db[_0x4409('0x2a')]['count'](_0x2d2ead)['then'](function(_0x128eaf){_0x5142cc[_0x4409('0x1d')]=_0x128eaf;if(_0x5a3857['query'][_0x4409('0x3c')]){_0x52b072[_0x4409('0x3d')]=[{'all':!![]}];}return db[_0x4409('0x2a')][_0x4409('0x3e')](_0x52b072);})[_0x4409('0x24')](function(_0x26e50a){_0x5142cc[_0x4409('0x3f')]=_0x26e50a;return _0x5142cc;})[_0x4409('0x24')](respondWithFilteredResult(_0x105676,_0x52b072))[_0x4409('0x40')](handleError(_0x105676,null));};exports[_0x4409('0x41')]=function(_0x52c8d7,_0x195cd2){var _0x48c614={'raw':![],'where':{'id':_0x52c8d7[_0x4409('0x42')]['id']}},_0x3f8a64={};_0x3f8a64['model']=_[_0x4409('0x2e')](db['AnalyticFieldReport']['rawAttributes']);_0x3f8a64['query']=_[_0x4409('0x2e')](_0x52c8d7[_0x4409('0x2f')]);_0x3f8a64[_0x4409('0x30')]=_[_0x4409('0x31')](_0x3f8a64[_0x4409('0x2c')],_0x3f8a64[_0x4409('0x2f')]);_0x48c614[_0x4409('0x33')]=_['intersection'](_0x3f8a64[_0x4409('0x2c')],qs[_0x4409('0x32')](_0x52c8d7['query']['fields']));_0x48c614[_0x4409('0x33')]=_0x48c614[_0x4409('0x33')]['length']?_0x48c614[_0x4409('0x33')]:_0x3f8a64[_0x4409('0x2c')];if(_0x52c8d7[_0x4409('0x2f')][_0x4409('0x3c')]){_0x48c614['include']=[{'all':!![]}];}_0x48c614=_[_0x4409('0x38')]({},_0x48c614,_0x52c8d7[_0x4409('0x3b')]);return db[_0x4409('0x2a')]['find'](_0x48c614)[_0x4409('0x24')](handleEntityNotFound(_0x195cd2,null))[_0x4409('0x24')](respondWithResult(_0x195cd2,null))[_0x4409('0x40')](handleError(_0x195cd2,null));};exports['create']=function(_0x36585b,_0x17db96){return db[_0x4409('0x2a')][_0x4409('0x43')](_0x36585b['body'],{})[_0x4409('0x24')](respondWithResult(_0x17db96,0xc9))['catch'](handleError(_0x17db96,null));};exports[_0x4409('0x44')]=function(_0x4c13e5,_0xe98364){return db[_0x4409('0x2a')]['bulkCreate'](_0x4c13e5[_0x4409('0x45')],{'raw':![],'individualHooks':!![]})[_0x4409('0x24')](respondWithResult(_0xe98364,0xc9))['catch'](handleError(_0xe98364,null));};exports[_0x4409('0x23')]=function(_0x14aa72,_0xfe0f1d){if(_0x14aa72['body']['id']){delete _0x14aa72['body']['id'];}return db[_0x4409('0x2a')][_0x4409('0x46')]({'where':{'id':_0x14aa72[_0x4409('0x42')]['id']}})[_0x4409('0x24')](handleEntityNotFound(_0xfe0f1d,null))['then'](saveUpdates(_0x14aa72[_0x4409('0x45')],null))['then'](respondWithResult(_0xfe0f1d,null))[_0x4409('0x40')](handleError(_0xfe0f1d,null));};exports[_0x4409('0x47')]=function(_0x1d4ed9,_0x288239){return db[_0x4409('0x2a')]['find']({'where':{'id':_0x1d4ed9[_0x4409('0x42')]['id']}})[_0x4409('0x24')](handleEntityNotFound(_0x288239,null))[_0x4409('0x24')](removeEntity(_0x288239,null))[_0x4409('0x40')](handleError(_0x288239,null));};exports[_0x4409('0x48')]=function(_0x67bcd,_0xd2629e){return db['AnalyticFieldReport'][_0x4409('0x47')]({'where':{'id':_0x67bcd['query'][_0x4409('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x4409('0x24')](respondWithResult(_0xd2629e,0xcc))['catch'](handleError(_0xd2629e,null));};exports[_0x4409('0x4a')]=function(_0x2580ba,_0x3784b7,_0xbb17b7){return db[_0x4409('0x4b')][_0x4409('0x4c')]({'where':{'id':_0x2580ba[_0x4409('0x42')]['id']}})[_0x4409('0x24')](handleEntityNotFound(_0x3784b7,null))[_0x4409('0x24')](function(_0x419260){if(_0x419260){return db['sequelize'][_0x4409('0x4d')](function(_0x5f32d9){return db[_0x4409('0x2a')]['destroy']({'where':{'CustomReportId':_0x2580ba['params']['id']},'transaction':_0x5f32d9})['then'](function(_0x5e279e){var _0x261250=_[_0x4409('0x2d')](_0x2580ba[_0x4409('0x45')],function(_0xa72055){delete _0xa72055['id'];_0xa72055[_0x4409('0x4e')]=_0x2580ba['params']['id'];return _0xa72055;});return db[_0x4409('0x2a')][_0x4409('0x44')](_0x261250,{'transaction':_0x5f32d9});});})[_0x4409('0x24')](function(){return db[_0x4409('0x2a')][_0x4409('0x3e')]({'where':{'CustomReportId':_0x2580ba[_0x4409('0x42')]['id']}});});}})['then'](respondWithResult(_0x3784b7,null))[_0x4409('0x40')](handleError(_0x3784b7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 9eae5cc..5d38938 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 _0x03d2=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x03d2,0x1c7));var _0x203d=function(_0x411862,_0x5aea8c){_0x411862=_0x411862-0x0;var _0x22195a=_0x03d2[_0x411862];return _0x22195a;};'use strict';var _=require(_0x203d('0x0'));var util=require(_0x203d('0x1'));var logger=require(_0x203d('0x2'))(_0x203d('0x3'));var moment=require(_0x203d('0x4'));var BPromise=require(_0x203d('0x5'));var rp=require(_0x203d('0x6'));var fs=require('fs');var path=require(_0x203d('0x7'));var rimraf=require('rimraf');var config=require(_0x203d('0x8'));var attributes=require(_0x203d('0x9'));module['exports']=function(_0x4b089d,_0x5e3141){return _0x4b089d['define'](_0x203d('0xa'),attributes,{'tableName':_0x203d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x79d4=['api','moment','bluebird','path','../../config/environment','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x3d33fb,_0x5c577a){var _0x5cafdb=function(_0x1be7ee){while(--_0x1be7ee){_0x3d33fb['push'](_0x3d33fb['shift']());}};_0x5cafdb(++_0x5c577a);}(_0x79d4,0xf2));var _0x479d=function(_0x2def61,_0x1ec064){_0x2def61=_0x2def61-0x0;var _0x3292e0=_0x79d4[_0x2def61];return _0x3292e0;};'use strict';var _=require(_0x479d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x479d('0x1'));var moment=require(_0x479d('0x2'));var BPromise=require(_0x479d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x479d('0x4'));var rimraf=require('rimraf');var config=require(_0x479d('0x5'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x370ba9,_0x4b9baa){return _0x370ba9[_0x479d('0x6')](_0x479d('0x7'),attributes,{'tableName':_0x479d('0x8'),'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 1eb37c0..f6f9bad 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 _0xb8f0=['util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xb8f0,0x1af));var _0x0b8f=function(_0x38980b,_0x3a0faa){_0x38980b=_0x38980b-0x0;var _0x26a661=_0xb8f0[_0x38980b];return _0x26a661;};'use strict';var _=require(_0x0b8f('0x0'));var util=require(_0x0b8f('0x1'));var moment=require('moment');var BPromise=require(_0x0b8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b8f('0x3'));var logger=require(_0x0b8f('0x4'))(_0x0b8f('0x5'));var config=require(_0x0b8f('0x6'));var jayson=require(_0x0b8f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58d1b9,_0x40510f,_0x3db35e){return new BPromise(function(_0x36b067,_0x25642d){return client['request'](_0x58d1b9,_0x3db35e)['then'](function(_0x559ecc){logger[_0x0b8f('0x8')](_0x0b8f('0x9'),_0x40510f,_0x0b8f('0xa'));logger[_0x0b8f('0xb')](_0x0b8f('0xc'),_0x40510f,_0x0b8f('0xa'),JSON[_0x0b8f('0xd')](_0x559ecc));if(_0x559ecc[_0x0b8f('0xe')]){if(_0x559ecc[_0x0b8f('0xe')][_0x0b8f('0xf')]===0x1f4){logger[_0x0b8f('0xe')](_0x0b8f('0x9'),_0x40510f,_0x559ecc['error'][_0x0b8f('0x10')]);return _0x25642d(_0x559ecc[_0x0b8f('0xe')][_0x0b8f('0x10')]);}logger[_0x0b8f('0xe')](_0x0b8f('0x9'),_0x40510f,_0x559ecc['error'][_0x0b8f('0x10')]);return _0x36b067(_0x559ecc['error'][_0x0b8f('0x10')]);}else{logger['info'](_0x0b8f('0x9'),_0x40510f,_0x0b8f('0xa'));_0x36b067(_0x559ecc[_0x0b8f('0x11')][_0x0b8f('0x10')]);}})['catch'](function(_0x5c54d1){logger[_0x0b8f('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x40510f,_0x5c54d1);_0x25642d(_0x5c54d1);});});}
\ No newline at end of file
+var _0x3e5c=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment'];(function(_0x2964cf,_0x4708d4){var _0x17ff4b=function(_0x1fdc54){while(--_0x1fdc54){_0x2964cf['push'](_0x2964cf['shift']());}};_0x17ff4b(++_0x4708d4);}(_0x3e5c,0x19b));var _0xc3e5=function(_0x2d4ce5,_0x4aa00d){_0x2d4ce5=_0x2d4ce5-0x0;var _0x243120=_0x3e5c[_0x2d4ce5];return _0x243120;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var moment=require(_0xc3e5('0x2'));var BPromise=require(_0xc3e5('0x3'));var rs=require(_0xc3e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3e5('0x6'))(_0xc3e5('0x7'));var config=require(_0xc3e5('0x8'));var jayson=require(_0xc3e5('0x9'));var client=jayson[_0xc3e5('0xa')][_0xc3e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe33ee9,_0x3f2b2a,_0x35ad72){return new BPromise(function(_0x21d6e0,_0x200972){return client[_0xc3e5('0xc')](_0xe33ee9,_0x35ad72)[_0xc3e5('0xd')](function(_0x4ac825){logger[_0xc3e5('0xe')](_0xc3e5('0xf'),_0x3f2b2a,_0xc3e5('0x10'));logger[_0xc3e5('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3f2b2a,_0xc3e5('0x10'),JSON[_0xc3e5('0x12')](_0x4ac825));if(_0x4ac825[_0xc3e5('0x13')]){if(_0x4ac825[_0xc3e5('0x13')][_0xc3e5('0x14')]===0x1f4){logger[_0xc3e5('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f2b2a,_0x4ac825['error'][_0xc3e5('0x15')]);return _0x200972(_0x4ac825[_0xc3e5('0x13')][_0xc3e5('0x15')]);}logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0x3f2b2a,_0x4ac825['error'][_0xc3e5('0x15')]);return _0x21d6e0(_0x4ac825[_0xc3e5('0x13')][_0xc3e5('0x15')]);}else{logger[_0xc3e5('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f2b2a,_0xc3e5('0x10'));_0x21d6e0(_0x4ac825[_0xc3e5('0x16')][_0xc3e5('0x15')]);}})['catch'](function(_0x1dfb03){logger[_0xc3e5('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f2b2a,_0x1dfb03);_0x200972(_0x1dfb03);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 1997c7c..b4626fb 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(_0x3ed4e7,_0x4b9caf){var _0x4933cf=function(_0x30bc3f){while(--_0x30bc3f){_0x3ed4e7['push'](_0x3ed4e7['shift']());}};_0x4933cf(++_0x4b9caf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x30ffc1,_0x556cd6){var _0x586b40=function(_0x2b0bed){while(--_0x2b0bed){_0x30ffc1['push'](_0x30ffc1['shift']());}};_0x586b40(++_0x556cd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 ba9fa71..e70aec2 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 _0x6c76=['sequelize','exports','STRING','TEXT'];(function(_0x6dc565,_0x5503bd){var _0x2c2583=function(_0x46c813){while(--_0x46c813){_0x6dc565['push'](_0x6dc565['shift']());}};_0x2c2583(++_0x5503bd);}(_0x6c76,0x184));var _0x66c7=function(_0x1f1a46,_0x500d95){_0x1f1a46=_0x1f1a46-0x0;var _0x483b2a=_0x6c76[_0x1f1a46];return _0x483b2a;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'name':{'type':Sequelize[_0x66c7('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x66c7('0x2')]},'metric':{'type':Sequelize[_0x66c7('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xefe3=['STRING','TEXT','sequelize'];(function(_0xc7045d,_0x29b4f1){var _0x4dbd5d=function(_0x3fe744){while(--_0x3fe744){_0xc7045d['push'](_0xc7045d['shift']());}};_0x4dbd5d(++_0x29b4f1);}(_0xefe3,0xf5));var _0x3efe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xefe3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3efe('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x3efe('0x1')]},'metric':{'type':Sequelize[_0x3efe('0x2')]},'description':{'type':Sequelize[_0x3efe('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 731a39f..0732178 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x3101e4,_0x288e9f){var _0x47b990=function(_0x46b62a){while(--_0x46b62a){_0x3101e4['push'](_0x3101e4['shift']());}};_0x47b990(++_0x288e9f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x5fc3[_0x231e16];return _0x570a7c;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../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','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xb17508,_0x323537){var _0x70c57a=function(_0x53afbc){while(--_0x53afbc){_0xb17508['push'](_0xb17508['shift']());}};_0x70c57a(++_0x323537);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1a27f3,_0x1c082d){_0x1a27f3=_0x1a27f3-0x0;var _0x3ce222=_0xf2ca[_0x1a27f3];return _0x3ce222;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 8e18d2d..3e2c843 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 _0x624c=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x46e331,_0x4d880a){var _0x295a22=function(_0x246e61){while(--_0x246e61){_0x46e331['push'](_0x46e331['shift']());}};_0x295a22(++_0x4d880a);}(_0x624c,0x1ee));var _0xc624=function(_0x59db6d,_0x17d6d3){_0x59db6d=_0x59db6d-0x0;var _0x487659=_0x624c[_0x59db6d];return _0x487659;};'use strict';var _=require('lodash');var util=require(_0xc624('0x0'));var logger=require(_0xc624('0x1'))(_0xc624('0x2'));var moment=require(_0xc624('0x3'));var BPromise=require(_0xc624('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc624('0x5'));var rimraf=require('rimraf');var config=require(_0xc624('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xc624('0x7')]=function(_0x2d1db7,_0x39759e){return _0x2d1db7[_0xc624('0x8')](_0xc624('0x9'),attributes,{'tableName':_0xc624('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeff8=['rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','lodash','util','api','moment','bluebird','path'];(function(_0x3f7e8d,_0xbddf){var _0x57e87c=function(_0x262e7d){while(--_0x262e7d){_0x3f7e8d['push'](_0x3f7e8d['shift']());}};_0x57e87c(++_0xbddf);}(_0xeff8,0x186));var _0x8eff=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xeff8[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),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 67ac389..fd3021c 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 _0xd51f=['rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x46f2a2,_0x59b5a4){var _0x1ea996=function(_0x90ce2e){while(--_0x90ce2e){_0x46f2a2['push'](_0x46f2a2['shift']());}};_0x1ea996(++_0x59b5a4);}(_0xd51f,0x1f2));var _0xfd51=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xd51f[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var moment=require('moment');var BPromise=require(_0xfd51('0x2'));var rs=require(_0xfd51('0x3'));var fs=require('fs');var Redis=require(_0xfd51('0x4'));var db=require(_0xfd51('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd51('0x6'));var config=require(_0xfd51('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfd51('0x8')][_0xfd51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xee989a,_0x132de0,_0x55987f){return new BPromise(function(_0x26a444,_0x37d4d5){return client[_0xfd51('0xa')](_0xee989a,_0x55987f)[_0xfd51('0xb')](function(_0x4627d){logger[_0xfd51('0xc')](_0xfd51('0xd'),_0x132de0,_0xfd51('0xe'));logger['debug'](_0xfd51('0xf'),_0x132de0,_0xfd51('0xe'),JSON[_0xfd51('0x10')](_0x4627d));if(_0x4627d[_0xfd51('0x11')]){if(_0x4627d[_0xfd51('0x11')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x132de0,_0x4627d[_0xfd51('0x11')][_0xfd51('0x12')]);return _0x37d4d5(_0x4627d[_0xfd51('0x11')]['message']);}logger[_0xfd51('0x11')](_0xfd51('0xd'),_0x132de0,_0x4627d[_0xfd51('0x11')][_0xfd51('0x12')]);return _0x26a444(_0x4627d[_0xfd51('0x11')][_0xfd51('0x12')]);}else{logger[_0xfd51('0xc')](_0xfd51('0xd'),_0x132de0,_0xfd51('0xe'));_0x26a444(_0x4627d[_0xfd51('0x13')][_0xfd51('0x12')]);}})[_0xfd51('0x14')](function(_0x604996){logger[_0xfd51('0x11')](_0xfd51('0xd'),_0x132de0,_0x604996);_0x37d4d5(_0x604996);});});}
\ No newline at end of file
+var _0x2dfb=['catch','moment','randomstring','../../config/utils','../../config/logger','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x2dfb,0x121));var _0xb2df=function(_0x34df9a,_0x14e0db){_0x34df9a=_0x34df9a-0x0;var _0x33b4e7=_0x2dfb[_0x34df9a];return _0x33b4e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb2df('0x0'));var BPromise=require('bluebird');var rs=require(_0xb2df('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2df('0x2'));var logger=require(_0xb2df('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2df('0x4')][_0xb2df('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x163397,_0x39c795,_0xe5aa99){return new BPromise(function(_0x5aabf8,_0x4b0e98){return client['request'](_0x163397,_0xe5aa99)[_0xb2df('0x6')](function(_0x1c1309){logger[_0xb2df('0x7')](_0xb2df('0x8'),_0x39c795,_0xb2df('0x9'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x39c795,_0xb2df('0x9'),JSON[_0xb2df('0xa')](_0x1c1309));if(_0x1c1309[_0xb2df('0xb')]){if(_0x1c1309['error'][_0xb2df('0xc')]===0x1f4){logger['error'](_0xb2df('0x8'),_0x39c795,_0x1c1309[_0xb2df('0xb')]['message']);return _0x4b0e98(_0x1c1309[_0xb2df('0xb')]['message']);}logger[_0xb2df('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x39c795,_0x1c1309[_0xb2df('0xb')][_0xb2df('0xd')]);return _0x5aabf8(_0x1c1309[_0xb2df('0xb')]['message']);}else{logger['info'](_0xb2df('0x8'),_0x39c795,'request\x20sent');_0x5aabf8(_0x1c1309[_0xb2df('0xe')][_0xb2df('0xd')]);}})[_0xb2df('0xf')](function(_0x318c3b){logger[_0xb2df('0xb')](_0xb2df('0x8'),_0x39c795,_0x318c3b);_0x4b0e98(_0x318c3b);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b839c47..6b416af 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 _0x4cfd=['/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x5cbf88,_0x4d503a){var _0x332089=function(_0x1ef8fb){while(--_0x1ef8fb){_0x5cbf88['push'](_0x5cbf88['shift']());}};_0x332089(++_0x4d503a);}(_0x4cfd,0x170));var _0xd4cf=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x4cfd[_0x7d62cb];return _0x3a6266;};'use strict';var multer=require(_0xd4cf('0x0'));var util=require(_0xd4cf('0x1'));var path=require('path');var timeout=require(_0xd4cf('0x2'));var express=require(_0xd4cf('0x3'));var router=express[_0xd4cf('0x4')]();var fs_extra=require(_0xd4cf('0x5'));var auth=require(_0xd4cf('0x6'));var interaction=require(_0xd4cf('0x7'));var config=require('../../config/environment');var controller=require(_0xd4cf('0x8'));router[_0xd4cf('0x9')]('/',auth[_0xd4cf('0xa')](),controller[_0xd4cf('0xb')]);router[_0xd4cf('0x9')](_0xd4cf('0xc'),auth['isAuthenticated'](),controller[_0xd4cf('0xd')]);router[_0xd4cf('0xe')]('/',auth[_0xd4cf('0xa')](),controller[_0xd4cf('0xf')]);router[_0xd4cf('0x10')](_0xd4cf('0xc'),auth[_0xd4cf('0xa')](),controller['update']);router[_0xd4cf('0x11')](_0xd4cf('0xc'),auth[_0xd4cf('0xa')](),controller[_0xd4cf('0x12')]);module[_0xd4cf('0x13')]=router;
\ No newline at end of file
+var _0xb39f=['get','/:id','post','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb39f,0x1e6));var _0xfb39=function(_0x1fa0f3,_0x2d3c19){_0x1fa0f3=_0x1fa0f3-0x0;var _0x48fd5f=_0xb39f[_0x1fa0f3];return _0x48fd5f;};'use strict';var multer=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var path=require(_0xfb39('0x2'));var timeout=require(_0xfb39('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb39('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfb39('0x5'));var controller=require(_0xfb39('0x6'));router['get']('/',auth[_0xfb39('0x7')](),controller[_0xfb39('0x8')]);router[_0xfb39('0x9')](_0xfb39('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xfb39('0xb')]('/',auth[_0xfb39('0x7')](),controller['create']);router['put']('/:id',auth[_0xfb39('0x7')](),controller[_0xfb39('0xc')]);router[_0xfb39('0xd')](_0xfb39('0xa'),auth[_0xfb39('0x7')](),controller['destroy']);module[_0xfb39('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 44b1e7f..07cbc74 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 _0x490b=['sequelize','exports','TEXT'];(function(_0x1138c4,_0x841d33){var _0x200cc1=function(_0x2f6d85){while(--_0x2f6d85){_0x1138c4['push'](_0x1138c4['shift']());}};_0x200cc1(++_0x841d33);}(_0x490b,0xff));var _0xb490=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x490b[_0x2675da];return _0x5e6153;};'use strict';var Sequelize=require(_0xb490('0x0'));module[_0xb490('0x1')]={'tree':{'type':Sequelize[_0xb490('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xb394=['sequelize','exports'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xb394,0x1be));var _0x4b39=function(_0x1566a5,_0x429920){_0x1566a5=_0x1566a5-0x0;var _0x98f4b4=_0xb394[_0x1566a5];return _0x98f4b4;};'use strict';var Sequelize=require(_0x4b39('0x0'));module[_0x4b39('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 929e423..b2052c2 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 _0x8060=['map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','update','then','destroy','error','stack','name'];(function(_0x22a233,_0x7e7da0){var _0x5b5c60=function(_0x265ec8){while(--_0x265ec8){_0x22a233['push'](_0x22a233['shift']());}};_0x5b5c60(++_0x7e7da0);}(_0x8060,0x6e));var _0x0806=function(_0x372ee1,_0x45c637){_0x372ee1=_0x372ee1-0x0;var _0x31ea06=_0x8060[_0x372ee1];return _0x31ea06;};'use strict';var emlformat=require(_0x0806('0x0'));var rimraf=require(_0x0806('0x1'));var zipdir=require(_0x0806('0x2'));var jsonpatch=require(_0x0806('0x3'));var rp=require(_0x0806('0x4'));var moment=require(_0x0806('0x5'));var BPromise=require(_0x0806('0x6'));var Mustache=require('mustache');var util=require(_0x0806('0x7'));var path=require(_0x0806('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0806('0x9'));var fs=require('fs');var fs_extra=require(_0x0806('0xa'));var _=require('lodash');var squel=require(_0x0806('0xb'));var crypto=require(_0x0806('0xc'));var jsforce=require(_0x0806('0xd'));var deskjs=require(_0x0806('0xe'));var toCsv=require(_0x0806('0xf'));var querystring=require('querystring');var Papa=require(_0x0806('0x10'));var Redis=require('ioredis');var authService=require(_0x0806('0x11'));var qs=require(_0x0806('0x12'));var as=require(_0x0806('0x13'));var hardwareService=require(_0x0806('0x14'));var logger=require('../../config/logger')(_0x0806('0x15'));var utils=require(_0x0806('0x16'));var config=require(_0x0806('0x17'));var licenseUtil=require(_0x0806('0x18'));var db=require(_0x0806('0x19'))['db'];function respondWithStatusCode(_0x462fe3,_0x261638){_0x261638=_0x261638||0xcc;return function(_0x356c2d){if(_0x356c2d){return _0x462fe3[_0x0806('0x1a')](_0x261638);}return _0x462fe3[_0x0806('0x1b')](_0x261638)[_0x0806('0x1c')]();};}function respondWithResult(_0x17e5e8,_0x2ff96e){_0x2ff96e=_0x2ff96e||0xc8;return function(_0x3233e5){if(_0x3233e5){return _0x17e5e8['status'](_0x2ff96e)[_0x0806('0x1d')](_0x3233e5);}};}function respondWithFilteredResult(_0x513a72,_0x1607f7){return function(_0x4fa40f){if(_0x4fa40f){var _0x1430ee=typeof _0x1607f7['offset']===_0x0806('0x1e')&&typeof _0x1607f7['limit']==='undefined';var _0x11a217=_0x4fa40f[_0x0806('0x1f')];var _0xd60af3=_0x1430ee?0x0:_0x1607f7[_0x0806('0x20')];var _0x405b3e=_0x1430ee?_0x4fa40f['count']:_0x1607f7[_0x0806('0x20')]+_0x1607f7[_0x0806('0x21')];var _0x3f9e43;if(_0x405b3e>=_0x11a217){_0x405b3e=_0x11a217;_0x3f9e43=0xc8;}else{_0x3f9e43=0xce;}_0x513a72[_0x0806('0x1b')](_0x3f9e43);return _0x513a72[_0x0806('0x22')]('Content-Range',_0xd60af3+'-'+_0x405b3e+'/'+_0x11a217)[_0x0806('0x1d')](_0x4fa40f);}return null;};}function patchUpdates(_0x330c7e){return function(_0x5b236b){try{jsonpatch['apply'](_0x5b236b,_0x330c7e,!![]);}catch(_0x155b5c){return BPromise[_0x0806('0x23')](_0x155b5c);}return _0x5b236b['save']();};}function saveUpdates(_0x19a3cc,_0x51a333){return function(_0x50d214){if(_0x50d214){return _0x50d214[_0x0806('0x24')](_0x19a3cc)[_0x0806('0x25')](function(_0x5a2e61){return _0x5a2e61;});}return null;};}function removeEntity(_0x5097c9,_0x175771){return function(_0x1e34e2){if(_0x1e34e2){return _0x1e34e2[_0x0806('0x26')]()['then'](function(){_0x5097c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22d3b9,_0x298f1b){return function(_0x6ff3ab){if(!_0x6ff3ab){_0x22d3b9[_0x0806('0x1a')](0x194);}return _0x6ff3ab;};}function handleError(_0xa479ae,_0x468c2e){_0x468c2e=_0x468c2e||0x1f4;return function(_0x2b72ea){logger[_0x0806('0x27')](_0x2b72ea[_0x0806('0x28')]);if(_0x2b72ea[_0x0806('0x29')]){delete _0x2b72ea[_0x0806('0x29')];}_0xa479ae[_0x0806('0x1b')](_0x468c2e)['send'](_0x2b72ea);};}exports['index']=function(_0x48de05,_0x11653b){var _0x4da820={},_0x175f69={},_0x17d6f2={'count':0x0,'rows':[]};var _0xf249e6=_[_0x0806('0x2a')](db['AnalyticTreeReport'][_0x0806('0x2b')],function(_0x368163){return{'name':_0x368163[_0x0806('0x2c')],'type':_0x368163[_0x0806('0x2d')][_0x0806('0x2e')]};});_0x175f69['model']=_[_0x0806('0x2a')](_0xf249e6,'name');_0x175f69['query']=_[_0x0806('0x2f')](_0x48de05[_0x0806('0x30')]);_0x175f69[_0x0806('0x31')]=_[_0x0806('0x32')](_0x175f69[_0x0806('0x33')],_0x175f69[_0x0806('0x30')]);_0x4da820[_0x0806('0x34')]=_[_0x0806('0x32')](_0x175f69[_0x0806('0x33')],qs[_0x0806('0x35')](_0x48de05[_0x0806('0x30')]['fields']));_0x4da820['attributes']=_0x4da820['attributes'][_0x0806('0x36')]?_0x4da820[_0x0806('0x34')]:_0x175f69[_0x0806('0x33')];if(!_0x48de05[_0x0806('0x30')][_0x0806('0x37')](_0x0806('0x38'))){_0x4da820[_0x0806('0x21')]=qs[_0x0806('0x21')](_0x48de05[_0x0806('0x30')][_0x0806('0x21')]);_0x4da820[_0x0806('0x20')]=qs[_0x0806('0x20')](_0x48de05[_0x0806('0x30')]['offset']);}_0x4da820[_0x0806('0x39')]=qs['sort'](_0x48de05[_0x0806('0x30')][_0x0806('0x3a')]);_0x4da820[_0x0806('0x3b')]=qs['filters'](_[_0x0806('0x3c')](_0x48de05['query'],_0x175f69['filters']),_0xf249e6);if(_0x48de05[_0x0806('0x30')][_0x0806('0x3d')]){_0x4da820['where']=_['merge'](_0x4da820[_0x0806('0x3b')],{'$or':_['map'](_0xf249e6,function(_0x303822){if(_0x303822['type']!==_0x0806('0x3e')){var _0x33f10e={};_0x33f10e[_0x303822[_0x0806('0x29')]]={'$like':'%'+_0x48de05[_0x0806('0x30')][_0x0806('0x3d')]+'%'};return _0x33f10e;}})});}_0x4da820=_[_0x0806('0x3f')]({},_0x4da820,_0x48de05[_0x0806('0x40')]);var _0x3e702a={'where':_0x4da820[_0x0806('0x3b')]};return db[_0x0806('0x41')][_0x0806('0x1f')](_0x3e702a)[_0x0806('0x25')](function(_0x5264c7){_0x17d6f2[_0x0806('0x1f')]=_0x5264c7;if(_0x48de05[_0x0806('0x30')][_0x0806('0x42')]){_0x4da820['include']=[{'all':!![]}];}return db[_0x0806('0x41')][_0x0806('0x43')](_0x4da820);})[_0x0806('0x25')](function(_0x299b71){_0x17d6f2[_0x0806('0x44')]=_0x299b71;return _0x17d6f2;})[_0x0806('0x25')](respondWithFilteredResult(_0x11653b,_0x4da820))[_0x0806('0x45')](handleError(_0x11653b,null));};exports[_0x0806('0x46')]=function(_0x139a0f,_0x3b0bce){var _0x2c51f6={'raw':!![],'where':{'id':_0x139a0f['params']['id']}},_0x20bb95={};_0x20bb95[_0x0806('0x33')]=_[_0x0806('0x2f')](db[_0x0806('0x41')][_0x0806('0x2b')]);_0x20bb95[_0x0806('0x30')]=_[_0x0806('0x2f')](_0x139a0f['query']);_0x20bb95[_0x0806('0x31')]=_[_0x0806('0x32')](_0x20bb95['model'],_0x20bb95[_0x0806('0x30')]);_0x2c51f6[_0x0806('0x34')]=_['intersection'](_0x20bb95['model'],qs[_0x0806('0x35')](_0x139a0f[_0x0806('0x30')][_0x0806('0x35')]));_0x2c51f6['attributes']=_0x2c51f6[_0x0806('0x34')][_0x0806('0x36')]?_0x2c51f6[_0x0806('0x34')]:_0x20bb95[_0x0806('0x33')];if(_0x139a0f['query'][_0x0806('0x42')]){_0x2c51f6[_0x0806('0x47')]=[{'all':!![]}];}_0x2c51f6=_[_0x0806('0x3f')]({},_0x2c51f6,_0x139a0f[_0x0806('0x40')]);return db[_0x0806('0x41')][_0x0806('0x48')](_0x2c51f6)[_0x0806('0x25')](handleEntityNotFound(_0x3b0bce,null))[_0x0806('0x25')](respondWithResult(_0x3b0bce,null))[_0x0806('0x45')](handleError(_0x3b0bce,null));};exports[_0x0806('0x49')]=function(_0x179649,_0x540cf2){return db[_0x0806('0x41')][_0x0806('0x49')](_0x179649[_0x0806('0x4a')],{})['then'](respondWithResult(_0x540cf2,0xc9))[_0x0806('0x45')](handleError(_0x540cf2,null));};exports['update']=function(_0x1c9e3e,_0x1dc0c3){if(_0x1c9e3e[_0x0806('0x4a')]['id']){delete _0x1c9e3e['body']['id'];}return db[_0x0806('0x41')]['find']({'where':{'id':_0x1c9e3e['params']['id']}})[_0x0806('0x25')](handleEntityNotFound(_0x1dc0c3,null))['then'](saveUpdates(_0x1c9e3e[_0x0806('0x4a')],null))[_0x0806('0x25')](respondWithResult(_0x1dc0c3,null))[_0x0806('0x45')](handleError(_0x1dc0c3,null));};exports['destroy']=function(_0x389370,_0x3e0d0d){return db[_0x0806('0x41')][_0x0806('0x48')]({'where':{'id':_0x389370[_0x0806('0x4b')]['id']}})[_0x0806('0x25')](handleEntityNotFound(_0x3e0d0d,null))[_0x0806('0x25')](removeEntity(_0x3e0d0d,null))[_0x0806('0x45')](handleError(_0x3e0d0d,null));};
\ No newline at end of file
+var _0x5c6b=['name','send','index','AnalyticTreeReport','rawAttributes','type','key','model','map','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack'];(function(_0x5d9a6d,_0x5c2d3c){var _0x2a72a4=function(_0x30b355){while(--_0x30b355){_0x5d9a6d['push'](_0x5d9a6d['shift']());}};_0x2a72a4(++_0x5c2d3c);}(_0x5c6b,0x1a5));var _0xb5c6=function(_0x3c5a41,_0x39473c){_0x3c5a41=_0x3c5a41-0x0;var _0x58156f=_0x5c6b[_0x3c5a41];return _0x58156f;};'use strict';var emlformat=require(_0xb5c6('0x0'));var rimraf=require(_0xb5c6('0x1'));var zipdir=require(_0xb5c6('0x2'));var jsonpatch=require(_0xb5c6('0x3'));var rp=require(_0xb5c6('0x4'));var moment=require(_0xb5c6('0x5'));var BPromise=require(_0xb5c6('0x6'));var Mustache=require('mustache');var util=require(_0xb5c6('0x7'));var path=require(_0xb5c6('0x8'));var sox=require(_0xb5c6('0x9'));var csv=require(_0xb5c6('0xa'));var ejs=require(_0xb5c6('0xb'));var fs=require('fs');var fs_extra=require(_0xb5c6('0xc'));var _=require(_0xb5c6('0xd'));var squel=require(_0xb5c6('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb5c6('0xa'));var querystring=require('querystring');var Papa=require(_0xb5c6('0xf'));var Redis=require(_0xb5c6('0x10'));var authService=require(_0xb5c6('0x11'));var qs=require(_0xb5c6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5c6('0x13'));var logger=require(_0xb5c6('0x14'))('api');var utils=require(_0xb5c6('0x15'));var config=require(_0xb5c6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5c6('0x17'))['db'];function respondWithStatusCode(_0x42599,_0x20f159){_0x20f159=_0x20f159||0xcc;return function(_0x3f9691){if(_0x3f9691){return _0x42599[_0xb5c6('0x18')](_0x20f159);}return _0x42599[_0xb5c6('0x19')](_0x20f159)[_0xb5c6('0x1a')]();};}function respondWithResult(_0x17347b,_0x453d2f){_0x453d2f=_0x453d2f||0xc8;return function(_0x178f1e){if(_0x178f1e){return _0x17347b['status'](_0x453d2f)['json'](_0x178f1e);}};}function respondWithFilteredResult(_0x44ea19,_0x2216ea){return function(_0x187844){if(_0x187844){var _0x3c5b42=typeof _0x2216ea[_0xb5c6('0x1b')]==='undefined'&&typeof _0x2216ea['limit']===_0xb5c6('0x1c');var _0x58343d=_0x187844[_0xb5c6('0x1d')];var _0x59ab6c=_0x3c5b42?0x0:_0x2216ea[_0xb5c6('0x1b')];var _0x371634=_0x3c5b42?_0x187844[_0xb5c6('0x1d')]:_0x2216ea['offset']+_0x2216ea['limit'];var _0x3fc86b;if(_0x371634>=_0x58343d){_0x371634=_0x58343d;_0x3fc86b=0xc8;}else{_0x3fc86b=0xce;}_0x44ea19['status'](_0x3fc86b);return _0x44ea19[_0xb5c6('0x1e')](_0xb5c6('0x1f'),_0x59ab6c+'-'+_0x371634+'/'+_0x58343d)[_0xb5c6('0x20')](_0x187844);}return null;};}function patchUpdates(_0x16d785){return function(_0x29790f){try{jsonpatch[_0xb5c6('0x21')](_0x29790f,_0x16d785,!![]);}catch(_0x3c272c){return BPromise[_0xb5c6('0x22')](_0x3c272c);}return _0x29790f[_0xb5c6('0x23')]();};}function saveUpdates(_0x5de510,_0x1aa144){return function(_0xdf924d){if(_0xdf924d){return _0xdf924d[_0xb5c6('0x24')](_0x5de510)[_0xb5c6('0x25')](function(_0x172dad){return _0x172dad;});}return null;};}function removeEntity(_0xa4f4cc,_0x357cc3){return function(_0x44b3d6){if(_0x44b3d6){return _0x44b3d6[_0xb5c6('0x26')]()[_0xb5c6('0x25')](function(){_0xa4f4cc[_0xb5c6('0x19')](0xcc)[_0xb5c6('0x1a')]();});}};}function handleEntityNotFound(_0x31c250,_0xc87363){return function(_0xf52f93){if(!_0xf52f93){_0x31c250['sendStatus'](0x194);}return _0xf52f93;};}function handleError(_0x1e40ee,_0x5ccd82){_0x5ccd82=_0x5ccd82||0x1f4;return function(_0x2c75ea){logger[_0xb5c6('0x27')](_0x2c75ea[_0xb5c6('0x28')]);if(_0x2c75ea['name']){delete _0x2c75ea[_0xb5c6('0x29')];}_0x1e40ee[_0xb5c6('0x19')](_0x5ccd82)[_0xb5c6('0x2a')](_0x2c75ea);};}exports[_0xb5c6('0x2b')]=function(_0xcc8ebb,_0x702b2e){var _0x1f74ef={},_0x133c97={},_0x4a7bb3={'count':0x0,'rows':[]};var _0x2f19d3=_['map'](db[_0xb5c6('0x2c')][_0xb5c6('0x2d')],function(_0x3463f6){return{'name':_0x3463f6['fieldName'],'type':_0x3463f6[_0xb5c6('0x2e')][_0xb5c6('0x2f')]};});_0x133c97[_0xb5c6('0x30')]=_[_0xb5c6('0x31')](_0x2f19d3,_0xb5c6('0x29'));_0x133c97['query']=_[_0xb5c6('0x32')](_0xcc8ebb['query']);_0x133c97['filters']=_[_0xb5c6('0x33')](_0x133c97[_0xb5c6('0x30')],_0x133c97['query']);_0x1f74ef[_0xb5c6('0x34')]=_['intersection'](_0x133c97['model'],qs[_0xb5c6('0x35')](_0xcc8ebb[_0xb5c6('0x36')][_0xb5c6('0x35')]));_0x1f74ef['attributes']=_0x1f74ef[_0xb5c6('0x34')][_0xb5c6('0x37')]?_0x1f74ef[_0xb5c6('0x34')]:_0x133c97[_0xb5c6('0x30')];if(!_0xcc8ebb[_0xb5c6('0x36')][_0xb5c6('0x38')](_0xb5c6('0x39'))){_0x1f74ef['limit']=qs[_0xb5c6('0x3a')](_0xcc8ebb['query'][_0xb5c6('0x3a')]);_0x1f74ef[_0xb5c6('0x1b')]=qs['offset'](_0xcc8ebb[_0xb5c6('0x36')][_0xb5c6('0x1b')]);}_0x1f74ef[_0xb5c6('0x3b')]=qs[_0xb5c6('0x3c')](_0xcc8ebb[_0xb5c6('0x36')]['sort']);_0x1f74ef['where']=qs[_0xb5c6('0x3d')](_[_0xb5c6('0x3e')](_0xcc8ebb[_0xb5c6('0x36')],_0x133c97[_0xb5c6('0x3d')]),_0x2f19d3);if(_0xcc8ebb[_0xb5c6('0x36')][_0xb5c6('0x3f')]){_0x1f74ef[_0xb5c6('0x40')]=_[_0xb5c6('0x41')](_0x1f74ef[_0xb5c6('0x40')],{'$or':_['map'](_0x2f19d3,function(_0x57533f){if(_0x57533f[_0xb5c6('0x2e')]!==_0xb5c6('0x42')){var _0x4472f3={};_0x4472f3[_0x57533f[_0xb5c6('0x29')]]={'$like':'%'+_0xcc8ebb[_0xb5c6('0x36')][_0xb5c6('0x3f')]+'%'};return _0x4472f3;}})});}_0x1f74ef=_[_0xb5c6('0x41')]({},_0x1f74ef,_0xcc8ebb[_0xb5c6('0x43')]);var _0x4ff1a1={'where':_0x1f74ef[_0xb5c6('0x40')]};return db['AnalyticTreeReport'][_0xb5c6('0x1d')](_0x4ff1a1)[_0xb5c6('0x25')](function(_0x2d9c00){_0x4a7bb3[_0xb5c6('0x1d')]=_0x2d9c00;if(_0xcc8ebb['query']['includeAll']){_0x1f74ef[_0xb5c6('0x44')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xb5c6('0x45')](_0x1f74ef);})[_0xb5c6('0x25')](function(_0x25b8aa){_0x4a7bb3[_0xb5c6('0x46')]=_0x25b8aa;return _0x4a7bb3;})[_0xb5c6('0x25')](respondWithFilteredResult(_0x702b2e,_0x1f74ef))[_0xb5c6('0x47')](handleError(_0x702b2e,null));};exports[_0xb5c6('0x48')]=function(_0x4a5749,_0x13dee4){var _0x27a0b4={'raw':!![],'where':{'id':_0x4a5749[_0xb5c6('0x49')]['id']}},_0x1466c1={};_0x1466c1['model']=_['keys'](db[_0xb5c6('0x2c')][_0xb5c6('0x2d')]);_0x1466c1['query']=_[_0xb5c6('0x32')](_0x4a5749[_0xb5c6('0x36')]);_0x1466c1[_0xb5c6('0x3d')]=_[_0xb5c6('0x33')](_0x1466c1[_0xb5c6('0x30')],_0x1466c1[_0xb5c6('0x36')]);_0x27a0b4[_0xb5c6('0x34')]=_[_0xb5c6('0x33')](_0x1466c1[_0xb5c6('0x30')],qs[_0xb5c6('0x35')](_0x4a5749[_0xb5c6('0x36')][_0xb5c6('0x35')]));_0x27a0b4[_0xb5c6('0x34')]=_0x27a0b4[_0xb5c6('0x34')][_0xb5c6('0x37')]?_0x27a0b4[_0xb5c6('0x34')]:_0x1466c1[_0xb5c6('0x30')];if(_0x4a5749[_0xb5c6('0x36')]['includeAll']){_0x27a0b4['include']=[{'all':!![]}];}_0x27a0b4=_[_0xb5c6('0x41')]({},_0x27a0b4,_0x4a5749[_0xb5c6('0x43')]);return db[_0xb5c6('0x2c')][_0xb5c6('0x4a')](_0x27a0b4)['then'](handleEntityNotFound(_0x13dee4,null))['then'](respondWithResult(_0x13dee4,null))[_0xb5c6('0x47')](handleError(_0x13dee4,null));};exports[_0xb5c6('0x4b')]=function(_0x5d1528,_0xb3455a){return db[_0xb5c6('0x2c')][_0xb5c6('0x4b')](_0x5d1528[_0xb5c6('0x4c')],{})[_0xb5c6('0x25')](respondWithResult(_0xb3455a,0xc9))[_0xb5c6('0x47')](handleError(_0xb3455a,null));};exports['update']=function(_0x3cfc0a,_0x25d31d){if(_0x3cfc0a[_0xb5c6('0x4c')]['id']){delete _0x3cfc0a[_0xb5c6('0x4c')]['id'];}return db['AnalyticTreeReport'][_0xb5c6('0x4a')]({'where':{'id':_0x3cfc0a['params']['id']}})[_0xb5c6('0x25')](handleEntityNotFound(_0x25d31d,null))[_0xb5c6('0x25')](saveUpdates(_0x3cfc0a[_0xb5c6('0x4c')],null))[_0xb5c6('0x25')](respondWithResult(_0x25d31d,null))[_0xb5c6('0x47')](handleError(_0x25d31d,null));};exports[_0xb5c6('0x26')]=function(_0x2a3523,_0x2fd284){return db[_0xb5c6('0x2c')][_0xb5c6('0x4a')]({'where':{'id':_0x2a3523[_0xb5c6('0x49')]['id']}})['then'](handleEntityNotFound(_0x2fd284,null))[_0xb5c6('0x25')](removeEntity(_0x2fd284,null))[_0xb5c6('0x47')](handleError(_0x2fd284,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index cf4ae4b..ac076ff 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 _0xf4cf=['analytics_report_trees','util','../../config/logger','moment','bluebird','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf4cf,0x14b));var _0xff4c=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xf4cf[_0x403c20];return _0x2b271a;};'use strict';var _=require('lodash');var util=require(_0xff4c('0x0'));var logger=require(_0xff4c('0x1'))('api');var moment=require(_0xff4c('0x2'));var BPromise=require(_0xff4c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff4c('0x4'));var rimraf=require(_0xff4c('0x5'));var config=require('../../config/environment');var attributes=require(_0xff4c('0x6'));module[_0xff4c('0x7')]=function(_0x27dd0a,_0x4da85f){return _0x27dd0a[_0xff4c('0x8')](_0xff4c('0x9'),attributes,{'tableName':_0xff4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb324=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','bluebird','request-promise','../../config/environment','./analyticTreeReport.attributes'];(function(_0x20928f,_0x29aac5){var _0x2c0da7=function(_0x58f0af){while(--_0x58f0af){_0x20928f['push'](_0x20928f['shift']());}};_0x2c0da7(++_0x29aac5);}(_0xb324,0x19b));var _0x4b32=function(_0x5e5aab,_0x2e183f){_0x5e5aab=_0x5e5aab-0x0;var _0x16c527=_0xb324[_0x5e5aab];return _0x16c527;};'use strict';var _=require(_0x4b32('0x0'));var util=require(_0x4b32('0x1'));var logger=require('../../config/logger')(_0x4b32('0x2'));var moment=require('moment');var BPromise=require(_0x4b32('0x3'));var rp=require(_0x4b32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4b32('0x5'));var attributes=require(_0x4b32('0x6'));module[_0x4b32('0x7')]=function(_0x11bd4c,_0x68dec9){return _0x11bd4c[_0x4b32('0x8')](_0x4b32('0x9'),attributes,{'tableName':_0x4b32('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 8d03d92..2557504 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(_0x47af00,_0x301522){var _0x19808c=function(_0x25802d){while(--_0x25802d){_0x47af00['push'](_0x47af00['shift']());}};_0x19808c(++_0x301522);}(_0xdb28,0x106));var _0x8db2=function(_0x34084e,_0x29d638){_0x34084e=_0x34084e-0x0;var _0x4216f6=_0xdb28[_0x34084e];return _0x4216f6;};'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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x31e802,_0x468675){var _0x465cc1=function(_0xd3b254){while(--_0xd3b254){_0x31e802['push'](_0x31e802['shift']());}};_0x465cc1(++_0x468675);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 4f44e45..ce9f575 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 _0x4bd8=['/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x2a0e22,_0x1407f3){var _0x3b24fd=function(_0x515286){while(--_0x515286){_0x2a0e22['push'](_0x2a0e22['shift']());}};_0x3b24fd(++_0x1407f3);}(_0x4bd8,0x15e));var _0x84bd=function(_0x23358d,_0x35951e){_0x23358d=_0x23358d-0x0;var _0x3f10d1=_0x4bd8[_0x23358d];return _0x3f10d1;};'use strict';var multer=require(_0x84bd('0x0'));var util=require(_0x84bd('0x1'));var path=require(_0x84bd('0x2'));var timeout=require(_0x84bd('0x3'));var express=require(_0x84bd('0x4'));var router=express[_0x84bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x84bd('0x6'));var interaction=require(_0x84bd('0x7'));var config=require(_0x84bd('0x8'));var controller=require(_0x84bd('0x9'));router[_0x84bd('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84bd('0xa')](_0x84bd('0xb'),auth[_0x84bd('0xc')](),controller[_0x84bd('0xd')]);router[_0x84bd('0xe')]('/',auth[_0x84bd('0xc')](),controller[_0x84bd('0xf')]);router['put'](_0x84bd('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x84bd('0x10')](_0x84bd('0xb'),auth[_0x84bd('0xc')](),controller[_0x84bd('0x11')]);module[_0x84bd('0x12')]=router;
\ No newline at end of file
+var _0x1045=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x42ac41,_0xc9fc87){var _0x275666=function(_0x450f17){while(--_0x450f17){_0x42ac41['push'](_0x42ac41['shift']());}};_0x275666(++_0xc9fc87);}(_0x1045,0x71));var _0x5104=function(_0x3d8088,_0x59af8b){_0x3d8088=_0x3d8088-0x0;var _0x1705a6=_0x1045[_0x3d8088];return _0x1705a6;};'use strict';var multer=require(_0x5104('0x0'));var util=require(_0x5104('0x1'));var path=require(_0x5104('0x2'));var timeout=require(_0x5104('0x3'));var express=require(_0x5104('0x4'));var router=express[_0x5104('0x5')]();var fs_extra=require(_0x5104('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5104('0x7'));var config=require(_0x5104('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x5104('0x9')]('/',auth[_0x5104('0xa')](),controller[_0x5104('0xb')]);router[_0x5104('0x9')](_0x5104('0xc'),auth['isAuthenticated'](),controller[_0x5104('0xd')]);router[_0x5104('0xe')]('/',auth[_0x5104('0xa')](),controller[_0x5104('0xf')]);router[_0x5104('0x10')](_0x5104('0xc'),auth[_0x5104('0xa')](),controller[_0x5104('0x11')]);router[_0x5104('0x12')](_0x5104('0xc'),auth[_0x5104('0xa')](),controller[_0x5104('0x13')]);module[_0x5104('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 7e11894..676d512 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 _0x5b7f=['exports','STRING','sequelize'];(function(_0x3e9688,_0x5c5633){var _0x43a2e2=function(_0x555459){while(--_0x555459){_0x3e9688['push'](_0x3e9688['shift']());}};_0x43a2e2(++_0x5c5633);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x523daf,_0x4d821c){_0x523daf=_0x523daf-0x0;var _0x3fb759=_0x5b7f[_0x523daf];return _0x3fb759;};'use strict';var Sequelize=require(_0xf5b7('0x0'));module[_0xf5b7('0x1')]={'name':{'type':Sequelize[_0xf5b7('0x2')]},'basename':{'type':Sequelize[_0xf5b7('0x2')]},'type':{'type':Sequelize[_0xf5b7('0x2')]}};
\ No newline at end of file
+var _0x2137=['exports','STRING','sequelize'];(function(_0x422bb1,_0x41eb73){var _0xfe5f30=function(_0x1314ca){while(--_0x1314ca){_0x422bb1['push'](_0x422bb1['shift']());}};_0xfe5f30(++_0x41eb73);}(_0x2137,0x134));var _0x7213=function(_0x30a565,_0x1337bf){_0x30a565=_0x30a565-0x0;var _0x388956=_0x2137[_0x30a565];return _0x388956;};'use strict';var Sequelize=require(_0x7213('0x0'));module[_0x7213('0x1')]={'name':{'type':Sequelize[_0x7213('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 3be5f7a..2de2c9a 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 _0x0997=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','find','clone','length','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','mimetype','download','findOne','join','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x30397a,_0x3b62d9){var _0x169a8f=function(_0x440cd1){while(--_0x440cd1){_0x30397a['push'](_0x30397a['shift']());}};_0x169a8f(++_0x3b62d9);}(_0x0997,0x151));var _0x7099=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0997[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7099('0x0'));var rimraf=require(_0x7099('0x1'));var zipdir=require(_0x7099('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7099('0x3'));var moment=require(_0x7099('0x4'));var BPromise=require(_0x7099('0x5'));var Mustache=require(_0x7099('0x6'));var util=require('util');var path=require(_0x7099('0x7'));var sox=require(_0x7099('0x8'));var csv=require('to-csv');var ejs=require(_0x7099('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7099('0xa'));var squel=require(_0x7099('0xb'));var crypto=require(_0x7099('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7099('0xd'));var toCsv=require(_0x7099('0xe'));var querystring=require(_0x7099('0xf'));var Papa=require(_0x7099('0x10'));var Redis=require(_0x7099('0x11'));var authService=require(_0x7099('0x12'));var qs=require(_0x7099('0x13'));var as=require(_0x7099('0x14'));var hardwareService=require(_0x7099('0x15'));var logger=require(_0x7099('0x16'))(_0x7099('0x17'));var utils=require(_0x7099('0x18'));var config=require(_0x7099('0x19'));var licenseUtil=require(_0x7099('0x1a'));var db=require(_0x7099('0x1b'))['db'];function respondWithStatusCode(_0x1959dd,_0x2c5da1){_0x2c5da1=_0x2c5da1||0xcc;return function(_0x16a0a7){if(_0x16a0a7){return _0x1959dd[_0x7099('0x1c')](_0x2c5da1);}return _0x1959dd[_0x7099('0x1d')](_0x2c5da1)['end']();};}function respondWithResult(_0x5b9383,_0x400035){_0x400035=_0x400035||0xc8;return function(_0x4670ff){if(_0x4670ff){return _0x5b9383[_0x7099('0x1d')](_0x400035)[_0x7099('0x1e')](_0x4670ff);}};}function respondWithFilteredResult(_0x5c504b,_0x46fdaf){return function(_0x1efe8e){if(_0x1efe8e){var _0x14c66b=typeof _0x46fdaf[_0x7099('0x1f')]===_0x7099('0x20')&&typeof _0x46fdaf[_0x7099('0x21')]==='undefined';var _0x50ef5d=_0x1efe8e[_0x7099('0x22')];var _0x11815e=_0x14c66b?0x0:_0x46fdaf[_0x7099('0x1f')];var _0xc7aa0f=_0x14c66b?_0x1efe8e[_0x7099('0x22')]:_0x46fdaf[_0x7099('0x1f')]+_0x46fdaf['limit'];var _0x17e67f;if(_0xc7aa0f>=_0x50ef5d){_0xc7aa0f=_0x50ef5d;_0x17e67f=0xc8;}else{_0x17e67f=0xce;}_0x5c504b[_0x7099('0x1d')](_0x17e67f);return _0x5c504b['set']('Content-Range',_0x11815e+'-'+_0xc7aa0f+'/'+_0x50ef5d)[_0x7099('0x1e')](_0x1efe8e);}return null;};}function patchUpdates(_0x27a67e){return function(_0x50216f){try{jsonpatch[_0x7099('0x23')](_0x50216f,_0x27a67e,!![]);}catch(_0x5c4798){return BPromise['reject'](_0x5c4798);}return _0x50216f[_0x7099('0x24')]();};}function saveUpdates(_0x11dc75,_0x150800){return function(_0x1c28a9){if(_0x1c28a9){return _0x1c28a9[_0x7099('0x25')](_0x11dc75)[_0x7099('0x26')](function(_0xcd784c){return _0xcd784c;});}return null;};}function removeEntity(_0x36919c,_0x189412){return function(_0x6314ad){if(_0x6314ad){return _0x6314ad[_0x7099('0x27')]()[_0x7099('0x26')](function(){_0x36919c[_0x7099('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x562c92,_0x4c1f6d){return function(_0x5217d2){if(!_0x5217d2){_0x562c92[_0x7099('0x1c')](0x194);}return _0x5217d2;};}function handleError(_0x1578ee,_0x37b6d4){_0x37b6d4=_0x37b6d4||0x1f4;return function(_0x3ce5d9){logger[_0x7099('0x28')](_0x3ce5d9[_0x7099('0x29')]);if(_0x3ce5d9[_0x7099('0x2a')]){delete _0x3ce5d9[_0x7099('0x2a')];}_0x1578ee[_0x7099('0x1d')](_0x37b6d4)[_0x7099('0x2b')](_0x3ce5d9);};}exports[_0x7099('0x2c')]=function(_0x6f3002,_0x4906ad){var _0x45d208={},_0x381a32={},_0x38490e={'count':0x0,'rows':[]};var _0x21c7f1=_[_0x7099('0x2d')](db[_0x7099('0x2e')]['rawAttributes'],function(_0x909f0){return{'name':_0x909f0['fieldName'],'type':_0x909f0[_0x7099('0x2f')][_0x7099('0x30')]};});_0x381a32[_0x7099('0x31')]=_['map'](_0x21c7f1,'name');_0x381a32[_0x7099('0x32')]=_[_0x7099('0x33')](_0x6f3002[_0x7099('0x32')]);_0x381a32[_0x7099('0x34')]=_[_0x7099('0x35')](_0x381a32[_0x7099('0x31')],_0x381a32[_0x7099('0x32')]);_0x45d208[_0x7099('0x36')]=_[_0x7099('0x35')](_0x381a32[_0x7099('0x31')],qs[_0x7099('0x37')](_0x6f3002['query']['fields']));_0x45d208[_0x7099('0x36')]=_0x45d208[_0x7099('0x36')]['length']?_0x45d208[_0x7099('0x36')]:_0x381a32[_0x7099('0x31')];if(!_0x6f3002[_0x7099('0x32')][_0x7099('0x38')](_0x7099('0x39'))){_0x45d208[_0x7099('0x21')]=qs[_0x7099('0x21')](_0x6f3002[_0x7099('0x32')][_0x7099('0x21')]);_0x45d208[_0x7099('0x1f')]=qs['offset'](_0x6f3002['query'][_0x7099('0x1f')]);}_0x45d208[_0x7099('0x3a')]=qs[_0x7099('0x3b')](_0x6f3002[_0x7099('0x32')]['sort']);_0x45d208[_0x7099('0x3c')]=qs['filters'](_['pick'](_0x6f3002[_0x7099('0x32')],_0x381a32['filters']),_0x21c7f1);if(_0x6f3002[_0x7099('0x32')][_0x7099('0x3d')]){_0x45d208[_0x7099('0x3c')]=_['merge'](_0x45d208[_0x7099('0x3c')],{'$or':_['map'](_0x21c7f1,function(_0x5b5f5c){if(_0x5b5f5c['type']!==_0x7099('0x3e')){var _0x40776f={};_0x40776f[_0x5b5f5c['name']]={'$like':'%'+_0x6f3002[_0x7099('0x32')][_0x7099('0x3d')]+'%'};return _0x40776f;}})});}_0x45d208=_[_0x7099('0x3f')]({},_0x45d208,_0x6f3002[_0x7099('0x40')]);var _0x5aa67a={'where':_0x45d208[_0x7099('0x3c')]};return db[_0x7099('0x2e')][_0x7099('0x22')](_0x5aa67a)[_0x7099('0x26')](function(_0x4d1186){_0x38490e[_0x7099('0x22')]=_0x4d1186;if(_0x6f3002[_0x7099('0x32')][_0x7099('0x41')]){_0x45d208['include']=[{'all':!![]}];}return db[_0x7099('0x2e')][_0x7099('0x42')](_0x45d208);})[_0x7099('0x26')](function(_0x1ad1c2){_0x38490e['rows']=_0x1ad1c2;return _0x38490e;})[_0x7099('0x26')](respondWithFilteredResult(_0x4906ad,_0x45d208))[_0x7099('0x43')](handleError(_0x4906ad,null));};exports[_0x7099('0x44')]=function(_0x2a42b0,_0x328977){var _0x575afc={'raw':!![],'where':{'id':_0x2a42b0[_0x7099('0x45')]['id']}},_0x1020b4={};_0x1020b4[_0x7099('0x31')]=_[_0x7099('0x33')](db[_0x7099('0x2e')]['rawAttributes']);_0x1020b4[_0x7099('0x32')]=_['keys'](_0x2a42b0[_0x7099('0x32')]);_0x1020b4['filters']=_[_0x7099('0x35')](_0x1020b4[_0x7099('0x31')],_0x1020b4[_0x7099('0x32')]);_0x575afc['attributes']=_[_0x7099('0x35')](_0x1020b4[_0x7099('0x31')],qs[_0x7099('0x37')](_0x2a42b0[_0x7099('0x32')][_0x7099('0x37')]));_0x575afc[_0x7099('0x36')]=_0x575afc[_0x7099('0x36')]['length']?_0x575afc[_0x7099('0x36')]:_0x1020b4[_0x7099('0x31')];if(_0x2a42b0[_0x7099('0x32')]['includeAll']){_0x575afc[_0x7099('0x46')]=[{'all':!![]}];}_0x575afc=_['merge']({},_0x575afc,_0x2a42b0[_0x7099('0x40')]);return db['Attachment'][_0x7099('0x47')](_0x575afc)[_0x7099('0x26')](handleEntityNotFound(_0x328977,null))[_0x7099('0x26')](respondWithResult(_0x328977,null))[_0x7099('0x43')](handleError(_0x328977,null));};exports[_0x7099('0x48')]=function(_0x13d81e,_0x68b7ad){var _0x51ddbe={'where':{'id':_0x13d81e[_0x7099('0x45')]['id']}},_0x35d19e={};_0x35d19e[_0x7099('0x31')]=_[_0x7099('0x33')](db[_0x7099('0x2e')]['rawAttributes']);_0x51ddbe[_0x7099('0x36')]=_[_0x7099('0x35')](_0x35d19e[_0x7099('0x31')],qs[_0x7099('0x37')](_0x13d81e[_0x7099('0x32')]['fields']));_0x51ddbe[_0x7099('0x36')]=_0x51ddbe[_0x7099('0x36')][_0x7099('0x49')]?_0x51ddbe[_0x7099('0x36')]:_0x35d19e[_0x7099('0x31')];if(_0x13d81e[_0x7099('0x32')][_0x7099('0x41')]){_0x51ddbe[_0x7099('0x46')]=[{'all':!![]}];}_0x51ddbe=_['merge']({},_0x51ddbe,_0x13d81e[_0x7099('0x40')]);return db['Attachment'][_0x7099('0x47')](_0x51ddbe)[_0x7099('0x26')](handleEntityNotFound(_0x68b7ad,null))[_0x7099('0x26')](function(_0x47e2ea){if(_0x47e2ea){var _0xc8549c=_0x47e2ea[_0x7099('0x4a')]({'plain':!![]});_0xc8549c=qs[_0x7099('0x4b')](_0xc8549c,['id',_0x7099('0x4c'),'updatedAt']);_0x13d81e[_0x7099('0x4d')]=_[_0x7099('0x4b')](_0x13d81e[_0x7099('0x4d')],['id',_0x7099('0x4c'),_0x7099('0x4e')]);return db['Attachment'][_0x7099('0x4f')](_[_0x7099('0x3f')](_0xc8549c,_0x13d81e['body']),{'include':_0x13d81e[_0x7099('0x32')][_0x7099('0x41')]?[{'all':!![]}]:undefined});}})[_0x7099('0x26')](respondWithResult(_0x68b7ad,0xc9))['catch'](handleError(_0x68b7ad,null));};exports[_0x7099('0x25')]=function(_0xb9d5cc,_0x2f6319){if(_0xb9d5cc[_0x7099('0x4d')]['id']){delete _0xb9d5cc['body']['id'];}return db[_0x7099('0x2e')]['find']({'where':{'id':_0xb9d5cc[_0x7099('0x45')]['id']}})[_0x7099('0x26')](handleEntityNotFound(_0x2f6319,null))[_0x7099('0x26')](saveUpdates(_0xb9d5cc[_0x7099('0x4d')],null))[_0x7099('0x26')](respondWithResult(_0x2f6319,null))[_0x7099('0x43')](handleError(_0x2f6319,null));};exports[_0x7099('0x27')]=function(_0x42ab0d,_0x49389b){return db[_0x7099('0x2e')][_0x7099('0x47')]({'where':{'id':_0x42ab0d[_0x7099('0x45')]['id']}})[_0x7099('0x26')](handleEntityNotFound(_0x49389b,null))[_0x7099('0x26')](removeEntity(_0x49389b,null))[_0x7099('0x43')](handleError(_0x49389b,null));};exports[_0x7099('0x4f')]=function(_0x54c05f,_0x27eefc,_0x5bbc8b){_0x54c05f[_0x7099('0x4d')][_0x7099('0x2a')]=_0x54c05f[_0x7099('0x50')][_0x7099('0x51')];_0x54c05f[_0x7099('0x4d')][_0x7099('0x52')]=_0x54c05f[_0x7099('0x50')][_0x7099('0x53')];_0x54c05f[_0x7099('0x4d')]['type']=_0x54c05f[_0x7099('0x50')][_0x7099('0x54')];return db[_0x7099('0x2e')][_0x7099('0x4f')](_0x54c05f[_0x7099('0x4d')])[_0x7099('0x26')](respondWithResult(_0x27eefc,0xc9))[_0x7099('0x43')](handleError(_0x27eefc,null));};exports[_0x7099('0x55')]=function(_0x5d6581,_0x1cb82c,_0x2fc3d2){return db[_0x7099('0x2e')][_0x7099('0x56')]({'where':{'id':_0x5d6581[_0x7099('0x45')]['id']},'raw':!![]})[_0x7099('0x26')](handleEntityNotFound(_0x1cb82c,null))['then'](function(_0x3535c7){if(_0x3535c7){var _0x3a60b3=_0x3535c7['ChatOfflineMessageId']!==null;var _0xe2918a=path[_0x7099('0x57')](config['root'],_0x7099('0x58'));if(_0x3a60b3){_0xe2918a=path[_0x7099('0x57')](_0xe2918a,'offline-chat/');}var _0x5c36f6=path[_0x7099('0x57')](_0xe2918a,_0x3535c7[_0x7099('0x52')]);return _0x1cb82c['download'](_0x5c36f6);}})[_0x7099('0x43')](handleError(_0x1cb82c,null));};
\ No newline at end of file
+var _0x5ddc=['reject','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','catch','show','params','length','find','clone','includeAll','merge','createdAt','body','omit','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','join','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x5ddc,0x140));var _0xc5dd=function(_0x30058b,_0x1b0da5){_0x30058b=_0x30058b-0x0;var _0x43f735=_0x5ddc[_0x30058b];return _0x43f735;};'use strict';var emlformat=require(_0xc5dd('0x0'));var rimraf=require(_0xc5dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5dd('0x2'));var rp=require(_0xc5dd('0x3'));var moment=require(_0xc5dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc5dd('0x5'));var util=require(_0xc5dd('0x6'));var path=require(_0xc5dd('0x7'));var sox=require(_0xc5dd('0x8'));var csv=require(_0xc5dd('0x9'));var ejs=require(_0xc5dd('0xa'));var fs=require('fs');var fs_extra=require(_0xc5dd('0xb'));var _=require(_0xc5dd('0xc'));var squel=require(_0xc5dd('0xd'));var crypto=require(_0xc5dd('0xe'));var jsforce=require(_0xc5dd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc5dd('0x9'));var querystring=require(_0xc5dd('0x10'));var Papa=require(_0xc5dd('0x11'));var Redis=require('ioredis');var authService=require(_0xc5dd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc5dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5dd('0x14'))(_0xc5dd('0x15'));var utils=require('../../config/utils');var config=require(_0xc5dd('0x16'));var licenseUtil=require(_0xc5dd('0x17'));var db=require(_0xc5dd('0x18'))['db'];function respondWithStatusCode(_0x1cc66a,_0x632fcd){_0x632fcd=_0x632fcd||0xcc;return function(_0x113a22){if(_0x113a22){return _0x1cc66a[_0xc5dd('0x19')](_0x632fcd);}return _0x1cc66a[_0xc5dd('0x1a')](_0x632fcd)[_0xc5dd('0x1b')]();};}function respondWithResult(_0x21fb08,_0xe7885d){_0xe7885d=_0xe7885d||0xc8;return function(_0x4bc761){if(_0x4bc761){return _0x21fb08['status'](_0xe7885d)['json'](_0x4bc761);}};}function respondWithFilteredResult(_0x233f10,_0x28237a){return function(_0x264a84){if(_0x264a84){var _0x116f17=typeof _0x28237a['offset']===_0xc5dd('0x1c')&&typeof _0x28237a[_0xc5dd('0x1d')]===_0xc5dd('0x1c');var _0x1ba399=_0x264a84[_0xc5dd('0x1e')];var _0x1a55e1=_0x116f17?0x0:_0x28237a[_0xc5dd('0x1f')];var _0x51f7e4=_0x116f17?_0x264a84[_0xc5dd('0x1e')]:_0x28237a['offset']+_0x28237a[_0xc5dd('0x1d')];var _0x10dc32;if(_0x51f7e4>=_0x1ba399){_0x51f7e4=_0x1ba399;_0x10dc32=0xc8;}else{_0x10dc32=0xce;}_0x233f10[_0xc5dd('0x1a')](_0x10dc32);return _0x233f10[_0xc5dd('0x20')](_0xc5dd('0x21'),_0x1a55e1+'-'+_0x51f7e4+'/'+_0x1ba399)[_0xc5dd('0x22')](_0x264a84);}return null;};}function patchUpdates(_0x3612ad){return function(_0x37a4ca){try{jsonpatch[_0xc5dd('0x23')](_0x37a4ca,_0x3612ad,!![]);}catch(_0x46bee7){return BPromise[_0xc5dd('0x24')](_0x46bee7);}return _0x37a4ca['save']();};}function saveUpdates(_0x173903,_0xed063b){return function(_0x194970){if(_0x194970){return _0x194970[_0xc5dd('0x25')](_0x173903)[_0xc5dd('0x26')](function(_0x35ef17){return _0x35ef17;});}return null;};}function removeEntity(_0x4751ba,_0x296ac6){return function(_0x4906bb){if(_0x4906bb){return _0x4906bb[_0xc5dd('0x27')]()['then'](function(){_0x4751ba[_0xc5dd('0x1a')](0xcc)[_0xc5dd('0x1b')]();});}};}function handleEntityNotFound(_0x56dc7e,_0x290f70){return function(_0xff5ff){if(!_0xff5ff){_0x56dc7e['sendStatus'](0x194);}return _0xff5ff;};}function handleError(_0x2eb89f,_0x5d2ef9){_0x5d2ef9=_0x5d2ef9||0x1f4;return function(_0x23ed3d){logger[_0xc5dd('0x28')](_0x23ed3d[_0xc5dd('0x29')]);if(_0x23ed3d[_0xc5dd('0x2a')]){delete _0x23ed3d[_0xc5dd('0x2a')];}_0x2eb89f[_0xc5dd('0x1a')](_0x5d2ef9)[_0xc5dd('0x2b')](_0x23ed3d);};}exports[_0xc5dd('0x2c')]=function(_0x4a3472,_0x3e46ab){var _0x1926ee={},_0x4a2483={},_0x1209b3={'count':0x0,'rows':[]};var _0x3abe0c=_[_0xc5dd('0x2d')](db[_0xc5dd('0x2e')][_0xc5dd('0x2f')],function(_0x119e68){return{'name':_0x119e68[_0xc5dd('0x30')],'type':_0x119e68[_0xc5dd('0x31')][_0xc5dd('0x32')]};});_0x4a2483[_0xc5dd('0x33')]=_[_0xc5dd('0x2d')](_0x3abe0c,_0xc5dd('0x2a'));_0x4a2483[_0xc5dd('0x34')]=_[_0xc5dd('0x35')](_0x4a3472[_0xc5dd('0x34')]);_0x4a2483[_0xc5dd('0x36')]=_[_0xc5dd('0x37')](_0x4a2483['model'],_0x4a2483[_0xc5dd('0x34')]);_0x1926ee['attributes']=_[_0xc5dd('0x37')](_0x4a2483[_0xc5dd('0x33')],qs[_0xc5dd('0x38')](_0x4a3472[_0xc5dd('0x34')][_0xc5dd('0x38')]));_0x1926ee[_0xc5dd('0x39')]=_0x1926ee[_0xc5dd('0x39')]['length']?_0x1926ee[_0xc5dd('0x39')]:_0x4a2483[_0xc5dd('0x33')];if(!_0x4a3472[_0xc5dd('0x34')][_0xc5dd('0x3a')]('nolimit')){_0x1926ee['limit']=qs[_0xc5dd('0x1d')](_0x4a3472['query'][_0xc5dd('0x1d')]);_0x1926ee['offset']=qs['offset'](_0x4a3472['query'][_0xc5dd('0x1f')]);}_0x1926ee[_0xc5dd('0x3b')]=qs[_0xc5dd('0x3c')](_0x4a3472[_0xc5dd('0x34')]['sort']);_0x1926ee[_0xc5dd('0x3d')]=qs['filters'](_[_0xc5dd('0x3e')](_0x4a3472['query'],_0x4a2483[_0xc5dd('0x36')]),_0x3abe0c);if(_0x4a3472[_0xc5dd('0x34')][_0xc5dd('0x3f')]){_0x1926ee[_0xc5dd('0x3d')]=_['merge'](_0x1926ee['where'],{'$or':_[_0xc5dd('0x2d')](_0x3abe0c,function(_0x4c3965){if(_0x4c3965[_0xc5dd('0x31')]!==_0xc5dd('0x40')){var _0x5be16d={};_0x5be16d[_0x4c3965['name']]={'$like':'%'+_0x4a3472[_0xc5dd('0x34')]['filter']+'%'};return _0x5be16d;}})});}_0x1926ee=_['merge']({},_0x1926ee,_0x4a3472[_0xc5dd('0x41')]);var _0x6e4163={'where':_0x1926ee['where']};return db[_0xc5dd('0x2e')][_0xc5dd('0x1e')](_0x6e4163)['then'](function(_0x3ce419){_0x1209b3['count']=_0x3ce419;if(_0x4a3472[_0xc5dd('0x34')]['includeAll']){_0x1926ee[_0xc5dd('0x42')]=[{'all':!![]}];}return db[_0xc5dd('0x2e')]['findAll'](_0x1926ee);})[_0xc5dd('0x26')](function(_0x398f18){_0x1209b3['rows']=_0x398f18;return _0x1209b3;})['then'](respondWithFilteredResult(_0x3e46ab,_0x1926ee))[_0xc5dd('0x43')](handleError(_0x3e46ab,null));};exports[_0xc5dd('0x44')]=function(_0x32dad6,_0x5f181d){var _0x35bfaf={'raw':!![],'where':{'id':_0x32dad6[_0xc5dd('0x45')]['id']}},_0x24733e={};_0x24733e[_0xc5dd('0x33')]=_[_0xc5dd('0x35')](db[_0xc5dd('0x2e')][_0xc5dd('0x2f')]);_0x24733e['query']=_['keys'](_0x32dad6['query']);_0x24733e[_0xc5dd('0x36')]=_['intersection'](_0x24733e[_0xc5dd('0x33')],_0x24733e[_0xc5dd('0x34')]);_0x35bfaf[_0xc5dd('0x39')]=_[_0xc5dd('0x37')](_0x24733e[_0xc5dd('0x33')],qs['fields'](_0x32dad6[_0xc5dd('0x34')][_0xc5dd('0x38')]));_0x35bfaf[_0xc5dd('0x39')]=_0x35bfaf['attributes'][_0xc5dd('0x46')]?_0x35bfaf[_0xc5dd('0x39')]:_0x24733e[_0xc5dd('0x33')];if(_0x32dad6[_0xc5dd('0x34')]['includeAll']){_0x35bfaf['include']=[{'all':!![]}];}_0x35bfaf=_['merge']({},_0x35bfaf,_0x32dad6[_0xc5dd('0x41')]);return db[_0xc5dd('0x2e')][_0xc5dd('0x47')](_0x35bfaf)[_0xc5dd('0x26')](handleEntityNotFound(_0x5f181d,null))['then'](respondWithResult(_0x5f181d,null))[_0xc5dd('0x43')](handleError(_0x5f181d,null));};exports[_0xc5dd('0x48')]=function(_0x4e657d,_0x11e046){var _0x4713b5={'where':{'id':_0x4e657d[_0xc5dd('0x45')]['id']}},_0x52d3ed={};_0x52d3ed[_0xc5dd('0x33')]=_[_0xc5dd('0x35')](db[_0xc5dd('0x2e')][_0xc5dd('0x2f')]);_0x4713b5[_0xc5dd('0x39')]=_['intersection'](_0x52d3ed[_0xc5dd('0x33')],qs[_0xc5dd('0x38')](_0x4e657d[_0xc5dd('0x34')][_0xc5dd('0x38')]));_0x4713b5[_0xc5dd('0x39')]=_0x4713b5['attributes'][_0xc5dd('0x46')]?_0x4713b5[_0xc5dd('0x39')]:_0x52d3ed[_0xc5dd('0x33')];if(_0x4e657d[_0xc5dd('0x34')][_0xc5dd('0x49')]){_0x4713b5[_0xc5dd('0x42')]=[{'all':!![]}];}_0x4713b5=_[_0xc5dd('0x4a')]({},_0x4713b5,_0x4e657d[_0xc5dd('0x41')]);return db['Attachment'][_0xc5dd('0x47')](_0x4713b5)[_0xc5dd('0x26')](handleEntityNotFound(_0x11e046,null))[_0xc5dd('0x26')](function(_0x5e7155){if(_0x5e7155){var _0x5bec58=_0x5e7155['get']({'plain':!![]});_0x5bec58=qs['omit'](_0x5bec58,['id',_0xc5dd('0x4b'),'updatedAt']);_0x4e657d[_0xc5dd('0x4c')]=_[_0xc5dd('0x4d')](_0x4e657d[_0xc5dd('0x4c')],['id','createdAt','updatedAt']);return db[_0xc5dd('0x2e')][_0xc5dd('0x4e')](_['merge'](_0x5bec58,_0x4e657d['body']),{'include':_0x4e657d['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xc5dd('0x26')](respondWithResult(_0x11e046,0xc9))[_0xc5dd('0x43')](handleError(_0x11e046,null));};exports[_0xc5dd('0x25')]=function(_0x474215,_0x41fe8a){if(_0x474215[_0xc5dd('0x4c')]['id']){delete _0x474215[_0xc5dd('0x4c')]['id'];}return db[_0xc5dd('0x2e')][_0xc5dd('0x47')]({'where':{'id':_0x474215[_0xc5dd('0x45')]['id']}})['then'](handleEntityNotFound(_0x41fe8a,null))['then'](saveUpdates(_0x474215[_0xc5dd('0x4c')],null))[_0xc5dd('0x26')](respondWithResult(_0x41fe8a,null))[_0xc5dd('0x43')](handleError(_0x41fe8a,null));};exports[_0xc5dd('0x27')]=function(_0x3cc8c0,_0x55d3e8){return db[_0xc5dd('0x2e')][_0xc5dd('0x47')]({'where':{'id':_0x3cc8c0[_0xc5dd('0x45')]['id']}})[_0xc5dd('0x26')](handleEntityNotFound(_0x55d3e8,null))['then'](removeEntity(_0x55d3e8,null))[_0xc5dd('0x43')](handleError(_0x55d3e8,null));};exports['create']=function(_0x17c1c7,_0x1f00d9,_0x2a7752){_0x17c1c7[_0xc5dd('0x4c')][_0xc5dd('0x2a')]=_0x17c1c7[_0xc5dd('0x4f')][_0xc5dd('0x50')];_0x17c1c7['body'][_0xc5dd('0x51')]=_0x17c1c7[_0xc5dd('0x4f')][_0xc5dd('0x52')];_0x17c1c7[_0xc5dd('0x4c')][_0xc5dd('0x31')]=_0x17c1c7[_0xc5dd('0x4f')][_0xc5dd('0x53')];return db['Attachment'][_0xc5dd('0x4e')](_0x17c1c7[_0xc5dd('0x4c')])[_0xc5dd('0x26')](respondWithResult(_0x1f00d9,0xc9))[_0xc5dd('0x43')](handleError(_0x1f00d9,null));};exports[_0xc5dd('0x54')]=function(_0x1165f9,_0x5d35de,_0x53963b){return db[_0xc5dd('0x2e')][_0xc5dd('0x55')]({'where':{'id':_0x1165f9[_0xc5dd('0x45')]['id']},'raw':!![]})[_0xc5dd('0x26')](handleEntityNotFound(_0x5d35de,null))[_0xc5dd('0x26')](function(_0x4c59f9){if(_0x4c59f9){var _0x551748=_0x4c59f9[_0xc5dd('0x56')]!==null;var _0x17d9d7=path['join'](config[_0xc5dd('0x57')],'server/files/attachments/');if(_0x551748){_0x17d9d7=path[_0xc5dd('0x58')](_0x17d9d7,'offline-chat/');}var _0x339eb0=path[_0xc5dd('0x58')](_0x17d9d7,_0x4c59f9[_0xc5dd('0x51')]);return _0x5d35de[_0xc5dd('0x54')](_0x339eb0);}})['catch'](handleError(_0x5d35de,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 9c2ac48..458349e 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 _0x64a6=['attachments','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0xf6c391,_0x1c7537){var _0x1f6ace=function(_0x387c7b){while(--_0x387c7b){_0xf6c391['push'](_0xf6c391['shift']());}};_0x1f6ace(++_0x1c7537);}(_0x64a6,0x1da));var _0x664a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x64a6[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x664a('0x0'));var util=require(_0x664a('0x1'));var logger=require(_0x664a('0x2'))(_0x664a('0x3'));var moment=require(_0x664a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x664a('0x5'));var config=require(_0x664a('0x6'));var attributes=require(_0x664a('0x7'));module[_0x664a('0x8')]=function(_0x3a4ce6,_0x3b3d35){return _0x3a4ce6[_0x664a('0x9')]('Attachment',attributes,{'tableName':_0x664a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a61=['Attachment','attachments','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x5a61,0x1f1));var _0x15a6=function(_0x4bcbc2,_0x46cbff){_0x4bcbc2=_0x4bcbc2-0x0;var _0xe5b888=_0x5a61[_0x4bcbc2];return _0xe5b888;};'use strict';var _=require(_0x15a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x15a6('0x1'));var BPromise=require(_0x15a6('0x2'));var rp=require(_0x15a6('0x3'));var fs=require('fs');var path=require(_0x15a6('0x4'));var rimraf=require(_0x15a6('0x5'));var config=require(_0x15a6('0x6'));var attributes=require('./attachment.attributes');module[_0x15a6('0x7')]=function(_0x22419c,_0x8e9f6){return _0x22419c[_0x15a6('0x8')](_0x15a6('0x9'),attributes,{'tableName':_0x15a6('0xa'),'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 60e65dd..8f93b29 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 _0x6c76=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateAttachment','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s'];(function(_0x3c549d,_0x1e8903){var _0xd134db=function(_0x512656){while(--_0x512656){_0x3c549d['push'](_0x3c549d['shift']());}};_0xd134db(++_0x1e8903);}(_0x6c76,0x184));var _0x66c7=function(_0x26df51,_0x534482){_0x26df51=_0x26df51-0x0;var _0x99842c=_0x6c76[_0x26df51];return _0x99842c;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['CreateAttachment']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['Attachment'][_0x66c7('0x14')](_0x5129f6[_0x66c7('0x15')],{'raw':_0x5129f6[_0x66c7('0x16')]?_0x5129f6[_0x66c7('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1853b2){logger[_0x66c7('0xa')](_0x66c7('0x17'),_0x5129f6);logger[_0x66c7('0x18')](_0x66c7('0x17'),_0x5129f6,JSON[_0x66c7('0xe')](_0x1853b2));_0x19f29d(_0x1853b2);})['catch'](function(_0x4ddbd2){logger[_0x66c7('0xf')]('CreateAttachment',_0x4ddbd2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0x4ddbd2[_0x66c7('0x11')]));});});};
\ No newline at end of file
+var _0xc788=['catch','CreateAttachment','body','options','raw','debug','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','message','Attachment,\x20%s,\x20%s','result'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc788,0xc4));var _0x8c78=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0xc788[_0x568cf0];return _0x360f81;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var moment=require(_0x8c78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c78('0x3'));var db=require(_0x8c78('0x4'))['db'];var utils=require(_0x8c78('0x5'));var logger=require(_0x8c78('0x6'))(_0x8c78('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c78('0x8'));var client=jayson[_0x8c78('0x9')][_0x8c78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ac27f,_0x205cc1,_0x4d54a5){return new BPromise(function(_0x247188,_0x299d9d){return client[_0x8c78('0xb')](_0x1ac27f,_0x4d54a5)[_0x8c78('0xc')](function(_0xdb0c17){logger[_0x8c78('0xd')]('Attachment,\x20%s,\x20%s',_0x205cc1,_0x8c78('0xe'));logger['debug'](_0x8c78('0xf'),_0x205cc1,_0x8c78('0xe'),JSON['stringify'](_0xdb0c17));if(_0xdb0c17[_0x8c78('0x10')]){if(_0xdb0c17[_0x8c78('0x10')]['code']===0x1f4){logger[_0x8c78('0x10')]('Attachment,\x20%s,\x20%s',_0x205cc1,_0xdb0c17['error'][_0x8c78('0x11')]);return _0x299d9d(_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);}logger[_0x8c78('0x10')](_0x8c78('0x12'),_0x205cc1,_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);return _0x247188(_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);}else{logger[_0x8c78('0xd')]('Attachment,\x20%s,\x20%s',_0x205cc1,_0x8c78('0xe'));_0x247188(_0xdb0c17[_0x8c78('0x13')]['message']);}})[_0x8c78('0x14')](function(_0x554464){logger[_0x8c78('0x10')](_0x8c78('0x12'),_0x205cc1,_0x554464);_0x299d9d(_0x554464);});});}exports[_0x8c78('0x15')]=function(_0x461eff){var _0x54eafa=this;return new Promise(function(_0x4f7bf9,_0x339d04){return db['Attachment']['create'](_0x461eff[_0x8c78('0x16')],{'raw':_0x461eff['options']?_0x461eff[_0x8c78('0x17')][_0x8c78('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x6c9a12){logger['info'](_0x8c78('0x15'),_0x461eff);logger[_0x8c78('0x19')]('CreateAttachment',_0x461eff,JSON[_0x8c78('0x1a')](_0x6c9a12));_0x4f7bf9(_0x6c9a12);})[_0x8c78('0x14')](function(_0x499603){logger[_0x8c78('0x10')](_0x8c78('0x15'),_0x499603[_0x8c78('0x11')],_0x461eff);_0x339d04(_0x54eafa[_0x8c78('0x10')](0x1f4,_0x499603[_0x8c78('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 118bc11..0fe5395 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x1e48bc,_0x5700f5){_0x1e48bc=_0x1e48bc-0x0;var _0x5ba90d=_0xdb28[_0x1e48bc];return _0x5ba90d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index f21dce6..dfcb3b7 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 _0x83c8=['Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','google','/login','profile','email','callback','clientID','secret','callbackURL','Setting','findOne','then','find','map','emails','value','admin','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x83c8,0x196));var _0x883c=function(_0xbb9b40,_0x51b63a){_0xbb9b40=_0xbb9b40-0x0;var _0x4cd1b3=_0x83c8[_0xbb9b40];return _0x4cd1b3;};'use strict';var _=require(_0x883c('0x0'));var passport=require(_0x883c('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x883c('0x2')];var moment=require(_0x883c('0x3'));var db=require(_0x883c('0x4'))['db'];var config=require(_0x883c('0x5'));var signToken=require(_0x883c('0x6'))[_0x883c('0x7')];var utils=require(_0x883c('0x8'));exports['login']=passport['authenticate'](_0x883c('0x9'),{'failureRedirect':_0x883c('0xa'),'scope':[_0x883c('0xb'),_0x883c('0xc')],'session':![]});exports[_0x883c('0xd')]=passport['authenticate'](_0x883c('0x9'),{'failureRedirect':_0x883c('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x883c('0x9')][_0x883c('0xe')]:'id','clientSecret':config[_0x883c('0x9')]?config[_0x883c('0x9')]['clientSecret']:_0x883c('0xf'),'callbackURL':config['google']?config['google'][_0x883c('0x10')]:''},function(_0x2a2777,_0x2e73f0,_0x1f3806,_0x5e8979){var _0x4fefe5,_0x344476;return db[_0x883c('0x11')][_0x883c('0x12')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x883c('0x13')](function(_0x23aadc){_0x4fefe5=_0x23aadc;return db['User'][_0x883c('0x14')]({'where':{'email':_[_0x883c('0x15')](_0x1f3806[_0x883c('0x16')],_0x883c('0x17')),'role':{'$or':[_0x883c('0x18'),'user','agent']}}});})[_0x883c('0x13')](function(_0xc33e84){_0x344476=_0xc33e84;if(_0x344476){if(_0x344476[_0x883c('0x19')]){return _0x5e8979(_0x883c('0x1a'));}else if(_0x4fefe5[_0x883c('0x1b')]>0x0){if(_0x344476[_0x883c('0x1c')]){if(moment(_0x344476[_0x883c('0x1d')])[_0x883c('0x1e')](_0x4fefe5[_0x883c('0x1b')],_0x883c('0x1f'))>moment()){return _0x5e8979(_0x883c('0x1a'));}else{return utils['clearBlockUser'](_0x344476,0x0,![],null)[_0x883c('0x13')](function(){return utils[_0x883c('0x20')](_0x344476);})[_0x883c('0x13')](function(){return _0x5e8979(null,_0x344476);});}}else{return utils[_0x883c('0x20')](_0x344476)[_0x883c('0x13')](function(){return _0x5e8979(null,_0x344476);});}}else{return utils[_0x883c('0x20')](_0x344476)[_0x883c('0x13')](function(){return _0x5e8979(null,_0x344476);});}}return _0x5e8979(_0x883c('0x1a'));})[_0x883c('0x21')](function(_0x3f389c){_0x5e8979(_0x3f389c);});}));
\ No newline at end of file
+var _0xfa15=['getLicense','lodash','passport','../../mysqldb','../../components/auth/service','../../config/utils','login','authenticate','/login','profile','email','google','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes'];(function(_0x4a9f71,_0x1db1ce){var _0x1134cd=function(_0x3e456d){while(--_0x3e456d){_0x4a9f71['push'](_0x4a9f71['shift']());}};_0x1134cd(++_0x1db1ce);}(_0xfa15,0xa6));var _0x5fa1=function(_0x13485b,_0x29fb3e){_0x13485b=_0x13485b-0x0;var _0x4ae5e8=_0xfa15[_0x13485b];return _0x4ae5e8;};'use strict';var _=require(_0x5fa1('0x0'));var passport=require(_0x5fa1('0x1'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require('moment');var db=require(_0x5fa1('0x2'))['db'];var config=require('../../config/environment');var signToken=require(_0x5fa1('0x3'))['signToken'];var utils=require(_0x5fa1('0x4'));exports[_0x5fa1('0x5')]=passport[_0x5fa1('0x6')]('google',{'failureRedirect':_0x5fa1('0x7'),'scope':[_0x5fa1('0x8'),_0x5fa1('0x9')],'session':![]});exports['callback']=passport[_0x5fa1('0x6')](_0x5fa1('0xa'),{'failureRedirect':'/login','session':![]});passport[_0x5fa1('0xb')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x5fa1('0xc')]:'id','clientSecret':config[_0x5fa1('0xa')]?config['google']['clientSecret']:_0x5fa1('0xd'),'callbackURL':config[_0x5fa1('0xa')]?config[_0x5fa1('0xa')][_0x5fa1('0xe')]:''},function(_0x40eba5,_0x2cb3ea,_0x22fcc4,_0x207902){var _0x1f010c,_0x3af1eb;return db[_0x5fa1('0xf')][_0x5fa1('0x10')]({'where':{'id':0x1},'attributes':[_0x5fa1('0x11'),_0x5fa1('0x12')],'raw':!![]})[_0x5fa1('0x13')](function(_0x379d1e){_0x1f010c=_0x379d1e;return db['User']['find']({'where':{'email':_[_0x5fa1('0x14')](_0x22fcc4[_0x5fa1('0x15')],_0x5fa1('0x16')),'role':{'$or':[_0x5fa1('0x17'),_0x5fa1('0x18'),_0x5fa1('0x19')]}}});})[_0x5fa1('0x13')](function(_0x3ef4ab){_0x3af1eb=_0x3ef4ab;if(_0x3af1eb){if(_0x3af1eb[_0x5fa1('0x1a')]){return _0x207902(_0x5fa1('0x1b'));}else if(_0x1f010c[_0x5fa1('0x12')]>0x0){if(_0x3af1eb[_0x5fa1('0x1c')]){if(moment(_0x3af1eb[_0x5fa1('0x1d')])[_0x5fa1('0x1e')](_0x1f010c[_0x5fa1('0x12')],_0x5fa1('0x1f'))>moment()){return _0x207902('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x3af1eb,0x0,![],null)['then'](function(){return utils['getLicense'](_0x3af1eb);})[_0x5fa1('0x13')](function(){return _0x207902(null,_0x3af1eb);});}}else{return utils[_0x5fa1('0x20')](_0x3af1eb)[_0x5fa1('0x13')](function(){return _0x207902(null,_0x3af1eb);});}}else{return utils[_0x5fa1('0x20')](_0x3af1eb)[_0x5fa1('0x13')](function(){return _0x207902(null,_0x3af1eb);});}}return _0x207902(_0x5fa1('0x1b'));})['catch'](function(_0x13e4ef){_0x207902(_0x13e4ef);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 0520ffe..c55aedc 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 _0x7b04=['Router','./authGoogle.controller','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports','passport'];(function(_0x28c959,_0x1b5063){var _0x1815ef=function(_0x7af2be){while(--_0x7af2be){_0x28c959['push'](_0x28c959['shift']());}};_0x1815ef(++_0x1b5063);}(_0x7b04,0x12b));var _0x47b0=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x7b04[_0x2235bf];return _0x4c3a64;};'use strict';var express=require('express');var passport=require(_0x47b0('0x0'));var router=express[_0x47b0('0x1')]();var controller=require(_0x47b0('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x47b0('0x3'));router[_0x47b0('0x4')]('/',controller[_0x47b0('0x5')]);router[_0x47b0('0x4')](_0x47b0('0x6'),controller['callback'],authService[_0x47b0('0x7')],userController[_0x47b0('0x5')],authService[_0x47b0('0x8')]);module[_0x47b0('0x9')]=router;
\ No newline at end of file
+var _0x8756=['setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login'];(function(_0x394eda,_0x2b141a){var _0x3338d1=function(_0x3d3d96){while(--_0x3d3d96){_0x394eda['push'](_0x394eda['shift']());}};_0x3338d1(++_0x2b141a);}(_0x8756,0xc2));var _0x6875=function(_0x134258,_0x44296d){_0x134258=_0x134258-0x0;var _0x4fa42f=_0x8756[_0x134258];return _0x4fa42f;};'use strict';var express=require(_0x6875('0x0'));var passport=require(_0x6875('0x1'));var router=express[_0x6875('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x6875('0x3'));var authService=require(_0x6875('0x4'));router[_0x6875('0x5')]('/',controller['login']);router[_0x6875('0x5')](_0x6875('0x6'),controller[_0x6875('0x7')],authService[_0x6875('0x8')],userController[_0x6875('0x9')],authService[_0x6875('0xa')]);module[_0x6875('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 260fa3d..c0e1f42 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 _0xfc03=['login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','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','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','save','use','util','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','role','disabled','blocked','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','blockedAt','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','error','status','send'];(function(_0x2520ab,_0x3c456a){var _0x597c0d=function(_0x5a225c){while(--_0x5a225c){_0x2520ab['push'](_0x2520ab['shift']());}};_0x597c0d(++_0x3c456a);}(_0xfc03,0x16f));var _0x3fc0=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xfc03[_0x2e4e19];return _0x9ba20b;};'use strict';var util=require(_0x3fc0('0x0'));var passport=require('passport');var LocalStrategy=require(_0x3fc0('0x1'))[_0x3fc0('0x2')];var jayson=require('jayson/promise');var _=require(_0x3fc0('0x3'));var rs=require('randomstring');var moment=require(_0x3fc0('0x4'));var db=require(_0x3fc0('0x5'))['db'];var authService=require(_0x3fc0('0x6'));var utils=require(_0x3fc0('0x7'));var client=jayson[_0x3fc0('0x8')][_0x3fc0('0x9')]({'port':0x232b});function localAuthenticate(_0x2b4ef6,_0xeeb912,_0x55eac5,_0x2fb1a6){var _0x5f52b5,_0x1369ac;return db[_0x3fc0('0xa')][_0x3fc0('0xb')]({'where':{'id':0x1},'attributes':[_0x3fc0('0xc'),'blockDuration'],'raw':!![]})[_0x3fc0('0xd')](function(_0x929f8f){_0x5f52b5=_0x929f8f;return _0x2b4ef6[_0x3fc0('0xb')]({'attributes':['id',_0x3fc0('0xe'),_0x3fc0('0xf'),'salt',_0x3fc0('0x10'),_0x3fc0('0x11'),_0x3fc0('0x12'),'blockedAt',_0x3fc0('0x13')],'where':{'name':_0xeeb912,'role':{'$or':['admin',_0x3fc0('0x14'),_0x3fc0('0x15')]}}});})['then'](function(_0x3fe564){if(!_0x3fe564||_0x3fe564&&_0x3fe564[_0x3fc0('0xe')]!==_0xeeb912){throw new Error(_0x3fc0('0x16'));}else{_0x1369ac=_0x3fe564;return _0x1369ac;}})['then'](function(){_0x1369ac[_0x3fc0('0x17')](_0x55eac5,function(_0x3ac8c3,_0x367ce1){var _0x27619a=_0x1369ac['loginAttempts']+0x1;if(_0x3ac8c3){return _0x2fb1a6(_0x3ac8c3);}else if(!_0x367ce1){if(_0x1369ac[_0x3fc0('0x11')]){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}else if(_0x5f52b5[_0x3fc0('0xc')]>0x0){if(_0x1369ac['blocked']){if(_0x5f52b5[_0x3fc0('0x18')]>0x0){if(moment(_0x1369ac['blockedAt'])[_0x3fc0('0x19')](_0x5f52b5[_0x3fc0('0x18')],'minutes')>moment()){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}else{return utils[_0x3fc0('0x1a')](_0x1369ac,_0x27619a,![],null)[_0x3fc0('0xd')](function(){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});});}}else{return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}}else{if(_0x27619a>=_0x5f52b5[_0x3fc0('0xc')]){return utils[_0x3fc0('0x1a')](_0x1369ac,0x0,!![],moment())[_0x3fc0('0xd')](function(){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});});}else{return utils['clearBlockUser'](_0x1369ac,_0x27619a,![],null)[_0x3fc0('0xd')](function(){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});});}}}else{return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}}else{if(_0x1369ac[_0x3fc0('0x11')]){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}else if(_0x5f52b5[_0x3fc0('0xc')]>0x0){if(_0x1369ac['blocked']){if(_0x5f52b5[_0x3fc0('0x18')]>0x0){if(moment(_0x1369ac[_0x3fc0('0x1b')])[_0x3fc0('0x19')](_0x5f52b5[_0x3fc0('0x18')],_0x3fc0('0x1c'))>moment()){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}else{return utils[_0x3fc0('0x1a')](_0x1369ac,0x0,![],null)[_0x3fc0('0xd')](function(){return utils[_0x3fc0('0x1d')](_0x1369ac);})[_0x3fc0('0xd')](function(){return _0x2fb1a6(null,_0x1369ac);});}}else{return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}}else{return utils[_0x3fc0('0x1a')](_0x1369ac,0x0,![],null)[_0x3fc0('0xd')](function(){return utils[_0x3fc0('0x1d')](_0x1369ac);})[_0x3fc0('0xd')](function(){return _0x2fb1a6(null,_0x1369ac);})[_0x3fc0('0x1e')](function(_0x4f5111){return _0x2fb1a6(null,![],_0x4f5111);});}}else{if(_0x1369ac[_0x3fc0('0x12')]){return _0x2fb1a6(null,![],{'message':_0x3fc0('0x16')});}else{return utils[_0x3fc0('0x1d')](_0x1369ac)[_0x3fc0('0xd')](function(){return _0x2fb1a6(null,_0x1369ac);});}}}});})['catch'](function(_0x134317){return _0x2fb1a6(null,![],_0x134317);});}function sendServiceMail(_0x197dfa){return db[_0x3fc0('0x1f')][_0x3fc0('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x3fc0('0x21')],'include':[{'model':db[_0x3fc0('0x22')],'as':_0x3fc0('0x23')}]})[_0x3fc0('0xd')](function(_0x29aa32){if(!_0x29aa32){throw new Error(_0x3fc0('0x24'));}var _0x485f0c={'tls':{'rejectUnauthorized':![]}};if(_0x29aa32[_0x3fc0('0x23')][_0x3fc0('0x25')]){_0x485f0c[_0x3fc0('0x25')]=_0x29aa32[_0x3fc0('0x23')][_0x3fc0('0x25')];}else{_0x485f0c[_0x3fc0('0x26')]=_0x29aa32[_0x3fc0('0x23')][_0x3fc0('0x26')];_0x485f0c['port']=_0x29aa32['Smtp'][_0x3fc0('0x27')];_0x485f0c['secure']=_0x29aa32[_0x3fc0('0x23')][_0x3fc0('0x28')];}if(_0x29aa32[_0x3fc0('0x23')][_0x3fc0('0x29')]){_0x485f0c[_0x3fc0('0x2a')]={'user':_0x29aa32['Smtp']['user'],'pass':_0x29aa32[_0x3fc0('0x23')][_0x3fc0('0x2b')]};}var _0x151492={'account':_0x485f0c,'message':_[_0x3fc0('0x2c')]({'from':util[_0x3fc0('0x2d')]('\x22%s\x22\x20<%s>',_0x29aa32[_0x3fc0('0xe')],_0x29aa32[_0x3fc0('0x21')]||_0x29aa32[_0x3fc0('0x23')]['user'])},_0x197dfa)};return client[_0x3fc0('0x2e')](_0x3fc0('0x2f'),_0x151492);})[_0x3fc0('0xd')](function(_0x2eee6e){if(_0x2eee6e['error']){throw new Error(util[_0x3fc0('0x2d')](_0x3fc0('0x30'),_0x2eee6e['error'][_0x3fc0('0x31')]||JSON['stringify'](_0x2eee6e[_0x3fc0('0x32')])));}return!![];});}function handleError(_0x193f74,_0xc97121,_0x2db02e){return _0x193f74[_0x3fc0('0x33')](_0xc97121||0x1f4)[_0x3fc0('0x34')]({'message':_0x2db02e?_0x2db02e[_0x3fc0('0x31')]||_0x2db02e:''});}exports[_0x3fc0('0x35')]=function(_0x5bb04d,_0x2e479f,_0x41b4b3){passport['authenticate'](_0x3fc0('0x36'),function(_0x145442,_0x2af7c6,_0x28b4d5){var _0x21de4c=_0x145442||_0x28b4d5;if(_0x21de4c){return handleError(_0x2e479f,0x191,_0x21de4c);}if(!_0x2af7c6){return handleError(_0x2e479f,0x194,{'message':_0x3fc0('0x37')});}else{var _0x5176fb={'payload':{'id':_0x2af7c6['id'],'role':_0x2af7c6['role']},'options':{'expiresIn':0x15180}};return authService[_0x3fc0('0x38')](_0x5176fb)[_0x3fc0('0xd')](function(_0x35310e){_0x2e479f[_0x3fc0('0x39')]({'id':_0x2af7c6['id'],'token':_0x35310e,'statusCall':'','isAlreadyLogged':_0x2af7c6[_0x3fc0('0x3a')]});});}})(_0x5bb04d,_0x2e479f,_0x41b4b3);};exports['forgot']=function(_0x53b45e,_0x5c87af,_0x1bc6ad){if(!_0x53b45e[_0x3fc0('0x3b')][_0x3fc0('0x21')]){return handleError(_0x5c87af,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5e3d79=rs[_0x3fc0('0x3c')]();_0x53b45e[_0x3fc0('0x3b')][_0x3fc0('0x21')]=_0x53b45e[_0x3fc0('0x3b')]['email']['trim']()[_0x3fc0('0x3d')]();var _0x2a45dc;return db['Setting'][_0x3fc0('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3fc0('0x18')],'raw':!![]})[_0x3fc0('0xd')](function(_0x33af75){_0x2a45dc=_0x33af75;return db[_0x3fc0('0x3e')][_0x3fc0('0x20')]({'where':{'email':_0x53b45e[_0x3fc0('0x3b')][_0x3fc0('0x21')]}});})[_0x3fc0('0xd')](function(_0x508137){if(!_0x508137){throw new Error(_0x3fc0('0x3f'));}if(_0x508137['disabled']){throw new Error(_0x3fc0('0x40'));}if(_0x508137[_0x3fc0('0x12')]){if(moment(_0x508137[_0x3fc0('0x1b')])[_0x3fc0('0x19')](_0x2a45dc[_0x3fc0('0x18')],'minutes')>moment()){throw new Error(_0x3fc0('0x41'));}else{_0x508137[_0x3fc0('0x12')]=![];_0x508137[_0x3fc0('0x1b')]=null;}}_0x508137[_0x3fc0('0x42')]=_0x5e3d79;_0x508137['resetPasswordExpires']=Date[_0x3fc0('0x43')]()+0x36ee80;return _0x508137['save']();})[_0x3fc0('0xd')](function(){return sendServiceMail({'to':_0x53b45e[_0x3fc0('0x3b')][_0x3fc0('0x21')],'subject':_0x3fc0('0x44'),'text':_0x3fc0('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x3fc0('0x46')+_0x53b45e[_0x3fc0('0x47')][_0x3fc0('0x26')]+'/reset/'+_0x5e3d79+'\x0a\x0a'+_0x3fc0('0x48')});})[_0x3fc0('0xd')](function(){_0x5c87af['status'](0xc8)[_0x3fc0('0x34')]({'message':_0x3fc0('0x49')});})[_0x3fc0('0x1e')](function(_0x51489b){return handleError(_0x5c87af,0x1f4,_0x51489b);});};exports['reset']=function(_0x3a35ac,_0xa3de5a,_0xb70836){return db['User'][_0x3fc0('0x20')]({'where':{'resetPasswordToken':_0x3a35ac['params'][_0x3fc0('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x5be8cc){if(!_0x5be8cc){throw new Error(_0x3fc0('0x4b'));}return db[_0x3fc0('0xa')][_0x3fc0('0xb')]({'attributes':['id',_0x3fc0('0x4c'),_0x3fc0('0x4d'),_0x3fc0('0x4e')]})['then'](function(_0x2cf279){if(_0x2cf279[_0x3fc0('0x4c')])authService['validatePasswordPattern'](_0x3a35ac['body'][_0x3fc0('0xf')]);if(!_0x2cf279[_0x3fc0('0x4d')]||!_0x5be8cc[_0x3fc0('0x4f')])return _0x5be8cc;authService[_0x3fc0('0x50')](_0x3a35ac[_0x3fc0('0x3b')][_0x3fc0('0xf')],_0x5be8cc[_0x3fc0('0x4f')],_0x2cf279[_0x3fc0('0x4e')]);return _0x5be8cc;})[_0x3fc0('0xd')](function(){_0x5be8cc[_0x3fc0('0xf')]=_0x3a35ac[_0x3fc0('0x3b')][_0x3fc0('0xf')];_0x5be8cc['resetPasswordToken']=null;_0x5be8cc[_0x3fc0('0x51')]=null;return _0x5be8cc[_0x3fc0('0x52')]();});})[_0x3fc0('0xd')](function(){_0xa3de5a[_0x3fc0('0x33')](0xc8)[_0x3fc0('0x34')]({'message':'Password\x20reset!'});})[_0x3fc0('0x1e')](function(_0x57b6d0){return handleError(_0xa3de5a,0x1f4,_0x57b6d0);});};passport[_0x3fc0('0x53')](new LocalStrategy({'usernameField':_0x3fc0('0xe'),'passwordField':_0x3fc0('0xf')},function(_0x10c05b,_0x519973,_0x1656c7){return localAuthenticate(db[_0x3fc0('0x3e')],_0x10c05b,_0x519973,_0x1656c7);}));
\ No newline at end of file
+var _0x8e0d=['auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','find','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordExpires','send','Password\x20reset!','use','util','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','then','salt','role','disabled','loginAttempts','user','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication'];(function(_0x2fa393,_0x57e26d){var _0x15a4fb=function(_0x2a8eb9){while(--_0x2a8eb9){_0x2fa393['push'](_0x2fa393['shift']());}};_0x15a4fb(++_0x57e26d);}(_0x8e0d,0x82));var _0xd8e0=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x8e0d[_0x531d15];return _0x271a18;};'use strict';var util=require(_0xd8e0('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xd8e0('0x1')];var jayson=require(_0xd8e0('0x2'));var _=require('lodash');var rs=require(_0xd8e0('0x3'));var moment=require(_0xd8e0('0x4'));var db=require(_0xd8e0('0x5'))['db'];var authService=require(_0xd8e0('0x6'));var utils=require('../../config/utils');var client=jayson['client'][_0xd8e0('0x7')]({'port':0x232b});function localAuthenticate(_0x33ff41,_0x42d42b,_0x1e4616,_0x5e9735){var _0xd0c45c,_0x144a8a;return db[_0xd8e0('0x8')][_0xd8e0('0x9')]({'where':{'id':0x1},'attributes':[_0xd8e0('0xa'),'blockDuration'],'raw':!![]})[_0xd8e0('0xb')](function(_0x565f45){_0xd0c45c=_0x565f45;return _0x33ff41[_0xd8e0('0x9')]({'attributes':['id','name','password',_0xd8e0('0xc'),_0xd8e0('0xd'),_0xd8e0('0xe'),'blocked','blockedAt',_0xd8e0('0xf')],'where':{'name':_0x42d42b,'role':{'$or':['admin',_0xd8e0('0x10'),'agent']}}});})['then'](function(_0x496593){if(!_0x496593||_0x496593&&_0x496593[_0xd8e0('0x11')]!==_0x42d42b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x144a8a=_0x496593;return _0x144a8a;}})[_0xd8e0('0xb')](function(){_0x144a8a[_0xd8e0('0x12')](_0x1e4616,function(_0x2f0004,_0x14e38b){var _0x2689d3=_0x144a8a[_0xd8e0('0xf')]+0x1;if(_0x2f0004){return _0x5e9735(_0x2f0004);}else if(!_0x14e38b){if(_0x144a8a[_0xd8e0('0xe')]){return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}else if(_0xd0c45c[_0xd8e0('0xa')]>0x0){if(_0x144a8a['blocked']){if(_0xd0c45c[_0xd8e0('0x14')]>0x0){if(moment(_0x144a8a[_0xd8e0('0x15')])[_0xd8e0('0x16')](_0xd0c45c[_0xd8e0('0x14')],_0xd8e0('0x17'))>moment()){return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}else{return utils[_0xd8e0('0x18')](_0x144a8a,_0x2689d3,![],null)[_0xd8e0('0xb')](function(){return _0x5e9735(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}}else{if(_0x2689d3>=_0xd0c45c[_0xd8e0('0xa')]){return utils['clearBlockUser'](_0x144a8a,0x0,!![],moment())[_0xd8e0('0xb')](function(){return _0x5e9735(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x144a8a,_0x2689d3,![],null)['then'](function(){return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});});}}}else{return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}}else{if(_0x144a8a['disabled']){return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}else if(_0xd0c45c[_0xd8e0('0xa')]>0x0){if(_0x144a8a[_0xd8e0('0x19')]){if(_0xd0c45c[_0xd8e0('0x14')]>0x0){if(moment(_0x144a8a[_0xd8e0('0x15')])[_0xd8e0('0x16')](_0xd0c45c['blockDuration'],_0xd8e0('0x17'))>moment()){return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}else{return utils['clearBlockUser'](_0x144a8a,0x0,![],null)['then'](function(){return utils['getLicense'](_0x144a8a);})[_0xd8e0('0xb')](function(){return _0x5e9735(null,_0x144a8a);});}}else{return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}}else{return utils[_0xd8e0('0x18')](_0x144a8a,0x0,![],null)[_0xd8e0('0xb')](function(){return utils[_0xd8e0('0x1a')](_0x144a8a);})['then'](function(){return _0x5e9735(null,_0x144a8a);})['catch'](function(_0x1a29c7){return _0x5e9735(null,![],_0x1a29c7);});}}else{if(_0x144a8a[_0xd8e0('0x19')]){return _0x5e9735(null,![],{'message':_0xd8e0('0x13')});}else{return utils[_0xd8e0('0x1a')](_0x144a8a)['then'](function(){return _0x5e9735(null,_0x144a8a);});}}}});})[_0xd8e0('0x1b')](function(_0x3da15f){return _0x5e9735(null,![],_0x3da15f);});}function sendServiceMail(_0xd60219){return db[_0xd8e0('0x1c')]['find']({'where':{'service':!![]},'attributes':['id',_0xd8e0('0x11'),_0xd8e0('0x1d')],'include':[{'model':db[_0xd8e0('0x1e')],'as':_0xd8e0('0x1f')}]})[_0xd8e0('0xb')](function(_0x345bf3){if(!_0x345bf3){throw new Error(_0xd8e0('0x20'));}var _0x559d97={'tls':{'rejectUnauthorized':![]}};if(_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x21')]){_0x559d97[_0xd8e0('0x21')]=_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x21')];}else{_0x559d97[_0xd8e0('0x22')]=_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x22')];_0x559d97[_0xd8e0('0x23')]=_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x23')];_0x559d97['secure']=_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x24')];}if(_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x25')]){_0x559d97[_0xd8e0('0x26')]={'user':_0x345bf3[_0xd8e0('0x1f')]['user'],'pass':_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x27')]};}var _0x4637e8={'account':_0x559d97,'message':_[_0xd8e0('0x28')]({'from':util[_0xd8e0('0x29')](_0xd8e0('0x2a'),_0x345bf3['name'],_0x345bf3[_0xd8e0('0x1d')]||_0x345bf3[_0xd8e0('0x1f')][_0xd8e0('0x10')])},_0xd60219)};return client['request'](_0xd8e0('0x2b'),_0x4637e8);})['then'](function(_0x1dd7ca){if(_0x1dd7ca[_0xd8e0('0x2c')]){throw new Error(util[_0xd8e0('0x29')](_0xd8e0('0x2d'),_0x1dd7ca[_0xd8e0('0x2c')][_0xd8e0('0x2e')]||JSON['stringify'](_0x1dd7ca[_0xd8e0('0x2c')])));}return!![];});}function handleError(_0x14884f,_0x171a9e,_0x1dd227){return _0x14884f[_0xd8e0('0x2f')](_0x171a9e||0x1f4)['send']({'message':_0x1dd227?_0x1dd227[_0xd8e0('0x2e')]||_0x1dd227:''});}exports[_0xd8e0('0x30')]=function(_0x1f6041,_0x37acd4,_0x221d4b){passport[_0xd8e0('0x12')](_0xd8e0('0x31'),function(_0x298a6e,_0x1c9c45,_0x4b3d02){var _0xbee321=_0x298a6e||_0x4b3d02;if(_0xbee321){return handleError(_0x37acd4,0x191,_0xbee321);}if(!_0x1c9c45){return handleError(_0x37acd4,0x194,{'message':_0xd8e0('0x32')});}else{var _0x19b066={'payload':{'id':_0x1c9c45['id'],'role':_0x1c9c45[_0xd8e0('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xd8e0('0x33')](_0x19b066)[_0xd8e0('0xb')](function(_0x2a9b44){_0x37acd4['json']({'id':_0x1c9c45['id'],'token':_0x2a9b44,'statusCall':'','isAlreadyLogged':_0x1c9c45[_0xd8e0('0x34')]});});}})(_0x1f6041,_0x37acd4,_0x221d4b);};exports[_0xd8e0('0x35')]=function(_0x5f6426,_0x286035,_0x1cac75){if(!_0x5f6426[_0xd8e0('0x36')]['email']){return handleError(_0x286035,0x1f4,{'message':_0xd8e0('0x37')});}var _0x3f0f31=rs['generate']();_0x5f6426[_0xd8e0('0x36')][_0xd8e0('0x1d')]=_0x5f6426[_0xd8e0('0x36')][_0xd8e0('0x1d')][_0xd8e0('0x38')]()[_0xd8e0('0x39')]();var _0x41ec9c;return db[_0xd8e0('0x8')][_0xd8e0('0x9')]({'where':{'id':0x1},'attributes':[_0xd8e0('0xa'),_0xd8e0('0x14')],'raw':!![]})[_0xd8e0('0xb')](function(_0x1f5ebb){_0x41ec9c=_0x1f5ebb;return db['User']['find']({'where':{'email':_0x5f6426[_0xd8e0('0x36')]['email']}});})[_0xd8e0('0xb')](function(_0x41eae2){if(!_0x41eae2){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x41eae2[_0xd8e0('0xe')]){throw new Error(_0xd8e0('0x3a'));}if(_0x41eae2[_0xd8e0('0x19')]){if(moment(_0x41eae2[_0xd8e0('0x15')])[_0xd8e0('0x16')](_0x41ec9c['blockDuration'],_0xd8e0('0x17'))>moment()){throw new Error(_0xd8e0('0x3b'));}else{_0x41eae2[_0xd8e0('0x19')]=![];_0x41eae2['blockedAt']=null;}}_0x41eae2['resetPasswordToken']=_0x3f0f31;_0x41eae2['resetPasswordExpires']=Date[_0xd8e0('0x3c')]()+0x36ee80;return _0x41eae2[_0xd8e0('0x3d')]();})[_0xd8e0('0xb')](function(){return sendServiceMail({'to':_0x5f6426[_0xd8e0('0x36')][_0xd8e0('0x1d')],'subject':_0xd8e0('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xd8e0('0x3f')+_0xd8e0('0x40')+_0x5f6426[_0xd8e0('0x41')][_0xd8e0('0x22')]+_0xd8e0('0x42')+_0x3f0f31+'\x0a\x0a'+_0xd8e0('0x43')});})[_0xd8e0('0xb')](function(){_0x286035[_0xd8e0('0x2f')](0xc8)['send']({'message':_0xd8e0('0x44')});})[_0xd8e0('0x1b')](function(_0x4b8a78){return handleError(_0x286035,0x1f4,_0x4b8a78);});};exports['reset']=function(_0x3cec45,_0x33ce72,_0x4615be){return db[_0xd8e0('0x45')][_0xd8e0('0x46')]({'where':{'resetPasswordToken':_0x3cec45[_0xd8e0('0x47')][_0xd8e0('0x48')],'resetPasswordExpires':{'$gt':Date[_0xd8e0('0x3c')]()}}})[_0xd8e0('0xb')](function(_0x593c8f){if(!_0x593c8f){throw new Error(_0xd8e0('0x49'));}return db[_0xd8e0('0x8')][_0xd8e0('0x9')]({'attributes':['id','securePassword',_0xd8e0('0x4a'),_0xd8e0('0x4b')]})[_0xd8e0('0xb')](function(_0x252be7){if(_0x252be7['securePassword'])authService[_0xd8e0('0x4c')](_0x3cec45[_0xd8e0('0x36')][_0xd8e0('0x4d')]);if(!_0x252be7[_0xd8e0('0x4a')]||!_0x593c8f[_0xd8e0('0x4e')])return _0x593c8f;authService[_0xd8e0('0x4f')](_0x3cec45[_0xd8e0('0x36')][_0xd8e0('0x4d')],_0x593c8f[_0xd8e0('0x4e')],_0x252be7['passwordHistoryLimit']);return _0x593c8f;})[_0xd8e0('0xb')](function(){_0x593c8f['password']=_0x3cec45[_0xd8e0('0x36')]['password'];_0x593c8f['resetPasswordToken']=null;_0x593c8f[_0xd8e0('0x50')]=null;return _0x593c8f[_0xd8e0('0x3d')]();});})[_0xd8e0('0xb')](function(){_0x33ce72[_0xd8e0('0x2f')](0xc8)[_0xd8e0('0x51')]({'message':_0xd8e0('0x52')});})[_0xd8e0('0x1b')](function(_0x48fa01){return handleError(_0x33ce72,0x1f4,_0x48fa01);});};passport[_0xd8e0('0x53')](new LocalStrategy({'usernameField':_0xd8e0('0x11'),'passwordField':_0xd8e0('0x4d')},function(_0x2e80ed,_0x4967dd,_0x16ddb6){return localAuthenticate(db[_0xd8e0('0x45')],_0x2e80ed,_0x4967dd,_0x16ddb6);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 3d6e39e..01583ba 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 _0x65c4=['login','forgot','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x11d08,_0x4abde1){var _0x160786=function(_0x5cc6df){while(--_0x5cc6df){_0x11d08['push'](_0x11d08['shift']());}};_0x160786(++_0x4abde1);}(_0x65c4,0x15c));var _0x465c=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x65c4[_0x3b90ab];return _0x206e92;};'use strict';var express=require(_0x465c('0x0'));var router=express[_0x465c('0x1')]();var controller=require(_0x465c('0x2'));router[_0x465c('0x3')]('/',controller[_0x465c('0x4')]);router[_0x465c('0x3')]('/forgot',controller[_0x465c('0x5')]);router[_0x465c('0x3')]('/reset/:token',controller[_0x465c('0x6')]);module[_0x465c('0x7')]=router;
\ No newline at end of file
+var _0x1f80=['reset','exports','express','Router','post','forgot','/reset/:token'];(function(_0x4c49d2,_0x2b18b7){var _0x1d653b=function(_0x302ce3){while(--_0x302ce3){_0x4c49d2['push'](_0x4c49d2['shift']());}};_0x1d653b(++_0x2b18b7);}(_0x1f80,0x1bb));var _0x01f8=function(_0x1c2845,_0x2bd014){_0x1c2845=_0x1c2845-0x0;var _0x17bb6f=_0x1f80[_0x1c2845];return _0x17bb6f;};'use strict';var express=require(_0x01f8('0x0'));var router=express[_0x01f8('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0x01f8('0x2')]('/forgot',controller[_0x01f8('0x3')]);router[_0x01f8('0x2')](_0x01f8('0x4'),controller[_0x01f8('0x5')]);module[_0x01f8('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index ff32ddc..0b152ff 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 _0xfe1f=['sequelize','STRING','INTEGER'];(function(_0x3c3809,_0x501175){var _0x3fb31e=function(_0x3fd215){while(--_0x3fd215){_0x3c3809['push'](_0x3c3809['shift']());}};_0x3fb31e(++_0x501175);}(_0xfe1f,0x159));var _0xffe1=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0xfe1f[_0x2d8434];return _0x26b9e4;};'use strict';var Sequelize=require(_0xffe1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xffe1('0x1')]},'description':{'type':Sequelize[_0xffe1('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xffe1('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xb7a4=['STRING','INTEGER','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb7a4,0x14c));var _0x4b7a=function(_0x19bdc4,_0x52632d){_0x19bdc4=_0x19bdc4-0x0;var _0x361650=_0xb7a4[_0x19bdc4];return _0x361650;};'use strict';var Sequelize=require(_0x4b7a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x4b7a('0x1')]},'description':{'type':Sequelize[_0x4b7a('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4b7a('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 9b1d533..733f22e 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 _0x3880=['filter','where','merge','VIRTUAL','options','includeAll','include','Automation','rows','catch','show','rawAttributes','length','find','create','body','update','params','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x3880,0x71));var _0x0388=function(_0x27bf68,_0x2028b1){_0x27bf68=_0x27bf68-0x0;var _0x471506=_0x3880[_0x27bf68];return _0x471506;};'use strict';var emlformat=require(_0x0388('0x0'));var rimraf=require(_0x0388('0x1'));var zipdir=require(_0x0388('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0388('0x3'));var moment=require(_0x0388('0x4'));var BPromise=require(_0x0388('0x5'));var Mustache=require(_0x0388('0x6'));var util=require(_0x0388('0x7'));var path=require(_0x0388('0x8'));var sox=require(_0x0388('0x9'));var csv=require(_0x0388('0xa'));var ejs=require(_0x0388('0xb'));var fs=require('fs');var fs_extra=require(_0x0388('0xc'));var _=require(_0x0388('0xd'));var squel=require('squel');var crypto=require(_0x0388('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0388('0xf'));var toCsv=require(_0x0388('0xa'));var querystring=require(_0x0388('0x10'));var Papa=require(_0x0388('0x11'));var Redis=require('ioredis');var authService=require(_0x0388('0x12'));var qs=require(_0x0388('0x13'));var as=require(_0x0388('0x14'));var hardwareService=require(_0x0388('0x15'));var logger=require('../../config/logger')(_0x0388('0x16'));var utils=require('../../config/utils');var config=require(_0x0388('0x17'));var licenseUtil=require(_0x0388('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x374dae,_0x3d80da){_0x3d80da=_0x3d80da||0xcc;return function(_0x8565e6){if(_0x8565e6){return _0x374dae['sendStatus'](_0x3d80da);}return _0x374dae[_0x0388('0x19')](_0x3d80da)[_0x0388('0x1a')]();};}function respondWithResult(_0x4026b5,_0x21856d){_0x21856d=_0x21856d||0xc8;return function(_0x54505f){if(_0x54505f){return _0x4026b5['status'](_0x21856d)[_0x0388('0x1b')](_0x54505f);}};}function respondWithFilteredResult(_0x1598c2,_0x48a550){return function(_0x2da4b0){if(_0x2da4b0){var _0x1d5f6b=typeof _0x48a550['offset']===_0x0388('0x1c')&&typeof _0x48a550[_0x0388('0x1d')]==='undefined';var _0x576860=_0x2da4b0[_0x0388('0x1e')];var _0x4a494a=_0x1d5f6b?0x0:_0x48a550[_0x0388('0x1f')];var _0x251945=_0x1d5f6b?_0x2da4b0[_0x0388('0x1e')]:_0x48a550[_0x0388('0x1f')]+_0x48a550[_0x0388('0x1d')];var _0x27b21f;if(_0x251945>=_0x576860){_0x251945=_0x576860;_0x27b21f=0xc8;}else{_0x27b21f=0xce;}_0x1598c2[_0x0388('0x19')](_0x27b21f);return _0x1598c2[_0x0388('0x20')]('Content-Range',_0x4a494a+'-'+_0x251945+'/'+_0x576860)[_0x0388('0x1b')](_0x2da4b0);}return null;};}function patchUpdates(_0x3d99a3){return function(_0x40fde8){try{jsonpatch[_0x0388('0x21')](_0x40fde8,_0x3d99a3,!![]);}catch(_0x3f949d){return BPromise[_0x0388('0x22')](_0x3f949d);}return _0x40fde8[_0x0388('0x23')]();};}function saveUpdates(_0x533e9c,_0x22e5b7){return function(_0x17fcaa){if(_0x17fcaa){return _0x17fcaa['update'](_0x533e9c)[_0x0388('0x24')](function(_0x3d22ff){return _0x3d22ff;});}return null;};}function removeEntity(_0xa49445,_0x1991ee){return function(_0x47f064){if(_0x47f064){return _0x47f064[_0x0388('0x25')]()[_0x0388('0x24')](function(){_0xa49445[_0x0388('0x19')](0xcc)[_0x0388('0x1a')]();});}};}function handleEntityNotFound(_0x4bd5a0,_0x58c79b){return function(_0x2f4980){if(!_0x2f4980){_0x4bd5a0[_0x0388('0x26')](0x194);}return _0x2f4980;};}function handleError(_0x3c4ebe,_0x223c03){_0x223c03=_0x223c03||0x1f4;return function(_0x396136){logger[_0x0388('0x27')](_0x396136[_0x0388('0x28')]);if(_0x396136['name']){delete _0x396136[_0x0388('0x29')];}_0x3c4ebe['status'](_0x223c03)[_0x0388('0x2a')](_0x396136);};}exports['index']=function(_0x278925,_0x39219f){var _0x5caea3={},_0x46d2a3={},_0x469575={'count':0x0,'rows':[]};var _0x279ff0=_[_0x0388('0x2b')](db['Automation']['rawAttributes'],function(_0x100ad3){return{'name':_0x100ad3[_0x0388('0x2c')],'type':_0x100ad3[_0x0388('0x2d')]['key']};});_0x46d2a3[_0x0388('0x2e')]=_['map'](_0x279ff0,'name');_0x46d2a3[_0x0388('0x2f')]=_[_0x0388('0x30')](_0x278925[_0x0388('0x2f')]);_0x46d2a3[_0x0388('0x31')]=_[_0x0388('0x32')](_0x46d2a3[_0x0388('0x2e')],_0x46d2a3[_0x0388('0x2f')]);_0x5caea3['attributes']=_[_0x0388('0x32')](_0x46d2a3[_0x0388('0x2e')],qs[_0x0388('0x33')](_0x278925[_0x0388('0x2f')]['fields']));_0x5caea3[_0x0388('0x34')]=_0x5caea3[_0x0388('0x34')]['length']?_0x5caea3[_0x0388('0x34')]:_0x46d2a3[_0x0388('0x2e')];if(!_0x278925['query'][_0x0388('0x35')]('nolimit')){_0x5caea3[_0x0388('0x1d')]=qs[_0x0388('0x1d')](_0x278925[_0x0388('0x2f')][_0x0388('0x1d')]);_0x5caea3[_0x0388('0x1f')]=qs[_0x0388('0x1f')](_0x278925['query']['offset']);}_0x5caea3[_0x0388('0x36')]=qs[_0x0388('0x37')](_0x278925[_0x0388('0x2f')][_0x0388('0x37')]);_0x5caea3['where']=qs['filters'](_[_0x0388('0x38')](_0x278925[_0x0388('0x2f')],_0x46d2a3['filters']),_0x279ff0);if(_0x278925['query'][_0x0388('0x39')]){_0x5caea3[_0x0388('0x3a')]=_[_0x0388('0x3b')](_0x5caea3['where'],{'$or':_['map'](_0x279ff0,function(_0x5f4b32){if(_0x5f4b32[_0x0388('0x2d')]!==_0x0388('0x3c')){var _0x335fe0={};_0x335fe0[_0x5f4b32[_0x0388('0x29')]]={'$like':'%'+_0x278925[_0x0388('0x2f')]['filter']+'%'};return _0x335fe0;}})});}_0x5caea3=_[_0x0388('0x3b')]({},_0x5caea3,_0x278925[_0x0388('0x3d')]);var _0x1b1dd1={'where':_0x5caea3[_0x0388('0x3a')]};return db['Automation']['count'](_0x1b1dd1)[_0x0388('0x24')](function(_0x50a9cd){_0x469575['count']=_0x50a9cd;if(_0x278925[_0x0388('0x2f')][_0x0388('0x3e')]){_0x5caea3[_0x0388('0x3f')]=[{'all':!![]}];}return db[_0x0388('0x40')]['findAll'](_0x5caea3);})[_0x0388('0x24')](function(_0xece33){_0x469575[_0x0388('0x41')]=_0xece33;return _0x469575;})['then'](respondWithFilteredResult(_0x39219f,_0x5caea3))[_0x0388('0x42')](handleError(_0x39219f,null));};exports[_0x0388('0x43')]=function(_0x4dbadb,_0x3cfb19){var _0x2ce763={'raw':![],'where':{'id':_0x4dbadb['params']['id']}},_0x1f365e={};_0x1f365e[_0x0388('0x2e')]=_[_0x0388('0x30')](db[_0x0388('0x40')][_0x0388('0x44')]);_0x1f365e[_0x0388('0x2f')]=_[_0x0388('0x30')](_0x4dbadb[_0x0388('0x2f')]);_0x1f365e['filters']=_[_0x0388('0x32')](_0x1f365e[_0x0388('0x2e')],_0x1f365e['query']);_0x2ce763[_0x0388('0x34')]=_[_0x0388('0x32')](_0x1f365e[_0x0388('0x2e')],qs[_0x0388('0x33')](_0x4dbadb[_0x0388('0x2f')][_0x0388('0x33')]));_0x2ce763[_0x0388('0x34')]=_0x2ce763['attributes'][_0x0388('0x45')]?_0x2ce763[_0x0388('0x34')]:_0x1f365e[_0x0388('0x2e')];if(_0x4dbadb[_0x0388('0x2f')][_0x0388('0x3e')]){_0x2ce763['include']=[{'all':!![]}];}_0x2ce763=_[_0x0388('0x3b')]({},_0x2ce763,_0x4dbadb[_0x0388('0x3d')]);return db[_0x0388('0x40')][_0x0388('0x46')](_0x2ce763)['then'](handleEntityNotFound(_0x3cfb19,null))['then'](respondWithResult(_0x3cfb19,null))[_0x0388('0x42')](handleError(_0x3cfb19,null));};exports['create']=function(_0x2eed41,_0x4ec7b2){return db[_0x0388('0x40')][_0x0388('0x47')](_0x2eed41[_0x0388('0x48')],{})[_0x0388('0x24')](respondWithResult(_0x4ec7b2,0xc9))[_0x0388('0x42')](handleError(_0x4ec7b2,null));};exports[_0x0388('0x49')]=function(_0x30dec6,_0x444135){if(_0x30dec6['body']['id']){delete _0x30dec6['body']['id'];}return db['Automation'][_0x0388('0x46')]({'where':{'id':_0x30dec6[_0x0388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x444135,null))[_0x0388('0x24')](saveUpdates(_0x30dec6['body'],null))[_0x0388('0x24')](respondWithResult(_0x444135,null))[_0x0388('0x42')](handleError(_0x444135,null));};exports[_0x0388('0x25')]=function(_0xdaa9a2,_0x196e8b){return db[_0x0388('0x40')]['find']({'where':{'id':_0xdaa9a2['params']['id']}})[_0x0388('0x24')](handleEntityNotFound(_0x196e8b,null))[_0x0388('0x24')](removeEntity(_0x196e8b,null))[_0x0388('0x42')](handleError(_0x196e8b,null));};exports[_0x0388('0x4b')]=function(_0xb8933a,_0xb09ef4,_0x13e8b3){return db[_0x0388('0x4c')]['find']({'where':{'id':_0xb8933a['params']['id']}})['then'](handleEntityNotFound(_0xb09ef4,null))[_0x0388('0x24')](function(_0x160fe2){if(_0x160fe2){return _0x160fe2[_0x0388('0x4b')](_0xb8933a[_0x0388('0x48')][_0x0388('0x4d')],_[_0x0388('0x4e')](_0xb8933a[_0x0388('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0xb09ef4,null))[_0x0388('0x42')](handleError(_0xb09ef4,null));};exports[_0x0388('0x4f')]=function(_0xeb321e,_0x224a9c,_0x5b83f6){var _0x2bfb31={};var _0x4d3ada={};var _0x5c4f99;var _0x538535;return db[_0x0388('0x40')][_0x0388('0x50')]({'where':{'id':_0xeb321e[_0x0388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x224a9c,null))[_0x0388('0x24')](function(_0xa708f9){if(_0xa708f9){_0x5c4f99=_0xa708f9;_0x4d3ada[_0x0388('0x2e')]=_[_0x0388('0x30')](db[_0x0388('0x4c')][_0x0388('0x44')]);_0x4d3ada[_0x0388('0x2f')]=_[_0x0388('0x30')](_0xeb321e[_0x0388('0x2f')]);_0x4d3ada['filters']=_[_0x0388('0x32')](_0x4d3ada[_0x0388('0x2e')],_0x4d3ada[_0x0388('0x2f')]);_0x2bfb31[_0x0388('0x34')]=_['intersection'](_0x4d3ada[_0x0388('0x2e')],qs['fields'](_0xeb321e[_0x0388('0x2f')][_0x0388('0x33')]));_0x2bfb31[_0x0388('0x34')]=_0x2bfb31[_0x0388('0x34')][_0x0388('0x45')]?_0x2bfb31['attributes']:_0x4d3ada[_0x0388('0x2e')];_0x2bfb31['order']=qs['sort'](_0xeb321e[_0x0388('0x2f')]['sort']);_0x2bfb31['where']=qs[_0x0388('0x31')](_[_0x0388('0x38')](_0xeb321e[_0x0388('0x2f')],_0x4d3ada[_0x0388('0x31')]));if(_0xeb321e[_0x0388('0x2f')][_0x0388('0x39')]){_0x2bfb31[_0x0388('0x3a')]=_['merge'](_0x2bfb31['where'],{'$or':_[_0x0388('0x2b')](_0x2bfb31[_0x0388('0x34')],function(_0x4b214a){var _0xb2b25={};_0xb2b25[_0x4b214a]={'$like':'%'+_0xeb321e[_0x0388('0x2f')]['filter']+'%'};return _0xb2b25;})});}_0x2bfb31=_[_0x0388('0x3b')]({},_0x2bfb31,_0xeb321e[_0x0388('0x3d')]);return _0x5c4f99[_0x0388('0x4f')](_0x2bfb31);}})['then'](function(_0x3441e9){if(_0x3441e9){_0x538535=_0x3441e9[_0x0388('0x45')];if(!_0xeb321e[_0x0388('0x2f')][_0x0388('0x35')](_0x0388('0x51'))){_0x2bfb31[_0x0388('0x1d')]=qs[_0x0388('0x1d')](_0xeb321e[_0x0388('0x2f')][_0x0388('0x1d')]);_0x2bfb31['offset']=qs[_0x0388('0x1f')](_0xeb321e[_0x0388('0x2f')][_0x0388('0x1f')]);}return _0x5c4f99[_0x0388('0x4f')](_0x2bfb31);}})[_0x0388('0x24')](function(_0xf34a8f){if(_0xf34a8f){return _0xf34a8f?{'count':_0x538535,'rows':_0xf34a8f}:null;}})[_0x0388('0x24')](respondWithResult(_0x224a9c,null))[_0x0388('0x42')](handleError(_0x224a9c,null));};exports[_0x0388('0x52')]=function(_0x54f310,_0x4ae35a,_0xa0a4b2){return db[_0x0388('0x53')][_0x0388('0x46')]({'where':{'id':_0x54f310['params']['id']}})[_0x0388('0x24')](handleEntityNotFound(_0x4ae35a,null))['then'](function(_0x2ab634){if(_0x2ab634){return _0x2ab634[_0x0388('0x52')](_0x54f310[_0x0388('0x48')][_0x0388('0x4d')],_[_0x0388('0x4e')](_0x54f310['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4ae35a,null))[_0x0388('0x42')](handleError(_0x4ae35a,null));};exports[_0x0388('0x54')]=function(_0x2c02dd,_0x292ee6,_0x4072a9){var _0x42f27e={};var _0x5c5bd9={};var _0x30ceb3;var _0x396e0f;return db[_0x0388('0x40')]['findOne']({'where':{'id':_0x2c02dd[_0x0388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x292ee6,null))[_0x0388('0x24')](function(_0x4374cb){if(_0x4374cb){_0x30ceb3=_0x4374cb;_0x5c5bd9[_0x0388('0x2e')]=_[_0x0388('0x30')](db[_0x0388('0x53')][_0x0388('0x44')]);_0x5c5bd9[_0x0388('0x2f')]=_[_0x0388('0x30')](_0x2c02dd[_0x0388('0x2f')]);_0x5c5bd9[_0x0388('0x31')]=_['intersection'](_0x5c5bd9[_0x0388('0x2e')],_0x5c5bd9[_0x0388('0x2f')]);_0x42f27e['attributes']=_[_0x0388('0x32')](_0x5c5bd9['model'],qs[_0x0388('0x33')](_0x2c02dd[_0x0388('0x2f')][_0x0388('0x33')]));_0x42f27e[_0x0388('0x34')]=_0x42f27e[_0x0388('0x34')][_0x0388('0x45')]?_0x42f27e[_0x0388('0x34')]:_0x5c5bd9['model'];_0x42f27e[_0x0388('0x36')]=qs['sort'](_0x2c02dd[_0x0388('0x2f')][_0x0388('0x37')]);_0x42f27e[_0x0388('0x3a')]=qs['filters'](_[_0x0388('0x38')](_0x2c02dd[_0x0388('0x2f')],_0x5c5bd9[_0x0388('0x31')]));if(_0x2c02dd[_0x0388('0x2f')][_0x0388('0x39')]){_0x42f27e[_0x0388('0x3a')]=_[_0x0388('0x3b')](_0x42f27e[_0x0388('0x3a')],{'$or':_[_0x0388('0x2b')](_0x42f27e['attributes'],function(_0x3c030a){var _0xdd34ba={};_0xdd34ba[_0x3c030a]={'$like':'%'+_0x2c02dd[_0x0388('0x2f')][_0x0388('0x39')]+'%'};return _0xdd34ba;})});}_0x42f27e=_[_0x0388('0x3b')]({},_0x42f27e,_0x2c02dd[_0x0388('0x3d')]);return _0x30ceb3['getActions'](_0x42f27e);}})[_0x0388('0x24')](function(_0x30084){if(_0x30084){_0x396e0f=_0x30084[_0x0388('0x45')];if(!_0x2c02dd[_0x0388('0x2f')][_0x0388('0x35')](_0x0388('0x51'))){_0x42f27e[_0x0388('0x1d')]=qs[_0x0388('0x1d')](_0x2c02dd[_0x0388('0x2f')][_0x0388('0x1d')]);_0x42f27e[_0x0388('0x1f')]=qs['offset'](_0x2c02dd['query'][_0x0388('0x1f')]);}return _0x30ceb3[_0x0388('0x54')](_0x42f27e);}})[_0x0388('0x24')](function(_0x36bafc){if(_0x36bafc){return _0x36bafc?{'count':_0x396e0f,'rows':_0x36bafc}:null;}})['then'](respondWithResult(_0x292ee6,null))[_0x0388('0x42')](handleError(_0x292ee6,null));};
\ No newline at end of file
+var _0x21cc=['nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Automation','findAll','catch','show','params','rawAttributes','length','include','find','create','body','Condition','ids','getConditions','findOne','hasOwnProperty','addActions','Action','omit','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x52098f,_0x4005c7){var _0x538435=function(_0xde643c){while(--_0xde643c){_0x52098f['push'](_0x52098f['shift']());}};_0x538435(++_0x4005c7);}(_0x21cc,0x72));var _0xc21c=function(_0x2fba78,_0x251be3){_0x2fba78=_0x2fba78-0x0;var _0x375ef5=_0x21cc[_0x2fba78];return _0x375ef5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc21c('0x0'));var zipdir=require(_0xc21c('0x1'));var jsonpatch=require(_0xc21c('0x2'));var rp=require(_0xc21c('0x3'));var moment=require(_0xc21c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc21c('0x5'));var util=require(_0xc21c('0x6'));var path=require(_0xc21c('0x7'));var sox=require(_0xc21c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc21c('0x9'));var _=require(_0xc21c('0xa'));var squel=require(_0xc21c('0xb'));var crypto=require(_0xc21c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc21c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc21c('0xe'));var Papa=require(_0xc21c('0xf'));var Redis=require(_0xc21c('0x10'));var authService=require(_0xc21c('0x11'));var qs=require(_0xc21c('0x12'));var as=require(_0xc21c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc21c('0x14'))(_0xc21c('0x15'));var utils=require(_0xc21c('0x16'));var config=require(_0xc21c('0x17'));var licenseUtil=require(_0xc21c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6ed913,_0x56b4f6){_0x56b4f6=_0x56b4f6||0xcc;return function(_0x316b41){if(_0x316b41){return _0x6ed913[_0xc21c('0x19')](_0x56b4f6);}return _0x6ed913[_0xc21c('0x1a')](_0x56b4f6)[_0xc21c('0x1b')]();};}function respondWithResult(_0x599779,_0x490280){_0x490280=_0x490280||0xc8;return function(_0x43f797){if(_0x43f797){return _0x599779[_0xc21c('0x1a')](_0x490280)['json'](_0x43f797);}};}function respondWithFilteredResult(_0x3509a8,_0x26e386){return function(_0x45f386){if(_0x45f386){var _0x2ebccd=typeof _0x26e386['offset']==='undefined'&&typeof _0x26e386[_0xc21c('0x1c')]==='undefined';var _0x53891c=_0x45f386['count'];var _0x1d97df=_0x2ebccd?0x0:_0x26e386[_0xc21c('0x1d')];var _0x4816c3=_0x2ebccd?_0x45f386[_0xc21c('0x1e')]:_0x26e386[_0xc21c('0x1d')]+_0x26e386[_0xc21c('0x1c')];var _0x43ed0a;if(_0x4816c3>=_0x53891c){_0x4816c3=_0x53891c;_0x43ed0a=0xc8;}else{_0x43ed0a=0xce;}_0x3509a8['status'](_0x43ed0a);return _0x3509a8[_0xc21c('0x1f')](_0xc21c('0x20'),_0x1d97df+'-'+_0x4816c3+'/'+_0x53891c)[_0xc21c('0x21')](_0x45f386);}return null;};}function patchUpdates(_0x22d06a){return function(_0x131691){try{jsonpatch[_0xc21c('0x22')](_0x131691,_0x22d06a,!![]);}catch(_0x1976f6){return BPromise[_0xc21c('0x23')](_0x1976f6);}return _0x131691[_0xc21c('0x24')]();};}function saveUpdates(_0x52b108,_0x38dce2){return function(_0x4d4991){if(_0x4d4991){return _0x4d4991[_0xc21c('0x25')](_0x52b108)[_0xc21c('0x26')](function(_0x472fed){return _0x472fed;});}return null;};}function removeEntity(_0x547605,_0x49a591){return function(_0x350b98){if(_0x350b98){return _0x350b98[_0xc21c('0x27')]()[_0xc21c('0x26')](function(){_0x547605['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47fab9,_0x356f26){return function(_0x379482){if(!_0x379482){_0x47fab9[_0xc21c('0x19')](0x194);}return _0x379482;};}function handleError(_0x100bfb,_0x567f5c){_0x567f5c=_0x567f5c||0x1f4;return function(_0x211d6a){logger[_0xc21c('0x28')](_0x211d6a[_0xc21c('0x29')]);if(_0x211d6a[_0xc21c('0x2a')]){delete _0x211d6a[_0xc21c('0x2a')];}_0x100bfb['status'](_0x567f5c)[_0xc21c('0x2b')](_0x211d6a);};}exports[_0xc21c('0x2c')]=function(_0x37b7fb,_0x4b4cc3){var _0x2f509d={},_0x479889={},_0x2c879d={'count':0x0,'rows':[]};var _0x4c4b08=_[_0xc21c('0x2d')](db['Automation']['rawAttributes'],function(_0x21b099){return{'name':_0x21b099[_0xc21c('0x2e')],'type':_0x21b099[_0xc21c('0x2f')][_0xc21c('0x30')]};});_0x479889[_0xc21c('0x31')]=_['map'](_0x4c4b08,_0xc21c('0x2a'));_0x479889[_0xc21c('0x32')]=_[_0xc21c('0x33')](_0x37b7fb[_0xc21c('0x32')]);_0x479889[_0xc21c('0x34')]=_[_0xc21c('0x35')](_0x479889['model'],_0x479889[_0xc21c('0x32')]);_0x2f509d[_0xc21c('0x36')]=_['intersection'](_0x479889[_0xc21c('0x31')],qs['fields'](_0x37b7fb[_0xc21c('0x32')][_0xc21c('0x37')]));_0x2f509d[_0xc21c('0x36')]=_0x2f509d[_0xc21c('0x36')]['length']?_0x2f509d[_0xc21c('0x36')]:_0x479889['model'];if(!_0x37b7fb[_0xc21c('0x32')]['hasOwnProperty'](_0xc21c('0x38'))){_0x2f509d['limit']=qs[_0xc21c('0x1c')](_0x37b7fb[_0xc21c('0x32')]['limit']);_0x2f509d[_0xc21c('0x1d')]=qs[_0xc21c('0x1d')](_0x37b7fb[_0xc21c('0x32')][_0xc21c('0x1d')]);}_0x2f509d[_0xc21c('0x39')]=qs[_0xc21c('0x3a')](_0x37b7fb[_0xc21c('0x32')][_0xc21c('0x3a')]);_0x2f509d['where']=qs['filters'](_[_0xc21c('0x3b')](_0x37b7fb[_0xc21c('0x32')],_0x479889[_0xc21c('0x34')]),_0x4c4b08);if(_0x37b7fb['query'][_0xc21c('0x3c')]){_0x2f509d[_0xc21c('0x3d')]=_['merge'](_0x2f509d['where'],{'$or':_['map'](_0x4c4b08,function(_0x80ab6f){if(_0x80ab6f['type']!==_0xc21c('0x3e')){var _0x2cfb41={};_0x2cfb41[_0x80ab6f[_0xc21c('0x2a')]]={'$like':'%'+_0x37b7fb[_0xc21c('0x32')][_0xc21c('0x3c')]+'%'};return _0x2cfb41;}})});}_0x2f509d=_[_0xc21c('0x3f')]({},_0x2f509d,_0x37b7fb[_0xc21c('0x40')]);var _0x4f6127={'where':_0x2f509d['where']};return db[_0xc21c('0x41')]['count'](_0x4f6127)[_0xc21c('0x26')](function(_0x328a7e){_0x2c879d['count']=_0x328a7e;if(_0x37b7fb[_0xc21c('0x32')]['includeAll']){_0x2f509d['include']=[{'all':!![]}];}return db[_0xc21c('0x41')][_0xc21c('0x42')](_0x2f509d);})[_0xc21c('0x26')](function(_0x4ed109){_0x2c879d['rows']=_0x4ed109;return _0x2c879d;})[_0xc21c('0x26')](respondWithFilteredResult(_0x4b4cc3,_0x2f509d))[_0xc21c('0x43')](handleError(_0x4b4cc3,null));};exports[_0xc21c('0x44')]=function(_0x576d85,_0x261521){var _0x1c0d34={'raw':![],'where':{'id':_0x576d85[_0xc21c('0x45')]['id']}},_0x27f5c4={};_0x27f5c4[_0xc21c('0x31')]=_[_0xc21c('0x33')](db[_0xc21c('0x41')][_0xc21c('0x46')]);_0x27f5c4[_0xc21c('0x32')]=_[_0xc21c('0x33')](_0x576d85[_0xc21c('0x32')]);_0x27f5c4['filters']=_[_0xc21c('0x35')](_0x27f5c4['model'],_0x27f5c4[_0xc21c('0x32')]);_0x1c0d34[_0xc21c('0x36')]=_[_0xc21c('0x35')](_0x27f5c4[_0xc21c('0x31')],qs['fields'](_0x576d85[_0xc21c('0x32')][_0xc21c('0x37')]));_0x1c0d34['attributes']=_0x1c0d34['attributes'][_0xc21c('0x47')]?_0x1c0d34[_0xc21c('0x36')]:_0x27f5c4[_0xc21c('0x31')];if(_0x576d85[_0xc21c('0x32')]['includeAll']){_0x1c0d34[_0xc21c('0x48')]=[{'all':!![]}];}_0x1c0d34=_['merge']({},_0x1c0d34,_0x576d85[_0xc21c('0x40')]);return db['Automation'][_0xc21c('0x49')](_0x1c0d34)[_0xc21c('0x26')](handleEntityNotFound(_0x261521,null))[_0xc21c('0x26')](respondWithResult(_0x261521,null))['catch'](handleError(_0x261521,null));};exports[_0xc21c('0x4a')]=function(_0x49bc70,_0x51a21e){return db[_0xc21c('0x41')][_0xc21c('0x4a')](_0x49bc70[_0xc21c('0x4b')],{})[_0xc21c('0x26')](respondWithResult(_0x51a21e,0xc9))[_0xc21c('0x43')](handleError(_0x51a21e,null));};exports[_0xc21c('0x25')]=function(_0x3097c1,_0x1dd507){if(_0x3097c1['body']['id']){delete _0x3097c1['body']['id'];}return db[_0xc21c('0x41')][_0xc21c('0x49')]({'where':{'id':_0x3097c1['params']['id']}})[_0xc21c('0x26')](handleEntityNotFound(_0x1dd507,null))[_0xc21c('0x26')](saveUpdates(_0x3097c1[_0xc21c('0x4b')],null))[_0xc21c('0x26')](respondWithResult(_0x1dd507,null))['catch'](handleError(_0x1dd507,null));};exports[_0xc21c('0x27')]=function(_0x2dbb48,_0x1d4c8e){return db[_0xc21c('0x41')][_0xc21c('0x49')]({'where':{'id':_0x2dbb48[_0xc21c('0x45')]['id']}})[_0xc21c('0x26')](handleEntityNotFound(_0x1d4c8e,null))['then'](removeEntity(_0x1d4c8e,null))[_0xc21c('0x43')](handleError(_0x1d4c8e,null));};exports['addConditions']=function(_0x593994,_0x3d2e3b,_0x5a9e69){return db[_0xc21c('0x4c')][_0xc21c('0x49')]({'where':{'id':_0x593994[_0xc21c('0x45')]['id']}})[_0xc21c('0x26')](handleEntityNotFound(_0x3d2e3b,null))[_0xc21c('0x26')](function(_0x58ab09){if(_0x58ab09){return _0x58ab09['addConditions'](_0x593994[_0xc21c('0x4b')][_0xc21c('0x4d')],_['omit'](_0x593994[_0xc21c('0x4b')],['ids','id'])||{});}})['then'](respondWithResult(_0x3d2e3b,null))[_0xc21c('0x43')](handleError(_0x3d2e3b,null));};exports[_0xc21c('0x4e')]=function(_0x22665a,_0xf17713,_0x16a91d){var _0x1e4d3a={};var _0xbeed8b={};var _0x4d8897;var _0x2fcbf5;return db[_0xc21c('0x41')][_0xc21c('0x4f')]({'where':{'id':_0x22665a[_0xc21c('0x45')]['id']}})['then'](handleEntityNotFound(_0xf17713,null))[_0xc21c('0x26')](function(_0x14cd6f){if(_0x14cd6f){_0x4d8897=_0x14cd6f;_0xbeed8b['model']=_[_0xc21c('0x33')](db[_0xc21c('0x4c')][_0xc21c('0x46')]);_0xbeed8b[_0xc21c('0x32')]=_[_0xc21c('0x33')](_0x22665a['query']);_0xbeed8b[_0xc21c('0x34')]=_[_0xc21c('0x35')](_0xbeed8b['model'],_0xbeed8b[_0xc21c('0x32')]);_0x1e4d3a[_0xc21c('0x36')]=_['intersection'](_0xbeed8b[_0xc21c('0x31')],qs[_0xc21c('0x37')](_0x22665a[_0xc21c('0x32')][_0xc21c('0x37')]));_0x1e4d3a['attributes']=_0x1e4d3a[_0xc21c('0x36')][_0xc21c('0x47')]?_0x1e4d3a[_0xc21c('0x36')]:_0xbeed8b[_0xc21c('0x31')];_0x1e4d3a[_0xc21c('0x39')]=qs['sort'](_0x22665a['query'][_0xc21c('0x3a')]);_0x1e4d3a[_0xc21c('0x3d')]=qs[_0xc21c('0x34')](_['pick'](_0x22665a[_0xc21c('0x32')],_0xbeed8b[_0xc21c('0x34')]));if(_0x22665a[_0xc21c('0x32')]['filter']){_0x1e4d3a[_0xc21c('0x3d')]=_['merge'](_0x1e4d3a['where'],{'$or':_[_0xc21c('0x2d')](_0x1e4d3a[_0xc21c('0x36')],function(_0x2d5c56){var _0x384055={};_0x384055[_0x2d5c56]={'$like':'%'+_0x22665a['query']['filter']+'%'};return _0x384055;})});}_0x1e4d3a=_[_0xc21c('0x3f')]({},_0x1e4d3a,_0x22665a[_0xc21c('0x40')]);return _0x4d8897['getConditions'](_0x1e4d3a);}})[_0xc21c('0x26')](function(_0x4bcf70){if(_0x4bcf70){_0x2fcbf5=_0x4bcf70['length'];if(!_0x22665a[_0xc21c('0x32')][_0xc21c('0x50')](_0xc21c('0x38'))){_0x1e4d3a[_0xc21c('0x1c')]=qs['limit'](_0x22665a[_0xc21c('0x32')][_0xc21c('0x1c')]);_0x1e4d3a[_0xc21c('0x1d')]=qs[_0xc21c('0x1d')](_0x22665a[_0xc21c('0x32')]['offset']);}return _0x4d8897[_0xc21c('0x4e')](_0x1e4d3a);}})['then'](function(_0x48f663){if(_0x48f663){return _0x48f663?{'count':_0x2fcbf5,'rows':_0x48f663}:null;}})[_0xc21c('0x26')](respondWithResult(_0xf17713,null))['catch'](handleError(_0xf17713,null));};exports[_0xc21c('0x51')]=function(_0x48ec7e,_0x4a6994,_0x125ec5){return db[_0xc21c('0x52')][_0xc21c('0x49')]({'where':{'id':_0x48ec7e[_0xc21c('0x45')]['id']}})[_0xc21c('0x26')](handleEntityNotFound(_0x4a6994,null))[_0xc21c('0x26')](function(_0x129c1f){if(_0x129c1f){return _0x129c1f['addActions'](_0x48ec7e[_0xc21c('0x4b')]['ids'],_[_0xc21c('0x53')](_0x48ec7e[_0xc21c('0x4b')],[_0xc21c('0x4d'),'id'])||{});}})[_0xc21c('0x26')](respondWithResult(_0x4a6994,null))[_0xc21c('0x43')](handleError(_0x4a6994,null));};exports[_0xc21c('0x54')]=function(_0x615a75,_0x457147,_0x53eed2){var _0x7fece2={};var _0x400547={};var _0x4977b9;var _0x2639a4;return db[_0xc21c('0x41')][_0xc21c('0x4f')]({'where':{'id':_0x615a75[_0xc21c('0x45')]['id']}})['then'](handleEntityNotFound(_0x457147,null))[_0xc21c('0x26')](function(_0x5176b3){if(_0x5176b3){_0x4977b9=_0x5176b3;_0x400547['model']=_[_0xc21c('0x33')](db['Action'][_0xc21c('0x46')]);_0x400547['query']=_[_0xc21c('0x33')](_0x615a75[_0xc21c('0x32')]);_0x400547[_0xc21c('0x34')]=_[_0xc21c('0x35')](_0x400547[_0xc21c('0x31')],_0x400547[_0xc21c('0x32')]);_0x7fece2[_0xc21c('0x36')]=_[_0xc21c('0x35')](_0x400547[_0xc21c('0x31')],qs[_0xc21c('0x37')](_0x615a75[_0xc21c('0x32')][_0xc21c('0x37')]));_0x7fece2[_0xc21c('0x36')]=_0x7fece2[_0xc21c('0x36')][_0xc21c('0x47')]?_0x7fece2[_0xc21c('0x36')]:_0x400547[_0xc21c('0x31')];_0x7fece2[_0xc21c('0x39')]=qs[_0xc21c('0x3a')](_0x615a75[_0xc21c('0x32')][_0xc21c('0x3a')]);_0x7fece2[_0xc21c('0x3d')]=qs[_0xc21c('0x34')](_['pick'](_0x615a75[_0xc21c('0x32')],_0x400547[_0xc21c('0x34')]));if(_0x615a75[_0xc21c('0x32')]['filter']){_0x7fece2['where']=_[_0xc21c('0x3f')](_0x7fece2['where'],{'$or':_[_0xc21c('0x2d')](_0x7fece2['attributes'],function(_0x1351f8){var _0x4d0472={};_0x4d0472[_0x1351f8]={'$like':'%'+_0x615a75[_0xc21c('0x32')][_0xc21c('0x3c')]+'%'};return _0x4d0472;})});}_0x7fece2=_[_0xc21c('0x3f')]({},_0x7fece2,_0x615a75['options']);return _0x4977b9[_0xc21c('0x54')](_0x7fece2);}})[_0xc21c('0x26')](function(_0x3ef0e5){if(_0x3ef0e5){_0x2639a4=_0x3ef0e5[_0xc21c('0x47')];if(!_0x615a75[_0xc21c('0x32')][_0xc21c('0x50')](_0xc21c('0x38'))){_0x7fece2[_0xc21c('0x1c')]=qs[_0xc21c('0x1c')](_0x615a75['query'][_0xc21c('0x1c')]);_0x7fece2[_0xc21c('0x1d')]=qs[_0xc21c('0x1d')](_0x615a75[_0xc21c('0x32')][_0xc21c('0x1d')]);}return _0x4977b9['getActions'](_0x7fece2);}})[_0xc21c('0x26')](function(_0x3e95a9){if(_0x3e95a9){return _0x3e95a9?{'count':_0x2639a4,'rows':_0x3e95a9}:null;}})['then'](respondWithResult(_0x457147,null))[_0xc21c('0x43')](handleError(_0x457147,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6438964..a9a7cd7 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 _0x7d48=['../../config/environment','./automation.attributes','exports','Automation','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x270aba,_0x13305c){var _0x44dda3=function(_0x428d28){while(--_0x428d28){_0x270aba['push'](_0x270aba['shift']());}};_0x44dda3(++_0x13305c);}(_0x7d48,0xdc));var _0x87d4=function(_0x32a669,_0x3f7a07){_0x32a669=_0x32a669-0x0;var _0x124a57=_0x7d48[_0x32a669];return _0x124a57;};'use strict';var _=require(_0x87d4('0x0'));var util=require(_0x87d4('0x1'));var logger=require(_0x87d4('0x2'))(_0x87d4('0x3'));var moment=require(_0x87d4('0x4'));var BPromise=require(_0x87d4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87d4('0x6'));var rimraf=require(_0x87d4('0x7'));var config=require(_0x87d4('0x8'));var attributes=require(_0x87d4('0x9'));module[_0x87d4('0xa')]=function(_0x50abb1,_0x57cc0a){return _0x50abb1['define'](_0x87d4('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d46=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Automation','tools_automations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d46,0x1e0));var _0x60d4=function(_0x1280fc,_0x46e1ca){_0x1280fc=_0x1280fc-0x0;var _0x1eab1f=_0x0d46[_0x1280fc];return _0x1eab1f;};'use strict';var _=require(_0x60d4('0x0'));var util=require(_0x60d4('0x1'));var logger=require(_0x60d4('0x2'))(_0x60d4('0x3'));var moment=require(_0x60d4('0x4'));var BPromise=require(_0x60d4('0x5'));var rp=require(_0x60d4('0x6'));var fs=require('fs');var path=require(_0x60d4('0x7'));var rimraf=require(_0x60d4('0x8'));var config=require(_0x60d4('0x9'));var attributes=require('./automation.attributes');module['exports']=function(_0x2a8f2b,_0x31dfcf){return _0x2a8f2b[_0x60d4('0xa')](_0x60d4('0xb'),attributes,{'tableName':_0x60d4('0xc'),'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 b00f10b..4da4fda 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 _0xa9fc=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','Automation,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa9fc,0x19f));var _0xca9f=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0xa9fc[_0x33554b];return _0x256954;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var BPromise=require(_0xca9f('0x3'));var rs=require(_0xca9f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca9f('0x6'))(_0xca9f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48f9ca,_0x39963d,_0x61b1b6){return new BPromise(function(_0x400980,_0xf7ebb1){return client[_0xca9f('0x9')](_0x48f9ca,_0x61b1b6)[_0xca9f('0xa')](function(_0x4713f0){logger[_0xca9f('0xb')]('Automation,\x20%s,\x20%s',_0x39963d,_0xca9f('0xc'));logger[_0xca9f('0xd')](_0xca9f('0xe'),_0x39963d,_0xca9f('0xc'),JSON['stringify'](_0x4713f0));if(_0x4713f0[_0xca9f('0xf')]){if(_0x4713f0[_0xca9f('0xf')]['code']===0x1f4){logger[_0xca9f('0xf')](_0xca9f('0x10'),_0x39963d,_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);return _0xf7ebb1(_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);}logger[_0xca9f('0xf')](_0xca9f('0x10'),_0x39963d,_0x4713f0[_0xca9f('0xf')][_0xca9f('0x11')]);return _0x400980(_0x4713f0['error']['message']);}else{logger[_0xca9f('0xb')]('Automation,\x20%s,\x20%s',_0x39963d,'request\x20sent');_0x400980(_0x4713f0[_0xca9f('0x12')][_0xca9f('0x11')]);}})['catch'](function(_0x4afedf){logger['error'](_0xca9f('0x10'),_0x39963d,_0x4afedf);_0xf7ebb1(_0x4afedf);});});}
\ No newline at end of file
+var _0x8383=['stringify','error','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c222b,_0x5d2eb7){var _0xd9fdbb=function(_0x3aa0d2){while(--_0x3aa0d2){_0x3c222b['push'](_0x3c222b['shift']());}};_0xd9fdbb(++_0x5d2eb7);}(_0x8383,0x98));var _0x3838=function(_0x5ca1c2,_0x2cecf5){_0x5ca1c2=_0x5ca1c2-0x0;var _0x5b5fde=_0x8383[_0x5ca1c2];return _0x5b5fde;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3838('0x1'));var rs=require(_0x3838('0x2'));var fs=require('fs');var Redis=require(_0x3838('0x3'));var db=require(_0x3838('0x4'))['db'];var utils=require(_0x3838('0x5'));var logger=require(_0x3838('0x6'))(_0x3838('0x7'));var config=require(_0x3838('0x8'));var jayson=require(_0x3838('0x9'));var client=jayson[_0x3838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239750,_0x235001,_0x4cf52b){return new BPromise(function(_0x2abbda,_0x5e2e42){return client[_0x3838('0xb')](_0x239750,_0x4cf52b)[_0x3838('0xc')](function(_0x340c39){logger['info'](_0x3838('0xd'),_0x235001,_0x3838('0xe'));logger[_0x3838('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x235001,_0x3838('0xe'),JSON[_0x3838('0x10')](_0x340c39));if(_0x340c39[_0x3838('0x11')]){if(_0x340c39[_0x3838('0x11')]['code']===0x1f4){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')]['message']);return _0x5e2e42(_0x340c39[_0x3838('0x11')]['message']);}logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')][_0x3838('0x12')]);return _0x2abbda(_0x340c39[_0x3838('0x11')]['message']);}else{logger[_0x3838('0x13')](_0x3838('0xd'),_0x235001,_0x3838('0xe'));_0x2abbda(_0x340c39[_0x3838('0x14')][_0x3838('0x12')]);}})['catch'](function(_0x464fd9){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x464fd9);_0x5e2e42(_0x464fd9);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 623d43e..5f17dc4 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 _0xeea0=['post','/:id/conditions','addConditions','addActions','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions'];(function(_0x375b8a,_0x56ddf6){var _0x304c8f=function(_0xfb6d09){while(--_0xfb6d09){_0x375b8a['push'](_0x375b8a['shift']());}};_0x304c8f(++_0x56ddf6);}(_0xeea0,0x91));var _0x0eea=function(_0xf3d64b,_0x1e1155){_0xf3d64b=_0xf3d64b-0x0;var _0x4cfdf1=_0xeea0[_0xf3d64b];return _0x4cfdf1;};'use strict';var multer=require(_0x0eea('0x0'));var util=require(_0x0eea('0x1'));var path=require(_0x0eea('0x2'));var timeout=require(_0x0eea('0x3'));var express=require(_0x0eea('0x4'));var router=express['Router']();var fs_extra=require(_0x0eea('0x5'));var auth=require(_0x0eea('0x6'));var interaction=require(_0x0eea('0x7'));var config=require(_0x0eea('0x8'));var controller=require(_0x0eea('0x9'));router[_0x0eea('0xa')]('/',auth[_0x0eea('0xb')](),controller['index']);router[_0x0eea('0xa')](_0x0eea('0xc'),auth[_0x0eea('0xb')](),controller[_0x0eea('0xd')]);router[_0x0eea('0xa')]('/:id/conditions',auth[_0x0eea('0xb')](),controller[_0x0eea('0xe')]);router[_0x0eea('0xa')](_0x0eea('0xf'),auth['isAuthenticated'](),controller['getActions']);router[_0x0eea('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0eea('0x10')](_0x0eea('0x11'),auth['isAuthenticated'](),controller[_0x0eea('0x12')]);router['post'](_0x0eea('0xf'),auth['isAuthenticated'](),controller[_0x0eea('0x13')]);router['put']('/:id',auth[_0x0eea('0xb')](),controller[_0x0eea('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0eea('0x15')]);module[_0x0eea('0x16')]=router;
\ No newline at end of file
+var _0x455d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','getActions','create','post','addConditions','addActions','put','update','delete','/:id','destroy','exports'];(function(_0x3ad219,_0x25d74c){var _0x475d37=function(_0x146238){while(--_0x146238){_0x3ad219['push'](_0x3ad219['shift']());}};_0x475d37(++_0x25d74c);}(_0x455d,0x190));var _0xd455=function(_0x2050cc,_0x328036){_0x2050cc=_0x2050cc-0x0;var _0x236dd1=_0x455d[_0x2050cc];return _0x236dd1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd455('0x0'));var timeout=require(_0xd455('0x1'));var express=require(_0xd455('0x2'));var router=express['Router']();var fs_extra=require(_0xd455('0x3'));var auth=require(_0xd455('0x4'));var interaction=require(_0xd455('0x5'));var config=require(_0xd455('0x6'));var controller=require(_0xd455('0x7'));router[_0xd455('0x8')]('/',auth[_0xd455('0x9')](),controller[_0xd455('0xa')]);router[_0xd455('0x8')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0xb')]);router['get'](_0xd455('0xc'),auth[_0xd455('0x9')](),controller[_0xd455('0xd')]);router[_0xd455('0x8')]('/:id/actions',auth[_0xd455('0x9')](),controller[_0xd455('0xe')]);router['post']('/',auth[_0xd455('0x9')](),controller[_0xd455('0xf')]);router[_0xd455('0x10')](_0xd455('0xc'),auth[_0xd455('0x9')](),controller[_0xd455('0x11')]);router['post']('/:id/actions',auth[_0xd455('0x9')](),controller[_0xd455('0x12')]);router[_0xd455('0x13')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0x14')]);router[_0xd455('0x15')](_0xd455('0x16'),auth[_0xd455('0x9')](),controller[_0xd455('0x17')]);module[_0xd455('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e71848f..162ea20 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 _0x7a3d=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','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)'];(function(_0x3d4cf7,_0x445fba){var _0x34d183=function(_0x4abd59){while(--_0x4abd59){_0x3d4cf7['push'](_0x3d4cf7['shift']());}};_0x34d183(++_0x445fba);}(_0x7a3d,0x1d1));var _0xd7a3=function(_0x579ac5,_0x40ef64){_0x579ac5=_0x579ac5-0x0;var _0x4eec60=_0x7a3d[_0x579ac5];return _0x4eec60;};'use strict';var Sequelize=require('sequelize');module[_0xd7a3('0x0')]={'name':{'type':Sequelize[_0xd7a3('0x1')],'unique':_0xd7a3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd7a3('0x3')](_0xd7a3('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xd7a3('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xd7a3('0x5')](0x4)[_0xd7a3('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd7a3('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd7a3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd7a3('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7a3('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd7a3('0x5')](0x5)[_0xd7a3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7a3('0x9')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7a3('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'defaultValue':0x3,'comment':_0xd7a3('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7a3('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd7a3('0xd')},'dialTimezone':{'type':Sequelize[_0xd7a3('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd7a3('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xd7a3('0x3')]('always',_0xd7a3('0xf'),_0xd7a3('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd7a3('0x11')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd7a3('0x5')](0x9)[_0xd7a3('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd7a3('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xd7a3('0x5')](0x9)[_0xd7a3('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd7a3('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd7a3('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd7a3('0x5')](0x9)[_0xd7a3('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd7a3('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xd7a3('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd7a3('0x5')](0x9)[_0xd7a3('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd7a3('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd7a3('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd7a3('0x5')](0x5)[_0xd7a3('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd7a3('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd7a3('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd7a3('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xd7a3('0x18')},'dialPrefix':{'type':Sequelize[_0xd7a3('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd7a3('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd7a3('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7a3('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7a3('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7a3('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd7a3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7a3('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7a3('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd7a3('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)[_0xd7a3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd7a3('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7a3('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd7a3('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd7a3('0x5')](0x5)[_0xd7a3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7a3('0x20')}};
\ No newline at end of file
+var _0xae08=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x31a8a7,_0xb6e543){var _0x74b669=function(_0x42e763){while(--_0x42e763){_0x31a8a7['push'](_0x31a8a7['shift']());}};_0x74b669(++_0xb6e543);}(_0xae08,0x115));var _0x8ae0=function(_0x36e360,_0x5e5a7d){_0x36e360=_0x36e360-0x0;var _0x1f240c=_0xae08[_0x36e360];return _0x1f240c;};'use strict';var Sequelize=require('sequelize');module[_0x8ae0('0x0')]={'name':{'type':Sequelize[_0x8ae0('0x1')],'unique':_0x8ae0('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8ae0('0x3')](_0x8ae0('0x4')),'allowNull':![],'defaultValue':_0x8ae0('0x4')},'description':{'type':Sequelize[_0x8ae0('0x1')]},'active':{'type':Sequelize[_0x8ae0('0x5')],'defaultValue':0x0,'comment':_0x8ae0('0x6')},'limitCalls':{'type':Sequelize[_0x8ae0('0x7')](0x4)[_0x8ae0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8ae0('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8ae0('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8ae0('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x8ae0('0x7')](0x3)[_0x8ae0('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x8ae0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ae0('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8ae0('0x7')](0x5)[_0x8ae0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ae0('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8ae0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ae0('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8ae0('0x7')](0x5)[_0x8ae0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8ae0('0x8')],'defaultValue':0x3,'comment':_0x8ae0('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8ae0('0x7')](0x5)[_0x8ae0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ae0('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8ae0('0x7')](0x3)[_0x8ae0('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[_0x8ae0('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x8ae0('0x3')]('always',_0x8ae0('0xf'),'onlyIfOpen'),'defaultValue':_0x8ae0('0x10')},'dialAMDActive':{'type':Sequelize[_0x8ae0('0x5')],'defaultValue':0x0,'comment':_0x8ae0('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8ae0('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8ae0('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x8ae0('0x7')](0x9)[_0x8ae0('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8ae0('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8ae0('0x7')](0x9)[_0x8ae0('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8ae0('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8ae0('0x7')](0x9)[_0x8ae0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8ae0('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x8ae0('0x7')](0x9)[_0x8ae0('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8ae0('0x7')](0x9)[_0x8ae0('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8ae0('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8ae0('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8ae0('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8ae0('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8ae0('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8ae0('0x7')](0x9)[_0x8ae0('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8ae0('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8ae0('0x3')](_0x8ae0('0x1a'),'ASC'),'defaultValue':_0x8ae0('0x1a')},'dialPrefix':{'type':Sequelize[_0x8ae0('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8ae0('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8ae0('0x1b')},'dialCutDigit':{'type':Sequelize[_0x8ae0('0x7')](0x3)[_0x8ae0('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8ae0('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8ae0('0x7')](0x3)[_0x8ae0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ae0('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8ae0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x8ae0('0x7')](0x3)[_0x8ae0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ae0('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x8ae0('0x7')](0x5)[_0x8ae0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ae0('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8ae0('0x7')](0x3)[_0x8ae0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ae0('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x8ae0('0x7')](0x3)[_0x8ae0('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ae0('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8ae0('0x7')](0x5)[_0x8ae0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8ae0('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8ae0('0x7')](0x5)[_0x8ae0('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8ae0('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 545a4d3..44cde43 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 _0x4115=['query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','catch','show','length','includeAll','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','into','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','model'];(function(_0x530245,_0x1541ab){var _0x22506d=function(_0x395400){while(--_0x395400){_0x530245['push'](_0x530245['shift']());}};_0x22506d(++_0x1541ab);}(_0x4115,0x16c));var _0x5411=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x4115[_0xb24a3e];return _0x4038d7;};'use strict';var emlformat=require(_0x5411('0x0'));var rimraf=require(_0x5411('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5411('0x2'));var rp=require(_0x5411('0x3'));var moment=require(_0x5411('0x4'));var BPromise=require(_0x5411('0x5'));var Mustache=require('mustache');var util=require(_0x5411('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5411('0x7'));var ejs=require(_0x5411('0x8'));var fs=require('fs');var fs_extra=require(_0x5411('0x9'));var _=require(_0x5411('0xa'));var squel=require(_0x5411('0xb'));var crypto=require(_0x5411('0xc'));var jsforce=require(_0x5411('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5411('0x7'));var querystring=require(_0x5411('0xe'));var Papa=require(_0x5411('0xf'));var Redis=require(_0x5411('0x10'));var authService=require(_0x5411('0x11'));var qs=require(_0x5411('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5411('0x13'));var logger=require(_0x5411('0x14'))(_0x5411('0x15'));var utils=require(_0x5411('0x16'));var config=require(_0x5411('0x17'));var licenseUtil=require(_0x5411('0x18'));var db=require(_0x5411('0x19'))['db'];function respondWithStatusCode(_0x34d4a5,_0x260555){_0x260555=_0x260555||0xcc;return function(_0x3a2759){if(_0x3a2759){return _0x34d4a5[_0x5411('0x1a')](_0x260555);}return _0x34d4a5[_0x5411('0x1b')](_0x260555)['end']();};}function respondWithResult(_0x526b4a,_0x1fc594){_0x1fc594=_0x1fc594||0xc8;return function(_0x5b91ac){if(_0x5b91ac){return _0x526b4a['status'](_0x1fc594)['json'](_0x5b91ac);}};}function respondWithFilteredResult(_0x177eec,_0x49aa38){return function(_0x404db4){if(_0x404db4){var _0x12fbae=typeof _0x49aa38[_0x5411('0x1c')]===_0x5411('0x1d')&&typeof _0x49aa38[_0x5411('0x1e')]===_0x5411('0x1d');var _0x1bc74a=_0x404db4[_0x5411('0x1f')];var _0x588180=_0x12fbae?0x0:_0x49aa38[_0x5411('0x1c')];var _0x1e99a0=_0x12fbae?_0x404db4[_0x5411('0x1f')]:_0x49aa38[_0x5411('0x1c')]+_0x49aa38['limit'];var _0x425230;if(_0x1e99a0>=_0x1bc74a){_0x1e99a0=_0x1bc74a;_0x425230=0xc8;}else{_0x425230=0xce;}_0x177eec[_0x5411('0x1b')](_0x425230);return _0x177eec[_0x5411('0x20')](_0x5411('0x21'),_0x588180+'-'+_0x1e99a0+'/'+_0x1bc74a)[_0x5411('0x22')](_0x404db4);}return null;};}function patchUpdates(_0x9a36e2){return function(_0x383af0){try{jsonpatch['apply'](_0x383af0,_0x9a36e2,!![]);}catch(_0x49c2de){return BPromise[_0x5411('0x23')](_0x49c2de);}return _0x383af0['save']();};}function saveUpdates(_0x43a0b5,_0x2dd672){return function(_0x250605){if(_0x250605){return _0x250605[_0x5411('0x24')](_0x43a0b5)[_0x5411('0x25')](function(_0x1d7e8d){return _0x1d7e8d;});}return null;};}function removeEntity(_0x5d57e7,_0xd596ad){return function(_0x303895){if(_0x303895){return _0x303895[_0x5411('0x26')]()[_0x5411('0x25')](function(){var _0x32eac5=_0x303895['get']({'plain':!![]});var _0x46fe38=_0x5411('0x27');return db[_0x5411('0x28')][_0x5411('0x26')]({'where':{'type':_0x46fe38,'resourceId':_0x32eac5['id']}})[_0x5411('0x25')](function(){return _0x303895;});})['then'](function(){_0x5d57e7['status'](0xcc)[_0x5411('0x29')]();});}};}function handleEntityNotFound(_0x1281ee,_0x502f78){return function(_0x1a4761){if(!_0x1a4761){_0x1281ee[_0x5411('0x1a')](0x194);}return _0x1a4761;};}function handleError(_0x2d0505,_0x22d86a){_0x22d86a=_0x22d86a||0x1f4;return function(_0x2e47f5){logger[_0x5411('0x2a')](_0x2e47f5[_0x5411('0x2b')]);if(_0x2e47f5[_0x5411('0x2c')]){delete _0x2e47f5[_0x5411('0x2c')];}_0x2d0505[_0x5411('0x1b')](_0x22d86a)[_0x5411('0x2d')](_0x2e47f5);};}exports[_0x5411('0x2e')]=function(_0x259871,_0x15fa41){var _0x39de76={},_0x13c72d={},_0x35f20c={'count':0x0,'rows':[]};var _0x1435de=_[_0x5411('0x2f')](db[_0x5411('0x30')][_0x5411('0x31')],function(_0x298b59){return{'name':_0x298b59['fieldName'],'type':_0x298b59[_0x5411('0x32')][_0x5411('0x33')]};});_0x13c72d[_0x5411('0x34')]=_[_0x5411('0x2f')](_0x1435de,_0x5411('0x2c'));_0x13c72d[_0x5411('0x35')]=_[_0x5411('0x36')](_0x259871[_0x5411('0x35')]);_0x13c72d['filters']=_['intersection'](_0x13c72d['model'],_0x13c72d[_0x5411('0x35')]);_0x39de76[_0x5411('0x37')]=_[_0x5411('0x38')](_0x13c72d['model'],qs[_0x5411('0x39')](_0x259871['query'][_0x5411('0x39')]));_0x39de76[_0x5411('0x37')]=_0x39de76[_0x5411('0x37')]['length']?_0x39de76[_0x5411('0x37')]:_0x13c72d[_0x5411('0x34')];if(!_0x259871[_0x5411('0x35')][_0x5411('0x3a')](_0x5411('0x3b'))){_0x39de76[_0x5411('0x1e')]=qs[_0x5411('0x1e')](_0x259871[_0x5411('0x35')][_0x5411('0x1e')]);_0x39de76[_0x5411('0x1c')]=qs[_0x5411('0x1c')](_0x259871[_0x5411('0x35')]['offset']);}_0x39de76[_0x5411('0x3c')]=qs[_0x5411('0x3d')](_0x259871['query'][_0x5411('0x3d')]);_0x39de76[_0x5411('0x3e')]=qs[_0x5411('0x3f')](_['pick'](_0x259871['query'],_0x13c72d[_0x5411('0x3f')]),_0x1435de);if(_0x259871[_0x5411('0x35')][_0x5411('0x40')]){_0x39de76[_0x5411('0x3e')]=_['merge'](_0x39de76['where'],{'$or':_[_0x5411('0x2f')](_0x1435de,function(_0x3df57c){if(_0x3df57c[_0x5411('0x32')]!==_0x5411('0x41')){var _0x42237d={};_0x42237d[_0x3df57c[_0x5411('0x2c')]]={'$like':'%'+_0x259871['query'][_0x5411('0x40')]+'%'};return _0x42237d;}})});}_0x39de76=_[_0x5411('0x42')]({},_0x39de76,_0x259871[_0x5411('0x43')]);var _0x7fbe7f={'where':_0x39de76['where']};return db[_0x5411('0x30')][_0x5411('0x1f')](_0x7fbe7f)['then'](function(_0x1d6210){_0x35f20c['count']=_0x1d6210;if(_0x259871[_0x5411('0x35')]['includeAll']){_0x39de76[_0x5411('0x44')]=[{'all':!![]}];}return db[_0x5411('0x30')][_0x5411('0x45')](_0x39de76);})[_0x5411('0x25')](function(_0x214fc8){_0x35f20c['rows']=_0x214fc8;return _0x35f20c;})[_0x5411('0x25')](respondWithFilteredResult(_0x15fa41,_0x39de76))[_0x5411('0x46')](handleError(_0x15fa41,null));};exports[_0x5411('0x47')]=function(_0x2ed8fd,_0x4ed315){var _0x2e32f3={'raw':![],'where':{'id':_0x2ed8fd['params']['id']}},_0x29d3a3={};_0x29d3a3[_0x5411('0x34')]=_['keys'](db[_0x5411('0x30')]['rawAttributes']);_0x29d3a3[_0x5411('0x35')]=_[_0x5411('0x36')](_0x2ed8fd[_0x5411('0x35')]);_0x29d3a3[_0x5411('0x3f')]=_[_0x5411('0x38')](_0x29d3a3[_0x5411('0x34')],_0x29d3a3[_0x5411('0x35')]);_0x2e32f3['attributes']=_[_0x5411('0x38')](_0x29d3a3['model'],qs['fields'](_0x2ed8fd[_0x5411('0x35')][_0x5411('0x39')]));_0x2e32f3[_0x5411('0x37')]=_0x2e32f3[_0x5411('0x37')][_0x5411('0x48')]?_0x2e32f3['attributes']:_0x29d3a3[_0x5411('0x34')];if(_0x2ed8fd[_0x5411('0x35')][_0x5411('0x49')]){_0x2e32f3[_0x5411('0x44')]=[{'all':!![]}];}_0x2e32f3=_['merge']({},_0x2e32f3,_0x2ed8fd[_0x5411('0x43')]);return db[_0x5411('0x30')][_0x5411('0x4a')](_0x2e32f3)[_0x5411('0x25')](handleEntityNotFound(_0x4ed315,null))[_0x5411('0x25')](respondWithResult(_0x4ed315,null))[_0x5411('0x46')](handleError(_0x4ed315,null));};exports[_0x5411('0x4b')]=function(_0x14d6ed,_0x336897){return db[_0x5411('0x30')][_0x5411('0x4b')](_0x14d6ed[_0x5411('0x4c')],{})[_0x5411('0x25')](function(_0x143355){var _0xffd844=_0x14d6ed['user'][_0x5411('0x4d')]({'plain':!![]});if(!_0xffd844)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffd844[_0x5411('0x4e')]===_0x5411('0x4f')){var _0x4ffb4a=_0x143355[_0x5411('0x4d')]({'plain':!![]});var _0x1493c6=_0x5411('0x27');return db[_0x5411('0x50')][_0x5411('0x4a')]({'where':{'name':_0x1493c6,'userProfileId':_0xffd844[_0x5411('0x51')]},'raw':!![]})[_0x5411('0x25')](function(_0x313f53){if(_0x313f53&&_0x313f53[_0x5411('0x52')]===0x0){return db[_0x5411('0x28')][_0x5411('0x4b')]({'name':_0x4ffb4a[_0x5411('0x2c')],'resourceId':_0x4ffb4a['id'],'type':_0x313f53[_0x5411('0x2c')],'sectionId':_0x313f53['id']},{})[_0x5411('0x25')](function(){return _0x143355;});}else{return _0x143355;}})[_0x5411('0x46')](function(_0x4151c8){logger[_0x5411('0x2a')](_0x5411('0x53'),_0x4151c8);throw _0x4151c8;});}return _0x143355;})[_0x5411('0x25')](respondWithResult(_0x336897,0xc9))['catch'](handleError(_0x336897,null));};exports[_0x5411('0x54')]=function(_0xdccae8,_0x452a8c){var _0x1f5f70={'where':{'id':_0xdccae8[_0x5411('0x55')]['id']}},_0x123ab0={};_0x123ab0['model']=_['keys'](db[_0x5411('0x30')]['rawAttributes']);_0x1f5f70[_0x5411('0x37')]=_['intersection'](_0x123ab0[_0x5411('0x34')],qs[_0x5411('0x39')](_0xdccae8['query'][_0x5411('0x39')]));_0x1f5f70[_0x5411('0x37')]=_0x1f5f70[_0x5411('0x37')]['length']?_0x1f5f70[_0x5411('0x37')]:_0x123ab0[_0x5411('0x34')];if(_0xdccae8[_0x5411('0x35')]['includeAll']){_0x1f5f70[_0x5411('0x44')]=[{'all':!![]}];}_0x1f5f70=_['merge']({},_0x1f5f70,_0xdccae8[_0x5411('0x43')]);return db[_0x5411('0x30')][_0x5411('0x4a')](_0x1f5f70)['then'](handleEntityNotFound(_0x452a8c,null))[_0x5411('0x25')](function(_0x3f5aaf){if(_0x3f5aaf){var _0x360b6c=_0x3f5aaf[_0x5411('0x4d')]({'plain':!![]});_0x360b6c=qs[_0x5411('0x56')](_0x360b6c,['id','createdAt',_0x5411('0x57')]);_0xdccae8['body']=_[_0x5411('0x56')](_0xdccae8[_0x5411('0x4c')],['id',_0x5411('0x58'),_0x5411('0x57')]);return db[_0x5411('0x30')][_0x5411('0x4b')](_['merge'](_0x360b6c,_0xdccae8[_0x5411('0x4c')]),{'include':_0xdccae8[_0x5411('0x35')][_0x5411('0x49')]?[{'all':!![]}]:undefined})[_0x5411('0x25')](function(_0x1280dd){var _0x16bd7b=_0xdccae8[_0x5411('0x4f')]['get']({'plain':!![]});if(!_0x16bd7b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16bd7b[_0x5411('0x4e')]===_0x5411('0x4f')){var _0x30e035=_0x1280dd['get']({'plain':!![]});var _0x33b32c=_0x5411('0x27');return db[_0x5411('0x50')][_0x5411('0x4a')]({'where':{'name':_0x33b32c,'userProfileId':_0x16bd7b['userProfileId']},'raw':!![]})['then'](function(_0x2e424f){if(_0x2e424f&&_0x2e424f[_0x5411('0x52')]===0x0){return db[_0x5411('0x28')][_0x5411('0x4b')]({'name':_0x30e035[_0x5411('0x2c')],'resourceId':_0x30e035['id'],'type':_0x2e424f['name'],'sectionId':_0x2e424f['id']},{})[_0x5411('0x25')](function(){return _0x1280dd;});}else{return _0x1280dd;}})[_0x5411('0x46')](function(_0xa2a7ef){logger['error'](_0x5411('0x53'),_0xa2a7ef);throw _0xa2a7ef;});}return _0x1280dd;});}})[_0x5411('0x25')](respondWithResult(_0x452a8c,0xc9))['catch'](handleError(_0x452a8c,null));};exports[_0x5411('0x24')]=function(_0x4ff3d8,_0x3d1215){if(_0x4ff3d8['body']['id']){delete _0x4ff3d8[_0x5411('0x4c')]['id'];}return db[_0x5411('0x30')][_0x5411('0x4a')]({'where':{'id':_0x4ff3d8[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x3d1215,null))[_0x5411('0x25')](saveUpdates(_0x4ff3d8[_0x5411('0x4c')],null))[_0x5411('0x25')](respondWithResult(_0x3d1215,null))[_0x5411('0x46')](handleError(_0x3d1215,null));};exports[_0x5411('0x26')]=function(_0x1bb35f,_0x50f3c0){return db[_0x5411('0x30')][_0x5411('0x4a')]({'where':{'id':_0x1bb35f['params']['id']}})['then'](handleEntityNotFound(_0x50f3c0,null))['then'](removeEntity(_0x50f3c0,null))['catch'](handleError(_0x50f3c0,null));};exports[_0x5411('0x59')]=function(_0x39e899,_0x4251bb,_0x51b791){var _0x4e3276={'raw':!![],'where':{}};var _0x48a29c={};var _0x36b3c6={'count':0x0,'rows':[]};return db[_0x5411('0x30')][_0x5411('0x5a')]({'where':{'id':_0x39e899[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x4251bb,null))[_0x5411('0x25')](function(_0x30fd1a){if(_0x30fd1a){_0x48a29c[_0x5411('0x34')]=_[_0x5411('0x36')](db['CmHopper'][_0x5411('0x31')]);_0x48a29c[_0x5411('0x35')]=_[_0x5411('0x36')](_0x39e899[_0x5411('0x35')]);_0x48a29c['filters']=_[_0x5411('0x38')](_0x48a29c[_0x5411('0x34')],_0x48a29c[_0x5411('0x35')]);_0x4e3276[_0x5411('0x37')]=_[_0x5411('0x38')](_0x48a29c['model'],qs['fields'](_0x39e899['query'][_0x5411('0x39')]));_0x4e3276[_0x5411('0x37')]=_0x4e3276[_0x5411('0x37')][_0x5411('0x48')]?_0x4e3276[_0x5411('0x37')]:_0x48a29c[_0x5411('0x34')];if(!_0x39e899[_0x5411('0x35')]['hasOwnProperty']('nolimit')){_0x4e3276[_0x5411('0x1e')]=qs['limit'](_0x39e899[_0x5411('0x35')][_0x5411('0x1e')]);_0x4e3276['offset']=qs['offset'](_0x39e899[_0x5411('0x35')][_0x5411('0x1c')]);}_0x4e3276[_0x5411('0x3c')]=qs[_0x5411('0x3d')](_0x39e899[_0x5411('0x35')][_0x5411('0x3d')]);_0x4e3276['where']=qs['filters'](_[_0x5411('0x5b')](_0x39e899[_0x5411('0x35')],_0x48a29c[_0x5411('0x3f')]));_0x4e3276[_0x5411('0x3e')][_0x5411('0x5c')]=_0x30fd1a['id'];if(_0x39e899[_0x5411('0x35')][_0x5411('0x40')]){_0x4e3276[_0x5411('0x3e')]=_[_0x5411('0x42')](_0x4e3276[_0x5411('0x3e')],{'$or':_[_0x5411('0x2f')](_0x4e3276['attributes'],function(_0x265c94){var _0x5ab848={};_0x5ab848[_0x265c94]={'$like':'%'+_0x39e899[_0x5411('0x35')][_0x5411('0x40')]+'%'};return _0x5ab848;})});}_0x4e3276=_[_0x5411('0x42')]({},_0x4e3276,_0x39e899[_0x5411('0x43')]);return db[_0x5411('0x5d')][_0x5411('0x1f')]({'where':_0x4e3276[_0x5411('0x3e')]})[_0x5411('0x25')](function(_0x40a89c){_0x36b3c6[_0x5411('0x1f')]=_0x40a89c;if(_0x39e899[_0x5411('0x35')][_0x5411('0x49')]){_0x4e3276[_0x5411('0x44')]=[{'all':!![]}];}return db[_0x5411('0x5d')][_0x5411('0x45')](_0x4e3276);})[_0x5411('0x25')](function(_0x3cb3ad){_0x36b3c6['rows']=_0x3cb3ad;return _0x36b3c6;});}})['then'](respondWithFilteredResult(_0x4251bb,_0x4e3276))[_0x5411('0x46')](handleError(_0x4251bb,null));};exports[_0x5411('0x5e')]=function(_0x99bfb,_0x2fc3b9,_0x496751){var _0x2ddcb8={'raw':!![],'where':{}};var _0x5af668={};var _0x2af265={'count':0x0,'rows':[]};return db[_0x5411('0x30')][_0x5411('0x5a')]({'where':{'id':_0x99bfb[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x2fc3b9,null))[_0x5411('0x25')](function(_0x3dd0fe){if(_0x3dd0fe){_0x5af668[_0x5411('0x34')]=_[_0x5411('0x36')](db[_0x5411('0x5f')][_0x5411('0x31')]);_0x5af668['query']=_[_0x5411('0x36')](_0x99bfb[_0x5411('0x35')]);_0x5af668['filters']=_[_0x5411('0x38')](_0x5af668[_0x5411('0x34')],_0x5af668['query']);_0x2ddcb8[_0x5411('0x37')]=_['intersection'](_0x5af668[_0x5411('0x34')],qs['fields'](_0x99bfb[_0x5411('0x35')][_0x5411('0x39')]));_0x2ddcb8['attributes']=_0x2ddcb8[_0x5411('0x37')]['length']?_0x2ddcb8[_0x5411('0x37')]:_0x5af668['model'];if(!_0x99bfb['query'][_0x5411('0x3a')](_0x5411('0x3b'))){_0x2ddcb8['limit']=qs['limit'](_0x99bfb[_0x5411('0x35')][_0x5411('0x1e')]);_0x2ddcb8[_0x5411('0x1c')]=qs[_0x5411('0x1c')](_0x99bfb[_0x5411('0x35')][_0x5411('0x1c')]);}_0x2ddcb8[_0x5411('0x3c')]=qs[_0x5411('0x3d')](_0x99bfb[_0x5411('0x35')]['sort']);_0x2ddcb8[_0x5411('0x3e')]=qs[_0x5411('0x3f')](_[_0x5411('0x5b')](_0x99bfb[_0x5411('0x35')],_0x5af668['filters']));_0x2ddcb8[_0x5411('0x3e')][_0x5411('0x5c')]=_0x3dd0fe['id'];if(_0x99bfb['query'][_0x5411('0x40')]){_0x2ddcb8[_0x5411('0x3e')]=_['merge'](_0x2ddcb8['where'],{'$or':_[_0x5411('0x2f')](_0x2ddcb8[_0x5411('0x37')],function(_0x8d2356){var _0x2c5f8c={};_0x2c5f8c[_0x8d2356]={'$like':'%'+_0x99bfb[_0x5411('0x35')][_0x5411('0x40')]+'%'};return _0x2c5f8c;})});}_0x2ddcb8=_[_0x5411('0x42')]({},_0x2ddcb8,_0x99bfb[_0x5411('0x43')]);return db[_0x5411('0x5f')][_0x5411('0x1f')]({'where':_0x2ddcb8[_0x5411('0x3e')]})[_0x5411('0x25')](function(_0x2256ef){_0x2af265['count']=_0x2256ef;if(_0x99bfb[_0x5411('0x35')][_0x5411('0x49')]){_0x2ddcb8[_0x5411('0x44')]=[{'all':!![]}];}return db[_0x5411('0x5f')][_0x5411('0x45')](_0x2ddcb8);})[_0x5411('0x25')](function(_0x1df7f2){_0x2af265[_0x5411('0x60')]=_0x1df7f2;return _0x2af265;});}})[_0x5411('0x25')](respondWithFilteredResult(_0x2fc3b9,_0x2ddcb8))[_0x5411('0x46')](handleError(_0x2fc3b9,null));};exports[_0x5411('0x61')]=function(_0x3531bb,_0x10b40d,_0x150eac){var _0x4de7b4={'raw':!![],'where':{}};var _0x90c52b={};var _0x435db8={'count':0x0,'rows':[]};return db[_0x5411('0x30')][_0x5411('0x5a')]({'where':{'id':_0x3531bb[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x10b40d,null))[_0x5411('0x25')](function(_0xc0dea0){if(_0xc0dea0){_0x90c52b['model']=_[_0x5411('0x36')](db['CmHopperFinal'][_0x5411('0x31')]);_0x90c52b[_0x5411('0x35')]=_[_0x5411('0x36')](_0x3531bb['query']);_0x90c52b['filters']=_[_0x5411('0x38')](_0x90c52b[_0x5411('0x34')],_0x90c52b['query']);_0x4de7b4[_0x5411('0x37')]=_[_0x5411('0x38')](_0x90c52b[_0x5411('0x34')],qs[_0x5411('0x39')](_0x3531bb[_0x5411('0x35')]['fields']));_0x4de7b4[_0x5411('0x37')]=_0x4de7b4[_0x5411('0x37')]['length']?_0x4de7b4['attributes']:_0x90c52b['model'];if(!_0x3531bb['query'][_0x5411('0x3a')](_0x5411('0x3b'))){_0x4de7b4[_0x5411('0x1e')]=qs[_0x5411('0x1e')](_0x3531bb['query'][_0x5411('0x1e')]);_0x4de7b4['offset']=qs[_0x5411('0x1c')](_0x3531bb[_0x5411('0x35')][_0x5411('0x1c')]);}_0x4de7b4[_0x5411('0x3c')]=qs['sort'](_0x3531bb[_0x5411('0x35')][_0x5411('0x3d')]);_0x4de7b4['where']=qs[_0x5411('0x3f')](_[_0x5411('0x5b')](_0x3531bb[_0x5411('0x35')],_0x90c52b[_0x5411('0x3f')]));_0x4de7b4['where']['CampaignId']=_0xc0dea0['id'];if(_0x3531bb[_0x5411('0x35')][_0x5411('0x40')]){_0x4de7b4[_0x5411('0x3e')]=_[_0x5411('0x42')](_0x4de7b4[_0x5411('0x3e')],{'$or':_['map'](_0x4de7b4[_0x5411('0x37')],function(_0x2f918c){var _0x21e3cb={};_0x21e3cb[_0x2f918c]={'$like':'%'+_0x3531bb[_0x5411('0x35')]['filter']+'%'};return _0x21e3cb;})});}_0x4de7b4=_[_0x5411('0x42')]({},_0x4de7b4,_0x3531bb['options']);return db[_0x5411('0x62')][_0x5411('0x1f')]({'where':_0x4de7b4[_0x5411('0x3e')]})[_0x5411('0x25')](function(_0x19ce19){_0x435db8[_0x5411('0x1f')]=_0x19ce19;if(_0x3531bb['query'][_0x5411('0x49')]){_0x4de7b4[_0x5411('0x44')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x4de7b4);})[_0x5411('0x25')](function(_0x430d9e){_0x435db8[_0x5411('0x60')]=_0x430d9e;return _0x435db8;});}})[_0x5411('0x25')](respondWithFilteredResult(_0x10b40d,_0x4de7b4))[_0x5411('0x46')](handleError(_0x10b40d,null));};exports['getHopperBlacks']=function(_0x196d5a,_0xe0f988,_0x8a638e){var _0xaa86aa={'raw':!![],'where':{}};var _0x3c710b={};var _0x21a494={'count':0x0,'rows':[]};return db[_0x5411('0x30')]['findOne']({'where':{'id':_0x196d5a[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0xe0f988,null))[_0x5411('0x25')](function(_0x3878b9){if(_0x3878b9){_0x3c710b['model']=_['keys'](db[_0x5411('0x63')][_0x5411('0x31')]);_0x3c710b[_0x5411('0x35')]=_['keys'](_0x196d5a['query']);_0x3c710b['filters']=_[_0x5411('0x38')](_0x3c710b[_0x5411('0x34')],_0x3c710b[_0x5411('0x35')]);_0xaa86aa[_0x5411('0x37')]=_[_0x5411('0x38')](_0x3c710b['model'],qs[_0x5411('0x39')](_0x196d5a[_0x5411('0x35')][_0x5411('0x39')]));_0xaa86aa['attributes']=_0xaa86aa['attributes'][_0x5411('0x48')]?_0xaa86aa[_0x5411('0x37')]:_0x3c710b['model'];if(!_0x196d5a['query'][_0x5411('0x3a')](_0x5411('0x3b'))){_0xaa86aa[_0x5411('0x1e')]=qs[_0x5411('0x1e')](_0x196d5a[_0x5411('0x35')][_0x5411('0x1e')]);_0xaa86aa['offset']=qs[_0x5411('0x1c')](_0x196d5a[_0x5411('0x35')][_0x5411('0x1c')]);}_0xaa86aa['order']=qs['sort'](_0x196d5a[_0x5411('0x35')][_0x5411('0x3d')]);_0xaa86aa[_0x5411('0x3e')]=qs[_0x5411('0x3f')](_[_0x5411('0x5b')](_0x196d5a[_0x5411('0x35')],_0x3c710b[_0x5411('0x3f')]));_0xaa86aa[_0x5411('0x3e')]['CampaignId']=_0x3878b9['id'];if(_0x196d5a[_0x5411('0x35')][_0x5411('0x40')]){_0xaa86aa['where']=_[_0x5411('0x42')](_0xaa86aa[_0x5411('0x3e')],{'$or':_['map'](_0xaa86aa[_0x5411('0x37')],function(_0xbed050){var _0x31b8fb={};_0x31b8fb[_0xbed050]={'$like':'%'+_0x196d5a[_0x5411('0x35')][_0x5411('0x40')]+'%'};return _0x31b8fb;})});}_0xaa86aa=_[_0x5411('0x42')]({},_0xaa86aa,_0x196d5a[_0x5411('0x43')]);return db[_0x5411('0x63')]['count']({'where':_0xaa86aa[_0x5411('0x3e')]})[_0x5411('0x25')](function(_0x50551a){_0x21a494['count']=_0x50551a;if(_0x196d5a['query'][_0x5411('0x49')]){_0xaa86aa['include']=[{'all':!![]}];}return db[_0x5411('0x63')]['findAll'](_0xaa86aa);})[_0x5411('0x25')](function(_0x2b73f9){_0x21a494['rows']=_0x2b73f9;return _0x21a494;});}})[_0x5411('0x25')](respondWithFilteredResult(_0xe0f988,_0xaa86aa))[_0x5411('0x46')](handleError(_0xe0f988,null));};exports[_0x5411('0x64')]=function(_0x10c67d,_0x5aae5e,_0x38c6fc){var _0x464825={};var _0x23a9cb={};var _0x73b1c3;var _0x566a17;return db['Campaign'][_0x5411('0x5a')]({'where':{'id':_0x10c67d[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x5aae5e,null))['then'](function(_0x73bb44){if(_0x73bb44){_0x73b1c3=_0x73bb44;_0x23a9cb['model']=_[_0x5411('0x36')](db[_0x5411('0x65')][_0x5411('0x31')]);_0x23a9cb[_0x5411('0x35')]=_[_0x5411('0x36')](_0x10c67d[_0x5411('0x35')]);_0x23a9cb[_0x5411('0x3f')]=_[_0x5411('0x38')](_0x23a9cb['model'],_0x23a9cb[_0x5411('0x35')]);_0x464825[_0x5411('0x37')]=_[_0x5411('0x38')](_0x23a9cb['model'],qs[_0x5411('0x39')](_0x10c67d['query'][_0x5411('0x39')]));_0x464825[_0x5411('0x37')]=_0x464825[_0x5411('0x37')][_0x5411('0x48')]?_0x464825[_0x5411('0x37')]:_0x23a9cb['model'];_0x464825['order']=qs['sort'](_0x10c67d[_0x5411('0x35')][_0x5411('0x3d')]);_0x464825[_0x5411('0x3e')]=qs['filters'](_[_0x5411('0x5b')](_0x10c67d[_0x5411('0x35')],_0x23a9cb['filters']));if(_0x10c67d[_0x5411('0x35')]['filter']){_0x464825[_0x5411('0x3e')]=_[_0x5411('0x42')](_0x464825['where'],{'$or':_[_0x5411('0x2f')](_0x464825[_0x5411('0x37')],function(_0x39a841){var _0x4e7192={};_0x4e7192[_0x39a841]={'$like':'%'+_0x10c67d[_0x5411('0x35')][_0x5411('0x40')]+'%'};return _0x4e7192;})});}_0x464825=_[_0x5411('0x42')]({},_0x464825,_0x10c67d[_0x5411('0x43')]);return _0x73b1c3[_0x5411('0x64')](_0x464825);}})[_0x5411('0x25')](function(_0x1d2ff9){if(_0x1d2ff9){_0x566a17=_0x1d2ff9['length'];if(!_0x10c67d[_0x5411('0x35')]['hasOwnProperty'](_0x5411('0x3b'))){_0x464825[_0x5411('0x1e')]=qs[_0x5411('0x1e')](_0x10c67d[_0x5411('0x35')][_0x5411('0x1e')]);_0x464825[_0x5411('0x1c')]=qs[_0x5411('0x1c')](_0x10c67d[_0x5411('0x35')][_0x5411('0x1c')]);}return _0x73b1c3['getLists'](_0x464825);}})['then'](function(_0x5a421f){if(_0x5a421f){return _0x5a421f?{'count':_0x566a17,'rows':_0x5a421f}:null;}})[_0x5411('0x25')](respondWithResult(_0x5aae5e,null))[_0x5411('0x46')](handleError(_0x5aae5e,null));};exports[_0x5411('0x66')]=function(_0x3684c5,_0x139ddf,_0xce6c9){var _0x125230,_0x3e197f;return db['Campaign']['find']({'where':{'id':_0x3684c5['params']['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x139ddf,null))[_0x5411('0x25')](function(_0x4f5306){if(_0x4f5306){_0x3e197f=_0x4f5306;return _0x4f5306['addLists'](_0x3684c5[_0x5411('0x4c')][_0x5411('0x67')],_[_0x5411('0x56')](_0x3684c5[_0x5411('0x4c')],[_0x5411('0x67'),'id'])||{});}return null;})[_0x5411('0x68')](function(_0x415fe9){var _0x2597e8;_0x125230=_0x415fe9||[];var _0x4da8a8=[];if(_0x415fe9){for(var _0x40843c=0x0;_0x40843c<_0x415fe9[_0x5411('0x48')];_0x40843c+=0x1){var _0x1fcb27=_0x415fe9[_0x40843c][_0x5411('0x4d')]({'plain':!![]});_0x3e197f[_0x5411('0x69')]=_0x3684c5['body'][_0x5411('0x69')]?_0x3684c5[_0x5411('0x4c')]['dialCheckDuplicateType']:_0x3e197f[_0x5411('0x69')];switch(_0x3e197f[_0x5411('0x69')]){case _0x5411('0x6a'):_0x2597e8=squel[_0x5411('0x6b')]()['into'](_0x5411('0x6c'))[_0x5411('0x6d')](['phone',_0x5411('0x6e'),_0x5411('0x6f'),_0x5411('0x70'),'CampaignId',_0x5411('0x58'),_0x5411('0x57')],squel[_0x5411('0x71')]()[_0x5411('0x72')](_0x5411('0x73'),_0x5411('0x73'))[_0x5411('0x72')]('NOW()',_0x5411('0x6e'))['field']('id',_0x5411('0x6f'))[_0x5411('0x72')](_0x1fcb27[_0x5411('0x74')][_0x5411('0x75')](),_0x5411('0x70'))['field'](_0x3684c5[_0x5411('0x55')]['id']['toString'](),_0x5411('0x5c'))[_0x5411('0x72')](_0x5411('0x76'),'createdAt')['field'](_0x5411('0x76'),_0x5411('0x57'))[_0x5411('0x77')](_0x5411('0x78'))[_0x5411('0x3e')](_0x5411('0x79'))[_0x5411('0x3e')](_0x5411('0x7a'),_0x1fcb27[_0x5411('0x74')][_0x5411('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x5411('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5411('0x72')](_0x5411('0x7b'))['from'](_0x5411('0x7c'))[_0x5411('0x3e')]('CampaignId\x20=\x20?',_0x3684c5[_0x5411('0x55')]['id']['toString']()))[_0x5411('0x3e')](_0x5411('0x7d'),squel[_0x5411('0x71')]()[_0x5411('0x72')](_0x5411('0x7e'))[_0x5411('0x77')]('cm_hopper')[_0x5411('0x3e')]('CampaignId\x20=\x20?',_0x3684c5['params']['id'][_0x5411('0x75')]())))[_0x5411('0x75')]();break;case _0x5411('0x7f'):_0x2597e8=squel[_0x5411('0x6b')]()['into'](_0x5411('0x6c'))[_0x5411('0x6d')]([_0x5411('0x73'),_0x5411('0x6e'),_0x5411('0x6f'),_0x5411('0x70'),_0x5411('0x5c'),_0x5411('0x58'),'updatedAt'],squel[_0x5411('0x71')]()['field'](_0x5411('0x73'),_0x5411('0x73'))['field'](_0x5411('0x76'),_0x5411('0x6e'))[_0x5411('0x72')]('id',_0x5411('0x6f'))[_0x5411('0x72')](_0x1fcb27[_0x5411('0x74')][_0x5411('0x75')](),'ListId')['field'](_0x3684c5[_0x5411('0x55')]['id'][_0x5411('0x75')](),_0x5411('0x5c'))[_0x5411('0x72')]('NOW()','createdAt')['field']('NOW()',_0x5411('0x57'))['from']('cm_contacts')['where'](_0x5411('0x79'))[_0x5411('0x3e')]('ListId\x20=\x20?',_0x1fcb27['CmListId']['toString']())['where'](_0x5411('0x80'))[_0x5411('0x3e')](_0x5411('0x7d'),squel[_0x5411('0x71')]()[_0x5411('0x72')](_0x5411('0x7e'))[_0x5411('0x77')](_0x5411('0x6c'))[_0x5411('0x3e')](_0x5411('0x81'),_0x3684c5['params']['id'][_0x5411('0x75')]())))[_0x5411('0x75')]();break;default:_0x2597e8=squel[_0x5411('0x6b')]()['into'](_0x5411('0x6c'))['fromQuery'](['phone',_0x5411('0x6e'),_0x5411('0x6f'),_0x5411('0x70'),_0x5411('0x5c'),_0x5411('0x58'),_0x5411('0x57')],squel[_0x5411('0x71')]()[_0x5411('0x72')](_0x5411('0x73'),_0x5411('0x73'))[_0x5411('0x72')](_0x5411('0x76'),'scheduledAt')['field']('id',_0x5411('0x6f'))[_0x5411('0x72')](_0x1fcb27[_0x5411('0x74')][_0x5411('0x75')](),_0x5411('0x70'))['field'](_0x3684c5['params']['id'][_0x5411('0x75')](),_0x5411('0x5c'))[_0x5411('0x72')]('NOW()',_0x5411('0x58'))[_0x5411('0x72')](_0x5411('0x76'),_0x5411('0x57'))[_0x5411('0x77')](_0x5411('0x78'))['where'](_0x5411('0x79'))['where'](_0x5411('0x7a'),_0x1fcb27['CmListId'][_0x5411('0x75')]())[_0x5411('0x3e')](_0x5411('0x80')))[_0x5411('0x75')]();}_0x4da8a8[_0x5411('0x82')](db[_0x5411('0x83')][_0x5411('0x35')](_0x2597e8));}return BPromise[_0x5411('0x84')](_0x4da8a8);}})['then'](function(){return _0x125230;})['then'](respondWithResult(_0x139ddf,null))['catch'](handleError(_0x139ddf,null));};exports[_0x5411('0x85')]=function(_0x4d2066,_0x4adb97,_0x341403){return db[_0x5411('0x30')][_0x5411('0x4a')]({'where':{'id':_0x4d2066[_0x5411('0x55')]['id']}})['then'](handleEntityNotFound(_0x4adb97,null))['then'](function(_0x4d7e9b){if(_0x4d7e9b){return _0x4d7e9b[_0x5411('0x85')](_0x4d2066[_0x5411('0x35')]['ids']);}})[_0x5411('0x25')](function(_0x1202e6){if(_0x1202e6){return db['CmHopper'][_0x5411('0x26')]({'where':{'ListId':_0x4d2066[_0x5411('0x35')][_0x5411('0x67')],'CampaignId':_0x4d2066[_0x5411('0x55')]['id']}})[_0x5411('0x25')](function(){return _0x1202e6;});}})[_0x5411('0x25')](respondWithStatusCode(_0x4adb97,null))[_0x5411('0x46')](handleError(_0x4adb97,null));};exports[_0x5411('0x86')]=function(_0xd15b2,_0x1c0cfe,_0x5da68d){var _0x4c0ef7={};var _0x47a26b={};var _0x504e1b;var _0x2579b9;return db['Campaign'][_0x5411('0x5a')]({'where':{'id':_0xd15b2[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x1c0cfe,null))[_0x5411('0x25')](function(_0x38615c){if(_0x38615c){_0x504e1b=_0x38615c;_0x47a26b[_0x5411('0x34')]=_['keys'](db[_0x5411('0x65')]['rawAttributes']);_0x47a26b['query']=_['keys'](_0xd15b2[_0x5411('0x35')]);_0x47a26b['filters']=_['intersection'](_0x47a26b[_0x5411('0x34')],_0x47a26b[_0x5411('0x35')]);_0x4c0ef7[_0x5411('0x37')]=_[_0x5411('0x38')](_0x47a26b['model'],qs[_0x5411('0x39')](_0xd15b2[_0x5411('0x35')][_0x5411('0x39')]));_0x4c0ef7['attributes']=_0x4c0ef7[_0x5411('0x37')][_0x5411('0x48')]?_0x4c0ef7['attributes']:_0x47a26b[_0x5411('0x34')];_0x4c0ef7['order']=qs[_0x5411('0x3d')](_0xd15b2['query'][_0x5411('0x3d')]);_0x4c0ef7[_0x5411('0x3e')]=qs[_0x5411('0x3f')](_[_0x5411('0x5b')](_0xd15b2['query'],_0x47a26b[_0x5411('0x3f')]));if(_0xd15b2[_0x5411('0x35')][_0x5411('0x40')]){_0x4c0ef7[_0x5411('0x3e')]=_[_0x5411('0x42')](_0x4c0ef7[_0x5411('0x3e')],{'$or':_['map'](_0x4c0ef7[_0x5411('0x37')],function(_0x532ecd){var _0x1b2a63={};_0x1b2a63[_0x532ecd]={'$like':'%'+_0xd15b2[_0x5411('0x35')][_0x5411('0x40')]+'%'};return _0x1b2a63;})});}_0x4c0ef7=_[_0x5411('0x42')]({},_0x4c0ef7,_0xd15b2[_0x5411('0x43')]);return _0x504e1b[_0x5411('0x86')](_0x4c0ef7);}})[_0x5411('0x25')](function(_0x106aa4){if(_0x106aa4){_0x2579b9=_0x106aa4['length'];if(!_0xd15b2[_0x5411('0x35')][_0x5411('0x3a')]('nolimit')){_0x4c0ef7['limit']=qs[_0x5411('0x1e')](_0xd15b2[_0x5411('0x35')]['limit']);_0x4c0ef7[_0x5411('0x1c')]=qs[_0x5411('0x1c')](_0xd15b2['query']['offset']);}return _0x504e1b[_0x5411('0x86')](_0x4c0ef7);}})['then'](function(_0xc784c5){if(_0xc784c5){return _0xc784c5?{'count':_0x2579b9,'rows':_0xc784c5}:null;}})[_0x5411('0x25')](respondWithResult(_0x1c0cfe,null))[_0x5411('0x46')](handleError(_0x1c0cfe,null));};exports[_0x5411('0x87')]=function(_0x139e89,_0x4780fe,_0x5c2cc9){var _0x25772d,_0x501eb4;return db[_0x5411('0x30')]['find']({'where':{'id':_0x139e89[_0x5411('0x55')]['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x4780fe,null))['then'](function(_0x55cde3){if(_0x55cde3){_0x501eb4=_0x55cde3;return _0x55cde3['addBlackLists'](_0x139e89['body']['ids'],_[_0x5411('0x56')](_0x139e89[_0x5411('0x4c')],[_0x5411('0x67'),'id'])||{});}return null;})['spread'](function(_0x41cea5){var _0x12cdaa;_0x25772d=_0x41cea5||[];var _0x115deb=[];if(_0x41cea5){for(var _0x41b1bd=0x0;_0x41b1bd<_0x41cea5[_0x5411('0x48')];_0x41b1bd+=0x1){var _0x2c896b=_0x41cea5[_0x41b1bd][_0x5411('0x4d')]({'plain':!![]});_0x12cdaa=squel[_0x5411('0x6b')]()[_0x5411('0x88')](_0x5411('0x89'))[_0x5411('0x6d')](['phone',_0x5411('0x6f'),_0x5411('0x70'),_0x5411('0x5c'),'createdAt',_0x5411('0x57')],squel[_0x5411('0x71')]()[_0x5411('0x72')](_0x5411('0x73'),_0x5411('0x73'))[_0x5411('0x72')]('id','ContactId')[_0x5411('0x72')](_0x2c896b[_0x5411('0x74')][_0x5411('0x75')](),_0x5411('0x70'))[_0x5411('0x72')](_0x139e89['params']['id'][_0x5411('0x75')](),'CampaignId')['field'](_0x5411('0x76'),_0x5411('0x58'))[_0x5411('0x72')](_0x5411('0x76'),_0x5411('0x57'))[_0x5411('0x77')](_0x5411('0x78'))[_0x5411('0x3e')](_0x5411('0x79'))[_0x5411('0x3e')]('ListId\x20=\x20?',_0x2c896b['CmListId'][_0x5411('0x75')]())[_0x5411('0x3e')](_0x5411('0x80')))[_0x5411('0x75')]();_0x115deb[_0x5411('0x82')](db[_0x5411('0x83')][_0x5411('0x35')](_0x12cdaa));}return BPromise['all'](_0x115deb);}})['then'](function(){return _0x25772d;})[_0x5411('0x25')](respondWithResult(_0x4780fe,null))[_0x5411('0x46')](handleError(_0x4780fe,null));};exports['removeBlackLists']=function(_0x532995,_0x3a1b66,_0x4dbf23){return db['Campaign'][_0x5411('0x4a')]({'where':{'id':_0x532995['params']['id']}})[_0x5411('0x25')](handleEntityNotFound(_0x3a1b66,null))['then'](function(_0xa5c3f3){if(_0xa5c3f3){return _0xa5c3f3[_0x5411('0x8a')](_0x532995[_0x5411('0x35')]['ids']);}})['then'](function(_0x21af33){if(_0x21af33){return db[_0x5411('0x63')][_0x5411('0x26')]({'where':{'ListId':_0x532995[_0x5411('0x35')]['ids'],'CampaignId':_0x532995['params']['id']}})[_0x5411('0x25')](function(){return _0x21af33;});}})[_0x5411('0x25')](respondWithStatusCode(_0x3a1b66,null))['catch'](handleError(_0x3a1b66,null));};
\ No newline at end of file
+var _0xcbcd=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','getHoppers','CmHopper','hasOwnProperty','CampaignId','rows','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','ListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','deletedAt\x20IS\x20NULL','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x38ee82,_0x5d04b6){var _0x57203f=function(_0x1bee3f){while(--_0x1bee3f){_0x38ee82['push'](_0x38ee82['shift']());}};_0x57203f(++_0x5d04b6);}(_0xcbcd,0x177));var _0xdcbc=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0xcbcd[_0x10dbf6];return _0x452147;};'use strict';var emlformat=require(_0xdcbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcbc('0x1'));var jsonpatch=require(_0xdcbc('0x2'));var rp=require(_0xdcbc('0x3'));var moment=require(_0xdcbc('0x4'));var BPromise=require(_0xdcbc('0x5'));var Mustache=require(_0xdcbc('0x6'));var util=require(_0xdcbc('0x7'));var path=require(_0xdcbc('0x8'));var sox=require('sox');var csv=require(_0xdcbc('0x9'));var ejs=require(_0xdcbc('0xa'));var fs=require('fs');var fs_extra=require(_0xdcbc('0xb'));var _=require(_0xdcbc('0xc'));var squel=require('squel');var crypto=require(_0xdcbc('0xd'));var jsforce=require(_0xdcbc('0xe'));var deskjs=require(_0xdcbc('0xf'));var toCsv=require(_0xdcbc('0x9'));var querystring=require('querystring');var Papa=require(_0xdcbc('0x10'));var Redis=require('ioredis');var authService=require(_0xdcbc('0x11'));var qs=require(_0xdcbc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcbc('0x13'));var logger=require(_0xdcbc('0x14'))(_0xdcbc('0x15'));var utils=require('../../config/utils');var config=require(_0xdcbc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcbc('0x17'))['db'];function respondWithStatusCode(_0x56ce97,_0x2730e2){_0x2730e2=_0x2730e2||0xcc;return function(_0x42c23b){if(_0x42c23b){return _0x56ce97[_0xdcbc('0x18')](_0x2730e2);}return _0x56ce97[_0xdcbc('0x19')](_0x2730e2)[_0xdcbc('0x1a')]();};}function respondWithResult(_0x281434,_0x522f6d){_0x522f6d=_0x522f6d||0xc8;return function(_0x512ac5){if(_0x512ac5){return _0x281434[_0xdcbc('0x19')](_0x522f6d)[_0xdcbc('0x1b')](_0x512ac5);}};}function respondWithFilteredResult(_0xfea6c,_0x322596){return function(_0x2c4be4){if(_0x2c4be4){var _0x258b1f=typeof _0x322596[_0xdcbc('0x1c')]===_0xdcbc('0x1d')&&typeof _0x322596[_0xdcbc('0x1e')]===_0xdcbc('0x1d');var _0x4e8efb=_0x2c4be4[_0xdcbc('0x1f')];var _0x1cc97c=_0x258b1f?0x0:_0x322596[_0xdcbc('0x1c')];var _0x26940f=_0x258b1f?_0x2c4be4['count']:_0x322596['offset']+_0x322596[_0xdcbc('0x1e')];var _0x2ba435;if(_0x26940f>=_0x4e8efb){_0x26940f=_0x4e8efb;_0x2ba435=0xc8;}else{_0x2ba435=0xce;}_0xfea6c[_0xdcbc('0x19')](_0x2ba435);return _0xfea6c[_0xdcbc('0x20')](_0xdcbc('0x21'),_0x1cc97c+'-'+_0x26940f+'/'+_0x4e8efb)[_0xdcbc('0x1b')](_0x2c4be4);}return null;};}function patchUpdates(_0x44eb4c){return function(_0x168e81){try{jsonpatch[_0xdcbc('0x22')](_0x168e81,_0x44eb4c,!![]);}catch(_0x3f0b7e){return BPromise[_0xdcbc('0x23')](_0x3f0b7e);}return _0x168e81['save']();};}function saveUpdates(_0x575443,_0x1668c5){return function(_0x165acb){if(_0x165acb){return _0x165acb[_0xdcbc('0x24')](_0x575443)[_0xdcbc('0x25')](function(_0x5e1a3f){return _0x5e1a3f;});}return null;};}function removeEntity(_0x388e52,_0x3ebc41){return function(_0x289bff){if(_0x289bff){return _0x289bff[_0xdcbc('0x26')]()[_0xdcbc('0x25')](function(){var _0x5d2634=_0x289bff[_0xdcbc('0x27')]({'plain':!![]});var _0x20d21c=_0xdcbc('0x28');return db[_0xdcbc('0x29')][_0xdcbc('0x26')]({'where':{'type':_0x20d21c,'resourceId':_0x5d2634['id']}})['then'](function(){return _0x289bff;});})[_0xdcbc('0x25')](function(){_0x388e52['status'](0xcc)[_0xdcbc('0x1a')]();});}};}function handleEntityNotFound(_0x3c1889,_0x33c3d9){return function(_0x3cd993){if(!_0x3cd993){_0x3c1889[_0xdcbc('0x18')](0x194);}return _0x3cd993;};}function handleError(_0x50b355,_0x2dfed8){_0x2dfed8=_0x2dfed8||0x1f4;return function(_0x2bdbec){logger[_0xdcbc('0x2a')](_0x2bdbec['stack']);if(_0x2bdbec[_0xdcbc('0x2b')]){delete _0x2bdbec[_0xdcbc('0x2b')];}_0x50b355[_0xdcbc('0x19')](_0x2dfed8)[_0xdcbc('0x2c')](_0x2bdbec);};}exports[_0xdcbc('0x2d')]=function(_0x170fdd,_0x4adf9a){var _0x59bb5b={},_0x27a68e={},_0x403532={'count':0x0,'rows':[]};var _0xd4643e=_[_0xdcbc('0x2e')](db['Campaign'][_0xdcbc('0x2f')],function(_0x4a2c11){return{'name':_0x4a2c11['fieldName'],'type':_0x4a2c11[_0xdcbc('0x30')][_0xdcbc('0x31')]};});_0x27a68e['model']=_[_0xdcbc('0x2e')](_0xd4643e,_0xdcbc('0x2b'));_0x27a68e[_0xdcbc('0x32')]=_[_0xdcbc('0x33')](_0x170fdd['query']);_0x27a68e[_0xdcbc('0x34')]=_[_0xdcbc('0x35')](_0x27a68e['model'],_0x27a68e['query']);_0x59bb5b[_0xdcbc('0x36')]=_[_0xdcbc('0x35')](_0x27a68e[_0xdcbc('0x37')],qs[_0xdcbc('0x38')](_0x170fdd[_0xdcbc('0x32')][_0xdcbc('0x38')]));_0x59bb5b[_0xdcbc('0x36')]=_0x59bb5b[_0xdcbc('0x36')][_0xdcbc('0x39')]?_0x59bb5b[_0xdcbc('0x36')]:_0x27a68e[_0xdcbc('0x37')];if(!_0x170fdd[_0xdcbc('0x32')]['hasOwnProperty'](_0xdcbc('0x3a'))){_0x59bb5b[_0xdcbc('0x1e')]=qs[_0xdcbc('0x1e')](_0x170fdd[_0xdcbc('0x32')][_0xdcbc('0x1e')]);_0x59bb5b[_0xdcbc('0x1c')]=qs[_0xdcbc('0x1c')](_0x170fdd[_0xdcbc('0x32')][_0xdcbc('0x1c')]);}_0x59bb5b[_0xdcbc('0x3b')]=qs['sort'](_0x170fdd[_0xdcbc('0x32')][_0xdcbc('0x3c')]);_0x59bb5b[_0xdcbc('0x3d')]=qs[_0xdcbc('0x34')](_[_0xdcbc('0x3e')](_0x170fdd[_0xdcbc('0x32')],_0x27a68e[_0xdcbc('0x34')]),_0xd4643e);if(_0x170fdd[_0xdcbc('0x32')]['filter']){_0x59bb5b['where']=_[_0xdcbc('0x3f')](_0x59bb5b[_0xdcbc('0x3d')],{'$or':_[_0xdcbc('0x2e')](_0xd4643e,function(_0x1335d9){if(_0x1335d9[_0xdcbc('0x30')]!==_0xdcbc('0x40')){var _0x5b6850={};_0x5b6850[_0x1335d9['name']]={'$like':'%'+_0x170fdd[_0xdcbc('0x32')][_0xdcbc('0x41')]+'%'};return _0x5b6850;}})});}_0x59bb5b=_[_0xdcbc('0x3f')]({},_0x59bb5b,_0x170fdd[_0xdcbc('0x42')]);var _0x4e4627={'where':_0x59bb5b['where']};return db[_0xdcbc('0x43')][_0xdcbc('0x1f')](_0x4e4627)['then'](function(_0x547c03){_0x403532[_0xdcbc('0x1f')]=_0x547c03;if(_0x170fdd[_0xdcbc('0x32')][_0xdcbc('0x44')]){_0x59bb5b[_0xdcbc('0x45')]=[{'all':!![]}];}return db[_0xdcbc('0x43')][_0xdcbc('0x46')](_0x59bb5b);})['then'](function(_0x32ea4d){_0x403532['rows']=_0x32ea4d;return _0x403532;})['then'](respondWithFilteredResult(_0x4adf9a,_0x59bb5b))['catch'](handleError(_0x4adf9a,null));};exports[_0xdcbc('0x47')]=function(_0xc6252c,_0x50592c){var _0x4cd939={'raw':![],'where':{'id':_0xc6252c[_0xdcbc('0x48')]['id']}},_0xc129b={};_0xc129b['model']=_['keys'](db[_0xdcbc('0x43')][_0xdcbc('0x2f')]);_0xc129b['query']=_[_0xdcbc('0x33')](_0xc6252c[_0xdcbc('0x32')]);_0xc129b[_0xdcbc('0x34')]=_[_0xdcbc('0x35')](_0xc129b[_0xdcbc('0x37')],_0xc129b[_0xdcbc('0x32')]);_0x4cd939[_0xdcbc('0x36')]=_['intersection'](_0xc129b['model'],qs[_0xdcbc('0x38')](_0xc6252c[_0xdcbc('0x32')]['fields']));_0x4cd939[_0xdcbc('0x36')]=_0x4cd939[_0xdcbc('0x36')][_0xdcbc('0x39')]?_0x4cd939[_0xdcbc('0x36')]:_0xc129b[_0xdcbc('0x37')];if(_0xc6252c[_0xdcbc('0x32')]['includeAll']){_0x4cd939[_0xdcbc('0x45')]=[{'all':!![]}];}_0x4cd939=_[_0xdcbc('0x3f')]({},_0x4cd939,_0xc6252c[_0xdcbc('0x42')]);return db[_0xdcbc('0x43')][_0xdcbc('0x49')](_0x4cd939)['then'](handleEntityNotFound(_0x50592c,null))[_0xdcbc('0x25')](respondWithResult(_0x50592c,null))['catch'](handleError(_0x50592c,null));};exports['create']=function(_0xe56adb,_0x3ceb23){return db[_0xdcbc('0x43')][_0xdcbc('0x4a')](_0xe56adb[_0xdcbc('0x4b')],{})[_0xdcbc('0x25')](function(_0x3f1e60){var _0x2aa6f0=_0xe56adb[_0xdcbc('0x4c')]['get']({'plain':!![]});if(!_0x2aa6f0)throw new Error(_0xdcbc('0x4d'));if(_0x2aa6f0[_0xdcbc('0x4e')]===_0xdcbc('0x4c')){var _0xa8ae64=_0x3f1e60[_0xdcbc('0x27')]({'plain':!![]});var _0x3a268c=_0xdcbc('0x28');return db[_0xdcbc('0x4f')]['find']({'where':{'name':_0x3a268c,'userProfileId':_0x2aa6f0[_0xdcbc('0x50')]},'raw':!![]})[_0xdcbc('0x25')](function(_0x437d8a){if(_0x437d8a&&_0x437d8a[_0xdcbc('0x51')]===0x0){return db[_0xdcbc('0x29')]['create']({'name':_0xa8ae64[_0xdcbc('0x2b')],'resourceId':_0xa8ae64['id'],'type':_0x437d8a[_0xdcbc('0x2b')],'sectionId':_0x437d8a['id']},{})[_0xdcbc('0x25')](function(){return _0x3f1e60;});}else{return _0x3f1e60;}})[_0xdcbc('0x52')](function(_0x2d7af4){logger['error'](_0xdcbc('0x53'),_0x2d7af4);throw _0x2d7af4;});}return _0x3f1e60;})[_0xdcbc('0x25')](respondWithResult(_0x3ceb23,0xc9))[_0xdcbc('0x52')](handleError(_0x3ceb23,null));};exports[_0xdcbc('0x54')]=function(_0x305462,_0x73ba08){var _0x51c028={'where':{'id':_0x305462[_0xdcbc('0x48')]['id']}},_0x104fa8={};_0x104fa8[_0xdcbc('0x37')]=_[_0xdcbc('0x33')](db[_0xdcbc('0x43')][_0xdcbc('0x2f')]);_0x51c028['attributes']=_[_0xdcbc('0x35')](_0x104fa8[_0xdcbc('0x37')],qs[_0xdcbc('0x38')](_0x305462[_0xdcbc('0x32')][_0xdcbc('0x38')]));_0x51c028[_0xdcbc('0x36')]=_0x51c028['attributes'][_0xdcbc('0x39')]?_0x51c028[_0xdcbc('0x36')]:_0x104fa8[_0xdcbc('0x37')];if(_0x305462[_0xdcbc('0x32')]['includeAll']){_0x51c028[_0xdcbc('0x45')]=[{'all':!![]}];}_0x51c028=_['merge']({},_0x51c028,_0x305462[_0xdcbc('0x42')]);return db[_0xdcbc('0x43')][_0xdcbc('0x49')](_0x51c028)['then'](handleEntityNotFound(_0x73ba08,null))[_0xdcbc('0x25')](function(_0x9721d6){if(_0x9721d6){var _0x13c790=_0x9721d6[_0xdcbc('0x27')]({'plain':!![]});_0x13c790=qs['omit'](_0x13c790,['id','createdAt',_0xdcbc('0x55')]);_0x305462['body']=_[_0xdcbc('0x56')](_0x305462['body'],['id',_0xdcbc('0x57'),'updatedAt']);return db[_0xdcbc('0x43')]['create'](_[_0xdcbc('0x3f')](_0x13c790,_0x305462[_0xdcbc('0x4b')]),{'include':_0x305462['query']['includeAll']?[{'all':!![]}]:undefined})[_0xdcbc('0x25')](function(_0x6c7fca){var _0x20fefb=_0x305462[_0xdcbc('0x4c')][_0xdcbc('0x27')]({'plain':!![]});if(!_0x20fefb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20fefb['role']==='user'){var _0x5c1eab=_0x6c7fca[_0xdcbc('0x27')]({'plain':!![]});var _0x376bcf=_0xdcbc('0x28');return db[_0xdcbc('0x4f')][_0xdcbc('0x49')]({'where':{'name':_0x376bcf,'userProfileId':_0x20fefb['userProfileId']},'raw':!![]})[_0xdcbc('0x25')](function(_0x3eaa6c){if(_0x3eaa6c&&_0x3eaa6c[_0xdcbc('0x51')]===0x0){return db[_0xdcbc('0x29')]['create']({'name':_0x5c1eab[_0xdcbc('0x2b')],'resourceId':_0x5c1eab['id'],'type':_0x3eaa6c[_0xdcbc('0x2b')],'sectionId':_0x3eaa6c['id']},{})['then'](function(){return _0x6c7fca;});}else{return _0x6c7fca;}})[_0xdcbc('0x52')](function(_0x308f83){logger[_0xdcbc('0x2a')](_0xdcbc('0x53'),_0x308f83);throw _0x308f83;});}return _0x6c7fca;});}})['then'](respondWithResult(_0x73ba08,0xc9))['catch'](handleError(_0x73ba08,null));};exports[_0xdcbc('0x24')]=function(_0x434e30,_0x5d5a17){if(_0x434e30[_0xdcbc('0x4b')]['id']){delete _0x434e30[_0xdcbc('0x4b')]['id'];}return db['Campaign'][_0xdcbc('0x49')]({'where':{'id':_0x434e30['params']['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x5d5a17,null))[_0xdcbc('0x25')](saveUpdates(_0x434e30[_0xdcbc('0x4b')],null))['then'](respondWithResult(_0x5d5a17,null))[_0xdcbc('0x52')](handleError(_0x5d5a17,null));};exports[_0xdcbc('0x26')]=function(_0x2d11e4,_0x4aac97){return db[_0xdcbc('0x43')]['find']({'where':{'id':_0x2d11e4[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x4aac97,null))[_0xdcbc('0x25')](removeEntity(_0x4aac97,null))[_0xdcbc('0x52')](handleError(_0x4aac97,null));};exports[_0xdcbc('0x58')]=function(_0x65ed54,_0x440a2c,_0xf858d4){var _0x2f407b={'raw':!![],'where':{}};var _0x384378={};var _0x34527c={'count':0x0,'rows':[]};return db[_0xdcbc('0x43')]['findOne']({'where':{'id':_0x65ed54[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x440a2c,null))[_0xdcbc('0x25')](function(_0x3b15c7){if(_0x3b15c7){_0x384378['model']=_[_0xdcbc('0x33')](db[_0xdcbc('0x59')]['rawAttributes']);_0x384378['query']=_[_0xdcbc('0x33')](_0x65ed54[_0xdcbc('0x32')]);_0x384378[_0xdcbc('0x34')]=_[_0xdcbc('0x35')](_0x384378[_0xdcbc('0x37')],_0x384378[_0xdcbc('0x32')]);_0x2f407b[_0xdcbc('0x36')]=_[_0xdcbc('0x35')](_0x384378[_0xdcbc('0x37')],qs[_0xdcbc('0x38')](_0x65ed54[_0xdcbc('0x32')]['fields']));_0x2f407b['attributes']=_0x2f407b[_0xdcbc('0x36')][_0xdcbc('0x39')]?_0x2f407b[_0xdcbc('0x36')]:_0x384378[_0xdcbc('0x37')];if(!_0x65ed54['query'][_0xdcbc('0x5a')](_0xdcbc('0x3a'))){_0x2f407b[_0xdcbc('0x1e')]=qs[_0xdcbc('0x1e')](_0x65ed54[_0xdcbc('0x32')][_0xdcbc('0x1e')]);_0x2f407b[_0xdcbc('0x1c')]=qs[_0xdcbc('0x1c')](_0x65ed54[_0xdcbc('0x32')][_0xdcbc('0x1c')]);}_0x2f407b[_0xdcbc('0x3b')]=qs['sort'](_0x65ed54[_0xdcbc('0x32')]['sort']);_0x2f407b[_0xdcbc('0x3d')]=qs['filters'](_['pick'](_0x65ed54[_0xdcbc('0x32')],_0x384378['filters']));_0x2f407b[_0xdcbc('0x3d')][_0xdcbc('0x5b')]=_0x3b15c7['id'];if(_0x65ed54[_0xdcbc('0x32')][_0xdcbc('0x41')]){_0x2f407b[_0xdcbc('0x3d')]=_[_0xdcbc('0x3f')](_0x2f407b[_0xdcbc('0x3d')],{'$or':_[_0xdcbc('0x2e')](_0x2f407b[_0xdcbc('0x36')],function(_0x1c7401){var _0x30f616={};_0x30f616[_0x1c7401]={'$like':'%'+_0x65ed54['query'][_0xdcbc('0x41')]+'%'};return _0x30f616;})});}_0x2f407b=_[_0xdcbc('0x3f')]({},_0x2f407b,_0x65ed54['options']);return db[_0xdcbc('0x59')][_0xdcbc('0x1f')]({'where':_0x2f407b[_0xdcbc('0x3d')]})[_0xdcbc('0x25')](function(_0x36337e){_0x34527c[_0xdcbc('0x1f')]=_0x36337e;if(_0x65ed54[_0xdcbc('0x32')][_0xdcbc('0x44')]){_0x2f407b[_0xdcbc('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0xdcbc('0x46')](_0x2f407b);})['then'](function(_0x54e980){_0x34527c[_0xdcbc('0x5c')]=_0x54e980;return _0x34527c;});}})[_0xdcbc('0x25')](respondWithFilteredResult(_0x440a2c,_0x2f407b))[_0xdcbc('0x52')](handleError(_0x440a2c,null));};exports['getHopperHistories']=function(_0x5e3cb3,_0x1bbeef,_0x3eecee){var _0x38a08b={'raw':!![],'where':{}};var _0x254945={};var _0x25c976={'count':0x0,'rows':[]};return db[_0xdcbc('0x43')][_0xdcbc('0x5d')]({'where':{'id':_0x5e3cb3[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x1bbeef,null))[_0xdcbc('0x25')](function(_0x53b62b){if(_0x53b62b){_0x254945[_0xdcbc('0x37')]=_[_0xdcbc('0x33')](db[_0xdcbc('0x5e')][_0xdcbc('0x2f')]);_0x254945[_0xdcbc('0x32')]=_['keys'](_0x5e3cb3[_0xdcbc('0x32')]);_0x254945[_0xdcbc('0x34')]=_[_0xdcbc('0x35')](_0x254945['model'],_0x254945[_0xdcbc('0x32')]);_0x38a08b[_0xdcbc('0x36')]=_['intersection'](_0x254945[_0xdcbc('0x37')],qs[_0xdcbc('0x38')](_0x5e3cb3[_0xdcbc('0x32')]['fields']));_0x38a08b[_0xdcbc('0x36')]=_0x38a08b[_0xdcbc('0x36')][_0xdcbc('0x39')]?_0x38a08b[_0xdcbc('0x36')]:_0x254945['model'];if(!_0x5e3cb3[_0xdcbc('0x32')][_0xdcbc('0x5a')](_0xdcbc('0x3a'))){_0x38a08b[_0xdcbc('0x1e')]=qs['limit'](_0x5e3cb3[_0xdcbc('0x32')][_0xdcbc('0x1e')]);_0x38a08b['offset']=qs['offset'](_0x5e3cb3[_0xdcbc('0x32')]['offset']);}_0x38a08b[_0xdcbc('0x3b')]=qs[_0xdcbc('0x3c')](_0x5e3cb3[_0xdcbc('0x32')]['sort']);_0x38a08b[_0xdcbc('0x3d')]=qs[_0xdcbc('0x34')](_[_0xdcbc('0x3e')](_0x5e3cb3[_0xdcbc('0x32')],_0x254945[_0xdcbc('0x34')]));_0x38a08b[_0xdcbc('0x3d')][_0xdcbc('0x5b')]=_0x53b62b['id'];if(_0x5e3cb3['query'][_0xdcbc('0x41')]){_0x38a08b[_0xdcbc('0x3d')]=_[_0xdcbc('0x3f')](_0x38a08b[_0xdcbc('0x3d')],{'$or':_[_0xdcbc('0x2e')](_0x38a08b[_0xdcbc('0x36')],function(_0x3865d4){var _0x42ebb4={};_0x42ebb4[_0x3865d4]={'$like':'%'+_0x5e3cb3['query'][_0xdcbc('0x41')]+'%'};return _0x42ebb4;})});}_0x38a08b=_[_0xdcbc('0x3f')]({},_0x38a08b,_0x5e3cb3['options']);return db['CmHopperHistory'][_0xdcbc('0x1f')]({'where':_0x38a08b['where']})[_0xdcbc('0x25')](function(_0x3acf17){_0x25c976[_0xdcbc('0x1f')]=_0x3acf17;if(_0x5e3cb3['query'][_0xdcbc('0x44')]){_0x38a08b['include']=[{'all':!![]}];}return db[_0xdcbc('0x5e')][_0xdcbc('0x46')](_0x38a08b);})['then'](function(_0x11a9e6){_0x25c976['rows']=_0x11a9e6;return _0x25c976;});}})[_0xdcbc('0x25')](respondWithFilteredResult(_0x1bbeef,_0x38a08b))['catch'](handleError(_0x1bbeef,null));};exports['getHopperFinals']=function(_0x321950,_0x232a69,_0xe4201){var _0x394da6={'raw':!![],'where':{}};var _0x49d306={};var _0x31abae={'count':0x0,'rows':[]};return db['Campaign'][_0xdcbc('0x5d')]({'where':{'id':_0x321950[_0xdcbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x232a69,null))[_0xdcbc('0x25')](function(_0x486e5a){if(_0x486e5a){_0x49d306['model']=_['keys'](db[_0xdcbc('0x5f')][_0xdcbc('0x2f')]);_0x49d306['query']=_[_0xdcbc('0x33')](_0x321950['query']);_0x49d306[_0xdcbc('0x34')]=_['intersection'](_0x49d306[_0xdcbc('0x37')],_0x49d306['query']);_0x394da6[_0xdcbc('0x36')]=_[_0xdcbc('0x35')](_0x49d306[_0xdcbc('0x37')],qs[_0xdcbc('0x38')](_0x321950[_0xdcbc('0x32')][_0xdcbc('0x38')]));_0x394da6[_0xdcbc('0x36')]=_0x394da6[_0xdcbc('0x36')]['length']?_0x394da6[_0xdcbc('0x36')]:_0x49d306[_0xdcbc('0x37')];if(!_0x321950[_0xdcbc('0x32')][_0xdcbc('0x5a')]('nolimit')){_0x394da6[_0xdcbc('0x1e')]=qs[_0xdcbc('0x1e')](_0x321950[_0xdcbc('0x32')][_0xdcbc('0x1e')]);_0x394da6[_0xdcbc('0x1c')]=qs[_0xdcbc('0x1c')](_0x321950['query'][_0xdcbc('0x1c')]);}_0x394da6[_0xdcbc('0x3b')]=qs[_0xdcbc('0x3c')](_0x321950['query'][_0xdcbc('0x3c')]);_0x394da6['where']=qs[_0xdcbc('0x34')](_[_0xdcbc('0x3e')](_0x321950[_0xdcbc('0x32')],_0x49d306[_0xdcbc('0x34')]));_0x394da6[_0xdcbc('0x3d')][_0xdcbc('0x5b')]=_0x486e5a['id'];if(_0x321950['query'][_0xdcbc('0x41')]){_0x394da6['where']=_['merge'](_0x394da6['where'],{'$or':_['map'](_0x394da6[_0xdcbc('0x36')],function(_0x32935a){var _0x31fb1f={};_0x31fb1f[_0x32935a]={'$like':'%'+_0x321950['query'][_0xdcbc('0x41')]+'%'};return _0x31fb1f;})});}_0x394da6=_[_0xdcbc('0x3f')]({},_0x394da6,_0x321950[_0xdcbc('0x42')]);return db[_0xdcbc('0x5f')][_0xdcbc('0x1f')]({'where':_0x394da6[_0xdcbc('0x3d')]})['then'](function(_0x476db7){_0x31abae[_0xdcbc('0x1f')]=_0x476db7;if(_0x321950[_0xdcbc('0x32')][_0xdcbc('0x44')]){_0x394da6[_0xdcbc('0x45')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdcbc('0x46')](_0x394da6);})[_0xdcbc('0x25')](function(_0x2225af){_0x31abae[_0xdcbc('0x5c')]=_0x2225af;return _0x31abae;});}})[_0xdcbc('0x25')](respondWithFilteredResult(_0x232a69,_0x394da6))[_0xdcbc('0x52')](handleError(_0x232a69,null));};exports['getHopperBlacks']=function(_0x30243d,_0x5031f1,_0x13a0fa){var _0x583782={'raw':!![],'where':{}};var _0x11f950={};var _0x2bf08d={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x30243d[_0xdcbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x5031f1,null))['then'](function(_0x39ef55){if(_0x39ef55){_0x11f950[_0xdcbc('0x37')]=_[_0xdcbc('0x33')](db[_0xdcbc('0x60')][_0xdcbc('0x2f')]);_0x11f950[_0xdcbc('0x32')]=_[_0xdcbc('0x33')](_0x30243d[_0xdcbc('0x32')]);_0x11f950[_0xdcbc('0x34')]=_[_0xdcbc('0x35')](_0x11f950[_0xdcbc('0x37')],_0x11f950[_0xdcbc('0x32')]);_0x583782[_0xdcbc('0x36')]=_[_0xdcbc('0x35')](_0x11f950[_0xdcbc('0x37')],qs[_0xdcbc('0x38')](_0x30243d[_0xdcbc('0x32')]['fields']));_0x583782[_0xdcbc('0x36')]=_0x583782[_0xdcbc('0x36')]['length']?_0x583782['attributes']:_0x11f950[_0xdcbc('0x37')];if(!_0x30243d['query'][_0xdcbc('0x5a')](_0xdcbc('0x3a'))){_0x583782[_0xdcbc('0x1e')]=qs[_0xdcbc('0x1e')](_0x30243d[_0xdcbc('0x32')][_0xdcbc('0x1e')]);_0x583782[_0xdcbc('0x1c')]=qs[_0xdcbc('0x1c')](_0x30243d[_0xdcbc('0x32')][_0xdcbc('0x1c')]);}_0x583782[_0xdcbc('0x3b')]=qs['sort'](_0x30243d[_0xdcbc('0x32')][_0xdcbc('0x3c')]);_0x583782[_0xdcbc('0x3d')]=qs[_0xdcbc('0x34')](_[_0xdcbc('0x3e')](_0x30243d[_0xdcbc('0x32')],_0x11f950[_0xdcbc('0x34')]));_0x583782[_0xdcbc('0x3d')][_0xdcbc('0x5b')]=_0x39ef55['id'];if(_0x30243d['query']['filter']){_0x583782[_0xdcbc('0x3d')]=_[_0xdcbc('0x3f')](_0x583782[_0xdcbc('0x3d')],{'$or':_[_0xdcbc('0x2e')](_0x583782[_0xdcbc('0x36')],function(_0x25dcd1){var _0x200dde={};_0x200dde[_0x25dcd1]={'$like':'%'+_0x30243d[_0xdcbc('0x32')]['filter']+'%'};return _0x200dde;})});}_0x583782=_[_0xdcbc('0x3f')]({},_0x583782,_0x30243d[_0xdcbc('0x42')]);return db[_0xdcbc('0x60')][_0xdcbc('0x1f')]({'where':_0x583782[_0xdcbc('0x3d')]})[_0xdcbc('0x25')](function(_0x52ab7e){_0x2bf08d[_0xdcbc('0x1f')]=_0x52ab7e;if(_0x30243d[_0xdcbc('0x32')][_0xdcbc('0x44')]){_0x583782[_0xdcbc('0x45')]=[{'all':!![]}];}return db[_0xdcbc('0x60')][_0xdcbc('0x46')](_0x583782);})[_0xdcbc('0x25')](function(_0x2bdf96){_0x2bf08d[_0xdcbc('0x5c')]=_0x2bdf96;return _0x2bf08d;});}})[_0xdcbc('0x25')](respondWithFilteredResult(_0x5031f1,_0x583782))[_0xdcbc('0x52')](handleError(_0x5031f1,null));};exports[_0xdcbc('0x61')]=function(_0x4c80ba,_0x2bdcde,_0x1a055d){var _0x583ae5={};var _0x2fd432={};var _0x42e5ad;var _0x3c1e90;return db[_0xdcbc('0x43')][_0xdcbc('0x5d')]({'where':{'id':_0x4c80ba[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x2bdcde,null))[_0xdcbc('0x25')](function(_0x348d0a){if(_0x348d0a){_0x42e5ad=_0x348d0a;_0x2fd432['model']=_['keys'](db['CmList'][_0xdcbc('0x2f')]);_0x2fd432[_0xdcbc('0x32')]=_['keys'](_0x4c80ba[_0xdcbc('0x32')]);_0x2fd432[_0xdcbc('0x34')]=_[_0xdcbc('0x35')](_0x2fd432[_0xdcbc('0x37')],_0x2fd432[_0xdcbc('0x32')]);_0x583ae5[_0xdcbc('0x36')]=_[_0xdcbc('0x35')](_0x2fd432['model'],qs[_0xdcbc('0x38')](_0x4c80ba[_0xdcbc('0x32')][_0xdcbc('0x38')]));_0x583ae5[_0xdcbc('0x36')]=_0x583ae5['attributes'][_0xdcbc('0x39')]?_0x583ae5[_0xdcbc('0x36')]:_0x2fd432['model'];_0x583ae5[_0xdcbc('0x3b')]=qs[_0xdcbc('0x3c')](_0x4c80ba[_0xdcbc('0x32')][_0xdcbc('0x3c')]);_0x583ae5[_0xdcbc('0x3d')]=qs[_0xdcbc('0x34')](_[_0xdcbc('0x3e')](_0x4c80ba[_0xdcbc('0x32')],_0x2fd432[_0xdcbc('0x34')]));if(_0x4c80ba[_0xdcbc('0x32')][_0xdcbc('0x41')]){_0x583ae5['where']=_['merge'](_0x583ae5['where'],{'$or':_['map'](_0x583ae5[_0xdcbc('0x36')],function(_0x435cb1){var _0x1a6740={};_0x1a6740[_0x435cb1]={'$like':'%'+_0x4c80ba[_0xdcbc('0x32')][_0xdcbc('0x41')]+'%'};return _0x1a6740;})});}_0x583ae5=_[_0xdcbc('0x3f')]({},_0x583ae5,_0x4c80ba[_0xdcbc('0x42')]);return _0x42e5ad[_0xdcbc('0x61')](_0x583ae5);}})['then'](function(_0x197bb1){if(_0x197bb1){_0x3c1e90=_0x197bb1[_0xdcbc('0x39')];if(!_0x4c80ba[_0xdcbc('0x32')][_0xdcbc('0x5a')](_0xdcbc('0x3a'))){_0x583ae5[_0xdcbc('0x1e')]=qs[_0xdcbc('0x1e')](_0x4c80ba[_0xdcbc('0x32')][_0xdcbc('0x1e')]);_0x583ae5['offset']=qs['offset'](_0x4c80ba['query'][_0xdcbc('0x1c')]);}return _0x42e5ad[_0xdcbc('0x61')](_0x583ae5);}})[_0xdcbc('0x25')](function(_0x52e25f){if(_0x52e25f){return _0x52e25f?{'count':_0x3c1e90,'rows':_0x52e25f}:null;}})[_0xdcbc('0x25')](respondWithResult(_0x2bdcde,null))[_0xdcbc('0x52')](handleError(_0x2bdcde,null));};exports[_0xdcbc('0x62')]=function(_0x3ec13b,_0x16fff8,_0x5f2584){var _0x3c6cef,_0x4b2f78;return db[_0xdcbc('0x43')]['find']({'where':{'id':_0x3ec13b[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x16fff8,null))['then'](function(_0x15235f){if(_0x15235f){_0x4b2f78=_0x15235f;return _0x15235f[_0xdcbc('0x62')](_0x3ec13b[_0xdcbc('0x4b')][_0xdcbc('0x63')],_[_0xdcbc('0x56')](_0x3ec13b[_0xdcbc('0x4b')],[_0xdcbc('0x63'),'id'])||{});}return null;})['spread'](function(_0x39de01){var _0x1bd124;_0x3c6cef=_0x39de01||[];var _0x5c1150=[];if(_0x39de01){for(var _0x188f8c=0x0;_0x188f8c<_0x39de01[_0xdcbc('0x39')];_0x188f8c+=0x1){var _0x353faf=_0x39de01[_0x188f8c][_0xdcbc('0x27')]({'plain':!![]});_0x4b2f78['dialCheckDuplicateType']=_0x3ec13b['body'][_0xdcbc('0x64')]?_0x3ec13b['body']['dialCheckDuplicateType']:_0x4b2f78[_0xdcbc('0x64')];switch(_0x4b2f78[_0xdcbc('0x64')]){case _0xdcbc('0x65'):_0x1bd124=squel[_0xdcbc('0x66')]()[_0xdcbc('0x67')](_0xdcbc('0x68'))['fromQuery']([_0xdcbc('0x69'),'scheduledAt',_0xdcbc('0x6a'),'ListId',_0xdcbc('0x5b'),'createdAt','updatedAt'],squel[_0xdcbc('0x6b')]()[_0xdcbc('0x6c')](_0xdcbc('0x69'),_0xdcbc('0x69'))[_0xdcbc('0x6c')](_0xdcbc('0x6d'),_0xdcbc('0x6e'))[_0xdcbc('0x6c')]('id','ContactId')[_0xdcbc('0x6c')](_0x353faf[_0xdcbc('0x6f')][_0xdcbc('0x70')](),_0xdcbc('0x71'))[_0xdcbc('0x6c')](_0x3ec13b['params']['id'][_0xdcbc('0x70')](),_0xdcbc('0x5b'))[_0xdcbc('0x6c')]('NOW()',_0xdcbc('0x57'))[_0xdcbc('0x6c')]('NOW()',_0xdcbc('0x55'))[_0xdcbc('0x72')]('cm_contacts')[_0xdcbc('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0xdcbc('0x73'),_0x353faf[_0xdcbc('0x6f')]['toString']())[_0xdcbc('0x3d')](_0xdcbc('0x74'))['where'](_0xdcbc('0x75'),squel[_0xdcbc('0x6b')]()[_0xdcbc('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0xdcbc('0x72')](_0xdcbc('0x76'))[_0xdcbc('0x3d')](_0xdcbc('0x77'),_0x3ec13b[_0xdcbc('0x48')]['id'][_0xdcbc('0x70')]()))[_0xdcbc('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdcbc('0x6b')]()[_0xdcbc('0x6c')](_0xdcbc('0x78'))[_0xdcbc('0x72')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x3ec13b[_0xdcbc('0x48')]['id'][_0xdcbc('0x70')]())))[_0xdcbc('0x70')]();break;case _0xdcbc('0x79'):_0x1bd124=squel[_0xdcbc('0x66')]()['into'](_0xdcbc('0x68'))[_0xdcbc('0x7a')]([_0xdcbc('0x69'),_0xdcbc('0x6e'),_0xdcbc('0x6a'),_0xdcbc('0x71'),_0xdcbc('0x5b'),_0xdcbc('0x57'),'updatedAt'],squel[_0xdcbc('0x6b')]()[_0xdcbc('0x6c')](_0xdcbc('0x69'),'phone')[_0xdcbc('0x6c')](_0xdcbc('0x6d'),_0xdcbc('0x6e'))[_0xdcbc('0x6c')]('id','ContactId')[_0xdcbc('0x6c')](_0x353faf[_0xdcbc('0x6f')][_0xdcbc('0x70')](),_0xdcbc('0x71'))[_0xdcbc('0x6c')](_0x3ec13b[_0xdcbc('0x48')]['id'][_0xdcbc('0x70')](),_0xdcbc('0x5b'))[_0xdcbc('0x6c')](_0xdcbc('0x6d'),_0xdcbc('0x57'))[_0xdcbc('0x6c')]('NOW()',_0xdcbc('0x55'))[_0xdcbc('0x72')](_0xdcbc('0x7b'))[_0xdcbc('0x3d')](_0xdcbc('0x7c'))[_0xdcbc('0x3d')](_0xdcbc('0x73'),_0x353faf[_0xdcbc('0x6f')][_0xdcbc('0x70')]())[_0xdcbc('0x3d')](_0xdcbc('0x74'))['where'](_0xdcbc('0x75'),squel[_0xdcbc('0x6b')]()['field'](_0xdcbc('0x78'))[_0xdcbc('0x72')](_0xdcbc('0x68'))[_0xdcbc('0x3d')](_0xdcbc('0x77'),_0x3ec13b['params']['id'][_0xdcbc('0x70')]())))[_0xdcbc('0x70')]();break;default:_0x1bd124=squel[_0xdcbc('0x66')]()[_0xdcbc('0x67')](_0xdcbc('0x68'))['fromQuery']([_0xdcbc('0x69'),_0xdcbc('0x6e'),'ContactId',_0xdcbc('0x71'),'CampaignId',_0xdcbc('0x57'),'updatedAt'],squel[_0xdcbc('0x6b')]()[_0xdcbc('0x6c')](_0xdcbc('0x69'),_0xdcbc('0x69'))[_0xdcbc('0x6c')](_0xdcbc('0x6d'),_0xdcbc('0x6e'))[_0xdcbc('0x6c')]('id','ContactId')[_0xdcbc('0x6c')](_0x353faf['CmListId']['toString'](),_0xdcbc('0x71'))[_0xdcbc('0x6c')](_0x3ec13b[_0xdcbc('0x48')]['id'][_0xdcbc('0x70')](),_0xdcbc('0x5b'))[_0xdcbc('0x6c')]('NOW()',_0xdcbc('0x57'))[_0xdcbc('0x6c')]('NOW()',_0xdcbc('0x55'))['from'](_0xdcbc('0x7b'))[_0xdcbc('0x3d')](_0xdcbc('0x7c'))[_0xdcbc('0x3d')](_0xdcbc('0x73'),_0x353faf[_0xdcbc('0x6f')][_0xdcbc('0x70')]())['where'](_0xdcbc('0x74')))[_0xdcbc('0x70')]();}_0x5c1150[_0xdcbc('0x7d')](db[_0xdcbc('0x7e')][_0xdcbc('0x32')](_0x1bd124));}return BPromise['all'](_0x5c1150);}})[_0xdcbc('0x25')](function(){return _0x3c6cef;})[_0xdcbc('0x25')](respondWithResult(_0x16fff8,null))['catch'](handleError(_0x16fff8,null));};exports[_0xdcbc('0x7f')]=function(_0x40eb54,_0x3bb03c,_0x5bb8f4){return db[_0xdcbc('0x43')][_0xdcbc('0x49')]({'where':{'id':_0x40eb54['params']['id']}})['then'](handleEntityNotFound(_0x3bb03c,null))[_0xdcbc('0x25')](function(_0x595abb){if(_0x595abb){return _0x595abb['removeLists'](_0x40eb54['query']['ids']);}})[_0xdcbc('0x25')](function(_0x92775c){if(_0x92775c){return db['CmHopper']['destroy']({'where':{'ListId':_0x40eb54[_0xdcbc('0x32')][_0xdcbc('0x63')],'CampaignId':_0x40eb54[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](function(){return _0x92775c;});}})[_0xdcbc('0x25')](respondWithStatusCode(_0x3bb03c,null))[_0xdcbc('0x52')](handleError(_0x3bb03c,null));};exports[_0xdcbc('0x80')]=function(_0xc62e9,_0x527873,_0x501dac){var _0x24e7ac={};var _0x8ae55b={};var _0x174f6e;var _0x202536;return db[_0xdcbc('0x43')][_0xdcbc('0x5d')]({'where':{'id':_0xc62e9[_0xdcbc('0x48')]['id']}})['then'](handleEntityNotFound(_0x527873,null))[_0xdcbc('0x25')](function(_0x3badff){if(_0x3badff){_0x174f6e=_0x3badff;_0x8ae55b[_0xdcbc('0x37')]=_[_0xdcbc('0x33')](db['CmList'][_0xdcbc('0x2f')]);_0x8ae55b[_0xdcbc('0x32')]=_[_0xdcbc('0x33')](_0xc62e9[_0xdcbc('0x32')]);_0x8ae55b['filters']=_[_0xdcbc('0x35')](_0x8ae55b[_0xdcbc('0x37')],_0x8ae55b[_0xdcbc('0x32')]);_0x24e7ac[_0xdcbc('0x36')]=_[_0xdcbc('0x35')](_0x8ae55b[_0xdcbc('0x37')],qs[_0xdcbc('0x38')](_0xc62e9[_0xdcbc('0x32')]['fields']));_0x24e7ac[_0xdcbc('0x36')]=_0x24e7ac[_0xdcbc('0x36')]['length']?_0x24e7ac['attributes']:_0x8ae55b[_0xdcbc('0x37')];_0x24e7ac[_0xdcbc('0x3b')]=qs['sort'](_0xc62e9['query'][_0xdcbc('0x3c')]);_0x24e7ac[_0xdcbc('0x3d')]=qs[_0xdcbc('0x34')](_[_0xdcbc('0x3e')](_0xc62e9[_0xdcbc('0x32')],_0x8ae55b[_0xdcbc('0x34')]));if(_0xc62e9[_0xdcbc('0x32')][_0xdcbc('0x41')]){_0x24e7ac['where']=_[_0xdcbc('0x3f')](_0x24e7ac[_0xdcbc('0x3d')],{'$or':_[_0xdcbc('0x2e')](_0x24e7ac[_0xdcbc('0x36')],function(_0x242a8a){var _0x47e531={};_0x47e531[_0x242a8a]={'$like':'%'+_0xc62e9[_0xdcbc('0x32')][_0xdcbc('0x41')]+'%'};return _0x47e531;})});}_0x24e7ac=_[_0xdcbc('0x3f')]({},_0x24e7ac,_0xc62e9['options']);return _0x174f6e[_0xdcbc('0x80')](_0x24e7ac);}})['then'](function(_0x35000d){if(_0x35000d){_0x202536=_0x35000d[_0xdcbc('0x39')];if(!_0xc62e9['query'][_0xdcbc('0x5a')](_0xdcbc('0x3a'))){_0x24e7ac[_0xdcbc('0x1e')]=qs[_0xdcbc('0x1e')](_0xc62e9[_0xdcbc('0x32')][_0xdcbc('0x1e')]);_0x24e7ac[_0xdcbc('0x1c')]=qs[_0xdcbc('0x1c')](_0xc62e9[_0xdcbc('0x32')][_0xdcbc('0x1c')]);}return _0x174f6e[_0xdcbc('0x80')](_0x24e7ac);}})['then'](function(_0x84e98){if(_0x84e98){return _0x84e98?{'count':_0x202536,'rows':_0x84e98}:null;}})[_0xdcbc('0x25')](respondWithResult(_0x527873,null))[_0xdcbc('0x52')](handleError(_0x527873,null));};exports[_0xdcbc('0x81')]=function(_0x79c9,_0x4b4d0b,_0x47388b){var _0x426966,_0x3b92bb;return db['Campaign'][_0xdcbc('0x49')]({'where':{'id':_0x79c9[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x4b4d0b,null))['then'](function(_0x345d8b){if(_0x345d8b){_0x3b92bb=_0x345d8b;return _0x345d8b[_0xdcbc('0x81')](_0x79c9[_0xdcbc('0x4b')][_0xdcbc('0x63')],_['omit'](_0x79c9[_0xdcbc('0x4b')],[_0xdcbc('0x63'),'id'])||{});}return null;})[_0xdcbc('0x82')](function(_0x418337){var _0xa49ae3;_0x426966=_0x418337||[];var _0x52ab71=[];if(_0x418337){for(var _0x2b2e6f=0x0;_0x2b2e6f<_0x418337[_0xdcbc('0x39')];_0x2b2e6f+=0x1){var _0x4dd24e=_0x418337[_0x2b2e6f]['get']({'plain':!![]});_0xa49ae3=squel[_0xdcbc('0x66')]()[_0xdcbc('0x67')](_0xdcbc('0x83'))[_0xdcbc('0x7a')]([_0xdcbc('0x69'),_0xdcbc('0x6a'),_0xdcbc('0x71'),'CampaignId','createdAt',_0xdcbc('0x55')],squel[_0xdcbc('0x6b')]()[_0xdcbc('0x6c')](_0xdcbc('0x69'),_0xdcbc('0x69'))[_0xdcbc('0x6c')]('id','ContactId')[_0xdcbc('0x6c')](_0x4dd24e['CmListId'][_0xdcbc('0x70')](),_0xdcbc('0x71'))[_0xdcbc('0x6c')](_0x79c9[_0xdcbc('0x48')]['id'][_0xdcbc('0x70')](),_0xdcbc('0x5b'))[_0xdcbc('0x6c')](_0xdcbc('0x6d'),_0xdcbc('0x57'))[_0xdcbc('0x6c')](_0xdcbc('0x6d'),'updatedAt')[_0xdcbc('0x72')](_0xdcbc('0x7b'))['where']('deletedAt\x20IS\x20NULL')[_0xdcbc('0x3d')](_0xdcbc('0x73'),_0x4dd24e[_0xdcbc('0x6f')][_0xdcbc('0x70')]())[_0xdcbc('0x3d')](_0xdcbc('0x74')))[_0xdcbc('0x70')]();_0x52ab71[_0xdcbc('0x7d')](db['sequelize'][_0xdcbc('0x32')](_0xa49ae3));}return BPromise[_0xdcbc('0x84')](_0x52ab71);}})[_0xdcbc('0x25')](function(){return _0x426966;})[_0xdcbc('0x25')](respondWithResult(_0x4b4d0b,null))[_0xdcbc('0x52')](handleError(_0x4b4d0b,null));};exports['removeBlackLists']=function(_0x55ba9c,_0x46ca94,_0x5894c7){return db['Campaign'][_0xdcbc('0x49')]({'where':{'id':_0x55ba9c[_0xdcbc('0x48')]['id']}})[_0xdcbc('0x25')](handleEntityNotFound(_0x46ca94,null))[_0xdcbc('0x25')](function(_0xfc9ffd){if(_0xfc9ffd){return _0xfc9ffd['removeBlackLists'](_0x55ba9c[_0xdcbc('0x32')][_0xdcbc('0x63')]);}})[_0xdcbc('0x25')](function(_0x53ce39){if(_0x53ce39){return db[_0xdcbc('0x60')][_0xdcbc('0x26')]({'where':{'ListId':_0x55ba9c[_0xdcbc('0x32')][_0xdcbc('0x63')],'CampaignId':_0x55ba9c[_0xdcbc('0x48')]['id']}})['then'](function(){return _0x53ce39;});}})['then'](respondWithStatusCode(_0x46ca94,null))['catch'](handleError(_0x46ca94,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 822fd9a..306b443 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(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x266e80,_0xc5183a){var _0x26cbaa=function(_0x59c43a){while(--_0x59c43a){_0x266e80['push'](_0x266e80['shift']());}};_0x26cbaa(++_0xc5183a);}(_0x7a54,0x106));var _0x47a5=function(_0x719ced,_0x4c6cc7){_0x719ced=_0x719ced-0x0;var _0xa11cae=_0x7a54[_0x719ced];return _0xa11cae;};'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':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index ccbf5da..54de199 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 _0x9bde=['model','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Campaign,\x20%s,\x20%s','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','map','include'];(function(_0x363140,_0x1c56ca){var _0x28d4aa=function(_0x24e9ff){while(--_0x24e9ff){_0x363140['push'](_0x363140['shift']());}};_0x28d4aa(++_0x1c56ca);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3f4356,_0x24f8bd){_0x3f4356=_0x3f4356-0x0;var _0x1ab6ff=_0x9bde[_0x3f4356];return _0x1ab6ff;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('Campaign,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('Campaign,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('Campaign,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('Campaign,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}exports[_0xe9bd('0x16')]=function(_0x3bae08){var _0x34ba2b=this;return new Promise(function(_0x330733,_0x5cf674){return db[_0xe9bd('0x17')]['findAll']({'raw':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08['options'][_0xe9bd('0x19')]===undefined?!![]:![]:!![],'where':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1a')]||null:null,'attributes':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1b')]||null:null,'limit':_0x3bae08['options']?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1c')]||null:null,'include':_0x3bae08['options']?_0x3bae08[_0xe9bd('0x18')]['include']?_[_0xe9bd('0x1d')](_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1e')],function(_0xf02209){return{'model':db[_0xf02209['model']],'as':_0xf02209['as'],'attributes':_0xf02209[_0xe9bd('0x1b')],'include':_0xf02209[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0xf02209[_0xe9bd('0x1e')],function(_0x2641be){return{'model':db[_0x2641be[_0xe9bd('0x1f')]],'as':_0x2641be['as'],'attributes':_0x2641be[_0xe9bd('0x1b')],'include':_0x2641be[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0x2641be['include'],function(_0x3c211a){return{'model':db[_0x3c211a[_0xe9bd('0x1f')]],'as':_0x3c211a['as'],'attributes':_0x3c211a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9bd('0xb')](function(_0xc25248){logger[_0xe9bd('0xc')](_0xe9bd('0x16'),_0x3bae08);logger[_0xe9bd('0xd')](_0xe9bd('0x16'),_0x3bae08,JSON['stringify'](_0xc25248));_0x330733(_0xc25248);})['catch'](function(_0x1de54c){logger['error'](_0xe9bd('0x16'),_0x1de54c[_0xe9bd('0x12')],_0x3bae08);_0x5cf674(_0x34ba2b[_0xe9bd('0x10')](0x1f4,_0x1de54c[_0xe9bd('0x12')]));});});};
\ No newline at end of file
+var _0x48ea=['attributes','limit','include','model','map','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','error','code','message','result','catch','GetCampaign','Campaign','findAll','options'];(function(_0x168765,_0x534f44){var _0x3ee3a0=function(_0x274d2d){while(--_0x274d2d){_0x168765['push'](_0x168765['shift']());}};_0x3ee3a0(++_0x534f44);}(_0x48ea,0x9c));var _0xa48e=function(_0x32f1f6,_0x1b2b61){_0x32f1f6=_0x32f1f6-0x0;var _0x3da847=_0x48ea[_0x32f1f6];return _0x3da847;};'use strict';var _=require(_0xa48e('0x0'));var util=require('util');var moment=require(_0xa48e('0x1'));var BPromise=require(_0xa48e('0x2'));var rs=require(_0xa48e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa48e('0x4'));var logger=require('../../config/logger')(_0xa48e('0x5'));var config=require(_0xa48e('0x6'));var jayson=require(_0xa48e('0x7'));var client=jayson[_0xa48e('0x8')][_0xa48e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x405033,_0x5213e5,_0x143004){return new BPromise(function(_0x3bdc25,_0x170ffc){return client[_0xa48e('0xa')](_0x405033,_0x143004)[_0xa48e('0xb')](function(_0x3ad947){logger[_0xa48e('0xc')](_0xa48e('0xd'),_0x5213e5,'request\x20sent');logger[_0xa48e('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5213e5,'request\x20sent',JSON['stringify'](_0x3ad947));if(_0x3ad947[_0xa48e('0xf')]){if(_0x3ad947[_0xa48e('0xf')][_0xa48e('0x10')]===0x1f4){logger[_0xa48e('0xf')]('Campaign,\x20%s,\x20%s',_0x5213e5,_0x3ad947[_0xa48e('0xf')][_0xa48e('0x11')]);return _0x170ffc(_0x3ad947[_0xa48e('0xf')][_0xa48e('0x11')]);}logger[_0xa48e('0xf')](_0xa48e('0xd'),_0x5213e5,_0x3ad947[_0xa48e('0xf')]['message']);return _0x3bdc25(_0x3ad947[_0xa48e('0xf')][_0xa48e('0x11')]);}else{logger[_0xa48e('0xc')](_0xa48e('0xd'),_0x5213e5,'request\x20sent');_0x3bdc25(_0x3ad947[_0xa48e('0x12')][_0xa48e('0x11')]);}})[_0xa48e('0x13')](function(_0x28c15c){logger[_0xa48e('0xf')](_0xa48e('0xd'),_0x5213e5,_0x28c15c);_0x170ffc(_0x28c15c);});});}exports[_0xa48e('0x14')]=function(_0x1f1cbc){var _0x320d22=this;return new Promise(function(_0x1baea5,_0xfc65bf){return db[_0xa48e('0x15')][_0xa48e('0x16')]({'raw':_0x1f1cbc[_0xa48e('0x17')]?_0x1f1cbc[_0xa48e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1f1cbc['options']?_0x1f1cbc[_0xa48e('0x17')]['where']||null:null,'attributes':_0x1f1cbc[_0xa48e('0x17')]?_0x1f1cbc[_0xa48e('0x17')][_0xa48e('0x18')]||null:null,'limit':_0x1f1cbc[_0xa48e('0x17')]?_0x1f1cbc[_0xa48e('0x17')][_0xa48e('0x19')]||null:null,'include':_0x1f1cbc[_0xa48e('0x17')]?_0x1f1cbc['options'][_0xa48e('0x1a')]?_['map'](_0x1f1cbc['options']['include'],function(_0x1adb5d){return{'model':db[_0x1adb5d[_0xa48e('0x1b')]],'as':_0x1adb5d['as'],'attributes':_0x1adb5d[_0xa48e('0x18')],'include':_0x1adb5d[_0xa48e('0x1a')]?_[_0xa48e('0x1c')](_0x1adb5d[_0xa48e('0x1a')],function(_0x45689b){return{'model':db[_0x45689b[_0xa48e('0x1b')]],'as':_0x45689b['as'],'attributes':_0x45689b[_0xa48e('0x18')],'include':_0x45689b[_0xa48e('0x1a')]?_[_0xa48e('0x1c')](_0x45689b['include'],function(_0x239b15){return{'model':db[_0x239b15[_0xa48e('0x1b')]],'as':_0x239b15['as'],'attributes':_0x239b15[_0xa48e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b04f1){logger[_0xa48e('0xc')](_0xa48e('0x14'),_0x1f1cbc);logger[_0xa48e('0xe')]('GetCampaign',_0x1f1cbc,JSON[_0xa48e('0x1d')](_0x1b04f1));_0x1baea5(_0x1b04f1);})['catch'](function(_0x1dffc6){logger[_0xa48e('0xf')](_0xa48e('0x14'),_0x1dffc6[_0xa48e('0x11')],_0x1f1cbc);_0xfc65bf(_0x320d22[_0xa48e('0xf')](0x1f4,_0x1dffc6[_0xa48e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 056a48e..d22856c 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 _0x167e=['getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x30c6e0,_0x4b3605){var _0x2ea8bd=function(_0x58a2d9){while(--_0x58a2d9){_0x30c6e0['push'](_0x30c6e0['shift']());}};_0x2ea8bd(++_0x4b3605);}(_0x167e,0xa3));var _0xe167=function(_0x39cc31,_0x5293ef){_0x39cc31=_0x39cc31-0x0;var _0x5e90de=_0x167e[_0x39cc31];return _0x5e90de;};'use strict';var multer=require(_0xe167('0x0'));var util=require(_0xe167('0x1'));var path=require(_0xe167('0x2'));var timeout=require(_0xe167('0x3'));var express=require(_0xe167('0x4'));var router=express[_0xe167('0x5')]();var fs_extra=require(_0xe167('0x6'));var auth=require(_0xe167('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe167('0x8'));var controller=require('./campaign.controller');router[_0xe167('0x9')]('/',auth[_0xe167('0xa')](),controller[_0xe167('0xb')]);router[_0xe167('0x9')](_0xe167('0xc'),auth['isAuthenticated'](),controller[_0xe167('0xd')]);router['get'](_0xe167('0xe'),auth[_0xe167('0xa')](),controller[_0xe167('0xf')]);router[_0xe167('0x9')](_0xe167('0x10'),auth[_0xe167('0xa')](),controller[_0xe167('0x11')]);router[_0xe167('0x9')]('/:id/hopper_finals',auth[_0xe167('0xa')](),controller[_0xe167('0x12')]);router['get'](_0xe167('0x13'),auth[_0xe167('0xa')](),controller[_0xe167('0x14')]);router[_0xe167('0x9')](_0xe167('0x15'),auth[_0xe167('0xa')](),controller[_0xe167('0x16')]);router[_0xe167('0x9')](_0xe167('0x17'),auth['isAuthenticated'](),controller[_0xe167('0x18')]);router[_0xe167('0x19')]('/',auth[_0xe167('0xa')](),controller[_0xe167('0x1a')]);router['post'](_0xe167('0x1b'),auth[_0xe167('0xa')](),controller[_0xe167('0x1c')]);router[_0xe167('0x19')](_0xe167('0x15'),auth['isAuthenticated'](),controller[_0xe167('0x1d')]);router[_0xe167('0x19')](_0xe167('0x17'),auth[_0xe167('0xa')](),controller[_0xe167('0x1e')]);router[_0xe167('0x1f')]('/:id',auth[_0xe167('0xa')](),controller[_0xe167('0x20')]);router[_0xe167('0x21')](_0xe167('0xc'),auth[_0xe167('0xa')](),controller['destroy']);router[_0xe167('0x21')](_0xe167('0x15'),auth[_0xe167('0xa')](),controller[_0xe167('0x22')]);router[_0xe167('0x21')]('/:id/blacklists',auth[_0xe167('0xa')](),controller[_0xe167('0x23')]);module[_0xe167('0x24')]=router;
\ No newline at end of file
+var _0x4711=['show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index'];(function(_0x5a055d,_0x461b6d){var _0x545ed1=function(_0x216b12){while(--_0x216b12){_0x5a055d['push'](_0x5a055d['shift']());}};_0x545ed1(++_0x461b6d);}(_0x4711,0x10c));var _0x1471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4711[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1471('0x0'));var util=require(_0x1471('0x1'));var path=require(_0x1471('0x2'));var timeout=require(_0x1471('0x3'));var express=require(_0x1471('0x4'));var router=express[_0x1471('0x5')]();var fs_extra=require(_0x1471('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1471('0x7'));var config=require('../../config/environment');var controller=require(_0x1471('0x8'));router[_0x1471('0x9')]('/',auth[_0x1471('0xa')](),controller[_0x1471('0xb')]);router[_0x1471('0x9')]('/:id',auth[_0x1471('0xa')](),controller[_0x1471('0xc')]);router[_0x1471('0x9')](_0x1471('0xd'),auth[_0x1471('0xa')](),controller['getHoppers']);router['get'](_0x1471('0xe'),auth[_0x1471('0xa')](),controller[_0x1471('0xf')]);router[_0x1471('0x9')](_0x1471('0x10'),auth[_0x1471('0xa')](),controller[_0x1471('0x11')]);router[_0x1471('0x9')]('/:id/hopper_black',auth[_0x1471('0xa')](),controller[_0x1471('0x12')]);router[_0x1471('0x9')](_0x1471('0x13'),auth[_0x1471('0xa')](),controller['getLists']);router[_0x1471('0x9')](_0x1471('0x14'),auth[_0x1471('0xa')](),controller['getBlackLists']);router[_0x1471('0x15')]('/',auth[_0x1471('0xa')](),controller[_0x1471('0x16')]);router[_0x1471('0x15')](_0x1471('0x17'),auth[_0x1471('0xa')](),controller[_0x1471('0x18')]);router[_0x1471('0x15')](_0x1471('0x13'),auth[_0x1471('0xa')](),controller[_0x1471('0x19')]);router['post'](_0x1471('0x14'),auth[_0x1471('0xa')](),controller[_0x1471('0x1a')]);router[_0x1471('0x1b')](_0x1471('0x1c'),auth[_0x1471('0xa')](),controller[_0x1471('0x1d')]);router[_0x1471('0x1e')]('/:id',auth[_0x1471('0xa')](),controller[_0x1471('0x1f')]);router[_0x1471('0x1e')](_0x1471('0x13'),auth[_0x1471('0xa')](),controller[_0x1471('0x20')]);router[_0x1471('0x1e')](_0x1471('0x14'),auth[_0x1471('0xa')](),controller[_0x1471('0x21')]);module[_0x1471('0x22')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index d5aa11f..b7b20d4 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 _0x1b08=['sequelize','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0x44044a,_0x3a0097){var _0x43bb6e=function(_0x1afe12){while(--_0x1afe12){_0x44044a['push'](_0x44044a['shift']());}};_0x43bb6e(++_0x3a0097);}(_0x1b08,0xc0));var _0x81b0=function(_0x19c483,_0x3b63fc){_0x19c483=_0x19c483-0x0;var _0x47ae32=_0x1b08[_0x19c483];return _0x47ae32;};'use strict';var Sequelize=require(_0x81b0('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x81b0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x81b0('0x2')]},'name':{'type':Sequelize[_0x81b0('0x3')],'get':function(){return this[_0x81b0('0x4')](_0x81b0('0x5'));}}};
\ No newline at end of file
+var _0x839d=['key','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x874477,_0xff3645){var _0x285674=function(_0x3cd0c6){while(--_0x3cd0c6){_0x874477['push'](_0x874477['shift']());}};_0x285674(++_0xff3645);}(_0x839d,0x11b));var _0xd839=function(_0x1af170,_0x24cb12){_0x1af170=_0x1af170-0x0;var _0x3681e6=_0x839d[_0x1af170];return _0x3681e6;};'use strict';var Sequelize=require('sequelize');module[_0xd839('0x0')]={'key':{'type':Sequelize[_0xd839('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xd839('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd839('0x1')]},'name':{'type':Sequelize[_0xd839('0x3')],'get':function(){return this[_0xd839('0x4')](_0xd839('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index da2fe29..7f59657 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 _0xadfa=['get','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','CannedAnswer','include','rows','catch','includeAll','options','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CannedAnswers','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then'];(function(_0x49cb77,_0x2ce90c){var _0x28a5e5=function(_0xef518c){while(--_0xef518c){_0x49cb77['push'](_0x49cb77['shift']());}};_0x28a5e5(++_0x2ce90c);}(_0xadfa,0x87));var _0xaadf=function(_0x235a44,_0x52ebf7){_0x235a44=_0x235a44-0x0;var _0x14a6b6=_0xadfa[_0x235a44];return _0x14a6b6;};'use strict';var emlformat=require(_0xaadf('0x0'));var rimraf=require(_0xaadf('0x1'));var zipdir=require(_0xaadf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaadf('0x3'));var moment=require(_0xaadf('0x4'));var BPromise=require(_0xaadf('0x5'));var Mustache=require(_0xaadf('0x6'));var util=require(_0xaadf('0x7'));var path=require(_0xaadf('0x8'));var sox=require(_0xaadf('0x9'));var csv=require(_0xaadf('0xa'));var ejs=require(_0xaadf('0xb'));var fs=require('fs');var fs_extra=require(_0xaadf('0xc'));var _=require(_0xaadf('0xd'));var squel=require(_0xaadf('0xe'));var crypto=require('crypto');var jsforce=require(_0xaadf('0xf'));var deskjs=require(_0xaadf('0x10'));var toCsv=require(_0xaadf('0xa'));var querystring=require(_0xaadf('0x11'));var Papa=require(_0xaadf('0x12'));var Redis=require(_0xaadf('0x13'));var authService=require(_0xaadf('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xaadf('0x15'));var hardwareService=require(_0xaadf('0x16'));var logger=require(_0xaadf('0x17'))(_0xaadf('0x18'));var utils=require('../../config/utils');var config=require(_0xaadf('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaadf('0x1a'))['db'];function respondWithStatusCode(_0x14d92b,_0x55ef9e){_0x55ef9e=_0x55ef9e||0xcc;return function(_0x2ab868){if(_0x2ab868){return _0x14d92b[_0xaadf('0x1b')](_0x55ef9e);}return _0x14d92b['status'](_0x55ef9e)['end']();};}function respondWithResult(_0x419f15,_0x490918){_0x490918=_0x490918||0xc8;return function(_0x171196){if(_0x171196){return _0x419f15[_0xaadf('0x1c')](_0x490918)['json'](_0x171196);}};}function respondWithFilteredResult(_0x37c19b,_0x16da48){return function(_0x2e1654){if(_0x2e1654){var _0x18aa69=typeof _0x16da48[_0xaadf('0x1d')]===_0xaadf('0x1e')&&typeof _0x16da48[_0xaadf('0x1f')]===_0xaadf('0x1e');var _0x234727=_0x2e1654['count'];var _0x326666=_0x18aa69?0x0:_0x16da48[_0xaadf('0x1d')];var _0x4bee7c=_0x18aa69?_0x2e1654[_0xaadf('0x20')]:_0x16da48[_0xaadf('0x1d')]+_0x16da48[_0xaadf('0x1f')];var _0xe88fc7;if(_0x4bee7c>=_0x234727){_0x4bee7c=_0x234727;_0xe88fc7=0xc8;}else{_0xe88fc7=0xce;}_0x37c19b[_0xaadf('0x1c')](_0xe88fc7);return _0x37c19b[_0xaadf('0x21')](_0xaadf('0x22'),_0x326666+'-'+_0x4bee7c+'/'+_0x234727)[_0xaadf('0x23')](_0x2e1654);}return null;};}function patchUpdates(_0x25b3c7){return function(_0x10138e){try{jsonpatch['apply'](_0x10138e,_0x25b3c7,!![]);}catch(_0x4dafcb){return BPromise[_0xaadf('0x24')](_0x4dafcb);}return _0x10138e[_0xaadf('0x25')]();};}function saveUpdates(_0x3ff748,_0x11b6ab){return function(_0x5f11c0){if(_0x5f11c0){return _0x5f11c0[_0xaadf('0x26')](_0x3ff748)['then'](function(_0x33954a){return _0x33954a;});}return null;};}function removeEntity(_0x40ef44,_0x483f3d){return function(_0x374661){if(_0x374661){return _0x374661[_0xaadf('0x27')]()[_0xaadf('0x28')](function(){var _0x3c0719=_0x374661[_0xaadf('0x29')]({'plain':!![]});var _0x5a94a3='CannedAnswers';return db[_0xaadf('0x2a')]['destroy']({'where':{'type':_0x5a94a3,'resourceId':_0x3c0719['id']}})[_0xaadf('0x28')](function(){return _0x374661;});})[_0xaadf('0x28')](function(){_0x40ef44[_0xaadf('0x1c')](0xcc)[_0xaadf('0x2b')]();});}};}function handleEntityNotFound(_0x56931c,_0x5a1461){return function(_0xd2f9b0){if(!_0xd2f9b0){_0x56931c['sendStatus'](0x194);}return _0xd2f9b0;};}function handleError(_0x3f356e,_0x21c53e){_0x21c53e=_0x21c53e||0x1f4;return function(_0x227056){logger[_0xaadf('0x2c')](_0x227056[_0xaadf('0x2d')]);if(_0x227056[_0xaadf('0x2e')]){delete _0x227056['name'];}_0x3f356e[_0xaadf('0x1c')](_0x21c53e)[_0xaadf('0x2f')](_0x227056);};}exports['index']=function(_0xeee17,_0x14670f){var _0x1abc81={},_0x50e872={},_0x41b53f={'count':0x0,'rows':[]};var _0x4c58fa=_[_0xaadf('0x30')](db['CannedAnswer'][_0xaadf('0x31')],function(_0x532602){return{'name':_0x532602[_0xaadf('0x32')],'type':_0x532602[_0xaadf('0x33')]['key']};});_0x50e872['model']=_['map'](_0x4c58fa,_0xaadf('0x2e'));_0x50e872[_0xaadf('0x34')]=_[_0xaadf('0x35')](_0xeee17[_0xaadf('0x34')]);_0x50e872[_0xaadf('0x36')]=_[_0xaadf('0x37')](_0x50e872['model'],_0x50e872['query']);_0x1abc81['attributes']=_[_0xaadf('0x37')](_0x50e872[_0xaadf('0x38')],qs[_0xaadf('0x39')](_0xeee17[_0xaadf('0x34')][_0xaadf('0x39')]));_0x1abc81['attributes']=_0x1abc81[_0xaadf('0x3a')][_0xaadf('0x3b')]?_0x1abc81[_0xaadf('0x3a')]:_0x50e872[_0xaadf('0x38')];if(!_0xeee17['query']['hasOwnProperty']('nolimit')){_0x1abc81[_0xaadf('0x1f')]=qs[_0xaadf('0x1f')](_0xeee17[_0xaadf('0x34')]['limit']);_0x1abc81[_0xaadf('0x1d')]=qs['offset'](_0xeee17[_0xaadf('0x34')][_0xaadf('0x1d')]);}_0x1abc81[_0xaadf('0x3c')]=qs[_0xaadf('0x3d')](_0xeee17[_0xaadf('0x34')][_0xaadf('0x3d')]);_0x1abc81[_0xaadf('0x3e')]=qs['filters'](_[_0xaadf('0x3f')](_0xeee17[_0xaadf('0x34')],_0x50e872[_0xaadf('0x36')]),_0x4c58fa);if(_0xeee17[_0xaadf('0x34')][_0xaadf('0x40')]){_0x1abc81['where']=_[_0xaadf('0x41')](_0x1abc81['where'],{'$or':[{'key':{'$like':'%'+_0xeee17[_0xaadf('0x34')][_0xaadf('0x40')]+'%'}},{'value':{'$like':'%'+_0xeee17[_0xaadf('0x34')][_0xaadf('0x40')]+'%'}}]});}_0x1abc81=_[_0xaadf('0x41')]({},_0x1abc81,_0xeee17['options']);var _0x48133c={'where':_0x1abc81[_0xaadf('0x3e')]};return db[_0xaadf('0x42')][_0xaadf('0x20')](_0x48133c)['then'](function(_0xe566a0){_0x41b53f['count']=_0xe566a0;if(_0xeee17[_0xaadf('0x34')]['includeAll']){_0x1abc81[_0xaadf('0x43')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1abc81);})[_0xaadf('0x28')](function(_0x13ecf4){_0x41b53f[_0xaadf('0x44')]=_0x13ecf4;return _0x41b53f;})['then'](respondWithFilteredResult(_0x14670f,_0x1abc81))[_0xaadf('0x45')](handleError(_0x14670f,null));};exports['show']=function(_0x41d2fb,_0x2bb7aa){var _0x14f2f8={'raw':!![],'where':{'id':_0x41d2fb['params']['id']}},_0x55c03a={};_0x55c03a[_0xaadf('0x38')]=_[_0xaadf('0x35')](db[_0xaadf('0x42')]['rawAttributes']);_0x55c03a[_0xaadf('0x34')]=_[_0xaadf('0x35')](_0x41d2fb['query']);_0x55c03a[_0xaadf('0x36')]=_['intersection'](_0x55c03a[_0xaadf('0x38')],_0x55c03a[_0xaadf('0x34')]);_0x14f2f8['attributes']=_[_0xaadf('0x37')](_0x55c03a[_0xaadf('0x38')],qs[_0xaadf('0x39')](_0x41d2fb[_0xaadf('0x34')][_0xaadf('0x39')]));_0x14f2f8[_0xaadf('0x3a')]=_0x14f2f8[_0xaadf('0x3a')]['length']?_0x14f2f8['attributes']:_0x55c03a[_0xaadf('0x38')];if(_0x41d2fb[_0xaadf('0x34')][_0xaadf('0x46')]){_0x14f2f8[_0xaadf('0x43')]=[{'all':!![]}];}_0x14f2f8=_['merge']({},_0x14f2f8,_0x41d2fb[_0xaadf('0x47')]);return db['CannedAnswer'][_0xaadf('0x48')](_0x14f2f8)[_0xaadf('0x28')](handleEntityNotFound(_0x2bb7aa,null))['then'](respondWithResult(_0x2bb7aa,null))[_0xaadf('0x45')](handleError(_0x2bb7aa,null));};exports[_0xaadf('0x26')]=function(_0x25afe0,_0x174956){if(_0x25afe0['body']['id']){delete _0x25afe0[_0xaadf('0x49')]['id'];}return db[_0xaadf('0x42')][_0xaadf('0x48')]({'where':{'id':_0x25afe0['params']['id']}})[_0xaadf('0x28')](handleEntityNotFound(_0x174956,null))[_0xaadf('0x28')](saveUpdates(_0x25afe0[_0xaadf('0x49')],null))[_0xaadf('0x28')](respondWithResult(_0x174956,null))[_0xaadf('0x45')](handleError(_0x174956,null));};exports[_0xaadf('0x27')]=function(_0x5d61b6,_0x54205e){return db[_0xaadf('0x42')][_0xaadf('0x48')]({'where':{'id':_0x5d61b6[_0xaadf('0x4a')]['id']}})[_0xaadf('0x28')](handleEntityNotFound(_0x54205e,null))[_0xaadf('0x28')](removeEntity(_0x54205e,null))['catch'](handleError(_0x54205e,null));};exports[_0xaadf('0x4b')]=function(_0x679fc6,_0x18326e){var _0x14ee5a={'key':_0x679fc6[_0xaadf('0x49')][_0xaadf('0x4c')]};if(_0x679fc6[_0xaadf('0x49')][_0xaadf('0x4d')]){_0x14ee5a['MailAccountId']=_0x679fc6[_0xaadf('0x49')][_0xaadf('0x4d')];}else if(_0x679fc6[_0xaadf('0x49')]['SmsAccountId']){_0x14ee5a[_0xaadf('0x4e')]=_0x679fc6['body'][_0xaadf('0x4e')];}else if(_0x679fc6[_0xaadf('0x49')]['OpenchannelAccountId']){_0x14ee5a[_0xaadf('0x4f')]=_0x679fc6['body'][_0xaadf('0x4f')];}else if(_0x679fc6['body'][_0xaadf('0x50')]){_0x14ee5a[_0xaadf('0x50')]=_0x679fc6[_0xaadf('0x49')][_0xaadf('0x50')];}return db[_0xaadf('0x42')][_0xaadf('0x48')]({'where':_0x14ee5a})[_0xaadf('0x28')](function(_0x4da836){if(_0x4da836){throw new db[(_0xaadf('0x51'))][(_0xaadf('0x52'))](_0xaadf('0x53'));}return db['CannedAnswer'][_0xaadf('0x4b')](_0x679fc6[_0xaadf('0x49')]);})[_0xaadf('0x28')](function(_0x3b6764){var _0x498c45=_0x679fc6[_0xaadf('0x54')]['get']({'plain':!![]});if(!_0x498c45)throw new Error(_0xaadf('0x55'));if(_0x498c45['role']===_0xaadf('0x54')){var _0x52b188=_0x3b6764['get']({'plain':!![]});return db['UserProfileSection'][_0xaadf('0x48')]({'where':{'name':_0xaadf('0x56'),'userProfileId':_0x498c45['userProfileId']},'raw':!![]})[_0xaadf('0x28')](function(_0x2898ba){if(_0x2898ba&&_0x2898ba['autoAssociation']===0x0){return db[_0xaadf('0x2a')][_0xaadf('0x4b')]({'name':_0x52b188[_0xaadf('0x2e')],'resourceId':_0x52b188['id'],'type':_0x2898ba[_0xaadf('0x2e')],'sectionId':_0x2898ba['id']},{})['then'](function(){return _0x3b6764;});}else{return _0x3b6764;}})['catch'](function(_0x39469c){logger[_0xaadf('0x2c')](_0xaadf('0x57'),_0x39469c);throw _0x39469c;});}return _0x3b6764;})[_0xaadf('0x28')](respondWithResult(_0x18326e,0xc9))[_0xaadf('0x45')](handleError(_0x18326e,null));};
\ No newline at end of file
+var _0x87c3=['destroy','error','stack','name','send','map','CannedAnswer','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','keys','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../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','offset','count','set','Content-Range','json','apply','reject','save','update','then','CannedAnswers','UserProfileResource'];(function(_0x2486d8,_0x44f313){var _0x9a9e84=function(_0xd4e334){while(--_0xd4e334){_0x2486d8['push'](_0x2486d8['shift']());}};_0x9a9e84(++_0x44f313);}(_0x87c3,0x84));var _0x387c=function(_0x106d68,_0xc75926){_0x106d68=_0x106d68-0x0;var _0x9d93ef=_0x87c3[_0x106d68];return _0x9d93ef;};'use strict';var emlformat=require(_0x387c('0x0'));var rimraf=require(_0x387c('0x1'));var zipdir=require(_0x387c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x387c('0x3'));var moment=require(_0x387c('0x4'));var BPromise=require(_0x387c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x387c('0x6'));var sox=require(_0x387c('0x7'));var csv=require(_0x387c('0x8'));var ejs=require(_0x387c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x387c('0xa'));var crypto=require('crypto');var jsforce=require(_0x387c('0xb'));var deskjs=require(_0x387c('0xc'));var toCsv=require(_0x387c('0x8'));var querystring=require(_0x387c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x387c('0xe'));var qs=require(_0x387c('0xf'));var as=require(_0x387c('0x10'));var hardwareService=require(_0x387c('0x11'));var logger=require(_0x387c('0x12'))('api');var utils=require(_0x387c('0x13'));var config=require(_0x387c('0x14'));var licenseUtil=require(_0x387c('0x15'));var db=require(_0x387c('0x16'))['db'];function respondWithStatusCode(_0x11a7f4,_0x3f2d0d){_0x3f2d0d=_0x3f2d0d||0xcc;return function(_0x5bd07e){if(_0x5bd07e){return _0x11a7f4[_0x387c('0x17')](_0x3f2d0d);}return _0x11a7f4[_0x387c('0x18')](_0x3f2d0d)[_0x387c('0x19')]();};}function respondWithResult(_0x1a84cf,_0x42030f){_0x42030f=_0x42030f||0xc8;return function(_0x2bda19){if(_0x2bda19){return _0x1a84cf[_0x387c('0x18')](_0x42030f)['json'](_0x2bda19);}};}function respondWithFilteredResult(_0x8417af,_0x38538c){return function(_0x286a22){if(_0x286a22){var _0x1a7750=typeof _0x38538c['offset']===_0x387c('0x1a')&&typeof _0x38538c[_0x387c('0x1b')]===_0x387c('0x1a');var _0x4b4214=_0x286a22['count'];var _0x34367a=_0x1a7750?0x0:_0x38538c[_0x387c('0x1c')];var _0x2b7852=_0x1a7750?_0x286a22[_0x387c('0x1d')]:_0x38538c[_0x387c('0x1c')]+_0x38538c[_0x387c('0x1b')];var _0x303010;if(_0x2b7852>=_0x4b4214){_0x2b7852=_0x4b4214;_0x303010=0xc8;}else{_0x303010=0xce;}_0x8417af[_0x387c('0x18')](_0x303010);return _0x8417af[_0x387c('0x1e')](_0x387c('0x1f'),_0x34367a+'-'+_0x2b7852+'/'+_0x4b4214)[_0x387c('0x20')](_0x286a22);}return null;};}function patchUpdates(_0x59e898){return function(_0x595fce){try{jsonpatch[_0x387c('0x21')](_0x595fce,_0x59e898,!![]);}catch(_0x16271a){return BPromise[_0x387c('0x22')](_0x16271a);}return _0x595fce[_0x387c('0x23')]();};}function saveUpdates(_0x2791e1,_0x497053){return function(_0x5c191d){if(_0x5c191d){return _0x5c191d[_0x387c('0x24')](_0x2791e1)[_0x387c('0x25')](function(_0x5a4cec){return _0x5a4cec;});}return null;};}function removeEntity(_0x13db08,_0x3977c5){return function(_0xe516d4){if(_0xe516d4){return _0xe516d4['destroy']()['then'](function(){var _0x29267c=_0xe516d4['get']({'plain':!![]});var _0x52647c=_0x387c('0x26');return db[_0x387c('0x27')][_0x387c('0x28')]({'where':{'type':_0x52647c,'resourceId':_0x29267c['id']}})[_0x387c('0x25')](function(){return _0xe516d4;});})[_0x387c('0x25')](function(){_0x13db08[_0x387c('0x18')](0xcc)[_0x387c('0x19')]();});}};}function handleEntityNotFound(_0x14f446,_0x43044){return function(_0x139f89){if(!_0x139f89){_0x14f446[_0x387c('0x17')](0x194);}return _0x139f89;};}function handleError(_0x442366,_0x5a8300){_0x5a8300=_0x5a8300||0x1f4;return function(_0x2b04a3){logger[_0x387c('0x29')](_0x2b04a3[_0x387c('0x2a')]);if(_0x2b04a3['name']){delete _0x2b04a3[_0x387c('0x2b')];}_0x442366[_0x387c('0x18')](_0x5a8300)[_0x387c('0x2c')](_0x2b04a3);};}exports['index']=function(_0x2785fa,_0x69c5cd){var _0x15bb1c={},_0x401a7d={},_0x562830={'count':0x0,'rows':[]};var _0x17d6ca=_[_0x387c('0x2d')](db[_0x387c('0x2e')][_0x387c('0x2f')],function(_0xe37bf7){return{'name':_0xe37bf7['fieldName'],'type':_0xe37bf7[_0x387c('0x30')][_0x387c('0x31')]};});_0x401a7d[_0x387c('0x32')]=_['map'](_0x17d6ca,'name');_0x401a7d[_0x387c('0x33')]=_['keys'](_0x2785fa[_0x387c('0x33')]);_0x401a7d['filters']=_[_0x387c('0x34')](_0x401a7d[_0x387c('0x32')],_0x401a7d[_0x387c('0x33')]);_0x15bb1c['attributes']=_[_0x387c('0x34')](_0x401a7d[_0x387c('0x32')],qs[_0x387c('0x35')](_0x2785fa[_0x387c('0x33')][_0x387c('0x35')]));_0x15bb1c[_0x387c('0x36')]=_0x15bb1c['attributes'][_0x387c('0x37')]?_0x15bb1c[_0x387c('0x36')]:_0x401a7d['model'];if(!_0x2785fa[_0x387c('0x33')][_0x387c('0x38')](_0x387c('0x39'))){_0x15bb1c[_0x387c('0x1b')]=qs['limit'](_0x2785fa[_0x387c('0x33')][_0x387c('0x1b')]);_0x15bb1c[_0x387c('0x1c')]=qs['offset'](_0x2785fa[_0x387c('0x33')][_0x387c('0x1c')]);}_0x15bb1c[_0x387c('0x3a')]=qs[_0x387c('0x3b')](_0x2785fa[_0x387c('0x33')][_0x387c('0x3b')]);_0x15bb1c['where']=qs[_0x387c('0x3c')](_['pick'](_0x2785fa['query'],_0x401a7d[_0x387c('0x3c')]),_0x17d6ca);if(_0x2785fa['query'][_0x387c('0x3d')]){_0x15bb1c[_0x387c('0x3e')]=_[_0x387c('0x3f')](_0x15bb1c[_0x387c('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2785fa[_0x387c('0x33')][_0x387c('0x3d')]+'%'}},{'value':{'$like':'%'+_0x2785fa[_0x387c('0x33')]['filter']+'%'}}]});}_0x15bb1c=_[_0x387c('0x3f')]({},_0x15bb1c,_0x2785fa[_0x387c('0x40')]);var _0x39a194={'where':_0x15bb1c['where']};return db['CannedAnswer'][_0x387c('0x1d')](_0x39a194)[_0x387c('0x25')](function(_0x4fe9aa){_0x562830[_0x387c('0x1d')]=_0x4fe9aa;if(_0x2785fa[_0x387c('0x33')][_0x387c('0x41')]){_0x15bb1c[_0x387c('0x42')]=[{'all':!![]}];}return db[_0x387c('0x2e')][_0x387c('0x43')](_0x15bb1c);})[_0x387c('0x25')](function(_0x4b5b81){_0x562830['rows']=_0x4b5b81;return _0x562830;})[_0x387c('0x25')](respondWithFilteredResult(_0x69c5cd,_0x15bb1c))['catch'](handleError(_0x69c5cd,null));};exports['show']=function(_0x35d3a6,_0x5313fb){var _0x12ac98={'raw':!![],'where':{'id':_0x35d3a6['params']['id']}},_0x2fcc46={};_0x2fcc46['model']=_[_0x387c('0x44')](db['CannedAnswer'][_0x387c('0x2f')]);_0x2fcc46[_0x387c('0x33')]=_[_0x387c('0x44')](_0x35d3a6[_0x387c('0x33')]);_0x2fcc46[_0x387c('0x3c')]=_['intersection'](_0x2fcc46['model'],_0x2fcc46[_0x387c('0x33')]);_0x12ac98['attributes']=_[_0x387c('0x34')](_0x2fcc46[_0x387c('0x32')],qs[_0x387c('0x35')](_0x35d3a6[_0x387c('0x33')][_0x387c('0x35')]));_0x12ac98[_0x387c('0x36')]=_0x12ac98[_0x387c('0x36')][_0x387c('0x37')]?_0x12ac98[_0x387c('0x36')]:_0x2fcc46[_0x387c('0x32')];if(_0x35d3a6[_0x387c('0x33')][_0x387c('0x41')]){_0x12ac98[_0x387c('0x42')]=[{'all':!![]}];}_0x12ac98=_[_0x387c('0x3f')]({},_0x12ac98,_0x35d3a6[_0x387c('0x40')]);return db[_0x387c('0x2e')][_0x387c('0x45')](_0x12ac98)[_0x387c('0x25')](handleEntityNotFound(_0x5313fb,null))[_0x387c('0x25')](respondWithResult(_0x5313fb,null))['catch'](handleError(_0x5313fb,null));};exports[_0x387c('0x24')]=function(_0x3d2a26,_0xe30aa5){if(_0x3d2a26[_0x387c('0x46')]['id']){delete _0x3d2a26[_0x387c('0x46')]['id'];}return db[_0x387c('0x2e')]['find']({'where':{'id':_0x3d2a26['params']['id']}})[_0x387c('0x25')](handleEntityNotFound(_0xe30aa5,null))[_0x387c('0x25')](saveUpdates(_0x3d2a26[_0x387c('0x46')],null))['then'](respondWithResult(_0xe30aa5,null))[_0x387c('0x47')](handleError(_0xe30aa5,null));};exports[_0x387c('0x28')]=function(_0x1ff952,_0x46c4b9){return db['CannedAnswer'][_0x387c('0x45')]({'where':{'id':_0x1ff952['params']['id']}})[_0x387c('0x25')](handleEntityNotFound(_0x46c4b9,null))[_0x387c('0x25')](removeEntity(_0x46c4b9,null))[_0x387c('0x47')](handleError(_0x46c4b9,null));};exports[_0x387c('0x48')]=function(_0x1aeb70,_0x5edbe8){var _0x27e008={'key':_0x1aeb70['body'][_0x387c('0x31')]};if(_0x1aeb70['body'][_0x387c('0x49')]){_0x27e008[_0x387c('0x49')]=_0x1aeb70[_0x387c('0x46')][_0x387c('0x49')];}else if(_0x1aeb70[_0x387c('0x46')][_0x387c('0x4a')]){_0x27e008[_0x387c('0x4a')]=_0x1aeb70[_0x387c('0x46')][_0x387c('0x4a')];}else if(_0x1aeb70['body'][_0x387c('0x4b')]){_0x27e008[_0x387c('0x4b')]=_0x1aeb70[_0x387c('0x46')][_0x387c('0x4b')];}else if(_0x1aeb70[_0x387c('0x46')][_0x387c('0x4c')]){_0x27e008['ChatWebsiteId']=_0x1aeb70[_0x387c('0x46')][_0x387c('0x4c')];}return db[_0x387c('0x2e')][_0x387c('0x45')]({'where':_0x27e008})[_0x387c('0x25')](function(_0x28d584){if(_0x28d584){throw new db[(_0x387c('0x4d'))][(_0x387c('0x4e'))](_0x387c('0x4f'));}return db[_0x387c('0x2e')][_0x387c('0x48')](_0x1aeb70[_0x387c('0x46')]);})[_0x387c('0x25')](function(_0x590402){var _0x4082bf=_0x1aeb70[_0x387c('0x50')][_0x387c('0x51')]({'plain':!![]});if(!_0x4082bf)throw new Error(_0x387c('0x52'));if(_0x4082bf[_0x387c('0x53')]===_0x387c('0x50')){var _0x1df545=_0x590402[_0x387c('0x51')]({'plain':!![]});return db[_0x387c('0x54')]['find']({'where':{'name':_0x387c('0x26'),'userProfileId':_0x4082bf['userProfileId']},'raw':!![]})[_0x387c('0x25')](function(_0x44ca0c){if(_0x44ca0c&&_0x44ca0c[_0x387c('0x55')]===0x0){return db[_0x387c('0x27')]['create']({'name':_0x1df545[_0x387c('0x2b')],'resourceId':_0x1df545['id'],'type':_0x44ca0c[_0x387c('0x2b')],'sectionId':_0x44ca0c['id']},{})['then'](function(){return _0x590402;});}else{return _0x590402;}})[_0x387c('0x47')](function(_0x45bad4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45bad4);throw _0x45bad4;});}return _0x590402;})[_0x387c('0x25')](respondWithResult(_0x5edbe8,0xc9))[_0x387c('0x47')](handleError(_0x5edbe8,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 05a1d5b..fcbcf83 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 _0x90b2=['utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers'];(function(_0x1b9e81,_0x34b1b7){var _0x10b4fa=function(_0x1d4991){while(--_0x1d4991){_0x1b9e81['push'](_0x1b9e81['shift']());}};_0x10b4fa(++_0x34b1b7);}(_0x90b2,0x14c));var _0x290b=function(_0x247083,_0x3849ed){_0x247083=_0x247083-0x0;var _0x1576e4=_0x90b2[_0x247083];return _0x1576e4;};'use strict';var _=require(_0x290b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x290b('0x1'));var BPromise=require(_0x290b('0x2'));var rp=require(_0x290b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x290b('0x4'));var attributes=require(_0x290b('0x5'));module[_0x290b('0x6')]=function(_0x41cfa4,_0xc2eb63){return _0x41cfa4[_0x290b('0x7')]('CannedAnswer',attributes,{'tableName':_0x290b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x290b('0x9'),'collate':_0x290b('0xa')});};
\ No newline at end of file
+var _0x0ff9=['path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14fa3f,_0x1fcb19){var _0x40c7e7=function(_0xda4c2c){while(--_0xda4c2c){_0x14fa3f['push'](_0x14fa3f['shift']());}};_0x40c7e7(++_0x1fcb19);}(_0x0ff9,0x11a));var _0x90ff=function(_0x43f996,_0x1cc493){_0x43f996=_0x43f996-0x0;var _0x30edef=_0x0ff9[_0x43f996];return _0x30edef;};'use strict';var _=require(_0x90ff('0x0'));var util=require(_0x90ff('0x1'));var logger=require(_0x90ff('0x2'))(_0x90ff('0x3'));var moment=require(_0x90ff('0x4'));var BPromise=require(_0x90ff('0x5'));var rp=require(_0x90ff('0x6'));var fs=require('fs');var path=require(_0x90ff('0x7'));var rimraf=require(_0x90ff('0x8'));var config=require(_0x90ff('0x9'));var attributes=require(_0x90ff('0xa'));module[_0x90ff('0xb')]=function(_0x2c7bc7,_0x5ab9b9){return _0x2c7bc7[_0x90ff('0xc')](_0x90ff('0xd'),attributes,{'tableName':_0x90ff('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x90ff('0xf'),'collate':_0x90ff('0x10')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index ef6aedd..299e623 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(_0x57d886,_0xb9cc17){var _0x5a99e6=function(_0x3ff971){while(--_0x3ff971){_0x57d886['push'](_0x57d886['shift']());}};_0x5a99e6(++_0xb9cc17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x37b9fa,_0x156d8b){var _0x21861d=function(_0x2c37a8){while(--_0x2c37a8){_0x37b9fa['push'](_0x37b9fa['shift']());}};_0x21861d(++_0x156d8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 41704cb..41dc697 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 _0xfb3f=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy'];(function(_0x5cebe1,_0x520ec8){var _0x57a4fd=function(_0x5ec8f1){while(--_0x5ec8f1){_0x5cebe1['push'](_0x5cebe1['shift']());}};_0x57a4fd(++_0x520ec8);}(_0xfb3f,0x1e7));var _0xffb3=function(_0x4a3558,_0x35546d){_0x4a3558=_0x4a3558-0x0;var _0x381242=_0xfb3f[_0x4a3558];return _0x381242;};'use strict';var multer=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var path=require('path');var timeout=require(_0xffb3('0x2'));var express=require('express');var router=express[_0xffb3('0x3')]();var fs_extra=require(_0xffb3('0x4'));var auth=require(_0xffb3('0x5'));var interaction=require(_0xffb3('0x6'));var config=require('../../config/environment');var controller=require(_0xffb3('0x7'));router[_0xffb3('0x8')]('/',auth[_0xffb3('0x9')](),controller[_0xffb3('0xa')]);router[_0xffb3('0x8')](_0xffb3('0xb'),auth['isAuthenticated'](),controller[_0xffb3('0xc')]);router['post']('/',auth[_0xffb3('0x9')](),controller['create']);router[_0xffb3('0xd')]('/:id',auth[_0xffb3('0x9')](),controller[_0xffb3('0xe')]);router[_0xffb3('0xf')]('/:id',auth[_0xffb3('0x9')](),controller[_0xffb3('0x10')]);module[_0xffb3('0x11')]=router;
\ No newline at end of file
+var _0x66eb=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x4c3693,_0x5c240c){var _0xf36eb3=function(_0x39d294){while(--_0x39d294){_0x4c3693['push'](_0x4c3693['shift']());}};_0xf36eb3(++_0x5c240c);}(_0x66eb,0x130));var _0xb66e=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0x66eb[_0x2351c4];return _0x1dd3f8;};'use strict';var multer=require(_0xb66e('0x0'));var util=require(_0xb66e('0x1'));var path=require('path');var timeout=require(_0xb66e('0x2'));var express=require(_0xb66e('0x3'));var router=express['Router']();var fs_extra=require(_0xb66e('0x4'));var auth=require(_0xb66e('0x5'));var interaction=require(_0xb66e('0x6'));var config=require(_0xb66e('0x7'));var controller=require(_0xb66e('0x8'));router[_0xb66e('0x9')]('/',auth[_0xb66e('0xa')](),controller['index']);router[_0xb66e('0x9')]('/:id',auth[_0xb66e('0xa')](),controller[_0xb66e('0xb')]);router['post']('/',auth[_0xb66e('0xa')](),controller[_0xb66e('0xc')]);router[_0xb66e('0xd')](_0xb66e('0xe'),auth[_0xb66e('0xa')](),controller[_0xb66e('0xf')]);router[_0xb66e('0x10')]('/:id',auth[_0xb66e('0xa')](),controller[_0xb66e('0x11')]);module[_0xb66e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 2282910..e712f9f 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 _0x9189=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x45f4e9,_0x5246fd){var _0x559d8f=function(_0x591e11){while(--_0x591e11){_0x45f4e9['push'](_0x45f4e9['shift']());}};_0x559d8f(++_0x5246fd);}(_0x9189,0x1b0));var _0x9918=function(_0x579e02,_0x5621b6){_0x579e02=_0x579e02-0x0;var _0x554db9=_0x9189[_0x579e02];return _0x554db9;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x9918('0x0')],'allowNull':![],'defaultValue':_0x9918('0x1')},'clid':{'type':Sequelize[_0x9918('0x2')]},'src':{'type':Sequelize[_0x9918('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x9918('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9918('0x2')]},'lastdata':{'type':Sequelize[_0x9918('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9918('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9918('0x2')]},'amaflags':{'type':Sequelize[_0x9918('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x9918('0x2')]},'sequence':{'type':Sequelize[_0x9918('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9918('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xac7a=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xac7a,0x128));var _0xaac7=function(_0x177f71,_0x514ab9){_0x177f71=_0x177f71-0x0;var _0x57b964=_0xac7a[_0x177f71];return _0x57b964;};'use strict';var Sequelize=require(_0xaac7('0x0'));module[_0xaac7('0x1')]={'calldate':{'type':Sequelize[_0xaac7('0x2')],'allowNull':![],'defaultValue':_0xaac7('0x3')},'clid':{'type':Sequelize[_0xaac7('0x4')]},'src':{'type':Sequelize[_0xaac7('0x4')]},'dst':{'type':Sequelize[_0xaac7('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaac7('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xaac7('0x4')]},'lastdata':{'type':Sequelize[_0xaac7('0x4')]},'duration':{'type':Sequelize[_0xaac7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xaac7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaac7('0x4')]},'amaflags':{'type':Sequelize[_0xaac7('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaac7('0x4')]},'userfield':{'type':Sequelize[_0xaac7('0x4')]},'uniqueid':{'type':Sequelize[_0xaac7('0x4')]},'linkedid':{'type':Sequelize[_0xaac7('0x4')]},'sequence':{'type':Sequelize[_0xaac7('0x4')]},'peeraccount':{'type':Sequelize[_0xaac7('0x4')]},'type':{'type':Sequelize[_0xaac7('0x4')]},'tag':{'type':Sequelize[_0xaac7('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 49b3b06..813cef5 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 _0xee14=['params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','find','create','body'];(function(_0x469ae9,_0x24b390){var _0x4364a5=function(_0x38e0a0){while(--_0x38e0a0){_0x469ae9['push'](_0x469ae9['shift']());}};_0x4364a5(++_0x24b390);}(_0xee14,0x13a));var _0x4ee1=function(_0x294022,_0x32f1e2){_0x294022=_0x294022-0x0;var _0xfd20d=_0xee14[_0x294022];return _0xfd20d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['Cdr'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x2e')](_0x13944c,'name');_0x1d91be[_0x4ee1('0x34')]=_[_0x4ee1('0x35')](_0x4746c2[_0x4ee1('0x34')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],_0x1d91be['query']);_0x3dc870['attributes']=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x4746c2['query'][_0x4ee1('0x38')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3b')](_0x4ee1('0x3c'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x20')]);_0x3dc870['offset']=qs[_0x4ee1('0x1e')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x1e')]);}_0x3dc870['order']=qs['sort'](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3d')]);_0x3dc870[_0x4ee1('0x3e')]=qs[_0x4ee1('0x36')](_['pick'](_0x4746c2[_0x4ee1('0x34')],_0x1d91be[_0x4ee1('0x36')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]){_0x3dc870[_0x4ee1('0x3e')]=_[_0x4ee1('0x40')](_0x3dc870[_0x4ee1('0x3e')],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x59b5cc){if(_0x59b5cc[_0x4ee1('0x31')]!==_0x4ee1('0x41')){var _0x345003={};_0x345003[_0x59b5cc[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]+'%'};return _0x345003;}})});}_0x3dc870=_['merge']({},_0x3dc870,_0x4746c2[_0x4ee1('0x42')]);var _0x37176a={'where':_0x3dc870[_0x4ee1('0x3e')]};return db[_0x4ee1('0x43')][_0x4ee1('0x21')](_0x37176a)[_0x4ee1('0x29')](function(_0x3f0d8b){_0x59a34e[_0x4ee1('0x21')]=_0x3f0d8b;if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x3dc870[_0x4ee1('0x45')]=[{'all':!![]}];}return db[_0x4ee1('0x43')][_0x4ee1('0x46')](_0x3dc870);})['then'](function(_0x3b3bed){_0x59a34e[_0x4ee1('0x47')]=_0x3b3bed;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x48')](handleError(_0x4ec408,null));};exports['show']=function(_0x174167,_0x52ebc0){var _0x14c333={'raw':!![],'where':{'id':_0x174167['params']['id']}},_0xc7580c={};_0xc7580c[_0x4ee1('0x33')]=_[_0x4ee1('0x35')](db[_0x4ee1('0x43')][_0x4ee1('0x2f')]);_0xc7580c['query']=_[_0x4ee1('0x35')](_0x174167[_0x4ee1('0x34')]);_0xc7580c[_0x4ee1('0x36')]=_['intersection'](_0xc7580c['model'],_0xc7580c[_0x4ee1('0x34')]);_0x14c333[_0x4ee1('0x39')]=_[_0x4ee1('0x37')](_0xc7580c[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x174167['query']['fields']));_0x14c333[_0x4ee1('0x39')]=_0x14c333[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x14c333[_0x4ee1('0x39')]:_0xc7580c['model'];if(_0x174167[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x14c333['include']=[{'all':!![]}];}_0x14c333=_[_0x4ee1('0x40')]({},_0x14c333,_0x174167[_0x4ee1('0x42')]);return db[_0x4ee1('0x43')][_0x4ee1('0x49')](_0x14c333)[_0x4ee1('0x29')](handleEntityNotFound(_0x52ebc0,null))[_0x4ee1('0x29')](respondWithResult(_0x52ebc0,null))[_0x4ee1('0x48')](handleError(_0x52ebc0,null));};exports[_0x4ee1('0x4a')]=function(_0x390051,_0x4ebb28){return db['Cdr'][_0x4ee1('0x4a')](_0x390051[_0x4ee1('0x4b')],{})[_0x4ee1('0x29')](respondWithResult(_0x4ebb28,0xc9))[_0x4ee1('0x48')](handleError(_0x4ebb28,null));};exports['update']=function(_0x35edf5,_0x3c66d1){if(_0x35edf5[_0x4ee1('0x4b')]['id']){delete _0x35edf5[_0x4ee1('0x4b')]['id'];}return db[_0x4ee1('0x43')]['find']({'where':{'id':_0x35edf5[_0x4ee1('0x4c')]['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x3c66d1,null))[_0x4ee1('0x29')](saveUpdates(_0x35edf5['body'],null))[_0x4ee1('0x29')](respondWithResult(_0x3c66d1,null))['catch'](handleError(_0x3c66d1,null));};exports[_0x4ee1('0x28')]=function(_0x5a1114,_0x30a1cd){return db['Cdr'][_0x4ee1('0x49')]({'where':{'id':_0x5a1114['params']['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x30a1cd,null))[_0x4ee1('0x29')](removeEntity(_0x30a1cd,null))[_0x4ee1('0x48')](handleError(_0x30a1cd,null));};exports['describe']=function(_0x3368ed,_0x4118d7){return db[_0x4ee1('0x43')][_0x4ee1('0x4d')]()[_0x4ee1('0x29')](respondWithResult(_0x4118d7,null))[_0x4ee1('0x48')](handleError(_0x4118d7,null));};
\ No newline at end of file
+var _0x4074=['params','rawAttributes','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','Cdr','then','includeAll','findAll','rows','show'];(function(_0x32bed1,_0x3885b5){var _0xdac392=function(_0x4d2971){while(--_0x4d2971){_0x32bed1['push'](_0x32bed1['shift']());}};_0xdac392(++_0x3885b5);}(_0x4074,0xf0));var _0x4407=function(_0x1a24cc,_0xdb8313){_0x1a24cc=_0x1a24cc-0x0;var _0x5ceb20=_0x4074[_0x1a24cc];return _0x5ceb20;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={},_0x1d6b3d={},_0x37fba1={'count':0x0,'rows':[]};var _0x182bd9=_['map'](db['Cdr']['rawAttributes'],function(_0x28e99e){return{'name':_0x28e99e[_0x4407('0x2b')],'type':_0x28e99e[_0x4407('0x2c')][_0x4407('0x2d')]};});_0x1d6b3d[_0x4407('0x2e')]=_[_0x4407('0x2f')](_0x182bd9,_0x4407('0x29'));_0x1d6b3d[_0x4407('0x30')]=_[_0x4407('0x31')](_0x2feb6b[_0x4407('0x30')]);_0x1d6b3d['filters']=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],_0x1d6b3d[_0x4407('0x30')]);_0x84a8a[_0x4407('0x32')]=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],qs[_0x4407('0x33')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x33')]));_0x84a8a[_0x4407('0x32')]=_0x84a8a['attributes'][_0x4407('0x34')]?_0x84a8a['attributes']:_0x1d6b3d[_0x4407('0x2e')];if(!_0x2feb6b['query']['hasOwnProperty'](_0x4407('0x35'))){_0x84a8a[_0x4407('0x1f')]=qs[_0x4407('0x1f')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x1f')]);_0x84a8a[_0x4407('0x21')]=qs[_0x4407('0x21')](_0x2feb6b['query'][_0x4407('0x21')]);}_0x84a8a[_0x4407('0x36')]=qs[_0x4407('0x37')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x37')]);_0x84a8a['where']=qs[_0x4407('0x38')](_['pick'](_0x2feb6b[_0x4407('0x30')],_0x1d6b3d[_0x4407('0x38')]),_0x182bd9);if(_0x2feb6b[_0x4407('0x30')][_0x4407('0x39')]){_0x84a8a['where']=_[_0x4407('0x3a')](_0x84a8a[_0x4407('0x3b')],{'$or':_[_0x4407('0x2f')](_0x182bd9,function(_0x1bf4e2){if(_0x1bf4e2[_0x4407('0x2c')]!==_0x4407('0x3c')){var _0x30de66={};_0x30de66[_0x1bf4e2[_0x4407('0x29')]]={'$like':'%'+_0x2feb6b[_0x4407('0x30')]['filter']+'%'};return _0x30de66;}})});}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x3d')]);var _0xc47d0e={'where':_0x84a8a[_0x4407('0x3b')]};return db[_0x4407('0x3e')]['count'](_0xc47d0e)[_0x4407('0x3f')](function(_0x2cb65e){_0x37fba1[_0x4407('0x20')]=_0x2cb65e;if(_0x2feb6b['query'][_0x4407('0x40')]){_0x84a8a['include']=[{'all':!![]}];}return db['Cdr'][_0x4407('0x41')](_0x84a8a);})[_0x4407('0x3f')](function(_0x234fa5){_0x37fba1[_0x4407('0x42')]=_0x234fa5;return _0x37fba1;})[_0x4407('0x3f')](respondWithFilteredResult(_0x1f9828,_0x84a8a))['catch'](handleError(_0x1f9828,null));};exports[_0x4407('0x43')]=function(_0xf79768,_0x819b8b){var _0x15ba7b={'raw':!![],'where':{'id':_0xf79768[_0x4407('0x44')]['id']}},_0x5b41cf={};_0x5b41cf[_0x4407('0x2e')]=_[_0x4407('0x31')](db[_0x4407('0x3e')][_0x4407('0x45')]);_0x5b41cf['query']=_[_0x4407('0x31')](_0xf79768['query']);_0x5b41cf['filters']=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],_0x5b41cf['query']);_0x15ba7b[_0x4407('0x32')]=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],qs[_0x4407('0x33')](_0xf79768['query'][_0x4407('0x33')]));_0x15ba7b[_0x4407('0x32')]=_0x15ba7b[_0x4407('0x32')][_0x4407('0x34')]?_0x15ba7b[_0x4407('0x32')]:_0x5b41cf['model'];if(_0xf79768[_0x4407('0x30')][_0x4407('0x40')]){_0x15ba7b[_0x4407('0x47')]=[{'all':!![]}];}_0x15ba7b=_[_0x4407('0x3a')]({},_0x15ba7b,_0xf79768[_0x4407('0x3d')]);return db['Cdr'][_0x4407('0x48')](_0x15ba7b)[_0x4407('0x3f')](handleEntityNotFound(_0x819b8b,null))[_0x4407('0x3f')](respondWithResult(_0x819b8b,null))[_0x4407('0x49')](handleError(_0x819b8b,null));};exports['create']=function(_0x18ff16,_0x2b18b8){return db['Cdr'][_0x4407('0x4a')](_0x18ff16[_0x4407('0x4b')],{})['then'](respondWithResult(_0x2b18b8,0xc9))[_0x4407('0x49')](handleError(_0x2b18b8,null));};exports[_0x4407('0x25')]=function(_0x5ea36,_0x4fbc1f){if(_0x5ea36[_0x4407('0x4b')]['id']){delete _0x5ea36['body']['id'];}return db['Cdr'][_0x4407('0x48')]({'where':{'id':_0x5ea36[_0x4407('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fbc1f,null))[_0x4407('0x3f')](saveUpdates(_0x5ea36[_0x4407('0x4b')],null))[_0x4407('0x3f')](respondWithResult(_0x4fbc1f,null))[_0x4407('0x49')](handleError(_0x4fbc1f,null));};exports[_0x4407('0x26')]=function(_0x5a2c2b,_0x39865e){return db[_0x4407('0x3e')][_0x4407('0x48')]({'where':{'id':_0x5a2c2b[_0x4407('0x44')]['id']}})[_0x4407('0x3f')](handleEntityNotFound(_0x39865e,null))[_0x4407('0x3f')](removeEntity(_0x39865e,null))[_0x4407('0x49')](handleError(_0x39865e,null));};exports[_0x4407('0x4c')]=function(_0xd1dd66,_0x55f0ef){return db[_0x4407('0x3e')]['describe']()[_0x4407('0x3f')](respondWithResult(_0x55f0ef,null))[_0x4407('0x49')](handleError(_0x55f0ef,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b61a762..f7e67f8 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(_0x23db91,_0x46a816){var _0x5edde8=function(_0x6da8b7){while(--_0x6da8b7){_0x23db91['push'](_0x23db91['shift']());}};_0x5edde8(++_0x46a816);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xce5bb5,_0x4c2a4c){var _0x5e4830=function(_0x5c5297){while(--_0x5c5297){_0xce5bb5['push'](_0xce5bb5['shift']());}};_0x5e4830(++_0x4c2a4c);}(_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':'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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 0cef3c0..5a8e633 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 _0xc943=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc943,0x17e));var _0x3c94=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0xc943[_0x350258];return _0x3714b3;};'use strict';var _=require(_0x3c94('0x0'));var util=require(_0x3c94('0x1'));var moment=require('moment');var BPromise=require(_0x3c94('0x2'));var rs=require(_0x3c94('0x3'));var fs=require('fs');var Redis=require(_0x3c94('0x4'));var db=require(_0x3c94('0x5'))['db'];var utils=require(_0x3c94('0x6'));var logger=require(_0x3c94('0x7'))(_0x3c94('0x8'));var config=require('../../config/environment');var jayson=require(_0x3c94('0x9'));var client=jayson[_0x3c94('0xa')][_0x3c94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x448fac,_0x3209f9,_0x10d56e){return new BPromise(function(_0x300b6f,_0x132c49){return client[_0x3c94('0xc')](_0x448fac,_0x10d56e)['then'](function(_0x4c7515){logger[_0x3c94('0xd')](_0x3c94('0xe'),_0x3209f9,_0x3c94('0xf'));logger[_0x3c94('0x10')](_0x3c94('0x11'),_0x3209f9,_0x3c94('0xf'),JSON[_0x3c94('0x12')](_0x4c7515));if(_0x4c7515['error']){if(_0x4c7515[_0x3c94('0x13')]['code']===0x1f4){logger['error'](_0x3c94('0xe'),_0x3209f9,_0x4c7515['error'][_0x3c94('0x14')]);return _0x132c49(_0x4c7515['error'][_0x3c94('0x14')]);}logger[_0x3c94('0x13')]('Cdr,\x20%s,\x20%s',_0x3209f9,_0x4c7515[_0x3c94('0x13')][_0x3c94('0x14')]);return _0x300b6f(_0x4c7515[_0x3c94('0x13')]['message']);}else{logger[_0x3c94('0xd')]('Cdr,\x20%s,\x20%s',_0x3209f9,_0x3c94('0xf'));_0x300b6f(_0x4c7515[_0x3c94('0x15')]['message']);}})['catch'](function(_0x25c94e){logger['error'](_0x3c94('0xe'),_0x3209f9,_0x25c94e);_0x132c49(_0x25c94e);});});}
\ No newline at end of file
+var _0x461a=['stringify','code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4995b5,_0x45b4eb){var _0x22050d=function(_0x2172c1){while(--_0x2172c1){_0x4995b5['push'](_0x4995b5['shift']());}};_0x22050d(++_0x45b4eb);}(_0x461a,0x1e6));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa461('0x0'));var util=require(_0xa461('0x1'));var moment=require(_0xa461('0x2'));var BPromise=require(_0xa461('0x3'));var rs=require(_0xa461('0x4'));var fs=require('fs');var Redis=require(_0xa461('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa461('0x6'))(_0xa461('0x7'));var config=require(_0xa461('0x8'));var jayson=require(_0xa461('0x9'));var client=jayson['client'][_0xa461('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15e31d,_0x1ad8d7,_0x19f7a8){return new BPromise(function(_0x2118f9,_0x239066){return client['request'](_0x15e31d,_0x19f7a8)['then'](function(_0xe66eaf){logger['info'](_0xa461('0xb'),_0x1ad8d7,'request\x20sent');logger['debug'](_0xa461('0xc'),_0x1ad8d7,_0xa461('0xd'),JSON[_0xa461('0xe')](_0xe66eaf));if(_0xe66eaf['error']){if(_0xe66eaf['error'][_0xa461('0xf')]===0x1f4){logger[_0xa461('0x10')](_0xa461('0xb'),_0x1ad8d7,_0xe66eaf[_0xa461('0x10')][_0xa461('0x11')]);return _0x239066(_0xe66eaf[_0xa461('0x10')][_0xa461('0x11')]);}logger[_0xa461('0x10')]('Cdr,\x20%s,\x20%s',_0x1ad8d7,_0xe66eaf[_0xa461('0x10')]['message']);return _0x2118f9(_0xe66eaf[_0xa461('0x10')][_0xa461('0x11')]);}else{logger[_0xa461('0x12')](_0xa461('0xb'),_0x1ad8d7,_0xa461('0xd'));_0x2118f9(_0xe66eaf['result']['message']);}})[_0xa461('0x13')](function(_0x1ebc9c){logger[_0xa461('0x10')](_0xa461('0xb'),_0x1ad8d7,_0x1ebc9c);_0x239066(_0x1ebc9c);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 3d0fb75..46cbe88 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 _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(_0x1e46a5,_0x5b094e){var _0x35a2cf=function(_0x5e7c65){while(--_0x5e7c65){_0x1e46a5['push'](_0x1e46a5['shift']());}};_0x35a2cf(++_0x5b094e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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
+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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 9b77582..98ac32d 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 _0x883b=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x883b,0x15d));var _0xb883=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x883b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xb883('0x0')]={'priority':{'type':Sequelize[_0xb883('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb883('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb883('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb883('0x2')],'defaultValue':_0xb883('0x4')}};
\ No newline at end of file
+var _0x1f16=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x4acfcd,_0xabaa4e){var _0x1974fc=function(_0x244739){while(--_0x244739){_0x4acfcd['push'](_0x4acfcd['shift']());}};_0x1974fc(++_0xabaa4e);}(_0x1f16,0x115));var _0x61f1=function(_0xdbaf7f,_0x2ffdf7){_0xdbaf7f=_0xdbaf7f-0x0;var _0x2b296b=_0x1f16[_0xdbaf7f];return _0x2b296b;};'use strict';var Sequelize=require('sequelize');module[_0x61f1('0x0')]={'priority':{'type':Sequelize[_0x61f1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x61f1('0x2')],'allowNull':![],'defaultValue':_0x61f1('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x61f1('0x2')]},'interval':{'type':Sequelize[_0x61f1('0x2')],'defaultValue':_0x61f1('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5f12c03..a85654d 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 _0xf45e=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','ChatApplication','find','catch','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb'];(function(_0x2ddf2d,_0x53e9b3){var _0x30e9be=function(_0x25690d){while(--_0x25690d){_0x2ddf2d['push'](_0x2ddf2d['shift']());}};_0x30e9be(++_0x53e9b3);}(_0xf45e,0x115));var _0xef45=function(_0x41c943,_0x8f932c){_0x41c943=_0x41c943-0x0;var _0xba6d65=_0xf45e[_0x41c943];return _0xba6d65;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b35,_0x5f0593){return function(_0x38b470){if(!_0x38b470){_0x208b35[_0xef45('0x2a')](0x194);}return _0x38b470;};}function handleError(_0x578f03,_0x46e423){_0x46e423=_0x46e423||0x1f4;return function(_0x2c356d){logger['error'](_0x2c356d[_0xef45('0x2b')]);if(_0x2c356d['name']){delete _0x2c356d['name'];}_0x578f03['status'](_0x46e423)['send'](_0x2c356d);};}exports[_0xef45('0x2c')]=function(_0x2f72ef,_0x217e8d){var _0x15ad38={'raw':!![],'where':{'id':_0x2f72ef[_0xef45('0x2d')]['id']}},_0x5782d0={};_0x5782d0['model']=_[_0xef45('0x2e')](db['ChatApplication'][_0xef45('0x2f')]);_0x5782d0['query']=_['keys'](_0x2f72ef[_0xef45('0x30')]);_0x5782d0[_0xef45('0x31')]=_[_0xef45('0x32')](_0x5782d0[_0xef45('0x33')],_0x5782d0[_0xef45('0x30')]);_0x15ad38['attributes']=_['intersection'](_0x5782d0['model'],qs[_0xef45('0x34')](_0x2f72ef[_0xef45('0x30')][_0xef45('0x34')]));_0x15ad38[_0xef45('0x35')]=_0x15ad38[_0xef45('0x35')][_0xef45('0x36')]?_0x15ad38[_0xef45('0x35')]:_0x5782d0['model'];if(_0x2f72ef['query'][_0xef45('0x37')]){_0x15ad38['include']=[{'all':!![]}];}_0x15ad38=_[_0xef45('0x38')]({},_0x15ad38,_0x2f72ef['options']);return db[_0xef45('0x39')][_0xef45('0x3a')](_0x15ad38)[_0xef45('0x29')](handleEntityNotFound(_0x217e8d,null))[_0xef45('0x29')](respondWithResult(_0x217e8d,null))[_0xef45('0x3b')](handleError(_0x217e8d,null));};exports['update']=function(_0x372689,_0x331fdb){if(_0x372689[_0xef45('0x3c')]['id']){delete _0x372689['body']['id'];}return db['ChatApplication'][_0xef45('0x3a')]({'where':{'id':_0x372689[_0xef45('0x2d')]['id']}})['then'](handleEntityNotFound(_0x331fdb,null))[_0xef45('0x29')](saveUpdates(_0x372689['body'],null))['then'](respondWithResult(_0x331fdb,null))[_0xef45('0x3b')](handleError(_0x331fdb,null));};exports[_0xef45('0x28')]=function(_0x2688c9,_0x573caf){return db[_0xef45('0x39')][_0xef45('0x3a')]({'where':{'id':_0x2688c9[_0xef45('0x2d')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x573caf,null))['then'](removeEntity(_0x573caf,null))['catch'](handleError(_0x573caf,null));};
\ No newline at end of file
+var _0x2b84=['apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','attributes','include','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set'];(function(_0x510001,_0x4d5f91){var _0x3f603d=function(_0x1684c9){while(--_0x1684c9){_0x510001['push'](_0x510001['shift']());}};_0x3f603d(++_0x4d5f91);}(_0x2b84,0x105));var _0x42b8=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x2b84[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x42b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x42b8('0x1'));var jsonpatch=require(_0x42b8('0x2'));var rp=require(_0x42b8('0x3'));var moment=require(_0x42b8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x42b8('0x5'));var util=require(_0x42b8('0x6'));var path=require(_0x42b8('0x7'));var sox=require(_0x42b8('0x8'));var csv=require(_0x42b8('0x9'));var ejs=require(_0x42b8('0xa'));var fs=require('fs');var fs_extra=require(_0x42b8('0xb'));var _=require(_0x42b8('0xc'));var squel=require('squel');var crypto=require(_0x42b8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x42b8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x42b8('0xf'));var Redis=require(_0x42b8('0x10'));var authService=require(_0x42b8('0x11'));var qs=require(_0x42b8('0x12'));var as=require(_0x42b8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42b8('0x14'))(_0x42b8('0x15'));var utils=require(_0x42b8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x42b8('0x17'));var db=require(_0x42b8('0x18'))['db'];function respondWithStatusCode(_0x2c3e6c,_0x48dbba){_0x48dbba=_0x48dbba||0xcc;return function(_0x374d84){if(_0x374d84){return _0x2c3e6c[_0x42b8('0x19')](_0x48dbba);}return _0x2c3e6c['status'](_0x48dbba)[_0x42b8('0x1a')]();};}function respondWithResult(_0x4611e6,_0x3bd4e3){_0x3bd4e3=_0x3bd4e3||0xc8;return function(_0xe8c8fd){if(_0xe8c8fd){return _0x4611e6[_0x42b8('0x1b')](_0x3bd4e3)[_0x42b8('0x1c')](_0xe8c8fd);}};}function respondWithFilteredResult(_0x1638f5,_0x49e6be){return function(_0x4ea974){if(_0x4ea974){var _0x276222=typeof _0x49e6be[_0x42b8('0x1d')]===_0x42b8('0x1e')&&typeof _0x49e6be['limit']===_0x42b8('0x1e');var _0x4201f4=_0x4ea974['count'];var _0x2359a5=_0x276222?0x0:_0x49e6be[_0x42b8('0x1d')];var _0x21a5f0=_0x276222?_0x4ea974[_0x42b8('0x1f')]:_0x49e6be[_0x42b8('0x1d')]+_0x49e6be[_0x42b8('0x20')];var _0x17e10b;if(_0x21a5f0>=_0x4201f4){_0x21a5f0=_0x4201f4;_0x17e10b=0xc8;}else{_0x17e10b=0xce;}_0x1638f5[_0x42b8('0x1b')](_0x17e10b);return _0x1638f5[_0x42b8('0x21')]('Content-Range',_0x2359a5+'-'+_0x21a5f0+'/'+_0x4201f4)[_0x42b8('0x1c')](_0x4ea974);}return null;};}function patchUpdates(_0x33236b){return function(_0x561568){try{jsonpatch[_0x42b8('0x22')](_0x561568,_0x33236b,!![]);}catch(_0x1af649){return BPromise[_0x42b8('0x23')](_0x1af649);}return _0x561568[_0x42b8('0x24')]();};}function saveUpdates(_0x453079,_0x2be6c8){return function(_0x7bf526){if(_0x7bf526){return _0x7bf526[_0x42b8('0x25')](_0x453079)[_0x42b8('0x26')](function(_0x361d7a){return _0x361d7a;});}return null;};}function removeEntity(_0x23b015,_0x1c4908){return function(_0x41f708){if(_0x41f708){return _0x41f708[_0x42b8('0x27')]()[_0x42b8('0x26')](function(){_0x23b015['status'](0xcc)[_0x42b8('0x1a')]();});}};}function handleEntityNotFound(_0x316c98,_0x7eca17){return function(_0x146c5d){if(!_0x146c5d){_0x316c98[_0x42b8('0x19')](0x194);}return _0x146c5d;};}function handleError(_0xfa0a81,_0x296470){_0x296470=_0x296470||0x1f4;return function(_0x3ea491){logger[_0x42b8('0x28')](_0x3ea491[_0x42b8('0x29')]);if(_0x3ea491[_0x42b8('0x2a')]){delete _0x3ea491['name'];}_0xfa0a81['status'](_0x296470)[_0x42b8('0x2b')](_0x3ea491);};}exports[_0x42b8('0x2c')]=function(_0x3ef9e3,_0x5a11ba){var _0x559e98={'raw':!![],'where':{'id':_0x3ef9e3[_0x42b8('0x2d')]['id']}},_0x12d16d={};_0x12d16d[_0x42b8('0x2e')]=_['keys'](db[_0x42b8('0x2f')][_0x42b8('0x30')]);_0x12d16d[_0x42b8('0x31')]=_[_0x42b8('0x32')](_0x3ef9e3[_0x42b8('0x31')]);_0x12d16d[_0x42b8('0x33')]=_[_0x42b8('0x34')](_0x12d16d[_0x42b8('0x2e')],_0x12d16d[_0x42b8('0x31')]);_0x559e98['attributes']=_[_0x42b8('0x34')](_0x12d16d[_0x42b8('0x2e')],qs[_0x42b8('0x35')](_0x3ef9e3[_0x42b8('0x31')][_0x42b8('0x35')]));_0x559e98[_0x42b8('0x36')]=_0x559e98[_0x42b8('0x36')]['length']?_0x559e98[_0x42b8('0x36')]:_0x12d16d[_0x42b8('0x2e')];if(_0x3ef9e3[_0x42b8('0x31')]['includeAll']){_0x559e98[_0x42b8('0x37')]=[{'all':!![]}];}_0x559e98=_['merge']({},_0x559e98,_0x3ef9e3['options']);return db['ChatApplication'][_0x42b8('0x38')](_0x559e98)[_0x42b8('0x26')](handleEntityNotFound(_0x5a11ba,null))[_0x42b8('0x26')](respondWithResult(_0x5a11ba,null))[_0x42b8('0x39')](handleError(_0x5a11ba,null));};exports[_0x42b8('0x25')]=function(_0xcde2c,_0x2dd365){if(_0xcde2c[_0x42b8('0x3a')]['id']){delete _0xcde2c[_0x42b8('0x3a')]['id'];}return db[_0x42b8('0x2f')][_0x42b8('0x38')]({'where':{'id':_0xcde2c['params']['id']}})[_0x42b8('0x26')](handleEntityNotFound(_0x2dd365,null))[_0x42b8('0x26')](saveUpdates(_0xcde2c['body'],null))['then'](respondWithResult(_0x2dd365,null))[_0x42b8('0x39')](handleError(_0x2dd365,null));};exports[_0x42b8('0x27')]=function(_0x471903,_0x11a083){return db[_0x42b8('0x2f')][_0x42b8('0x38')]({'where':{'id':_0x471903['params']['id']}})['then'](handleEntityNotFound(_0x11a083,null))[_0x42b8('0x26')](removeEntity(_0x11a083,null))[_0x42b8('0x39')](handleError(_0x11a083,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 3ea8a1d..3dbc2cb 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 _0xfaba=['api','bluebird','rimraf','./chatApplication.attributes','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4c6137,_0x50e16b){var _0x13276f=function(_0x97b535){while(--_0x97b535){_0x4c6137['push'](_0x4c6137['shift']());}};_0x13276f(++_0x50e16b);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xafab('0x0'));var util=require(_0xafab('0x1'));var logger=require(_0xafab('0x2'))(_0xafab('0x3'));var moment=require('moment');var BPromise=require(_0xafab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xafab('0x5'));var config=require('../../config/environment');var attributes=require(_0xafab('0x6'));module['exports']=function(_0x180e83,_0x5154e0){return _0x180e83[_0xafab('0x7')](_0xafab('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xafab('0x9'),'collate':_0xafab('0xa')});};
\ No newline at end of file
+var _0xece1=['define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x123091,_0xaa9248){var _0x236430=function(_0x45054f){while(--_0x45054f){_0x123091['push'](_0x123091['shift']());}};_0x236430(++_0xaa9248);}(_0xece1,0x8a));var _0x1ece=function(_0x27a0bf,_0x261918){_0x27a0bf=_0x27a0bf-0x0;var _0x33249f=_0xece1[_0x27a0bf];return _0x33249f;};'use strict';var _=require(_0x1ece('0x0'));var util=require(_0x1ece('0x1'));var logger=require(_0x1ece('0x2'))(_0x1ece('0x3'));var moment=require(_0x1ece('0x4'));var BPromise=require(_0x1ece('0x5'));var rp=require(_0x1ece('0x6'));var fs=require('fs');var path=require(_0x1ece('0x7'));var rimraf=require(_0x1ece('0x8'));var config=require(_0x1ece('0x9'));var attributes=require(_0x1ece('0xa'));module[_0x1ece('0xb')]=function(_0xfe0b6c,_0x5a65b6){return _0xfe0b6c[_0x1ece('0xc')](_0x1ece('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ece('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 7122531..710d3d8 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 _0x0ab8=['ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x14361d,_0x4aa821){var _0x518d84=function(_0x5a9e49){while(--_0x5a9e49){_0x14361d['push'](_0x14361d['shift']());}};_0x518d84(++_0x4aa821);}(_0x0ab8,0x13c));var _0x80ab=function(_0x21710c,_0x294bb1){_0x21710c=_0x21710c-0x0;var _0x3c0a23=_0x0ab8[_0x21710c];return _0x3c0a23;};'use strict';var _=require(_0x80ab('0x0'));var util=require(_0x80ab('0x1'));var moment=require(_0x80ab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80ab('0x3'));var db=require(_0x80ab('0x4'))['db'];var utils=require(_0x80ab('0x5'));var logger=require(_0x80ab('0x6'))('rpc');var config=require(_0x80ab('0x7'));var jayson=require(_0x80ab('0x8'));var client=jayson[_0x80ab('0x9')][_0x80ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26743,_0xbb36db,_0x2d922c){return new BPromise(function(_0x2e3318,_0x4e6681){return client[_0x80ab('0xb')](_0x26743,_0x2d922c)['then'](function(_0x2a749b){logger[_0x80ab('0xc')]('ChatApplication,\x20%s,\x20%s',_0xbb36db,'request\x20sent');logger[_0x80ab('0xd')](_0x80ab('0xe'),_0xbb36db,_0x80ab('0xf'),JSON['stringify'](_0x2a749b));if(_0x2a749b[_0x80ab('0x10')]){if(_0x2a749b['error'][_0x80ab('0x11')]===0x1f4){logger[_0x80ab('0x10')]('ChatApplication,\x20%s,\x20%s',_0xbb36db,_0x2a749b[_0x80ab('0x10')][_0x80ab('0x12')]);return _0x4e6681(_0x2a749b['error'][_0x80ab('0x12')]);}logger[_0x80ab('0x10')](_0x80ab('0x13'),_0xbb36db,_0x2a749b[_0x80ab('0x10')]['message']);return _0x2e3318(_0x2a749b['error'][_0x80ab('0x12')]);}else{logger[_0x80ab('0xc')](_0x80ab('0x13'),_0xbb36db,'request\x20sent');_0x2e3318(_0x2a749b[_0x80ab('0x14')]['message']);}})[_0x80ab('0x15')](function(_0x51bc5e){logger[_0x80ab('0x10')]('ChatApplication,\x20%s,\x20%s',_0xbb36db,_0x51bc5e);_0x4e6681(_0x51bc5e);});});}
\ No newline at end of file
+var _0x674a=['moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util'];(function(_0x107790,_0x4e5fa6){var _0x2d79dc=function(_0x1fe72c){while(--_0x1fe72c){_0x107790['push'](_0x107790['shift']());}};_0x2d79dc(++_0x4e5fa6);}(_0x674a,0x1eb));var _0xa674=function(_0x504403,_0x1a8743){_0x504403=_0x504403-0x0;var _0x305c28=_0x674a[_0x504403];return _0x305c28;};'use strict';var _=require(_0xa674('0x0'));var util=require(_0xa674('0x1'));var moment=require(_0xa674('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa674('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa674('0x4'));var logger=require('../../config/logger')(_0xa674('0x5'));var config=require(_0xa674('0x6'));var jayson=require(_0xa674('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33afea,_0x398c4d,_0x473c03){return new BPromise(function(_0x564207,_0x3d0b95){return client[_0xa674('0x8')](_0x33afea,_0x473c03)[_0xa674('0x9')](function(_0x4d00c3){logger[_0xa674('0xa')](_0xa674('0xb'),_0x398c4d,_0xa674('0xc'));logger[_0xa674('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x398c4d,_0xa674('0xc'),JSON[_0xa674('0xe')](_0x4d00c3));if(_0x4d00c3[_0xa674('0xf')]){if(_0x4d00c3[_0xa674('0xf')]['code']===0x1f4){logger[_0xa674('0xf')](_0xa674('0xb'),_0x398c4d,_0x4d00c3[_0xa674('0xf')][_0xa674('0x10')]);return _0x3d0b95(_0x4d00c3[_0xa674('0xf')][_0xa674('0x10')]);}logger[_0xa674('0xf')](_0xa674('0xb'),_0x398c4d,_0x4d00c3[_0xa674('0xf')][_0xa674('0x10')]);return _0x564207(_0x4d00c3[_0xa674('0xf')][_0xa674('0x10')]);}else{logger['info'](_0xa674('0xb'),_0x398c4d,'request\x20sent');_0x564207(_0x4d00c3['result'][_0xa674('0x10')]);}})['catch'](function(_0x554905){logger[_0xa674('0xf')](_0xa674('0xb'),_0x398c4d,_0x554905);_0x3d0b95(_0x554905);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 5b2d7be..85e0e7d 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 _0x6420=['get','isAuthenticated','show','put','/:id','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x35ca6c,_0x490856){var _0x15d7f5=function(_0xaa45db){while(--_0xaa45db){_0x35ca6c['push'](_0x35ca6c['shift']());}};_0x15d7f5(++_0x490856);}(_0x6420,0x14a));var _0x0642=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x6420[_0x4e6ae6];return _0x23c108;};'use strict';var multer=require('multer');var util=require(_0x0642('0x0'));var path=require(_0x0642('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0642('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0642('0x3'));var interaction=require(_0x0642('0x4'));var config=require(_0x0642('0x5'));var controller=require('./chatApplication.controller');router[_0x0642('0x6')]('/:id',auth[_0x0642('0x7')](),controller[_0x0642('0x8')]);router[_0x0642('0x9')](_0x0642('0xa'),auth[_0x0642('0x7')](),controller['update']);router[_0x0642('0xb')](_0x0642('0xa'),auth[_0x0642('0x7')](),controller[_0x0642('0xc')]);module[_0x0642('0xd')]=router;
\ No newline at end of file
+var _0x0b11=['destroy','multer','express','Router','../../components/auth/service','/:id','isAuthenticated','put','update'];(function(_0x1863e7,_0x2dc75e){var _0x28237e=function(_0x351efb){while(--_0x351efb){_0x1863e7['push'](_0x1863e7['shift']());}};_0x28237e(++_0x2dc75e);}(_0x0b11,0xf4));var _0x10b1=function(_0x11762c,_0x16b25f){_0x11762c=_0x11762c-0x0;var _0x533adb=_0x0b11[_0x11762c];return _0x533adb;};'use strict';var multer=require(_0x10b1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10b1('0x1'));var router=express[_0x10b1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x10b1('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x10b1('0x4'),auth[_0x10b1('0x5')](),controller['show']);router[_0x10b1('0x6')](_0x10b1('0x4'),auth[_0x10b1('0x5')](),controller[_0x10b1('0x7')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x10b1('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 9bcb543..dc1fb87 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 _0x539d=['STRING','sequelize'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x539d,0x17b));var _0xd539=function(_0x2fd0f0,_0x4b634e){_0x2fd0f0=_0x2fd0f0-0x0;var _0x57f71a=_0x539d[_0x2fd0f0];return _0x57f71a;};'use strict';var Sequelize=require(_0xd539('0x0'));module['exports']={'name':{'type':Sequelize[_0xd539('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd539('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xee3c=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee3c,0x14a));var _0xcee3=function(_0x141324,_0x3ac3e4){_0x141324=_0x141324-0x0;var _0x26ee62=_0xee3c[_0x141324];return _0x26ee62;};'use strict';var Sequelize=require(_0xcee3('0x0'));module[_0xcee3('0x1')]={'name':{'type':Sequelize[_0xcee3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcee3('0x2')]},'write':{'type':Sequelize[_0xcee3('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index d70dc0a..ef080b4 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 _0xc77e=['register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','ChatGroup','includeAll','include','findAll','show','find','catch','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','ids','getMembers','findOne','User','options','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x302624,_0x2f7ca4){var _0x21d5b7=function(_0x303374){while(--_0x303374){_0x302624['push'](_0x302624['shift']());}};_0x21d5b7(++_0x2f7ca4);}(_0xc77e,0x104));var _0xec77=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc77e[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xec77('0x0'));var rimraf=require(_0xec77('0x1'));var zipdir=require(_0xec77('0x2'));var jsonpatch=require(_0xec77('0x3'));var rp=require('request-promise');var moment=require(_0xec77('0x4'));var BPromise=require(_0xec77('0x5'));var Mustache=require(_0xec77('0x6'));var util=require(_0xec77('0x7'));var path=require(_0xec77('0x8'));var sox=require(_0xec77('0x9'));var csv=require('to-csv');var ejs=require(_0xec77('0xa'));var fs=require('fs');var fs_extra=require(_0xec77('0xb'));var _=require(_0xec77('0xc'));var squel=require(_0xec77('0xd'));var crypto=require('crypto');var jsforce=require(_0xec77('0xe'));var deskjs=require(_0xec77('0xf'));var toCsv=require(_0xec77('0x10'));var querystring=require(_0xec77('0x11'));var Papa=require('papaparse');var Redis=require(_0xec77('0x12'));var authService=require(_0xec77('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xec77('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec77('0x15'))(_0xec77('0x16'));var utils=require(_0xec77('0x17'));var config=require(_0xec77('0x18'));var licenseUtil=require(_0xec77('0x19'));var db=require('../../mysqldb')['db'];config[_0xec77('0x1a')]=_[_0xec77('0x1b')](config[_0xec77('0x1a')],{'host':_0xec77('0x1c'),'port':0x18eb});var socket=require(_0xec77('0x1d'))(new Redis(config[_0xec77('0x1a')]));require(_0xec77('0x1e'))[_0xec77('0x1f')](socket);function respondWithStatusCode(_0x3e38fc,_0xb423b3){_0xb423b3=_0xb423b3||0xcc;return function(_0x5fc35a){if(_0x5fc35a){return _0x3e38fc[_0xec77('0x20')](_0xb423b3);}return _0x3e38fc[_0xec77('0x21')](_0xb423b3)[_0xec77('0x22')]();};}function respondWithResult(_0xb35089,_0x1e74f8){_0x1e74f8=_0x1e74f8||0xc8;return function(_0x116d97){if(_0x116d97){return _0xb35089[_0xec77('0x21')](_0x1e74f8)[_0xec77('0x23')](_0x116d97);}};}function respondWithFilteredResult(_0x1dea5d,_0x410d82){return function(_0x37321d){if(_0x37321d){var _0xfd3d66=typeof _0x410d82[_0xec77('0x24')]===_0xec77('0x25')&&typeof _0x410d82[_0xec77('0x26')]===_0xec77('0x25');var _0x5986e1=_0x37321d[_0xec77('0x27')];var _0x5af496=_0xfd3d66?0x0:_0x410d82['offset'];var _0x5808c5=_0xfd3d66?_0x37321d[_0xec77('0x27')]:_0x410d82['offset']+_0x410d82[_0xec77('0x26')];var _0x3483c9;if(_0x5808c5>=_0x5986e1){_0x5808c5=_0x5986e1;_0x3483c9=0xc8;}else{_0x3483c9=0xce;}_0x1dea5d[_0xec77('0x21')](_0x3483c9);return _0x1dea5d['set'](_0xec77('0x28'),_0x5af496+'-'+_0x5808c5+'/'+_0x5986e1)[_0xec77('0x23')](_0x37321d);}return null;};}function patchUpdates(_0x8a406f){return function(_0xd1d814){try{jsonpatch[_0xec77('0x29')](_0xd1d814,_0x8a406f,!![]);}catch(_0xefcf10){return BPromise[_0xec77('0x2a')](_0xefcf10);}return _0xd1d814[_0xec77('0x2b')]();};}function saveUpdates(_0x44a4b1,_0xba834){return function(_0x1007db){if(_0x1007db){return _0x1007db['update'](_0x44a4b1)[_0xec77('0x2c')](function(_0x2d19e2){return _0x2d19e2;});}return null;};}function removeEntity(_0x44512d,_0x1d1d8f){return function(_0x5179d2){if(_0x5179d2){return _0x5179d2[_0xec77('0x2d')]()['then'](function(){_0x44512d[_0xec77('0x21')](0xcc)[_0xec77('0x22')]();});}};}function handleEntityNotFound(_0x56267e,_0x675c1b){return function(_0x2c7f22){if(!_0x2c7f22){_0x56267e[_0xec77('0x20')](0x194);}return _0x2c7f22;};}function handleError(_0x16a629,_0x1d6812){_0x1d6812=_0x1d6812||0x1f4;return function(_0x5e0a1d){logger['error'](_0x5e0a1d['stack']);if(_0x5e0a1d['name']){delete _0x5e0a1d[_0xec77('0x2e')];}_0x16a629['status'](_0x1d6812)[_0xec77('0x2f')](_0x5e0a1d);};}exports['index']=function(_0x38d1d9,_0x1819db){var _0x525cdb={},_0x697b87={},_0x44c767={'count':0x0,'rows':[]};var _0x22297e=_[_0xec77('0x30')](db['ChatGroup'][_0xec77('0x31')],function(_0x499325){return{'name':_0x499325[_0xec77('0x32')],'type':_0x499325['type']['key']};});_0x697b87[_0xec77('0x33')]=_['map'](_0x22297e,_0xec77('0x2e'));_0x697b87[_0xec77('0x34')]=_[_0xec77('0x35')](_0x38d1d9[_0xec77('0x34')]);_0x697b87[_0xec77('0x36')]=_[_0xec77('0x37')](_0x697b87['model'],_0x697b87[_0xec77('0x34')]);_0x525cdb[_0xec77('0x38')]=_['intersection'](_0x697b87[_0xec77('0x33')],qs[_0xec77('0x39')](_0x38d1d9['query'][_0xec77('0x39')]));_0x525cdb[_0xec77('0x38')]=_0x525cdb[_0xec77('0x38')][_0xec77('0x3a')]?_0x525cdb[_0xec77('0x38')]:_0x697b87['model'];if(!_0x38d1d9[_0xec77('0x34')][_0xec77('0x3b')](_0xec77('0x3c'))){_0x525cdb[_0xec77('0x26')]=qs[_0xec77('0x26')](_0x38d1d9[_0xec77('0x34')]['limit']);_0x525cdb[_0xec77('0x24')]=qs[_0xec77('0x24')](_0x38d1d9['query'][_0xec77('0x24')]);}_0x525cdb[_0xec77('0x3d')]=qs[_0xec77('0x3e')](_0x38d1d9[_0xec77('0x34')][_0xec77('0x3e')]);_0x525cdb[_0xec77('0x3f')]=qs[_0xec77('0x36')](_[_0xec77('0x40')](_0x38d1d9[_0xec77('0x34')],_0x697b87[_0xec77('0x36')]),_0x22297e);if(_0x38d1d9[_0xec77('0x34')][_0xec77('0x41')]){_0x525cdb[_0xec77('0x3f')]=_['merge'](_0x525cdb['where'],{'$or':_[_0xec77('0x30')](_0x22297e,function(_0x469300){if(_0x469300[_0xec77('0x42')]!==_0xec77('0x43')){var _0x393e81={};_0x393e81[_0x469300['name']]={'$like':'%'+_0x38d1d9[_0xec77('0x34')][_0xec77('0x41')]+'%'};return _0x393e81;}})});}_0x525cdb=_[_0xec77('0x44')]({},_0x525cdb,_0x38d1d9['options']);var _0x24458f={'where':_0x525cdb[_0xec77('0x3f')]};return db[_0xec77('0x45')][_0xec77('0x27')](_0x24458f)[_0xec77('0x2c')](function(_0x124efe){_0x44c767[_0xec77('0x27')]=_0x124efe;if(_0x38d1d9[_0xec77('0x34')][_0xec77('0x46')]){_0x525cdb[_0xec77('0x47')]=[{'all':!![]}];}return db[_0xec77('0x45')][_0xec77('0x48')](_0x525cdb);})[_0xec77('0x2c')](function(_0x1b8d62){_0x44c767['rows']=_0x1b8d62;return _0x44c767;})[_0xec77('0x2c')](respondWithFilteredResult(_0x1819db,_0x525cdb))['catch'](handleError(_0x1819db,null));};exports[_0xec77('0x49')]=function(_0x26a2ef,_0x13cb84){var _0x3c81d1={'raw':!![],'where':{'id':_0x26a2ef['params']['id']}},_0x1d366d={};_0x1d366d[_0xec77('0x33')]=_['keys'](db['ChatGroup'][_0xec77('0x31')]);_0x1d366d[_0xec77('0x34')]=_[_0xec77('0x35')](_0x26a2ef[_0xec77('0x34')]);_0x1d366d[_0xec77('0x36')]=_[_0xec77('0x37')](_0x1d366d[_0xec77('0x33')],_0x1d366d[_0xec77('0x34')]);_0x3c81d1[_0xec77('0x38')]=_[_0xec77('0x37')](_0x1d366d['model'],qs[_0xec77('0x39')](_0x26a2ef[_0xec77('0x34')][_0xec77('0x39')]));_0x3c81d1[_0xec77('0x38')]=_0x3c81d1[_0xec77('0x38')][_0xec77('0x3a')]?_0x3c81d1['attributes']:_0x1d366d[_0xec77('0x33')];if(_0x26a2ef[_0xec77('0x34')]['includeAll']){_0x3c81d1[_0xec77('0x47')]=[{'all':!![]}];}_0x3c81d1=_['merge']({},_0x3c81d1,_0x26a2ef['options']);return db[_0xec77('0x45')][_0xec77('0x4a')](_0x3c81d1)[_0xec77('0x2c')](handleEntityNotFound(_0x13cb84,null))[_0xec77('0x2c')](respondWithResult(_0x13cb84,null))[_0xec77('0x4b')](handleError(_0x13cb84,null));};exports[_0xec77('0x4c')]=function(_0x15e6e3,_0x353ea8){return db[_0xec77('0x45')]['create'](_0x15e6e3[_0xec77('0x4d')],{})[_0xec77('0x2c')](respondWithResult(_0x353ea8,0xc9))['catch'](handleError(_0x353ea8,null));};exports['update']=function(_0x386318,_0x185631){if(_0x386318[_0xec77('0x4d')]['id']){delete _0x386318['body']['id'];}return db[_0xec77('0x45')][_0xec77('0x4a')]({'where':{'id':_0x386318[_0xec77('0x4e')]['id']}})['then'](handleEntityNotFound(_0x185631,null))['then'](saveUpdates(_0x386318['body'],null))['then'](respondWithResult(_0x185631,null))[_0xec77('0x4b')](handleError(_0x185631,null));};exports[_0xec77('0x2d')]=function(_0x4ca00b,_0x532a64){return db['ChatGroup'][_0xec77('0x4a')]({'where':{'id':_0x4ca00b[_0xec77('0x4e')]['id']}})[_0xec77('0x2c')](handleEntityNotFound(_0x532a64,null))[_0xec77('0x2c')](removeEntity(_0x532a64,null))[_0xec77('0x4b')](handleError(_0x532a64,null));};exports[_0xec77('0x4f')]=function(_0x2d0348,_0x37277d){return db[_0xec77('0x45')][_0xec77('0x4f')]()[_0xec77('0x2c')](respondWithResult(_0x37277d,null))[_0xec77('0x4b')](handleError(_0x37277d,null));};exports[_0xec77('0x50')]=function(_0x4990a4,_0x42593a,_0x57dc7c){return db[_0xec77('0x51')]['count']({'where':{'ChatGroupId':_0x4990a4[_0xec77('0x4e')]['id'],'ToId':_0x4990a4[_0xec77('0x52')]['id'],'read':![]}})[_0xec77('0x2c')](function(_0x3c9ed5){return{'id':_[_0xec77('0x53')](_0x4990a4[_0xec77('0x4e')]['id']),'count':_0x3c9ed5};})[_0xec77('0x2c')](respondWithResult(_0x42593a,null))[_0xec77('0x4b')](handleError(_0x42593a,null));};exports['addMembers']=function(_0x51bf66,_0x2154d8,_0x27611c){return db[_0xec77('0x45')][_0xec77('0x4a')]({'where':{'id':_0x51bf66['params']['id']}})[_0xec77('0x2c')](handleEntityNotFound(_0x2154d8,null))[_0xec77('0x2c')](function(_0x244100){if(_0x244100){return _0x244100['addMembers'](_0x51bf66[_0xec77('0x4d')]['ids'],_['omit'](_0x51bf66['body'],[_0xec77('0x54'),'id'])||{});}})[_0xec77('0x2c')](respondWithResult(_0x2154d8,null))[_0xec77('0x4b')](handleError(_0x2154d8,null));};exports[_0xec77('0x55')]=function(_0x19ff69,_0x5018bd,_0x19140a){var _0x41bf0a={};var _0x3b79ad={};var _0x3c46c9;var _0x5135de;return db[_0xec77('0x45')][_0xec77('0x56')]({'where':{'id':_0x19ff69[_0xec77('0x4e')]['id']}})[_0xec77('0x2c')](handleEntityNotFound(_0x5018bd,null))[_0xec77('0x2c')](function(_0x56dbc2){if(_0x56dbc2){_0x3c46c9=_0x56dbc2;_0x3b79ad[_0xec77('0x33')]=_['keys'](db[_0xec77('0x57')]['rawAttributes']);_0x3b79ad[_0xec77('0x34')]=_[_0xec77('0x35')](_0x19ff69[_0xec77('0x34')]);_0x3b79ad[_0xec77('0x36')]=_['intersection'](_0x3b79ad[_0xec77('0x33')],_0x3b79ad[_0xec77('0x34')]);_0x41bf0a['attributes']=_[_0xec77('0x37')](_0x3b79ad[_0xec77('0x33')],qs[_0xec77('0x39')](_0x19ff69[_0xec77('0x34')][_0xec77('0x39')]));_0x41bf0a[_0xec77('0x38')]=_0x41bf0a[_0xec77('0x38')]['length']?_0x41bf0a[_0xec77('0x38')]:_0x3b79ad[_0xec77('0x33')];_0x41bf0a[_0xec77('0x3d')]=qs[_0xec77('0x3e')](_0x19ff69[_0xec77('0x34')]['sort']);_0x41bf0a['where']=qs['filters'](_[_0xec77('0x40')](_0x19ff69[_0xec77('0x34')],_0x3b79ad['filters']));if(_0x19ff69[_0xec77('0x34')][_0xec77('0x41')]){_0x41bf0a[_0xec77('0x3f')]=_[_0xec77('0x44')](_0x41bf0a[_0xec77('0x3f')],{'$or':_[_0xec77('0x30')](_0x41bf0a[_0xec77('0x38')],function(_0x482ab4){var _0x1d145c={};_0x1d145c[_0x482ab4]={'$like':'%'+_0x19ff69[_0xec77('0x34')][_0xec77('0x41')]+'%'};return _0x1d145c;})});}_0x41bf0a=_['merge']({},_0x41bf0a,_0x19ff69[_0xec77('0x58')]);return _0x3c46c9['getMembers'](_0x41bf0a);}})[_0xec77('0x2c')](function(_0x25d7e5){if(_0x25d7e5){_0x5135de=_0x25d7e5[_0xec77('0x3a')];if(!_0x19ff69[_0xec77('0x34')][_0xec77('0x3b')](_0xec77('0x3c'))){_0x41bf0a['limit']=qs[_0xec77('0x26')](_0x19ff69[_0xec77('0x34')][_0xec77('0x26')]);_0x41bf0a['offset']=qs[_0xec77('0x24')](_0x19ff69[_0xec77('0x34')][_0xec77('0x24')]);}return _0x3c46c9[_0xec77('0x55')](_0x41bf0a);}})[_0xec77('0x2c')](function(_0x232074){if(_0x232074){return _0x232074?{'count':_0x5135de,'rows':_0x232074}:null;}})[_0xec77('0x2c')](respondWithResult(_0x5018bd,null))[_0xec77('0x4b')](handleError(_0x5018bd,null));};exports[_0xec77('0x59')]=function(_0x1b0de5,_0x597939,_0x17ec16){return db[_0xec77('0x45')]['find']({'where':{'id':_0x1b0de5['params']['id']}})[_0xec77('0x2c')](handleEntityNotFound(_0x597939,null))['then'](function(_0x3a060b){if(_0x3a060b){return _0x3a060b[_0xec77('0x59')](_0x1b0de5[_0xec77('0x34')][_0xec77('0x54')]);}})[_0xec77('0x2c')](respondWithStatusCode(_0x597939,null))['catch'](handleError(_0x597939,null));};exports[_0xec77('0x5a')]=function(_0x5d1475,_0x5bf495,_0x556352){if(_0x5d1475[_0xec77('0x4d')]['id']){delete _0x5d1475[_0xec77('0x4d')]['id'];}return db['ChatGroup'][_0xec77('0x4a')]({'where':{'id':_0x5d1475[_0xec77('0x4e')]['id']}})[_0xec77('0x2c')](handleEntityNotFound(_0x5bf495,null))[_0xec77('0x2c')](function(_0x362b91){if(_0x362b91){_0x5d1475[_0xec77('0x4d')][_0xec77('0x5b')]=_0x362b91['id'];return db['ChatInternalMessage'][_0xec77('0x4c')](_0x5d1475[_0xec77('0x4d')]);}})[_0xec77('0x2c')](respondWithResult(_0x5bf495,null))[_0xec77('0x4b')](handleError(_0x5bf495,null));};exports[_0xec77('0x5c')]=function(_0x4250be,_0x4c3095,_0x2f12f2){var _0x250619={};var _0x14755c={};var _0x560d6a;var _0x17e320;return db[_0xec77('0x45')][_0xec77('0x56')]({'where':{'id':_0x4250be[_0xec77('0x4e')]['id']}})[_0xec77('0x2c')](handleEntityNotFound(_0x4c3095,null))[_0xec77('0x2c')](function(_0x1632d6){if(_0x1632d6){_0x560d6a=_0x1632d6;_0x14755c[_0xec77('0x33')]=_[_0xec77('0x35')](db[_0xec77('0x51')]['rawAttributes']);_0x14755c['query']=_[_0xec77('0x35')](_0x4250be[_0xec77('0x34')]);_0x14755c['filters']=_[_0xec77('0x37')](_0x14755c['model'],_0x14755c['query']);_0x250619[_0xec77('0x38')]=_[_0xec77('0x37')](_0x14755c[_0xec77('0x33')],qs[_0xec77('0x39')](_0x4250be[_0xec77('0x34')][_0xec77('0x39')]));_0x250619[_0xec77('0x38')]=_0x250619[_0xec77('0x38')][_0xec77('0x3a')]?_0x250619[_0xec77('0x38')]:_0x14755c[_0xec77('0x33')];_0x250619[_0xec77('0x3d')]=qs[_0xec77('0x3e')](_0x4250be[_0xec77('0x34')][_0xec77('0x3e')]);_0x250619[_0xec77('0x3f')]=qs[_0xec77('0x36')](_[_0xec77('0x40')](_0x4250be[_0xec77('0x34')],_0x14755c[_0xec77('0x36')]));if(_0x4250be[_0xec77('0x34')][_0xec77('0x41')]){_0x250619[_0xec77('0x3f')]=_['merge'](_0x250619[_0xec77('0x3f')],{'$or':_[_0xec77('0x30')](_0x250619['attributes'],function(_0x2fc85b){var _0xeb6974={};_0xeb6974[_0x2fc85b]={'$like':'%'+_0x4250be[_0xec77('0x34')][_0xec77('0x41')]+'%'};return _0xeb6974;})});}if(_0x4250be[_0xec77('0x34')]['$gte']){var _0x439f0e=_0x4250be[_0xec77('0x34')][_0xec77('0x5d')][_0xec77('0x5e')](',');var _0x353a9a={};_0x353a9a[_0x439f0e[0x0]]={'$gte':moment(_0x439f0e[0x1])[_0xec77('0x5f')](_0xec77('0x60'))};_0x250619[_0xec77('0x3f')]=_[_0xec77('0x44')](_0x250619['where'],_0x353a9a);}_0x250619=_['merge']({},_0x250619,_0x4250be[_0xec77('0x58')]);return _0x560d6a['getMessages'](_0x250619);}})[_0xec77('0x2c')](function(_0x550a0d){if(_0x550a0d){_0x17e320=_0x550a0d[_0xec77('0x3a')];if(!_0x4250be[_0xec77('0x34')][_0xec77('0x3b')]('nolimit')){_0x250619[_0xec77('0x26')]=qs[_0xec77('0x26')](_0x4250be[_0xec77('0x34')][_0xec77('0x26')]);_0x250619['offset']=qs[_0xec77('0x24')](_0x4250be[_0xec77('0x34')]['offset']);}return _0x560d6a['getMessages'](_0x250619);}})[_0xec77('0x2c')](function(_0xfbdfe){if(_0xfbdfe){return _0xfbdfe?{'count':_0x17e320,'rows':_0xfbdfe}:null;}})[_0xec77('0x2c')](respondWithResult(_0x4c3095,null))[_0xec77('0x4b')](handleError(_0x4c3095,null));};
\ No newline at end of file
+var _0x605c=['apply','save','update','then','sendStatus','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','rows','catch','show','keys','length','includeAll','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','params','ids','getMembers','findOne','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','format','zip-dir','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','status','end','offset','limit','undefined','count','set','json'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x605c,0x1ee));var _0xc605=function(_0x1a9169,_0x78e58d){_0x1a9169=_0x1a9169-0x0;var _0x5a8aa9=_0x605c[_0x1a9169];return _0x5a8aa9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc605('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc605('0x1'));var Mustache=require(_0xc605('0x2'));var util=require(_0xc605('0x3'));var path=require('path');var sox=require(_0xc605('0x4'));var csv=require(_0xc605('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc605('0x6'));var _=require(_0xc605('0x7'));var squel=require(_0xc605('0x8'));var crypto=require(_0xc605('0x9'));var jsforce=require(_0xc605('0xa'));var deskjs=require(_0xc605('0xb'));var toCsv=require(_0xc605('0x5'));var querystring=require(_0xc605('0xc'));var Papa=require(_0xc605('0xd'));var Redis=require(_0xc605('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc605('0xf'));var logger=require('../../config/logger')(_0xc605('0x10'));var utils=require(_0xc605('0x11'));var config=require(_0xc605('0x12'));var licenseUtil=require(_0xc605('0x13'));var db=require(_0xc605('0x14'))['db'];config[_0xc605('0x15')]=_[_0xc605('0x16')](config['redis'],{'host':_0xc605('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc605('0x18'))[_0xc605('0x19')](socket);function respondWithStatusCode(_0x15ea82,_0x50f2b7){_0x50f2b7=_0x50f2b7||0xcc;return function(_0x5a86ee){if(_0x5a86ee){return _0x15ea82['sendStatus'](_0x50f2b7);}return _0x15ea82[_0xc605('0x1a')](_0x50f2b7)[_0xc605('0x1b')]();};}function respondWithResult(_0x394785,_0x2a0fc7){_0x2a0fc7=_0x2a0fc7||0xc8;return function(_0x3c8d10){if(_0x3c8d10){return _0x394785[_0xc605('0x1a')](_0x2a0fc7)['json'](_0x3c8d10);}};}function respondWithFilteredResult(_0x28a4e4,_0x43d49a){return function(_0x370b9d){if(_0x370b9d){var _0x472029=typeof _0x43d49a[_0xc605('0x1c')]==='undefined'&&typeof _0x43d49a[_0xc605('0x1d')]===_0xc605('0x1e');var _0x461bd7=_0x370b9d[_0xc605('0x1f')];var _0xdc6411=_0x472029?0x0:_0x43d49a['offset'];var _0xbdfd2d=_0x472029?_0x370b9d['count']:_0x43d49a[_0xc605('0x1c')]+_0x43d49a[_0xc605('0x1d')];var _0x28aa02;if(_0xbdfd2d>=_0x461bd7){_0xbdfd2d=_0x461bd7;_0x28aa02=0xc8;}else{_0x28aa02=0xce;}_0x28a4e4[_0xc605('0x1a')](_0x28aa02);return _0x28a4e4[_0xc605('0x20')]('Content-Range',_0xdc6411+'-'+_0xbdfd2d+'/'+_0x461bd7)[_0xc605('0x21')](_0x370b9d);}return null;};}function patchUpdates(_0x26cfb7){return function(_0x371b25){try{jsonpatch[_0xc605('0x22')](_0x371b25,_0x26cfb7,!![]);}catch(_0x5733ab){return BPromise['reject'](_0x5733ab);}return _0x371b25[_0xc605('0x23')]();};}function saveUpdates(_0x17b388,_0x527b68){return function(_0x551a0d){if(_0x551a0d){return _0x551a0d[_0xc605('0x24')](_0x17b388)[_0xc605('0x25')](function(_0x45de5e){return _0x45de5e;});}return null;};}function removeEntity(_0x3b3c45,_0x1d8d9c){return function(_0x211641){if(_0x211641){return _0x211641['destroy']()['then'](function(){_0x3b3c45[_0xc605('0x1a')](0xcc)[_0xc605('0x1b')]();});}};}function handleEntityNotFound(_0x4bfb8a,_0x3e4f00){return function(_0x4aad64){if(!_0x4aad64){_0x4bfb8a[_0xc605('0x26')](0x194);}return _0x4aad64;};}function handleError(_0x5f474f,_0xc523bc){_0xc523bc=_0xc523bc||0x1f4;return function(_0x3972e4){logger['error'](_0x3972e4['stack']);if(_0x3972e4[_0xc605('0x27')]){delete _0x3972e4[_0xc605('0x27')];}_0x5f474f[_0xc605('0x1a')](_0xc523bc)['send'](_0x3972e4);};}exports[_0xc605('0x28')]=function(_0x58d49e,_0x426406){var _0x4262b6={},_0x587f3b={},_0x2d2ac1={'count':0x0,'rows':[]};var _0x49f31b=_[_0xc605('0x29')](db[_0xc605('0x2a')][_0xc605('0x2b')],function(_0x23b778){return{'name':_0x23b778[_0xc605('0x2c')],'type':_0x23b778[_0xc605('0x2d')][_0xc605('0x2e')]};});_0x587f3b[_0xc605('0x2f')]=_['map'](_0x49f31b,_0xc605('0x27'));_0x587f3b['query']=_['keys'](_0x58d49e[_0xc605('0x30')]);_0x587f3b[_0xc605('0x31')]=_[_0xc605('0x32')](_0x587f3b['model'],_0x587f3b[_0xc605('0x30')]);_0x4262b6[_0xc605('0x33')]=_[_0xc605('0x32')](_0x587f3b[_0xc605('0x2f')],qs[_0xc605('0x34')](_0x58d49e['query'][_0xc605('0x34')]));_0x4262b6[_0xc605('0x33')]=_0x4262b6['attributes']['length']?_0x4262b6[_0xc605('0x33')]:_0x587f3b[_0xc605('0x2f')];if(!_0x58d49e[_0xc605('0x30')][_0xc605('0x35')](_0xc605('0x36'))){_0x4262b6['limit']=qs[_0xc605('0x1d')](_0x58d49e[_0xc605('0x30')][_0xc605('0x1d')]);_0x4262b6[_0xc605('0x1c')]=qs[_0xc605('0x1c')](_0x58d49e['query'][_0xc605('0x1c')]);}_0x4262b6[_0xc605('0x37')]=qs[_0xc605('0x38')](_0x58d49e['query'][_0xc605('0x38')]);_0x4262b6['where']=qs[_0xc605('0x31')](_['pick'](_0x58d49e[_0xc605('0x30')],_0x587f3b[_0xc605('0x31')]),_0x49f31b);if(_0x58d49e[_0xc605('0x30')][_0xc605('0x39')]){_0x4262b6['where']=_[_0xc605('0x3a')](_0x4262b6[_0xc605('0x3b')],{'$or':_[_0xc605('0x29')](_0x49f31b,function(_0x3c0b20){if(_0x3c0b20[_0xc605('0x2d')]!=='VIRTUAL'){var _0xcdc6fe={};_0xcdc6fe[_0x3c0b20[_0xc605('0x27')]]={'$like':'%'+_0x58d49e[_0xc605('0x30')][_0xc605('0x39')]+'%'};return _0xcdc6fe;}})});}_0x4262b6=_[_0xc605('0x3a')]({},_0x4262b6,_0x58d49e[_0xc605('0x3c')]);var _0x4c6844={'where':_0x4262b6[_0xc605('0x3b')]};return db['ChatGroup'][_0xc605('0x1f')](_0x4c6844)[_0xc605('0x25')](function(_0x47f096){_0x2d2ac1['count']=_0x47f096;if(_0x58d49e[_0xc605('0x30')]['includeAll']){_0x4262b6['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x4262b6);})[_0xc605('0x25')](function(_0x820c5){_0x2d2ac1[_0xc605('0x3d')]=_0x820c5;return _0x2d2ac1;})[_0xc605('0x25')](respondWithFilteredResult(_0x426406,_0x4262b6))[_0xc605('0x3e')](handleError(_0x426406,null));};exports[_0xc605('0x3f')]=function(_0x14e251,_0x2de4ed){var _0x2260af={'raw':!![],'where':{'id':_0x14e251['params']['id']}},_0xf90907={};_0xf90907[_0xc605('0x2f')]=_[_0xc605('0x40')](db[_0xc605('0x2a')][_0xc605('0x2b')]);_0xf90907[_0xc605('0x30')]=_['keys'](_0x14e251['query']);_0xf90907[_0xc605('0x31')]=_['intersection'](_0xf90907[_0xc605('0x2f')],_0xf90907[_0xc605('0x30')]);_0x2260af['attributes']=_['intersection'](_0xf90907[_0xc605('0x2f')],qs['fields'](_0x14e251[_0xc605('0x30')][_0xc605('0x34')]));_0x2260af['attributes']=_0x2260af[_0xc605('0x33')][_0xc605('0x41')]?_0x2260af[_0xc605('0x33')]:_0xf90907[_0xc605('0x2f')];if(_0x14e251[_0xc605('0x30')][_0xc605('0x42')]){_0x2260af[_0xc605('0x43')]=[{'all':!![]}];}_0x2260af=_[_0xc605('0x3a')]({},_0x2260af,_0x14e251[_0xc605('0x3c')]);return db['ChatGroup'][_0xc605('0x44')](_0x2260af)['then'](handleEntityNotFound(_0x2de4ed,null))[_0xc605('0x25')](respondWithResult(_0x2de4ed,null))[_0xc605('0x3e')](handleError(_0x2de4ed,null));};exports[_0xc605('0x45')]=function(_0x51e535,_0x5ac240){return db['ChatGroup'][_0xc605('0x45')](_0x51e535[_0xc605('0x46')],{})[_0xc605('0x25')](respondWithResult(_0x5ac240,0xc9))[_0xc605('0x3e')](handleError(_0x5ac240,null));};exports[_0xc605('0x24')]=function(_0xa1ada4,_0x29edc2){if(_0xa1ada4[_0xc605('0x46')]['id']){delete _0xa1ada4[_0xc605('0x46')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xa1ada4['params']['id']}})[_0xc605('0x25')](handleEntityNotFound(_0x29edc2,null))['then'](saveUpdates(_0xa1ada4[_0xc605('0x46')],null))[_0xc605('0x25')](respondWithResult(_0x29edc2,null))['catch'](handleError(_0x29edc2,null));};exports['destroy']=function(_0x508111,_0x4274ca){return db['ChatGroup'][_0xc605('0x44')]({'where':{'id':_0x508111['params']['id']}})[_0xc605('0x25')](handleEntityNotFound(_0x4274ca,null))['then'](removeEntity(_0x4274ca,null))[_0xc605('0x3e')](handleError(_0x4274ca,null));};exports[_0xc605('0x47')]=function(_0x10cafa,_0x3d8c60){return db[_0xc605('0x2a')][_0xc605('0x47')]()[_0xc605('0x25')](respondWithResult(_0x3d8c60,null))[_0xc605('0x3e')](handleError(_0x3d8c60,null));};exports[_0xc605('0x48')]=function(_0xe4d98f,_0x3e3369,_0x54c7cc){return db[_0xc605('0x49')][_0xc605('0x1f')]({'where':{'ChatGroupId':_0xe4d98f['params']['id'],'ToId':_0xe4d98f[_0xc605('0x4a')]['id'],'read':![]}})[_0xc605('0x25')](function(_0x2ea952){return{'id':_[_0xc605('0x4b')](_0xe4d98f['params']['id']),'count':_0x2ea952};})[_0xc605('0x25')](respondWithResult(_0x3e3369,null))['catch'](handleError(_0x3e3369,null));};exports[_0xc605('0x4c')]=function(_0x25d05f,_0x8367a8,_0x266b2a){return db[_0xc605('0x2a')]['find']({'where':{'id':_0x25d05f[_0xc605('0x4d')]['id']}})[_0xc605('0x25')](handleEntityNotFound(_0x8367a8,null))[_0xc605('0x25')](function(_0x452222){if(_0x452222){return _0x452222[_0xc605('0x4c')](_0x25d05f[_0xc605('0x46')]['ids'],_['omit'](_0x25d05f[_0xc605('0x46')],[_0xc605('0x4e'),'id'])||{});}})[_0xc605('0x25')](respondWithResult(_0x8367a8,null))['catch'](handleError(_0x8367a8,null));};exports[_0xc605('0x4f')]=function(_0x505a20,_0x5a2897,_0x27b7c3){var _0x4ccfb9={};var _0x51cdba={};var _0x2954da;var _0x75b35c;return db[_0xc605('0x2a')][_0xc605('0x50')]({'where':{'id':_0x505a20[_0xc605('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5a2897,null))[_0xc605('0x25')](function(_0x2be285){if(_0x2be285){_0x2954da=_0x2be285;_0x51cdba[_0xc605('0x2f')]=_[_0xc605('0x40')](db[_0xc605('0x51')][_0xc605('0x2b')]);_0x51cdba['query']=_[_0xc605('0x40')](_0x505a20[_0xc605('0x30')]);_0x51cdba[_0xc605('0x31')]=_['intersection'](_0x51cdba[_0xc605('0x2f')],_0x51cdba[_0xc605('0x30')]);_0x4ccfb9['attributes']=_[_0xc605('0x32')](_0x51cdba[_0xc605('0x2f')],qs['fields'](_0x505a20[_0xc605('0x30')][_0xc605('0x34')]));_0x4ccfb9[_0xc605('0x33')]=_0x4ccfb9[_0xc605('0x33')]['length']?_0x4ccfb9['attributes']:_0x51cdba['model'];_0x4ccfb9[_0xc605('0x37')]=qs[_0xc605('0x38')](_0x505a20['query']['sort']);_0x4ccfb9[_0xc605('0x3b')]=qs[_0xc605('0x31')](_[_0xc605('0x52')](_0x505a20['query'],_0x51cdba[_0xc605('0x31')]));if(_0x505a20[_0xc605('0x30')][_0xc605('0x39')]){_0x4ccfb9[_0xc605('0x3b')]=_[_0xc605('0x3a')](_0x4ccfb9['where'],{'$or':_[_0xc605('0x29')](_0x4ccfb9['attributes'],function(_0x2f91ec){var _0x168040={};_0x168040[_0x2f91ec]={'$like':'%'+_0x505a20['query'][_0xc605('0x39')]+'%'};return _0x168040;})});}_0x4ccfb9=_['merge']({},_0x4ccfb9,_0x505a20['options']);return _0x2954da[_0xc605('0x4f')](_0x4ccfb9);}})['then'](function(_0x3ce06a){if(_0x3ce06a){_0x75b35c=_0x3ce06a['length'];if(!_0x505a20[_0xc605('0x30')][_0xc605('0x35')](_0xc605('0x36'))){_0x4ccfb9[_0xc605('0x1d')]=qs[_0xc605('0x1d')](_0x505a20[_0xc605('0x30')][_0xc605('0x1d')]);_0x4ccfb9[_0xc605('0x1c')]=qs[_0xc605('0x1c')](_0x505a20[_0xc605('0x30')][_0xc605('0x1c')]);}return _0x2954da[_0xc605('0x4f')](_0x4ccfb9);}})[_0xc605('0x25')](function(_0x11c841){if(_0x11c841){return _0x11c841?{'count':_0x75b35c,'rows':_0x11c841}:null;}})[_0xc605('0x25')](respondWithResult(_0x5a2897,null))[_0xc605('0x3e')](handleError(_0x5a2897,null));};exports[_0xc605('0x53')]=function(_0x4d51fa,_0x476394,_0x4c0547){return db['ChatGroup'][_0xc605('0x44')]({'where':{'id':_0x4d51fa[_0xc605('0x4d')]['id']}})[_0xc605('0x25')](handleEntityNotFound(_0x476394,null))[_0xc605('0x25')](function(_0x4ab5ca){if(_0x4ab5ca){return _0x4ab5ca[_0xc605('0x53')](_0x4d51fa[_0xc605('0x30')]['ids']);}})[_0xc605('0x25')](respondWithStatusCode(_0x476394,null))[_0xc605('0x3e')](handleError(_0x476394,null));};exports[_0xc605('0x54')]=function(_0x540efc,_0x178192,_0x4cde82){if(_0x540efc[_0xc605('0x46')]['id']){delete _0x540efc[_0xc605('0x46')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x540efc[_0xc605('0x4d')]['id']}})[_0xc605('0x25')](handleEntityNotFound(_0x178192,null))[_0xc605('0x25')](function(_0x1e6b43){if(_0x1e6b43){_0x540efc[_0xc605('0x46')][_0xc605('0x55')]=_0x1e6b43['id'];return db[_0xc605('0x49')][_0xc605('0x45')](_0x540efc['body']);}})[_0xc605('0x25')](respondWithResult(_0x178192,null))[_0xc605('0x3e')](handleError(_0x178192,null));};exports[_0xc605('0x56')]=function(_0x5847ca,_0x417272,_0x136fa1){var _0x1fe228={};var _0x182e84={};var _0x92f7e;var _0x84622d;return db[_0xc605('0x2a')]['findOne']({'where':{'id':_0x5847ca['params']['id']}})[_0xc605('0x25')](handleEntityNotFound(_0x417272,null))['then'](function(_0x160ed2){if(_0x160ed2){_0x92f7e=_0x160ed2;_0x182e84[_0xc605('0x2f')]=_[_0xc605('0x40')](db['ChatInternalMessage']['rawAttributes']);_0x182e84[_0xc605('0x30')]=_[_0xc605('0x40')](_0x5847ca['query']);_0x182e84[_0xc605('0x31')]=_[_0xc605('0x32')](_0x182e84['model'],_0x182e84[_0xc605('0x30')]);_0x1fe228['attributes']=_[_0xc605('0x32')](_0x182e84[_0xc605('0x2f')],qs['fields'](_0x5847ca[_0xc605('0x30')][_0xc605('0x34')]));_0x1fe228[_0xc605('0x33')]=_0x1fe228[_0xc605('0x33')]['length']?_0x1fe228[_0xc605('0x33')]:_0x182e84[_0xc605('0x2f')];_0x1fe228['order']=qs[_0xc605('0x38')](_0x5847ca['query']['sort']);_0x1fe228[_0xc605('0x3b')]=qs['filters'](_[_0xc605('0x52')](_0x5847ca['query'],_0x182e84[_0xc605('0x31')]));if(_0x5847ca[_0xc605('0x30')][_0xc605('0x39')]){_0x1fe228['where']=_[_0xc605('0x3a')](_0x1fe228[_0xc605('0x3b')],{'$or':_[_0xc605('0x29')](_0x1fe228[_0xc605('0x33')],function(_0x34bed2){var _0x4836a6={};_0x4836a6[_0x34bed2]={'$like':'%'+_0x5847ca[_0xc605('0x30')][_0xc605('0x39')]+'%'};return _0x4836a6;})});}if(_0x5847ca[_0xc605('0x30')]['$gte']){var _0x5927e9=_0x5847ca[_0xc605('0x30')]['$gte']['split'](',');var _0x3b82c3={};_0x3b82c3[_0x5927e9[0x0]]={'$gte':moment(_0x5927e9[0x1])[_0xc605('0x57')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1fe228[_0xc605('0x3b')]=_[_0xc605('0x3a')](_0x1fe228[_0xc605('0x3b')],_0x3b82c3);}_0x1fe228=_[_0xc605('0x3a')]({},_0x1fe228,_0x5847ca[_0xc605('0x3c')]);return _0x92f7e[_0xc605('0x56')](_0x1fe228);}})[_0xc605('0x25')](function(_0x27dbfe){if(_0x27dbfe){_0x84622d=_0x27dbfe[_0xc605('0x41')];if(!_0x5847ca['query']['hasOwnProperty'](_0xc605('0x36'))){_0x1fe228[_0xc605('0x1d')]=qs['limit'](_0x5847ca[_0xc605('0x30')]['limit']);_0x1fe228[_0xc605('0x1c')]=qs[_0xc605('0x1c')](_0x5847ca[_0xc605('0x30')][_0xc605('0x1c')]);}return _0x92f7e[_0xc605('0x56')](_0x1fe228);}})[_0xc605('0x25')](function(_0x11e65a){if(_0x11e65a){return _0x11e65a?{'count':_0x84622d,'rows':_0x11e65a}:null;}})[_0xc605('0x25')](respondWithResult(_0x417272,null))[_0xc605('0x3e')](handleError(_0x417272,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index d636e2b..66e9318 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 _0x7d8a=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x7d8a[_0x28aea5];return _0x6a55f9;};'use strict';var EventEmitter=require(_0xa7d8('0x0'));var ChatGroup=require(_0xa7d8('0x1'))['db'][_0xa7d8('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa7d8('0x3')](0x0);var events={'afterCreate':_0xa7d8('0x4'),'afterUpdate':_0xa7d8('0x5'),'afterDestroy':_0xa7d8('0x6')};function emitEvent(_0x2b5af1){return function(_0x14a7d3,_0x199cdd,_0x1162e1){ChatGroupEvents[_0xa7d8('0x7')](_0x2b5af1+':'+_0x14a7d3['id'],_0x14a7d3);ChatGroupEvents[_0xa7d8('0x7')](_0x2b5af1,_0x14a7d3);_0x1162e1(null);};}for(var e in events){if(events[_0xa7d8('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xa7d8('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x8ad3=['setMaxListeners','save','emit','exports','events','ChatGroup'];(function(_0x1e8bce,_0x4bf67d){var _0x4b0dec=function(_0x3bcc62){while(--_0x3bcc62){_0x1e8bce['push'](_0x1e8bce['shift']());}};_0x4b0dec(++_0x4bf67d);}(_0x8ad3,0xe8));var _0x38ad=function(_0xd2483f,_0x36b9ab){_0xd2483f=_0xd2483f-0x0;var _0x5d54d6=_0x8ad3[_0xd2483f];return _0x5d54d6;};'use strict';var EventEmitter=require(_0x38ad('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x38ad('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x38ad('0x2')](0x0);var events={'afterCreate':_0x38ad('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e5176){return function(_0x55948b,_0x4ce30a,_0x8ae01a){ChatGroupEvents['emit'](_0x4e5176+':'+_0x55948b['id'],_0x55948b);ChatGroupEvents[_0x38ad('0x4')](_0x4e5176,_0x55948b);_0x8ae01a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x38ad('0x5')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1e495c5..b578c13 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 _0x1ec7=['ChatGroup','chat_groups','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x957be3,_0x1aab43){var _0x4aa9d8=function(_0x5c5682){while(--_0x5c5682){_0x957be3['push'](_0x957be3['shift']());}};_0x4aa9d8(++_0x1aab43);}(_0x1ec7,0x70));var _0x71ec=function(_0x2b22f5,_0x289a6b){_0x2b22f5=_0x2b22f5-0x0;var _0x4bcb28=_0x1ec7[_0x2b22f5];return _0x4bcb28;};'use strict';var _=require('lodash');var util=require(_0x71ec('0x0'));var logger=require('../../config/logger')(_0x71ec('0x1'));var moment=require(_0x71ec('0x2'));var BPromise=require(_0x71ec('0x3'));var rp=require(_0x71ec('0x4'));var fs=require('fs');var path=require(_0x71ec('0x5'));var rimraf=require(_0x71ec('0x6'));var config=require(_0x71ec('0x7'));var attributes=require(_0x71ec('0x8'));module['exports']=function(_0x1558ef,_0x5641c6){return _0x1558ef['define'](_0x71ec('0x9'),attributes,{'tableName':_0x71ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8784=['ChatGroup','chat_groups','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x8784,0x183));var _0x4878=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x8784[_0x217ff6];return _0x417c93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4878('0x0'))(_0x4878('0x1'));var moment=require('moment');var BPromise=require(_0x4878('0x2'));var rp=require(_0x4878('0x3'));var fs=require('fs');var path=require(_0x4878('0x4'));var rimraf=require(_0x4878('0x5'));var config=require(_0x4878('0x6'));var attributes=require(_0x4878('0x7'));module[_0x4878('0x8')]=function(_0x2c435d,_0x591fee){return _0x2c435d['define'](_0x4878('0x9'),attributes,{'tableName':_0x4878('0xa'),'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 388ecd5..308bc37 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 _0x6aa7=['client','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3bb85a,_0x47c79c){var _0x21bd4b=function(_0x4694d6){while(--_0x4694d6){_0x3bb85a['push'](_0x3bb85a['shift']());}};_0x21bd4b(++_0x47c79c);}(_0x6aa7,0x178));var _0x76aa=function(_0x1c4ea0,_0x4c6785){_0x1c4ea0=_0x1c4ea0-0x0;var _0x41463a=_0x6aa7[_0x1c4ea0];return _0x41463a;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}
\ No newline at end of file
+var _0xb1a3=['catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x3b029,_0x4aa690){var _0xe70d34=function(_0x5e93ec){while(--_0x5e93ec){_0x3b029['push'](_0x3b029['shift']());}};_0xe70d34(++_0x4aa690);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0xb1a3[_0x3f5dca];return _0x5b833a;};'use strict';var _=require(_0x3b1a('0x0'));var util=require(_0x3b1a('0x1'));var moment=require(_0x3b1a('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b1a('0x4'));var logger=require(_0x3b1a('0x5'))(_0x3b1a('0x6'));var config=require(_0x3b1a('0x7'));var jayson=require(_0x3b1a('0x8'));var client=jayson[_0x3b1a('0x9')][_0x3b1a('0xa')]({'port':0x232a});config['redis']=_[_0x3b1a('0xb')](config[_0x3b1a('0xc')],{'host':_0x3b1a('0xd'),'port':0x18eb});var socket=require(_0x3b1a('0xe'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x3b1a('0xf')](socket);function respondWithRpcPromise(_0x1e6925,_0x4cd175,_0x260128){return new BPromise(function(_0x553d63,_0xc6d255){return client['request'](_0x1e6925,_0x260128)[_0x3b1a('0x10')](function(_0x261800){logger[_0x3b1a('0x11')](_0x3b1a('0x12'),_0x4cd175,_0x3b1a('0x13'));logger[_0x3b1a('0x14')](_0x3b1a('0x15'),_0x4cd175,_0x3b1a('0x13'),JSON[_0x3b1a('0x16')](_0x261800));if(_0x261800['error']){if(_0x261800['error'][_0x3b1a('0x17')]===0x1f4){logger[_0x3b1a('0x18')](_0x3b1a('0x12'),_0x4cd175,_0x261800[_0x3b1a('0x18')]['message']);return _0xc6d255(_0x261800[_0x3b1a('0x18')][_0x3b1a('0x19')]);}logger['error'](_0x3b1a('0x12'),_0x4cd175,_0x261800[_0x3b1a('0x18')][_0x3b1a('0x19')]);return _0x553d63(_0x261800[_0x3b1a('0x18')][_0x3b1a('0x19')]);}else{logger[_0x3b1a('0x11')](_0x3b1a('0x12'),_0x4cd175,_0x3b1a('0x13'));_0x553d63(_0x261800['result'][_0x3b1a('0x19')]);}})[_0x3b1a('0x1a')](function(_0x569bc4){logger[_0x3b1a('0x18')]('ChatGroup,\x20%s,\x20%s',_0x4cd175,_0x569bc4);_0xc6d255(_0x569bc4);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 5b141a5..6356107 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 _0x692a=['register','length','chatGroup:','./chatGroup.events','save','remove','update','removeListener'];(function(_0x311b9c,_0x275f1e){var _0x5d54a2=function(_0x468219){while(--_0x468219){_0x311b9c['push'](_0x311b9c['shift']());}};_0x5d54a2(++_0x275f1e);}(_0x692a,0x93));var _0xa692=function(_0x7564d5,_0x28a02a){_0x7564d5=_0x7564d5-0x0;var _0x4f2c7f=_0x692a[_0x7564d5];return _0x4f2c7f;};'use strict';var ChatGroupEvents=require(_0xa692('0x0'));var events=[_0xa692('0x1'),_0xa692('0x2'),_0xa692('0x3')];function createListener(_0x3cb976,_0x11faff){return function(_0x2cd941){_0x11faff['emit'](_0x3cb976,_0x2cd941);};}function removeListener(_0x50f1a7,_0x32b030){return function(){ChatGroupEvents[_0xa692('0x4')](_0x50f1a7,_0x32b030);};}exports[_0xa692('0x5')]=function(_0x5ece00){for(var _0x10b8a9=0x0,_0x59cd65=events[_0xa692('0x6')];_0x10b8a9<_0x59cd65;_0x10b8a9++){var _0x3295fb=events[_0x10b8a9];var _0x3de0c8=createListener(_0xa692('0x7')+_0x3295fb,_0x5ece00);ChatGroupEvents['on'](_0x3295fb,_0x3de0c8);}};
\ No newline at end of file
+var _0x71d2=['chatGroup:','./chatGroup.events','save','remove','emit','removeListener','length'];(function(_0x43e0cc,_0xc5c862){var _0x4d7d9e=function(_0x535d4e){while(--_0x535d4e){_0x43e0cc['push'](_0x43e0cc['shift']());}};_0x4d7d9e(++_0xc5c862);}(_0x71d2,0x94));var _0x271d=function(_0x50887c,_0x53cd76){_0x50887c=_0x50887c-0x0;var _0x5fd1b7=_0x71d2[_0x50887c];return _0x5fd1b7;};'use strict';var ChatGroupEvents=require(_0x271d('0x0'));var events=[_0x271d('0x1'),_0x271d('0x2'),'update'];function createListener(_0x3d0776,_0x343026){return function(_0x47e325){_0x343026[_0x271d('0x3')](_0x3d0776,_0x47e325);};}function removeListener(_0x1062d5,_0x4b6700){return function(){ChatGroupEvents[_0x271d('0x4')](_0x1062d5,_0x4b6700);};}exports['register']=function(_0x291e32){for(var _0x325b7f=0x0,_0x1c3c76=events[_0x271d('0x5')];_0x325b7f<_0x1c3c76;_0x325b7f++){var _0x38c9e6=events[_0x325b7f];var _0x42acae=createListener(_0x271d('0x6')+_0x38c9e6,_0x291e32);ChatGroupEvents['on'](_0x38c9e6,_0x42acae);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 020ae62..eb49029 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 _0x26c2=['/:id/messages','addMessage','put','/:id','update','delete','destroy','removeMembers','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','isAuthenticated','show','/:id/unread','/:id/members','getMembers','getMessages','post'];(function(_0x562031,_0x1e5f67){var _0x332a34=function(_0x233822){while(--_0x233822){_0x562031['push'](_0x562031['shift']());}};_0x332a34(++_0x1e5f67);}(_0x26c2,0x117));var _0x226c=function(_0x3abc14,_0x48c685){_0x3abc14=_0x3abc14-0x0;var _0x5a861c=_0x26c2[_0x3abc14];return _0x5a861c;};'use strict';var multer=require(_0x226c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x226c('0x1'));var router=express[_0x226c('0x2')]();var fs_extra=require(_0x226c('0x3'));var auth=require(_0x226c('0x4'));var interaction=require(_0x226c('0x5'));var config=require(_0x226c('0x6'));var controller=require('./chatGroup.controller');router[_0x226c('0x7')]('/',auth['isAuthenticated'](),controller[_0x226c('0x8')]);router['get'](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xa')]);router['get']('/:id',auth[_0x226c('0xb')](),controller[_0x226c('0xc')]);router[_0x226c('0x7')](_0x226c('0xd'),auth[_0x226c('0xb')](),controller['getUnread']);router[_0x226c('0x7')](_0x226c('0xe'),auth[_0x226c('0xb')](),controller[_0x226c('0xf')]);router[_0x226c('0x7')]('/:id/messages',auth[_0x226c('0xb')](),controller[_0x226c('0x10')]);router[_0x226c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x226c('0xe'),auth[_0x226c('0xb')](),controller['addMembers']);router['post'](_0x226c('0x12'),auth['isAuthenticated'](),controller[_0x226c('0x13')]);router[_0x226c('0x14')](_0x226c('0x15'),auth[_0x226c('0xb')](),controller[_0x226c('0x16')]);router[_0x226c('0x17')](_0x226c('0x15'),auth[_0x226c('0xb')](),controller[_0x226c('0x18')]);router[_0x226c('0x17')](_0x226c('0xe'),auth[_0x226c('0xb')](),controller[_0x226c('0x19')]);module[_0x226c('0x1a')]=router;
\ No newline at end of file
+var _0x3645=['post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','getUnread','/:id/members','getMembers'];(function(_0xff5684,_0xfe6e00){var _0x41e374=function(_0x145196){while(--_0x145196){_0xff5684['push'](_0xff5684['shift']());}};_0x41e374(++_0xfe6e00);}(_0x3645,0x104));var _0x5364=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x3645[_0x81dcac];return _0xc7803b;};'use strict';var multer=require(_0x5364('0x0'));var util=require('util');var path=require(_0x5364('0x1'));var timeout=require(_0x5364('0x2'));var express=require('express');var router=express[_0x5364('0x3')]();var fs_extra=require(_0x5364('0x4'));var auth=require(_0x5364('0x5'));var interaction=require(_0x5364('0x6'));var config=require(_0x5364('0x7'));var controller=require('./chatGroup.controller');router[_0x5364('0x8')]('/',auth[_0x5364('0x9')](),controller['index']);router[_0x5364('0x8')](_0x5364('0xa'),auth[_0x5364('0x9')](),controller['describe']);router['get'](_0x5364('0xb'),auth[_0x5364('0x9')](),controller['show']);router[_0x5364('0x8')]('/:id/unread',auth[_0x5364('0x9')](),controller[_0x5364('0xc')]);router[_0x5364('0x8')](_0x5364('0xd'),auth[_0x5364('0x9')](),controller[_0x5364('0xe')]);router[_0x5364('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x5364('0xf')]('/',auth[_0x5364('0x9')](),controller[_0x5364('0x10')]);router[_0x5364('0xf')]('/:id/members',auth['isAuthenticated'](),controller[_0x5364('0x11')]);router[_0x5364('0xf')]('/:id/messages',auth[_0x5364('0x9')](),controller[_0x5364('0x12')]);router[_0x5364('0x13')](_0x5364('0xb'),auth[_0x5364('0x9')](),controller[_0x5364('0x14')]);router[_0x5364('0x15')](_0x5364('0xb'),auth[_0x5364('0x9')](),controller[_0x5364('0x16')]);router[_0x5364('0x15')](_0x5364('0xd'),auth[_0x5364('0x9')](),controller[_0x5364('0x17')]);module[_0x5364('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 8e5a10e..6d739dd 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 _0xe9e8=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize'];(function(_0x4a16df,_0x557a6b){var _0x5c1239=function(_0x1b5f93){while(--_0x1b5f93){_0x4a16df['push'](_0x4a16df['shift']());}};_0x5c1239(++_0x557a6b);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x260bc6,_0x3c5c74){_0x260bc6=_0x260bc6-0x0;var _0x155261=_0xe9e8[_0x260bc6];return _0x155261;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'closed':{'type':Sequelize[_0x8e9e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8e9e('0x3')]},'ratingType':{'type':Sequelize[_0x8e9e('0x4')](_0x8e9e('0x5'),_0x8e9e('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8e9e('0x7')]},'pathTranscript':{'type':Sequelize[_0x8e9e('0x7')]},'mailTranscript':{'type':Sequelize[_0x8e9e('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8e9e('0x8')]},'secondDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'note':{'type':Sequelize[_0x8e9e('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x8e9e('0x8')]},'osName':{'type':Sequelize[_0x8e9e('0x8')]},'osVersion':{'type':Sequelize[_0x8e9e('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8e9e('0x8')]},'deviceType':{'type':Sequelize[_0x8e9e('0x8')]},'referer':{'type':Sequelize[_0x8e9e('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8e9e('0x7')](_0x8e9e('0x9'))},'read1stAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x8e9e('0x4')]('in',_0x8e9e('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8e9e('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x8e9e('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x7334=['out','sequelize','exports','BOOLEAN','star','TEXT','STRING','DATE','long'];(function(_0x33d598,_0x1ad580){var _0x4dcfcc=function(_0x25583a){while(--_0x25583a){_0x33d598['push'](_0x33d598['shift']());}};_0x4dcfcc(++_0x1ad580);}(_0x7334,0x184));var _0x4733=function(_0x3e961c,_0x5483c6){_0x3e961c=_0x3e961c-0x0;var _0x44c13d=_0x7334[_0x3e961c];return _0x44c13d;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'closed':{'type':Sequelize[_0x4733('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x4733('0x3'),'thumb'),'defaultValue':_0x4733('0x3')},'ratingMessage':{'type':Sequelize[_0x4733('0x4')]},'pathTranscript':{'type':Sequelize[_0x4733('0x4')]},'mailTranscript':{'type':Sequelize[_0x4733('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4733('0x6')]},'disposition':{'type':Sequelize[_0x4733('0x5')]},'secondDisposition':{'type':Sequelize[_0x4733('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4733('0x5')]},'note':{'type':Sequelize[_0x4733('0x5')]},'browserName':{'type':Sequelize[_0x4733('0x5')]},'browserVersion':{'type':Sequelize[_0x4733('0x5')]},'osName':{'type':Sequelize[_0x4733('0x5')]},'osVersion':{'type':Sequelize[_0x4733('0x5')]},'deviceModel':{'type':Sequelize[_0x4733('0x5')]},'deviceVendor':{'type':Sequelize[_0x4733('0x5')]},'deviceType':{'type':Sequelize[_0x4733('0x5')]},'referer':{'type':Sequelize[_0x4733('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4733('0x4')](_0x4733('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x4733('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4733('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4733('0x5')]},'customerPort':{'type':Sequelize[_0x4733('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x4733('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x4733('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 60a9b0a..75c25a6 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 _0xd7d1=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','update','disposition','file','basename','filename','Attachment','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','Messages','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','service','host','secure','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','findAll','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','get','mkdirSync','Chat','Account','Owner','N.A.','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','stack','name','send','contact','agent','interaction','account','map','fullname','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x23fc57,_0xadec1e){_0x23fc57=_0x23fc57-0x0;var _0x1cea8d=_0xd7d1[_0x23fc57];return _0x1cea8d;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1d7d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x18'))(_0x1d7d('0x19'));var utils=require(_0x1d7d('0x1a'));var config=require(_0x1d7d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7d('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1d7d('0x1d')],{'host':_0x1d7d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1d7d('0x1f'))[_0x1d7d('0x20')](socket);var jayson=require(_0x1d7d('0x21'));var client=jayson[_0x1d7d('0x22')][_0x1d7d('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x1d7d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1de6cc,_0x51cbca,_0xb90a8c,_0x162c3a){return new BPromise(function(_0x3c3417,_0x47826a){var _0x40db4d=_0x162c3a||client;return _0x40db4d['request'](_0x1de6cc,_0xb90a8c)[_0x1d7d('0x24')](function(_0x191024){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x51cbca,_0x1d7d('0x25'));logger[_0x1d7d('0x26')](_0x1d7d('0x27'),_0x51cbca,_0x1d7d('0x25'),JSON[_0x1d7d('0x28')](_0x191024));if(_0x191024[_0x1d7d('0x29')]){if(_0x191024['error'][_0x1d7d('0x2a')]===0x1f4){logger[_0x1d7d('0x29')](_0x1d7d('0x2b'),_0x51cbca,_0x191024['error'][_0x1d7d('0x2c')]);return _0x47826a(_0x191024[_0x1d7d('0x29')]['message']);}logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x191024[_0x1d7d('0x29')][_0x1d7d('0x2c')]);return _0x3c3417(_0x191024['error'][_0x1d7d('0x2c')]);}else{logger[_0x1d7d('0x2d')](_0x1d7d('0x2b'),_0x51cbca,_0x1d7d('0x25'));_0x3c3417(_0x191024['result'][_0x1d7d('0x2c')]);}})[_0x1d7d('0x2e')](function(_0x5c8257){logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x5c8257);_0x47826a(_0x5c8257);});});}function respondWithStatusCode(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0xcc;return function(_0x2d4de4){if(_0x2d4de4){return _0x52c618[_0x1d7d('0x2f')](_0x38c323);}return _0x52c618[_0x1d7d('0x30')](_0x38c323)[_0x1d7d('0x31')]();};}function respondWithResult(_0x59f827,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x98c1ad){if(_0x98c1ad){return _0x59f827[_0x1d7d('0x30')](_0x1c2616)['json'](_0x98c1ad);}};}function respondWithFilteredResult(_0x78adbe,_0x1a935a){return function(_0x23ad85){if(_0x23ad85){var _0x482367=typeof _0x1a935a['offset']==='undefined'&&typeof _0x1a935a[_0x1d7d('0x32')]===_0x1d7d('0x33');var _0x559f19=_0x23ad85[_0x1d7d('0x34')];var _0x3e4136=_0x482367?0x0:_0x1a935a[_0x1d7d('0x35')];var _0x3336ab=_0x482367?_0x23ad85[_0x1d7d('0x34')]:_0x1a935a[_0x1d7d('0x35')]+_0x1a935a[_0x1d7d('0x32')];var _0x803dc9;if(_0x3336ab>=_0x559f19){_0x3336ab=_0x559f19;_0x803dc9=0xc8;}else{_0x803dc9=0xce;}_0x78adbe[_0x1d7d('0x30')](_0x803dc9);return _0x78adbe[_0x1d7d('0x36')]('Content-Range',_0x3e4136+'-'+_0x3336ab+'/'+_0x559f19)['json'](_0x23ad85);}return null;};}function patchUpdates(_0x2e4402){return function(_0x2266a6){try{jsonpatch[_0x1d7d('0x37')](_0x2266a6,_0x2e4402,!![]);}catch(_0x40318f){return BPromise[_0x1d7d('0x38')](_0x40318f);}return _0x2266a6[_0x1d7d('0x39')]();};}function saveUpdates(_0x1aee3c,_0x40aca9){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4['update'](_0x1aee3c)[_0x1d7d('0x24')](function(_0xf9d3e4){return _0xf9d3e4;});}return null;};}function removeEntity(_0x13a974,_0x30fb9a){return function(_0x4cc364){if(_0x4cc364){return _0x4cc364['destroy']()[_0x1d7d('0x24')](function(){_0x13a974[_0x1d7d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103c77,_0x3fea2e){return function(_0x568092){if(!_0x568092){_0x103c77['sendStatus'](0x194);}return _0x568092;};}function handleError(_0x26f81c,_0xc77f24){_0xc77f24=_0xc77f24||0x1f4;return function(_0x406f57){logger[_0x1d7d('0x29')](_0x406f57[_0x1d7d('0x3a')]);if(_0x406f57[_0x1d7d('0x3b')]){delete _0x406f57[_0x1d7d('0x3b')];}_0x26f81c[_0x1d7d('0x30')](_0xc77f24)[_0x1d7d('0x3c')](_0x406f57);};}function getMustacheRender(_0x318b9a,_0x4fcdcc){return Mustache['render'](_0x318b9a,_['merge'](_0x4fcdcc['body'],{'contact':_0x4fcdcc[_0x1d7d('0x3d')],'message':_0x4fcdcc['message'],'agent':_0x4fcdcc[_0x1d7d('0x3e')],'interaction':_0x4fcdcc[_0x1d7d('0x3f')],'account':_0x4fcdcc[_0x1d7d('0x40')]}))||'';}function getInteractionUsers(_0x515199,_0x5a4052){return new BPromise(function(_0x16a4e0,_0x153979){try{if(_0x5a4052[_0x515199['id']]){_0x515199['Users']=_[_0x1d7d('0x41')](_0x5a4052[_0x515199['id']],function(_0xa53806){return{'id':_0xa53806['id'],'fullname':_0xa53806[_0x1d7d('0x42')]};});}}catch(_0x2100f6){_0x153979(_0x2100f6);}_0x16a4e0(_0x515199);});}function getInteractionTags(_0x5eef0a,_0x1db8e8){return new BPromise(function(_0x42c229,_0x4239fa){try{if(_0x5eef0a[_0x1d7d('0x43')]){_0x5eef0a['Tags']=[];_0x5eef0a[_0x1d7d('0x43')]['split'](',')[_0x1d7d('0x44')](function(_0x31b850){_0x5eef0a[_0x1d7d('0x45')][_0x1d7d('0x46')](_0x1db8e8[_0x31b850]);});}delete _0x5eef0a[_0x1d7d('0x43')];}catch(_0x4becec){_0x4239fa(_0x4becec);}_0x42c229(_0x5eef0a);});}function updateChatInteraction(_0x59b8e7,_0x33582a,_0xe57fa5){return new BPromise(function(_0x1637fc,_0x4bed84){return getInteractionUsers(_0x59b8e7,_0xe57fa5)['then'](function(_0x12f397){return getInteractionTags(_0x12f397,_0x33582a);})['then'](function(_0x86e7bc){_0x1637fc(_0x86e7bc);})[_0x1d7d('0x2e')](function(_0x1d1064){_0x4bed84(_0x1d1064);});});}exports[_0x1d7d('0x47')]=function(_0x1e2ea8,_0x370e8d){var _0x72f5d7={},_0x51cb15={},_0x3ccd44={'count':0x0,'rows':[]};var _0x8b0c22=_['map'](db[_0x1d7d('0x48')][_0x1d7d('0x49')],function(_0x40599b){return{'name':_0x40599b[_0x1d7d('0x4a')],'type':_0x40599b[_0x1d7d('0x4b')][_0x1d7d('0x4c')]};});_0x51cb15[_0x1d7d('0x4d')]=_[_0x1d7d('0x41')](_0x8b0c22,_0x1d7d('0x3b'));_0x51cb15[_0x1d7d('0x4e')]=_[_0x1d7d('0x4f')](_0x1e2ea8[_0x1d7d('0x4e')]);_0x51cb15['filters']=_[_0x1d7d('0x50')](_0x51cb15['model'],_0x51cb15[_0x1d7d('0x4e')]);_0x72f5d7['attributes']=_[_0x1d7d('0x50')](_0x51cb15[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x1e2ea8[_0x1d7d('0x4e')]['fields']));_0x72f5d7[_0x1d7d('0x52')]=_0x72f5d7['attributes']['length']?_0x72f5d7[_0x1d7d('0x52')]:_0x51cb15['model'];if(!_0x1e2ea8['query'][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x72f5d7['limit']=qs[_0x1d7d('0x32')](_0x1e2ea8[_0x1d7d('0x4e')]['limit']);_0x72f5d7[_0x1d7d('0x35')]=qs[_0x1d7d('0x35')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x35')]);}_0x72f5d7['order']=qs['sort'](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x72f5d7[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1e2ea8['query'],_0x51cb15[_0x1d7d('0x57')]),_0x8b0c22);var _0x24e0b7=[];var _0x344b66=squel[_0x1d7d('0x59')]()[_0x1d7d('0x5a')]('id')[_0x1d7d('0x5a')](_0x1d7d('0x3b'))[_0x1d7d('0x5a')](_0x1d7d('0x5b'))['from'](_0x1d7d('0x5c'));var _0x41ad41=squel[_0x1d7d('0x59')]()['field']('u.id')[_0x1d7d('0x5a')](_0x1d7d('0x5d'))[_0x1d7d('0x5a')]('ui.ChatInteractionId')[_0x1d7d('0x5e')](_0x1d7d('0x5f'),'ui')['left_join'](_0x1d7d('0x60'),'u',_0x1d7d('0x61'));var _0x3fc216=squel[_0x1d7d('0x59')]()['from'](_0x1d7d('0x62'),'i')[_0x1d7d('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1d7d('0x63')](_0x1d7d('0x60'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1d7d('0x64'),'a',_0x1d7d('0x65'))[_0x1d7d('0x63')](_0x1d7d('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x1d7d('0x63')]('chat_interaction_has_tags','it',_0x1d7d('0x67'))[_0x1d7d('0x63')](_0x1d7d('0x5c'),'t',_0x1d7d('0x68'));var _0x5a4bd7=squel[_0x1d7d('0x69')]();var _0x1ea966=[];var _0x193135=squel[_0x1d7d('0x69')]();var _0x28ec14;if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]){_0x28ec14=as[_0x1d7d('0x6b')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]);var _0x44a187=_0x28ec14[_0x1d7d('0x6c')];for(var _0x301a67=0x0;_0x301a67<_0x28ec14[_0x1d7d('0x6d')][_0x1d7d('0x6e')];_0x301a67++){var _0x520d3c=_0x28ec14[_0x1d7d('0x6d')][_0x301a67];var _0x566d27='i';var _0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),_0x520d3c[_0x1d7d('0x5a')]]);if(!_0x1c9fe7){switch(_0x520d3c[_0x1d7d('0x5a')]){case _0x1d7d('0x70'):if(_0x520d3c['value']==0x1){_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c[_0x1d7d('0x5a')]+'`\x20=\x200');}else{_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c['field']+_0x1d7d('0x72'));}break;case _0x1d7d('0x73'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){if(_0x520d3c[_0x1d7d('0x76')][_0x1d7d('0x77')]('\x20')['length']>0x1){_0x5a4bd7[_0x44a187](_0x1d7d('0x78'),qs[_0x1d7d('0x79')](_0x520d3c['value']),null);}else{var _0x3289c2='%'+_0x520d3c[_0x1d7d('0x76')]+'%';_0x5a4bd7[_0x44a187](_0x1d7d('0x7a'),_0x3289c2,_0x3289c2,_0x3289c2);}}else{_0x1c9fe7=_['find'](_0x8b0c22,[_0x1d7d('0x3b'),_0x1d7d('0x7b')]);_0x520d3c[_0x1d7d('0x5a')]=_0x1d7d('0x7b');_0x2e26d4=as['buildExpression'](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}break;case _0x1d7d('0x7e'):var _0x10dea3=_0x520d3c['value'][_0x1d7d('0x77')](',')[_0x1d7d('0x41')](function(_0x17c174){return Number(_0x17c174);});_0x10dea3[_0x1d7d('0x44')](function(_0x47d27e){_0x193135['or'](_0x1d7d('0x7f'),'%,'+_0x47d27e+',%');});_0x1ea966=_['union'](_0x1ea966,_0x10dea3);break;case _0x1d7d('0x80'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){_0x5a4bd7[_0x44a187]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x520d3c[_0x1d7d('0x76')]+'%',null);}else{_0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),'UserId']);_0x520d3c[_0x1d7d('0x5a')]='UserId';_0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x31')]);}break;case _0x1d7d('0x82'):_0x2e26d4=as[_0x1d7d('0x81')]('me',null,_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')]['start'],_0x2e26d4['value'][_0x1d7d('0x31')]);break;}}else{var _0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7['type'],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4['value'][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}}}else{var _0x1f55a2=_(_0x1e2ea8[_0x1d7d('0x4e')])['keys']()[_0x1d7d('0x41')](function(_0x40ee1f){return _[_0x1d7d('0x83')](_0x8b0c22,['name',_0x40ee1f])?_0x40ee1f:undefined;})['compact']()[_0x1d7d('0x76')]();if(!_[_0x1d7d('0x84')](_0x1f55a2)){_0x1f55a2['forEach'](function(_0x33430c){if(_0x33430c===_0x1d7d('0x85')){_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),[]['concat'](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]));}else if(_0x33430c===_0x1d7d('0x87')){var _0x22cdd1=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x89')];var _0x42a83c=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x8a')];_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x8b'),_0x22cdd1,_0x42a83c);}else{if(_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]==='null'){_0x3fc216[_0x1d7d('0x56')]('i.'+_0x33430c+_0x1d7d('0x8c'));}else{_0x3fc216['where']('i.'+_0x33430c+_0x1d7d('0x8d'),_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]);}}});}if(_0x1e2ea8['query']['read']){if(_0x1e2ea8['query'][_0x1d7d('0x8e')]==0x1){_0x3fc216[_0x1d7d('0x71')](_0x1d7d('0x8f'));}else{_0x3fc216[_0x1d7d('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]){_0x1ea966=_[_0x1d7d('0x91')](_0x1e2ea8[_0x1d7d('0x4e')]['tag'])?_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]:new Array(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]);_0x1ea966[_0x1d7d('0x44')](function(_0x2a7229){_0x193135['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a7229+',%');});}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')]){var _0x57aba7=_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')][_0x1d7d('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1d7d('0x94')](_0x57aba7)){_0x5a4bd7['or']('i.id\x20LIKE\x20?',_0x57aba7+'%');}else{_0x5a4bd7['or'](_0x1d7d('0x95'),qs[_0x1d7d('0x79')](_0x57aba7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57aba7+'%');}}}_0x3fc216[_0x1d7d('0x56')](_0x5a4bd7);_0x3fc216[_0x1d7d('0x96')](_0x1d7d('0x97'));var _0xc3c42f={'type':db[_0x1d7d('0x98')][_0x1d7d('0x99')][_0x1d7d('0x9a')],'raw':!![]};var _0x155e88=_0x3fc216[_0x1d7d('0x9b')]();_0x155e88[_0x1d7d('0x5a')](_0x1d7d('0x97'));_0x155e88[_0x1d7d('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x72f5d7[_0x1d7d('0x9c')]){_0x72f5d7[_0x1d7d('0x9c')][_0x1d7d('0x44')](function(_0x395818){var _0x247289=_0x395818[0x0]===_0x1d7d('0x9d')?_0x395818[0x0]:'i.'+_0x395818[0x0];_0x3fc216[_0x1d7d('0x9c')](_0x247289,_0x395818[0x1]===_0x1d7d('0x9e')?![]:!![]);});}if(!_[_0x1d7d('0x84')](_0x1ea966)){_0x3fc216[_0x1d7d('0x71')](_0x193135);_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x9f'),_0x1ea966);}BPromise['resolve']()[_0x1d7d('0x24')](function(){if(!_0x28ec14){if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x85')])return;_0x155e88[_0x1d7d('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa0'));return;}if(_0x1e2ea8[_0x1d7d('0xa1')][_0x1d7d('0xa2')]!=='agent')return;return _0x1e2ea8['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10925b){if(_[_0x1d7d('0x84')](_0x10925b)){_0x155e88['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa3'));}else{_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));}});})[_0x1d7d('0x24')](function(){if(_0x1e2ea8[_0x1d7d('0xa1')]['role']===_0x1d7d('0x3e')&&!_0x28ec14&&!_0x1e2ea8['query'][_0x1d7d('0x85')])return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x155e88['toString'](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x40464c){_0x3ccd44[_0x1d7d('0x34')]=_0x40464c[_0x1d7d('0x6e')];if(_0x3ccd44[_0x1d7d('0x34')]===0x0)return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x344b66[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0x74e3fe){_0x24e0b7=_[_0x1d7d('0xa6')](_0x74e3fe,'id');_0xc3c42f=_[_0x1d7d('0xa7')](_0xc3c42f,{'model':db[_0x1d7d('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x51')]){_0x72f5d7[_0x1d7d('0x52')][_0x1d7d('0x44')](function(_0x2aac19){_0x3fc216[_0x1d7d('0x5a')]('i.'+_0x2aac19);});}else{_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xa8'),_0x1d7d('0x70'));_0x3fc216[_0x1d7d('0x5a')]('a.key',_0x1d7d('0xa9'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xaa'),'Account.mandatoryDisposition');_0x3fc216[_0x1d7d('0x5a')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3fc216['field']('i.*');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xab'),_0x1d7d('0xac'));_0x3fc216['field'](_0x1d7d('0xad'),'Contact.lastName');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xae'),_0x1d7d('0xaf'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb0'),_0x1d7d('0xb1'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb2'),_0x1d7d('0xb3'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb4'),'Contact.fax');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb5'),_0x1d7d('0xb6'));_0x3fc216['field'](_0x1d7d('0xb7'),_0x1d7d('0xb8'));_0x3fc216[_0x1d7d('0x5a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x72f5d7[_0x1d7d('0x32')])_0x3fc216['limit'](_0x72f5d7[_0x1d7d('0x32')]);if(_0x72f5d7[_0x1d7d('0x35')])_0x3fc216['offset'](_0x72f5d7[_0x1d7d('0x35')]);return db[_0x1d7d('0xa4')]['query'](_0x3fc216[_0x1d7d('0xa5')](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x45b5e2){if(_0x45b5e2[_0x1d7d('0x6e')]>0x0)_0x41ad41['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x1d7d('0x41')](_0x45b5e2,'id'));return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x41ad41[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0xa5c005){var _0x1af86a=_[_0x1d7d('0xb9')](_0xa5c005,_0x1d7d('0xba'));var _0x434500=[];_0x45b5e2[_0x1d7d('0x44')](function(_0x26781c){_0x434500[_0x1d7d('0x46')](updateChatInteraction(_0x26781c,_0x24e0b7,_0x1af86a));});return BPromise[_0x1d7d('0xbb')](_0x434500);});});})[_0x1d7d('0x24')](function(_0x39924a){_0x3ccd44[_0x1d7d('0xbc')]=_0x39924a;return _0x3ccd44;})[_0x1d7d('0x24')](respondWithFilteredResult(_0x370e8d,_0x72f5d7))['catch'](handleError(_0x370e8d,null));};exports[_0x1d7d('0xbd')]=function(_0x45e83d,_0x16ce51){var _0x20b99d={'raw':![],'where':{'id':_0x45e83d[_0x1d7d('0xbe')]['id']}},_0x5ca824={};_0x5ca824[_0x1d7d('0x4d')]=_[_0x1d7d('0x4f')](db[_0x1d7d('0x48')]['rawAttributes']);_0x5ca824[_0x1d7d('0x4e')]=_['keys'](_0x45e83d[_0x1d7d('0x4e')]);_0x5ca824[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x5ca824['model'],_0x5ca824[_0x1d7d('0x4e')]);_0x20b99d['attributes']=_[_0x1d7d('0x50')](_0x5ca824[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x45e83d[_0x1d7d('0x4e')]['fields']));_0x20b99d[_0x1d7d('0x52')]=_0x20b99d['attributes'][_0x1d7d('0x6e')]?_0x20b99d[_0x1d7d('0x52')]:_0x5ca824['model'];if(_0x45e83d[_0x1d7d('0x4e')][_0x1d7d('0xbf')]){_0x20b99d[_0x1d7d('0xc0')]=[{'all':!![]}];}_0x20b99d=_[_0x1d7d('0xa7')]({},_0x20b99d,_0x45e83d['options']);return db['ChatInteraction']['find'](_0x20b99d)[_0x1d7d('0x24')](handleEntityNotFound(_0x16ce51,null))[_0x1d7d('0x24')](respondWithResult(_0x16ce51,null))[_0x1d7d('0x2e')](handleError(_0x16ce51,null));};exports[_0x1d7d('0xc1')]=function(_0x458f92,_0x55ea3b){return db[_0x1d7d('0x48')][_0x1d7d('0xc1')](_0x458f92[_0x1d7d('0x82')],{})[_0x1d7d('0x24')](respondWithResult(_0x55ea3b,0xc9))['catch'](handleError(_0x55ea3b,null));};exports['update']=function(_0xbde512,_0x21995f){if(_0xbde512[_0x1d7d('0x82')]['id']){delete _0xbde512[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0xbde512['params']['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x21995f,null))['then'](saveUpdates(_0xbde512[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](respondWithResult(_0x21995f,null))['catch'](handleError(_0x21995f,null));};exports[_0x1d7d('0xc2')]=function(_0x5a754a,_0x13566e){return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x5a754a[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x13566e,null))['then'](removeEntity(_0x13566e,null))[_0x1d7d('0x2e')](handleError(_0x13566e,null));};exports['describe']=function(_0x303d6f,_0x5bf0de){return db['ChatInteraction'][_0x1d7d('0xc3')]()[_0x1d7d('0x24')](respondWithResult(_0x5bf0de,null))[_0x1d7d('0x2e')](handleError(_0x5bf0de,null));};exports[_0x1d7d('0xc4')]=function(_0x8ce169,_0x3f119f){var _0x14d3fb=_0x8ce169[_0x1d7d('0xbe')]['id'];var _0x3d5fff;var _0x3b7543;var _0x3e94d6;return db[_0x1d7d('0x48')]['findOne']({'where':{'id':_0x14d3fb}})['then'](function(_0x1f2d68){_0x3d5fff=_0x1f2d68;return db['ChatWebsite'][_0x1d7d('0xc5')]({'where':{'id':_0x1f2d68['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1d7d('0xc6'),_0x1d7d('0xc7'),_0x1d7d('0xc8'),_0x1d7d('0xc9')],'raw':!![]});})[_0x1d7d('0x24')](function(_0xd919b1){if(_0xd919b1&&_0xd919b1[_0x1d7d('0xca')]&&_0xd919b1[_0x1d7d('0xc6')]){_0x3b7543=_0xd919b1;var _0x5690c={'interaction':{'id':_0x14d3fb},'agent':{'id':_0x8ce169['user']['id'],'name':_0x8ce169['user'][_0x1d7d('0x3b')],'fullname':_0x8ce169['user'][_0x1d7d('0x42')],'email':_0x8ce169[_0x1d7d('0xa1')][_0x1d7d('0xcb')]},'contact':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x3d')],'account':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x40')]};var _0x3774f8={'rejectUnauthorized':![],'method':_0x1d7d('0xcc'),'url':_0x1d7d('0xcd'),'headers':{'X-APIKEY':_0xd919b1[_0x1d7d('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ce169[_0x1d7d('0xa1')]['email']],'buttons':null,'topic':_0x3b7543['vidaooTopic'],'note':_[_0x1d7d('0xce')](_0x3b7543[_0x1d7d('0xc8')])?null:getMustacheRender(_0x3b7543[_0x1d7d('0xc8')],_0x5690c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3b7543[_0x1d7d('0xc9')])){var _0x470f5e=getMustacheRender(_0x3b7543['vidaooMetadata'],_0x5690c);var _0x1f0d9f=JSON['parse'](_0x470f5e);_0x3774f8[_0x1d7d('0x82')]['metadata']=_0x1f0d9f;}}catch(_0x1f50d4){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd0'));}return rp(_0x3774f8);}else{throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd1'));}})[_0x1d7d('0x24')](function(_0x4f1602){_0x3e94d6=_0x4f1602;if(_0x3e94d6['id']){var _0x202d85={'body':_0x3e94d6[_0x1d7d('0xd2')],'ChatWebsiteId':_0x3b7543['id'],'ChatInteractionId':_0x3d5fff['id'],'direction':_0x1d7d('0xd3'),'UserId':_0x8ce169[_0x1d7d('0xa1')]['id']};return db[_0x1d7d('0xd4')][_0x1d7d('0xc1')](_0x202d85,{});}else{throw new db['Sequelize'][(_0x1d7d('0xcf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1d7d('0x24')](function(){return _0x3d5fff[_0x1d7d('0xd5')]({'vidaooSessionId':_0x3e94d6['id']});})['then'](respondWithResult(_0x3f119f,null))[_0x1d7d('0x2e')](handleError(_0x3f119f,null));};exports[_0x1d7d('0xd6')]=function(_0x3e7f3c,_0x454679){if(_0x3e7f3c['body']['id']){delete _0x3e7f3c[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x3e7f3c['params']['id']},'include':[{'model':db[_0x1d7d('0xd7')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x454679,null))['then'](saveUpdates(_0x3e7f3c[_0x1d7d('0x82')],null))['then'](respondWithResult(_0x454679,null))[_0x1d7d('0x2e')](handleError(_0x454679,null));};exports[_0x1d7d('0xd8')]=function(_0x4abfb1,_0x4caa84,_0x561f33){if(_0x4abfb1[_0x1d7d('0x82')]['id']){delete _0x4abfb1[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x4abfb1[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](function(_0x54616b){if(!_0x54616b){logger['error'](_0x1d7d('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x4caa84[_0x1d7d('0x2f')](0x194);}else{if(_0x54616b[_0x1d7d('0xda')]){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xdb'));}}return _0x54616b;})[_0x1d7d('0x24')](function(_0x19427f){if(_0x19427f){return _0x19427f[_0x1d7d('0xdc')]({'closed':_0x4abfb1['body']['closed'],'disposition':_0x4abfb1[_0x1d7d('0x82')][_0x1d7d('0xdd')]})[_0x1d7d('0x24')](function(_0x4d8a36){return _0x4d8a36;});}})[_0x1d7d('0x24')](function(_0x216585){return respondWithRpcPromise('AbandonInteraction',_0x1d7d('0xd8'),_0x4abfb1[_0x1d7d('0x82')],client9004);})[_0x1d7d('0x24')](respondWithResult(_0x4caa84,null))['catch'](handleError(_0x4caa84,null));};exports['attachmentUpload']=function(_0x854f68,_0x205d6f,_0x149415){_0x854f68[_0x1d7d('0x82')][_0x1d7d('0x3b')]=_0x854f68[_0x1d7d('0xde')]['originalname'];_0x854f68[_0x1d7d('0x82')][_0x1d7d('0xdf')]=_0x854f68['file'][_0x1d7d('0xe0')];_0x854f68[_0x1d7d('0x82')]['type']=_0x854f68['file']['mimetype'];return db[_0x1d7d('0xe1')][_0x1d7d('0xc1')](_0x854f68[_0x1d7d('0x82')])[_0x1d7d('0x24')](respondWithResult(_0x205d6f,0xc9))[_0x1d7d('0x2e')](handleError(_0x205d6f,null));};exports[_0x1d7d('0xe2')]=function(_0x3e358c,_0x2eae3c,_0x3838ef){return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0xbe')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null))['then'](function(_0x545b09){if(_0x545b09){if(_0x545b09[_0x1d7d('0xe3')]){return _0x2eae3c[_0x1d7d('0x30')](0x193)[_0x1d7d('0xe4')]({'status':0x193,'message':_0x1d7d('0xe5')});}return db[_0x1d7d('0xe1')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0x4e')][_0x1d7d('0xe6')]},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null));}})['then'](function(_0x549144){if(_0x549144){var _0x2a4feb=_0x549144[_0x1d7d('0xe7')]!==null;var _0x4df896=path[_0x1d7d('0xe8')](config['root'],_0x1d7d('0xe9'));if(_0x2a4feb){_0x4df896=path[_0x1d7d('0xe8')](_0x4df896,_0x1d7d('0xea'));}var _0x37eb97=path[_0x1d7d('0xe8')](_0x4df896,_0x549144[_0x1d7d('0xdf')]);return _0x2eae3c['download'](_0x37eb97);}})[_0x1d7d('0x2e')](handleError(_0x2eae3c,null));};exports[_0x1d7d('0xeb')]=function(_0x185697,_0x4d5753){var _0x55929b=null;var _0x43ce7f=null;var _0x2b0486=null;var _0x337c32=null;if(_0x185697['body']['id']){delete _0x185697[_0x1d7d('0x82')]['id'];}if(_0x185697['body'][_0x1d7d('0xec')]){_0x337c32=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server/files/chat/upload/',util['format'](_0x1d7d('0xee'),Date[_0x1d7d('0xef')]()));_0x185697[_0x1d7d('0x82')][_0x1d7d('0xf0')]=_0x337c32;}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x185697[_0x1d7d('0xbe')]['id']},'include':[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'include':[{'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80')}]}]})['then'](handleEntityNotFound(_0x4d5753,null))[_0x1d7d('0x24')](saveUpdates(_0x185697[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](function(_0x551a56){if(_0x551a56){_0x55929b=_0x551a56;return db['ChatWebsite'][_0x1d7d('0x6f')]({'where':{'id':_0x55929b['ChatWebsiteId']}});}})[_0x1d7d('0x24')](function(_0x1d47d9){if(_0x1d47d9){_0x2b0486=_0x1d47d9;return db[_0x1d7d('0xd7')]['find']({'where':{'id':_0x55929b[_0x1d7d('0x7b')]}});}})['then'](function(_0x5c0be4){if(_0x5c0be4){_0x43ce7f=_0x5c0be4;if(_0x337c32){var _0x46b9e5=null;for(var _0x385e15=0x1;_0x385e15<_0x55929b['Messages'][_0x1d7d('0x6e')];++_0x385e15){_0x46b9e5=_0x55929b[_0x1d7d('0xf1')][_0x385e15];var _0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')]('%s%d',_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5['UserId']):_0x1d7d('0xf4');var _0x474f68=_0x185697['body'][_0x1d7d('0xf5')]||util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x1d7d('0xf7'),_0x46b9e5[_0x1d7d('0x7b')]);switch(_0x2b0486[_0x1d7d('0xf8')]){case _0x1d7d('0xf9'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');break;case'agent_alias':_0x20543c=_0x46b9e5['UserId']?_0x46b9e5[_0x1d7d('0x80')]['alias']||_0x46b9e5['User'][_0x1d7d('0x42')]:'System';break;case _0x1d7d('0xfa'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?_0x46b9e5[_0x1d7d('0x80')]['fullname']:_0x1d7d('0xf4');break;default:_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');}var _0x353bb1=util[_0x1d7d('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46b9e5[_0x1d7d('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x46b9e5[_0x1d7d('0xfb')]==='in'?_0x474f68:_0x20543c,_0x46b9e5['body']);if(!_0x46b9e5[_0x1d7d('0xfc')]){fs[_0x1d7d('0xfd')](_0x337c32,_0x353bb1);}}return db[_0x1d7d('0xfe')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1d7d('0xff'),'raw':!![]}]});}}})[_0x1d7d('0x24')](function(_0x5c2113){if(_0x5c2113&&_0x5c2113[_0x1d7d('0xff')]&&_0x185697[_0x1d7d('0x82')]){var _0x129d4b={'tls':{'rejectUnauthorized':![]}};if(_0x5c2113['Smtp']['service']){_0x129d4b[_0x1d7d('0x100')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x100')];}else{_0x129d4b['host']=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x101')];_0x129d4b['port']=_0x5c2113['Smtp']['port'];_0x129d4b[_0x1d7d('0x102')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x102')];}if(_0x5c2113['Smtp']['authentication']){_0x129d4b[_0x1d7d('0x103')]={'user':_0x5c2113[_0x1d7d('0xff')]['user'],'pass':_0x5c2113['Smtp'][_0x1d7d('0x104')]};}return respondWithRpcPromise(_0x1d7d('0x105'),'sendMail',{'account':_0x129d4b,'message':{'from':util[_0x1d7d('0xf2')]('\x22%s\x22\x20<%s>',_0x5c2113[_0x1d7d('0x3b')],_0x5c2113[_0x1d7d('0xcb')]||_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0xa1')]),'to':_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')],'subject':_0x1d7d('0x106'),'text':util[_0x1d7d('0xf2')](_0x1d7d('0x107'),_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')]),'attachments':[{'path':_0x337c32}]}})['then'](function(){return _0x55929b;})[_0x1d7d('0x2e')](function(_0x18c505){console[_0x1d7d('0x29')](_0x18c505);});}else{return _0x55929b;}})['then'](respondWithStatusCode(_0x4d5753,0xc8))['catch'](handleError(_0x4d5753,null));};exports[_0x1d7d('0x108')]=function(_0x1b41b5,_0x5b79bd,_0xb87340){return db[_0x1d7d('0xd4')][_0x1d7d('0x6f')]({'where':{'id':_0x1b41b5[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x5b79bd,null))[_0x1d7d('0x24')](function(_0x537520){if(_0x537520){return _0x537520[_0x1d7d('0x108')](_0x1b41b5['body']['ids'],_['omit'](_0x1b41b5[_0x1d7d('0x82')],['ids','id'])||{});}})[_0x1d7d('0x24')](respondWithResult(_0x5b79bd,null))[_0x1d7d('0x2e')](handleError(_0x5b79bd,null));};exports['getMessages']=function(_0x1ce79d,_0x7dbbc9,_0x286ddd){var _0x1484b1={'raw':![],'where':{}};var _0x5be0c4={};var _0x50be17={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x1ce79d[_0x1d7d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x7dbbc9,null))['then'](function(_0x81fadf){if(_0x81fadf){_0x5be0c4['model']=_[_0x1d7d('0x4f')](db[_0x1d7d('0xd4')][_0x1d7d('0x49')]);_0x5be0c4[_0x1d7d('0x4e')]=_['keys'](_0x1ce79d[_0x1d7d('0x4e')]);_0x5be0c4['filters']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],_0x5be0c4[_0x1d7d('0x4e')]);_0x1484b1['attributes']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],qs['fields'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x51')]));_0x1484b1[_0x1d7d('0x52')]=_0x1484b1[_0x1d7d('0x52')]['length']?_0x1484b1[_0x1d7d('0x52')]:_0x5be0c4[_0x1d7d('0x4d')];if(!_0x1ce79d[_0x1d7d('0x4e')]['hasOwnProperty']('nolimit')){_0x1484b1[_0x1d7d('0x32')]=qs['limit'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x32')]);_0x1484b1[_0x1d7d('0x35')]=qs['offset'](_0x1ce79d[_0x1d7d('0x4e')]['offset']);}_0x1484b1[_0x1d7d('0x9c')]=qs['sort'](_0x1ce79d[_0x1d7d('0x4e')]['sort']);_0x1484b1['where']=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1ce79d[_0x1d7d('0x4e')],_0x5be0c4[_0x1d7d('0x57')]));_0x1484b1[_0x1d7d('0x56')]['ChatInteractionId']=_0x81fadf['id'];if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1[_0x1d7d('0x56')],{'$or':_['map'](_0x1484b1['attributes'],function(_0x19ee24){var _0x3cdad2={};_0x3cdad2[_0x19ee24]={'$like':'%'+_0x1ce79d['query'][_0x1d7d('0x92')]+'%'};return _0x3cdad2;})});}if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x89')]){var _0x24984d=_0x1ce79d[_0x1d7d('0x4e')]['$gte'][_0x1d7d('0x77')](',');var _0x5a2144={};_0x5a2144[_0x24984d[0x0]]={'$gte':moment(_0x24984d[0x1])[_0x1d7d('0xf2')](_0x1d7d('0x109'))};_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1['where'],_0x5a2144);}_0x1484b1=_['merge']({},_0x1484b1,_0x1ce79d['options']);return db['ChatMessage'][_0x1d7d('0x34')]({'where':_0x1484b1[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e83dc){_0x50be17[_0x1d7d('0x34')]=_0x1e83dc;if(_0x1ce79d['query']['includeAll']){_0x1484b1[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')]['findAll'](_0x1484b1);})[_0x1d7d('0x24')](function(_0x2d0232){_0x50be17[_0x1d7d('0xbc')]=_0x2d0232;return _0x50be17;});}})['then'](respondWithFilteredResult(_0x7dbbc9,_0x1484b1))[_0x1d7d('0x2e')](handleError(_0x7dbbc9,null));};exports[_0x1d7d('0x10a')]=function(_0xb42210,_0x3844b6,_0x1181b6){var _0x530493={'where':{}},_0x53cdb8={},_0x960917={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0xb42210[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x3844b6,null))['then'](function(_0x339603){if(_0x339603){_0x53cdb8[_0x1d7d('0x4d')]=_['keys'](db['ChatMessage'][_0x1d7d('0x49')]);_0x53cdb8['query']=_[_0x1d7d('0x4f')](_0xb42210[_0x1d7d('0x4e')]);_0x53cdb8[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x53cdb8[_0x1d7d('0x4d')],_0x53cdb8[_0x1d7d('0x4e')]);_0x530493[_0x1d7d('0x52')]=_['intersection'](_0x53cdb8[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0xb42210[_0x1d7d('0x4e')]['fields']));_0x530493[_0x1d7d('0x52')]=_0x530493[_0x1d7d('0x52')]['length']?_0x530493[_0x1d7d('0x52')]:_0x53cdb8['model'];if(!_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x530493[_0x1d7d('0x32')]=qs[_0x1d7d('0x32')](_0xb42210['query'][_0x1d7d('0x32')]);_0x530493[_0x1d7d('0x35')]=qs['offset'](_0xb42210['query'][_0x1d7d('0x35')]);}_0x530493[_0x1d7d('0x9c')]=qs['sort'](_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x530493[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_['pick'](_0xb42210['query'],_0x53cdb8[_0x1d7d('0x57')]));_0x530493[_0x1d7d('0x56')][_0x1d7d('0xba')]=_0x339603['id'];if(_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x530493[_0x1d7d('0x56')]=_[_0x1d7d('0xa7')](_0x530493[_0x1d7d('0x56')],{'$or':_[_0x1d7d('0x41')](_0x530493[_0x1d7d('0x52')],function(_0x3dfeb8){var _0x4726cb={};_0x4726cb[_0x3dfeb8]={'$like':'%'+_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]+'%'};return _0x4726cb;})});}_0x530493[_0x1d7d('0x56')][_0x1d7d('0xfc')]=![];if(_0xb42210[_0x1d7d('0x4e')]['id']){_0x530493['where']['id']={'$gt':_0xb42210[_0x1d7d('0x4e')]['id']};}_0x530493=_['merge']({},_0x530493,_0xb42210['options']);return db[_0x1d7d('0xd4')][_0x1d7d('0x34')]({'where':_0x530493[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e2b03){_0x960917['count']=_0x1e2b03;_0x530493[_0x1d7d('0xc0')]=[];if(_0xb42210[_0x1d7d('0x4e')]['includeAgent']){_0x530493[_0x1d7d('0xc0')]['push']({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42'),_0x1d7d('0x10b')]});}if(_0xb42210[_0x1d7d('0x4e')]['includeAll']){_0x530493[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')][_0x1d7d('0x10c')](_0x530493);})[_0x1d7d('0x24')](function(_0x2d1258){_0x960917[_0x1d7d('0xbc')]=_0x2d1258;return _0x960917;});}})[_0x1d7d('0x24')](respondWithFilteredResult(_0x3844b6,_0x530493))[_0x1d7d('0x2e')](handleError(_0x3844b6,null));};exports[_0x1d7d('0x10d')]=function(_0x34b43f,_0x14a937,_0x291f26){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x34b43f[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x14a937,null))['then'](function(_0x59b044){if(_0x59b044){return _0x59b044[_0x1d7d('0x10e')](_0x34b43f['body'][_0x1d7d('0x10f')],_[_0x1d7d('0x110')](_0x34b43f[_0x1d7d('0x82')],[_0x1d7d('0x10f'),'id'])||{})[_0x1d7d('0x111')](function(){return db[_0x1d7d('0x7e')]['findAll']({'attributes':['id',_0x1d7d('0x3b'),'color'],'where':{'id':_0x34b43f['body'][_0x1d7d('0x10f')]}});})[_0x1d7d('0x24')](function(_0x5b1ae1){socket[_0x1d7d('0x112')](_0x1d7d('0x113'),{'id':Number(_0x34b43f['params']['id']),'tags':_0x5b1ae1||[]});return{'id':Number(_0x34b43f[_0x1d7d('0xbe')]['id']),'tags':_0x5b1ae1||[]};});}})['then'](respondWithResult(_0x14a937,null))[_0x1d7d('0x2e')](handleError(_0x14a937,null));};exports[_0x1d7d('0x114')]=function(_0x7c3bd8,_0x552481,_0x2c91d5){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x7c3bd8[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x552481,null))[_0x1d7d('0x24')](function(_0xf5e9f8){if(_0xf5e9f8){return _0xf5e9f8['removeTags'](_0x7c3bd8['query'][_0x1d7d('0x10f')]);}})[_0x1d7d('0x24')](respondWithStatusCode(_0x552481,null))['catch'](handleError(_0x552481,null));};exports[_0x1d7d('0x115')]=function(_0x210be0,_0x5f1b69){var _0x44c5ac=moment()[_0x1d7d('0x116')]()['toString']();var _0x39cae3=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','files',_0x1d7d('0x117'));var _0x1eec70=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],_0x1d7d('0x118'),_0x1d7d('0x119'),_0x1d7d('0x11a'));var _0x3ded4b=path['join'](_0x39cae3,_0x44c5ac);var _0xe65d48=util[_0x1d7d('0xf2')](_0x1d7d('0x11b'),_0x210be0[_0x1d7d('0xbe')]['id'],_0x44c5ac);var _0x3b440c=path['join'](_0x39cae3,_0xe65d48);var _0x473472=[];_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42')],'raw':!![]});_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0xd7')],'as':_0x1d7d('0x73'),'attributes':['id','firstName',_0x1d7d('0x11c')],'raw':!![]});if(_0x210be0[_0x1d7d('0x4e')][_0x1d7d('0x11a')]){_0x473472[_0x1d7d('0x46')]({'model':db['Attachment'],'as':_0x1d7d('0xe1'),'raw':!![]});}var _0x2aab28=[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'attributes':['id','body',_0x1d7d('0x87'),_0x1d7d('0xfb'),'secret',_0x1d7d('0x8e')],'include':_0x473472}];_0x2aab28['push']({'model':db[_0x1d7d('0x11d')],'as':'Account','attributes':['id','name']});_0x2aab28[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':'Owner','attributes':['id','fullname']});return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x210be0[_0x1d7d('0xbe')]['id']},'include':_0x2aab28})[_0x1d7d('0x24')](handleEntityNotFound(_0x5f1b69,null))[_0x1d7d('0x24')](function(_0x4e8473){if(_0x4e8473){var _0x194822=_0x4e8473[_0x1d7d('0x11e')]({'plain':!![]});fs[_0x1d7d('0x11f')](_0x3ded4b);var _0x3e93bb={'channel':_0x1d7d('0x120'),'account':_0x194822[_0x1d7d('0x121')]['name'],'agent':_0x194822['Owner']?_0x194822[_0x1d7d('0x122')][_0x1d7d('0x42')]:_0x1d7d('0x123'),'createdAt':moment(_0x194822[_0x1d7d('0x87')])[_0x1d7d('0xf2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x194822[_0x1d7d('0xe3')]?moment(_0x194822['closedAt'])['format'](_0x1d7d('0x109'))[_0x1d7d('0xa5')]():'','disposition':_0x194822[_0x1d7d('0xdd')],'chatInfo':{'browser':_0x194822[_0x1d7d('0x124')],'os':_0x194822[_0x1d7d('0x125')],'referer':_0x194822['referer'],'customerIp':_0x194822[_0x1d7d('0x126')],'customerPort':_0x194822[_0x1d7d('0x127')]?_0x194822[_0x1d7d('0x127')]:_0x1d7d('0x123')},'messages':_(_0x194822[_0x1d7d('0xf1')])[_0x1d7d('0x128')]()['filter']({'secret':![]})[_0x1d7d('0x41')](function(_0x6ea91f){if(_0x6ea91f[_0x1d7d('0xe1')]){var _0x2b3cbd=path[_0x1d7d('0xe8')](_0x1eec70,_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]);if(fs['existsSync'](_0x2b3cbd)){fs[_0x1d7d('0x129')](_0x2b3cbd)[_0x1d7d('0x12a')](fs[_0x1d7d('0x12b')](path[_0x1d7d('0xe8')](_0x3ded4b,_0x6ea91f[_0x1d7d('0xe1')]['basename'])));}}return{'date':moment(_0x6ea91f[_0x1d7d('0x87')])[_0x1d7d('0xf2')](_0x1d7d('0x109'))[_0x1d7d('0xa5')](),'sender':_0x6ea91f['direction']==='out'?_0x6ea91f[_0x1d7d('0x80')]?_0x6ea91f[_0x1d7d('0x80')][_0x1d7d('0x42')]:_0x1d7d('0xf4'):_0x6ea91f[_0x1d7d('0x73')]['firstName']+(_0x6ea91f[_0x1d7d('0x73')][_0x1d7d('0x11c')]?'\x20'+_0x6ea91f[_0x1d7d('0x73')]['lastName']:''),'body':_0x6ea91f[_0x1d7d('0xe1')]?_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]:_0x6ea91f[_0x1d7d('0x82')],'direction':_0x6ea91f['direction']===_0x1d7d('0xd3')?'A':'C','secret':_0x6ea91f[_0x1d7d('0xfc')],'read':_0x6ea91f[_0x1d7d('0x8e')],'attachment':_0x6ea91f['Attachment']};})[_0x1d7d('0x76')]()};return ejs[_0x1d7d('0x12c')](path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','views',_0x1d7d('0x12d')),{'interaction':_0x3e93bb})[_0x1d7d('0x24')](function(_0x43f4cb){var _0x21d65a=path[_0x1d7d('0xe8')](_0x3ded4b,'transcript-'+_0x194822['id']+'-'+_0x44c5ac+_0x1d7d('0x12e'));var _0x4d0682={'path':_0x21d65a,'channel':_0x1d7d('0x120'),'interactionId':_0x194822['id']};return pdf[_0x1d7d('0x12f')](_0x43f4cb,_0x4d0682);})['then'](function(){return new BPromise(function(_0x29f93c,_0x582183){zipdir(_0x3ded4b,{'saveTo':_0x3b440c},function(_0x12250e,_0x19127b){if(_0x12250e)return _0x582183(_0x12250e);return _0x29f93c(_0x19127b);});})['then'](function(){return new BPromise(function(_0x35f2d1,_0x588610){rimraf(_0x3ded4b,function(_0x35f18d){if(_0x35f18d)_0x588610(_0x35f18d);return _0x35f2d1();});});})[_0x1d7d('0x24')](function(){return _0x5f1b69[_0x1d7d('0x115')](_0x3b440c,_0xe65d48,function(_0x10263c){if(_0x10263c){console['log']('err',_0x10263c);}else{fs[_0x1d7d('0x130')](_0x3b440c);}});});});}else{return _0x5f1b69[_0x1d7d('0x2f')](0xc8);}})[_0x1d7d('0x2e')](handleError(_0x5f1b69,null));};
\ No newline at end of file
+var _0x14a0=['t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ChatInteractionId','rows','show','params','intersection','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','customUpdate','CmContact','Contact','abandon','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','agentAlias','System','customer','agentIdentifier','%s%d','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','chatInteractionTags:save','removeTags','files','server','attachments','firstName','lastName','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerPort','existsSync','createReadStream','pipe','out','views','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','ChatInteraction','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','select','color','tools_tags','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','length','getFullTextValue','ContactId','buildExpression','text','start','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC'];(function(_0x5844c3,_0x13fc8c){var _0x3a4d56=function(_0x24328e){while(--_0x24328e){_0x5844c3['push'](_0x5844c3['shift']());}};_0x3a4d56(++_0x13fc8c);}(_0x14a0,0x8e));var _0x014a=function(_0x555dd8,_0x494deb){_0x555dd8=_0x555dd8-0x0;var _0x168163=_0x14a0[_0x555dd8];return _0x168163;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x014a('0xf'));var logger=require(_0x014a('0x10'))('api');var utils=require(_0x014a('0x11'));var config=require(_0x014a('0x12'));var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];config[_0x014a('0x15')]=_[_0x014a('0x16')](config[_0x014a('0x15')],{'host':_0x014a('0x17'),'port':0x18eb});var socket=require(_0x014a('0x18'))(new Redis(config[_0x014a('0x15')]));require(_0x014a('0x19'))[_0x014a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x014a('0x1b')][_0x014a('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x014a('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x128c46,_0x59a4ea,_0x16e6fc,_0x17e4be){return new BPromise(function(_0x20f148,_0x12da95){var _0x2c26ac=_0x17e4be||client;return _0x2c26ac[_0x014a('0x1d')](_0x128c46,_0x16e6fc)[_0x014a('0x1e')](function(_0x263b07){logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));logger[_0x014a('0x22')](_0x014a('0x23'),_0x59a4ea,_0x014a('0x21'),JSON['stringify'](_0x263b07));if(_0x263b07[_0x014a('0x24')]){if(_0x263b07[_0x014a('0x24')][_0x014a('0x25')]===0x1f4){logger[_0x014a('0x24')](_0x014a('0x20'),_0x59a4ea,_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);return _0x12da95(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}logger['error'](_0x014a('0x20'),_0x59a4ea,_0x263b07['error'][_0x014a('0x26')]);return _0x20f148(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}else{logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));_0x20f148(_0x263b07[_0x014a('0x27')][_0x014a('0x26')]);}})[_0x014a('0x28')](function(_0x4c2627){logger[_0x014a('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x59a4ea,_0x4c2627);_0x12da95(_0x4c2627);});});}function respondWithStatusCode(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['sendStatus'](_0x28701e);}return _0x39a432[_0x014a('0x29')](_0x28701e)[_0x014a('0x2a')]();};}function respondWithResult(_0x143346,_0x5ed71b){_0x5ed71b=_0x5ed71b||0xc8;return function(_0x183f19){if(_0x183f19){return _0x143346[_0x014a('0x29')](_0x5ed71b)['json'](_0x183f19);}};}function respondWithFilteredResult(_0x31dc95,_0x2560a6){return function(_0x496040){if(_0x496040){var _0x4f9c1c=typeof _0x2560a6[_0x014a('0x2b')]===_0x014a('0x2c')&&typeof _0x2560a6[_0x014a('0x2d')]===_0x014a('0x2c');var _0x4ea00c=_0x496040[_0x014a('0x2e')];var _0x147e7e=_0x4f9c1c?0x0:_0x2560a6[_0x014a('0x2b')];var _0x402d3b=_0x4f9c1c?_0x496040[_0x014a('0x2e')]:_0x2560a6[_0x014a('0x2b')]+_0x2560a6[_0x014a('0x2d')];var _0x1dae8e;if(_0x402d3b>=_0x4ea00c){_0x402d3b=_0x4ea00c;_0x1dae8e=0xc8;}else{_0x1dae8e=0xce;}_0x31dc95[_0x014a('0x29')](_0x1dae8e);return _0x31dc95[_0x014a('0x2f')](_0x014a('0x30'),_0x147e7e+'-'+_0x402d3b+'/'+_0x4ea00c)['json'](_0x496040);}return null;};}function patchUpdates(_0x105d4a){return function(_0x41ead8){try{jsonpatch[_0x014a('0x31')](_0x41ead8,_0x105d4a,!![]);}catch(_0x457883){return BPromise[_0x014a('0x32')](_0x457883);}return _0x41ead8[_0x014a('0x33')]();};}function saveUpdates(_0x211d18,_0x4dd025){return function(_0x116a24){if(_0x116a24){return _0x116a24[_0x014a('0x34')](_0x211d18)['then'](function(_0x415f83){return _0x415f83;});}return null;};}function removeEntity(_0x12de94,_0x40738f){return function(_0x467032){if(_0x467032){return _0x467032[_0x014a('0x35')]()[_0x014a('0x1e')](function(){_0x12de94[_0x014a('0x29')](0xcc)[_0x014a('0x2a')]();});}};}function handleEntityNotFound(_0x5e37e4,_0x19cee1){return function(_0x1dfe6e){if(!_0x1dfe6e){_0x5e37e4[_0x014a('0x36')](0x194);}return _0x1dfe6e;};}function handleError(_0x1f31c8,_0x5127f3){_0x5127f3=_0x5127f3||0x1f4;return function(_0x427c7a){logger[_0x014a('0x24')](_0x427c7a[_0x014a('0x37')]);if(_0x427c7a[_0x014a('0x38')]){delete _0x427c7a[_0x014a('0x38')];}_0x1f31c8[_0x014a('0x29')](_0x5127f3)[_0x014a('0x39')](_0x427c7a);};}function getMustacheRender(_0x36187b,_0x1ec350){return Mustache['render'](_0x36187b,_[_0x014a('0x3a')](_0x1ec350['body'],{'contact':_0x1ec350[_0x014a('0x3b')],'message':_0x1ec350[_0x014a('0x26')],'agent':_0x1ec350[_0x014a('0x3c')],'interaction':_0x1ec350[_0x014a('0x3d')],'account':_0x1ec350[_0x014a('0x3e')]}))||'';}function getInteractionUsers(_0x55126d,_0x1c6f6f){return new BPromise(function(_0x3f4a61,_0x51dca8){try{if(_0x1c6f6f[_0x55126d['id']]){_0x55126d[_0x014a('0x3f')]=_[_0x014a('0x40')](_0x1c6f6f[_0x55126d['id']],function(_0x3e5ecf){return{'id':_0x3e5ecf['id'],'fullname':_0x3e5ecf[_0x014a('0x41')]};});}}catch(_0x3788d6){_0x51dca8(_0x3788d6);}_0x3f4a61(_0x55126d);});}function getInteractionTags(_0x313eb8,_0x17b1b6){return new BPromise(function(_0x764fbe,_0x2beddc){try{if(_0x313eb8['TagIds']){_0x313eb8[_0x014a('0x42')]=[];_0x313eb8[_0x014a('0x43')][_0x014a('0x44')](',')[_0x014a('0x45')](function(_0x5f1a91){_0x313eb8[_0x014a('0x42')][_0x014a('0x46')](_0x17b1b6[_0x5f1a91]);});}delete _0x313eb8[_0x014a('0x43')];}catch(_0x1355dd){_0x2beddc(_0x1355dd);}_0x764fbe(_0x313eb8);});}function updateChatInteraction(_0x1dc647,_0x430a56,_0x5f2969){return new BPromise(function(_0x361866,_0x2830e1){return getInteractionUsers(_0x1dc647,_0x5f2969)['then'](function(_0xc086b3){return getInteractionTags(_0xc086b3,_0x430a56);})[_0x014a('0x1e')](function(_0x2c45f1){_0x361866(_0x2c45f1);})['catch'](function(_0x5bcf8){_0x2830e1(_0x5bcf8);});});}exports['index']=function(_0x5ab5e8,_0x67b30f){var _0x29c9ca={},_0x5aa496={},_0x1557ad={'count':0x0,'rows':[]};var _0x11c0d5=_[_0x014a('0x40')](db[_0x014a('0x47')][_0x014a('0x48')],function(_0xbaf8c6){return{'name':_0xbaf8c6['fieldName'],'type':_0xbaf8c6[_0x014a('0x49')][_0x014a('0x4a')]};});_0x5aa496[_0x014a('0x4b')]=_['map'](_0x11c0d5,'name');_0x5aa496[_0x014a('0x4c')]=_['keys'](_0x5ab5e8['query']);_0x5aa496[_0x014a('0x4d')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],_0x5aa496[_0x014a('0x4c')]);_0x29c9ca[_0x014a('0x4e')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x4f')]));_0x29c9ca[_0x014a('0x4e')]=_0x29c9ca[_0x014a('0x4e')]['length']?_0x29c9ca[_0x014a('0x4e')]:_0x5aa496[_0x014a('0x4b')];if(!_0x5ab5e8['query'][_0x014a('0x50')](_0x014a('0x51'))){_0x29c9ca[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x2d')]);_0x29c9ca[_0x014a('0x2b')]=qs[_0x014a('0x2b')](_0x5ab5e8['query'][_0x014a('0x2b')]);}_0x29c9ca[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x53')]);_0x29c9ca['where']=qs[_0x014a('0x4d')](_['pick'](_0x5ab5e8[_0x014a('0x4c')],_0x5aa496[_0x014a('0x4d')]),_0x11c0d5);var _0x40e02b=[];var _0x479dc0=squel[_0x014a('0x54')]()['field']('id')['field']('name')['field'](_0x014a('0x55'))['from'](_0x014a('0x56'));var _0x5b5318=squel['select']()[_0x014a('0x57')]('u.id')[_0x014a('0x57')](_0x014a('0x58'))[_0x014a('0x57')](_0x014a('0x59'))[_0x014a('0x5a')](_0x014a('0x5b'),'ui')[_0x014a('0x5c')](_0x014a('0x5d'),'u',_0x014a('0x5e'));var _0x3fc9ab=squel['select']()['from'](_0x014a('0x5f'),'i')[_0x014a('0x5c')](_0x014a('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x014a('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x014a('0x5c')](_0x014a('0x61'),'a',_0x014a('0x62'))[_0x014a('0x5c')]('chat_messages','me',_0x014a('0x63'))[_0x014a('0x5c')](_0x014a('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x014a('0x5c')]('tools_tags','t',_0x014a('0x65'));var _0x47074f=squel[_0x014a('0x66')]();var _0x24d433=[];var _0xd0334a=squel[_0x014a('0x66')]();var _0x4e9260;if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x67')]){_0x4e9260=as[_0x014a('0x68')](_0x5ab5e8['query'][_0x014a('0x67')]);var _0x17f9d7=_0x4e9260[_0x014a('0x69')];for(var _0xa4fd8d=0x0;_0xa4fd8d<_0x4e9260[_0x014a('0x6a')]['length'];_0xa4fd8d++){var _0x8ac9cd=_0x4e9260[_0x014a('0x6a')][_0xa4fd8d];var _0x63c341='i';var _0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x8ac9cd[_0x014a('0x57')]]);if(!_0x37a7b8){switch(_0x8ac9cd[_0x014a('0x57')]){case _0x014a('0x6c'):if(_0x8ac9cd[_0x014a('0x6d')]==0x1){_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd[_0x014a('0x57')]+'`\x20=\x200');}else{_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd['field']+'`\x20>\x200');}break;case'Contact':if(_0x8ac9cd['operator']==='$substring'){if(_0x8ac9cd[_0x014a('0x6d')][_0x014a('0x44')]('\x20')[_0x014a('0x6f')]>0x1){_0x47074f[_0x17f9d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x014a('0x70')](_0x8ac9cd[_0x014a('0x6d')]),null);}else{var _0x3071c8='%'+_0x8ac9cd[_0x014a('0x6d')]+'%';_0x47074f[_0x17f9d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3071c8,_0x3071c8,_0x3071c8);}}else{_0x37a7b8=_['find'](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x71')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x71');_0x58e087=as[_0x014a('0x72')](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}break;case'Tag':var _0x2d87e3=_0x8ac9cd[_0x014a('0x6d')]['split'](',')[_0x014a('0x40')](function(_0x3e39c9){return Number(_0x3e39c9);});_0x2d87e3['forEach'](function(_0x14f2e2){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f2e2+',%');});_0x24d433=_[_0x014a('0x75')](_0x24d433,_0x2d87e3);break;case _0x014a('0x76'):if(_0x8ac9cd[_0x014a('0x77')]===_0x014a('0x78')){_0x47074f[_0x17f9d7](_0x014a('0x79'),'%'+_0x8ac9cd['value']+'%',null);}else{_0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x7a')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x7a');_0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')]['end']);}break;case _0x014a('0x7b'):_0x58e087=as[_0x014a('0x72')]('me',null,_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);break;}}else{var _0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087['text'],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}}}else{var _0x55bca3=_(_0x5ab5e8['query'])[_0x014a('0x7c')]()[_0x014a('0x40')](function(_0x5f391d){return _[_0x014a('0x7d')](_0x11c0d5,[_0x014a('0x38'),_0x5f391d])?_0x5f391d:undefined;})['compact']()['value']();if(!_[_0x014a('0x7e')](_0x55bca3)){_0x55bca3[_0x014a('0x45')](function(_0x1ee130){if(_0x1ee130===_0x014a('0x7f')){_0x3fc9ab[_0x014a('0x80')](_0x014a('0x81'),[]['concat'](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]));}else if(_0x1ee130==='createdAt'){var _0x5a8351=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])['$gte'];var _0x27e363=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])[_0x014a('0x83')];_0x3fc9ab[_0x014a('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a8351,_0x27e363);}else{if(_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]===_0x014a('0x84')){_0x3fc9ab[_0x014a('0x80')]('i.'+_0x1ee130+_0x014a('0x85'));}else{_0x3fc9ab['where']('i.'+_0x1ee130+_0x014a('0x86'),_0x5ab5e8['query'][_0x1ee130]);}}});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]==0x1){_0x3fc9ab[_0x014a('0x6e')](_0x014a('0x88'));}else{_0x3fc9ab['having'](_0x014a('0x89'));}}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]){_0x24d433=_[_0x014a('0x8b')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')])?_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]:new Array(_0x5ab5e8['query'][_0x014a('0x8a')]);_0x24d433[_0x014a('0x45')](function(_0x3c2a39){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2a39+',%');});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')]){var _0x1cdfa5=_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')][_0x014a('0x8d')]('\x5c','\x5c\x5c')[_0x014a('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cdfa5)){_0x47074f['or']('i.id\x20LIKE\x20?',_0x1cdfa5+'%');}else{_0x47074f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdfa5))['or'](_0x014a('0x8e'),_0x1cdfa5+'%');}}}_0x3fc9ab[_0x014a('0x80')](_0x47074f);_0x3fc9ab[_0x014a('0x8f')](_0x014a('0x90'));var _0xe1b5ed={'type':db[_0x014a('0x91')][_0x014a('0x92')]['SELECT'],'raw':!![]};var _0x24ffb0=_0x3fc9ab[_0x014a('0x93')]();_0x24ffb0[_0x014a('0x57')](_0x014a('0x90'));_0x24ffb0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x014a('0x6c'));if(_0x29c9ca[_0x014a('0x52')]){_0x29c9ca['order']['forEach'](function(_0x9aa04b){var _0x5bcaf9=_0x9aa04b[0x0]==='contactName'?_0x9aa04b[0x0]:'i.'+_0x9aa04b[0x0];_0x3fc9ab[_0x014a('0x52')](_0x5bcaf9,_0x9aa04b[0x1]===_0x014a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x24d433)){_0x3fc9ab[_0x014a('0x6e')](_0xd0334a);_0x24ffb0[_0x014a('0x80')](_0x014a('0x95'),_0x24d433);}BPromise[_0x014a('0x96')]()[_0x014a('0x1e')](function(){if(!_0x4e9260){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x7f')])return;_0x24ffb0[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc9ab['where'](_0x014a('0x97'));return;}if(_0x5ab5e8['user']['role']!=='agent')return;return _0x5ab5e8[_0x014a('0x98')][_0x014a('0x99')]({'attributes':['id'],'raw':!![]})[_0x014a('0x1e')](function(_0x55408f){if(_[_0x014a('0x7e')](_0x55408f)){_0x24ffb0[_0x014a('0x80')](_0x014a('0x9a'));_0x3fc9ab[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24ffb0[_0x014a('0x80')](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));_0x3fc9ab['where'](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));}});})['then'](function(){if(_0x5ab5e8[_0x014a('0x98')][_0x014a('0x9b')]===_0x014a('0x3c')&&!_0x4e9260&&!_0x5ab5e8['query'][_0x014a('0x7f')])return[];return db[_0x014a('0x9c')]['query'](_0x24ffb0[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x317df3){_0x1557ad[_0x014a('0x2e')]=_0x317df3[_0x014a('0x6f')];if(_0x1557ad[_0x014a('0x2e')]===0x0)return[];return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x479dc0['toString'](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x1806d0){_0x40e02b=_['keyBy'](_0x1806d0,'id');_0xe1b5ed=_['merge'](_0xe1b5ed,{'model':db[_0x014a('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ab5e8[_0x014a('0x4c')]['fields']){_0x29c9ca[_0x014a('0x4e')][_0x014a('0x45')](function(_0x216b27){_0x3fc9ab['field']('i.'+_0x216b27);});}else{_0x3fc9ab[_0x014a('0x57')](_0x014a('0x9e'),'unreadMessages');_0x3fc9ab['field'](_0x014a('0x9f'),'Account.key');_0x3fc9ab[_0x014a('0x57')]('a.mandatoryDisposition',_0x014a('0xa0'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa1'),_0x014a('0xa2'));_0x3fc9ab[_0x014a('0x57')]('i.*');_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa3'),_0x014a('0xa4'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa5'),_0x014a('0xa6'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa7'),'Contact.email');_0x3fc9ab[_0x014a('0x57')]('c.phone',_0x014a('0xa8'));_0x3fc9ab['field']('c.mobile','Contact.mobile');_0x3fc9ab['field'](_0x014a('0xa9'),_0x014a('0xaa'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xab'),_0x014a('0xac'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xad'),_0x014a('0xae'));_0x3fc9ab['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x014a('0x43'));}if(_0x29c9ca[_0x014a('0x2d')])_0x3fc9ab[_0x014a('0x2d')](_0x29c9ca[_0x014a('0x2d')]);if(_0x29c9ca[_0x014a('0x2b')])_0x3fc9ab[_0x014a('0x2b')](_0x29c9ca[_0x014a('0x2b')]);return db[_0x014a('0x9c')]['query'](_0x3fc9ab[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x3a2752){if(_0x3a2752[_0x014a('0x6f')]>0x0)_0x5b5318[_0x014a('0x80')]('ui.ChatInteractionId\x20IN\x20?',_[_0x014a('0x40')](_0x3a2752,'id'));return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x5b5318[_0x014a('0x9d')](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x567357){var _0x3036e4=_['groupBy'](_0x567357,_0x014a('0xaf'));var _0x5a83ab=[];_0x3a2752['forEach'](function(_0x1667c8){_0x5a83ab[_0x014a('0x46')](updateChatInteraction(_0x1667c8,_0x40e02b,_0x3036e4));});return BPromise['all'](_0x5a83ab);});});})[_0x014a('0x1e')](function(_0x3199b9){_0x1557ad[_0x014a('0xb0')]=_0x3199b9;return _0x1557ad;})['then'](respondWithFilteredResult(_0x67b30f,_0x29c9ca))[_0x014a('0x28')](handleError(_0x67b30f,null));};exports[_0x014a('0xb1')]=function(_0x2feb8a,_0x336bcf){var _0x2f7969={'raw':![],'where':{'id':_0x2feb8a[_0x014a('0xb2')]['id']}},_0x263212={};_0x263212[_0x014a('0x4b')]=_[_0x014a('0x7c')](db['ChatInteraction']['rawAttributes']);_0x263212[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x2feb8a[_0x014a('0x4c')]);_0x263212['filters']=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],_0x263212[_0x014a('0x4c')]);_0x2f7969[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],qs['fields'](_0x2feb8a[_0x014a('0x4c')][_0x014a('0x4f')]));_0x2f7969[_0x014a('0x4e')]=_0x2f7969[_0x014a('0x4e')]['length']?_0x2f7969[_0x014a('0x4e')]:_0x263212[_0x014a('0x4b')];if(_0x2feb8a[_0x014a('0x4c')][_0x014a('0xb4')]){_0x2f7969[_0x014a('0xb5')]=[{'all':!![]}];}_0x2f7969=_['merge']({},_0x2f7969,_0x2feb8a[_0x014a('0xb6')]);return db['ChatInteraction']['find'](_0x2f7969)[_0x014a('0x1e')](handleEntityNotFound(_0x336bcf,null))[_0x014a('0x1e')](respondWithResult(_0x336bcf,null))[_0x014a('0x28')](handleError(_0x336bcf,null));};exports[_0x014a('0xb7')]=function(_0x3646b8,_0x243fd9){return db[_0x014a('0x47')][_0x014a('0xb7')](_0x3646b8[_0x014a('0x7b')],{})[_0x014a('0x1e')](respondWithResult(_0x243fd9,0xc9))[_0x014a('0x28')](handleError(_0x243fd9,null));};exports[_0x014a('0x34')]=function(_0x383bd8,_0x175c12){if(_0x383bd8[_0x014a('0x7b')]['id']){delete _0x383bd8[_0x014a('0x7b')]['id'];}return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x383bd8[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x175c12,null))['then'](saveUpdates(_0x383bd8[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x175c12,null))[_0x014a('0x28')](handleError(_0x175c12,null));};exports[_0x014a('0x35')]=function(_0x116631,_0xbfd7f8){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x116631[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x014a('0x1e')](removeEntity(_0xbfd7f8,null))[_0x014a('0x28')](handleError(_0xbfd7f8,null));};exports[_0x014a('0xb8')]=function(_0x11aab3,_0x4f91f1){return db[_0x014a('0x47')]['describe']()['then'](respondWithResult(_0x4f91f1,null))[_0x014a('0x28')](handleError(_0x4f91f1,null));};exports['createVidaooSession']=function(_0x2de457,_0x2ca658){var _0x4ee77b=_0x2de457[_0x014a('0xb2')]['id'];var _0x4e75e4;var _0x172210;var _0x8cc35d;return db['ChatInteraction'][_0x014a('0xb9')]({'where':{'id':_0x4ee77b}})[_0x014a('0x1e')](function(_0x50a129){_0x4e75e4=_0x50a129;return db[_0x014a('0xba')][_0x014a('0xb9')]({'where':{'id':_0x50a129[_0x014a('0x7f')]},'attributes':['id',_0x014a('0xbb'),_0x014a('0xbc'),_0x014a('0xbd'),_0x014a('0xbe'),_0x014a('0xbf')],'raw':!![]});})[_0x014a('0x1e')](function(_0x38df6c){if(_0x38df6c&&_0x38df6c[_0x014a('0xbb')]&&_0x38df6c[_0x014a('0xbc')]){_0x172210=_0x38df6c;var _0x4e0c1a={'interaction':{'id':_0x4ee77b},'agent':{'id':_0x2de457[_0x014a('0x98')]['id'],'name':_0x2de457[_0x014a('0x98')][_0x014a('0x38')],'fullname':_0x2de457[_0x014a('0x98')][_0x014a('0x41')],'email':_0x2de457[_0x014a('0x98')][_0x014a('0xc0')]},'contact':_0x2de457[_0x014a('0x7b')]['contact'],'account':_0x2de457[_0x014a('0x7b')][_0x014a('0x3e')]};var _0x2b3dc0={'rejectUnauthorized':![],'method':_0x014a('0xc1'),'url':_0x014a('0xc2'),'headers':{'X-APIKEY':_0x38df6c[_0x014a('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2de457['user'][_0x014a('0xc0')]],'buttons':null,'topic':_0x172210[_0x014a('0xbd')],'note':_[_0x014a('0xc3')](_0x172210['vidaooNote'])?null:getMustacheRender(_0x172210['vidaooNote'],_0x4e0c1a),'metadata':null},'redirect':_0x014a('0xc4'),'json':!![]};try{if(!_[_0x014a('0xc3')](_0x172210[_0x014a('0xbf')])){var _0x31e65e=getMustacheRender(_0x172210[_0x014a('0xbf')],_0x4e0c1a);var _0x537353=JSON[_0x014a('0x82')](_0x31e65e);_0x2b3dc0[_0x014a('0x7b')][_0x014a('0xc5')]=_0x537353;}}catch(_0x5dd7a5){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b3dc0);}else{throw new db[(_0x014a('0x91'))]['ValidationError'](_0x014a('0xc7'));}})['then'](function(_0x57d852){_0x8cc35d=_0x57d852;if(_0x8cc35d['id']){var _0x581c3a={'body':_0x8cc35d[_0x014a('0xc8')],'ChatWebsiteId':_0x172210['id'],'ChatInteractionId':_0x4e75e4['id'],'direction':'out','UserId':_0x2de457[_0x014a('0x98')]['id']};return db['ChatMessage'][_0x014a('0xb7')](_0x581c3a,{});}else{throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x014a('0x1e')](function(){return _0x4e75e4['updateAttributes']({'vidaooSessionId':_0x8cc35d['id']});})[_0x014a('0x1e')](respondWithResult(_0x2ca658,null))[_0x014a('0x28')](handleError(_0x2ca658,null));};exports[_0x014a('0xc9')]=function(_0x533371,_0x57b53b){if(_0x533371[_0x014a('0x7b')]['id']){delete _0x533371[_0x014a('0x7b')]['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x533371[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xca')],'as':_0x014a('0xcb')}]})[_0x014a('0x1e')](handleEntityNotFound(_0x57b53b,null))[_0x014a('0x1e')](saveUpdates(_0x533371[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x57b53b,null))[_0x014a('0x28')](handleError(_0x57b53b,null));};exports[_0x014a('0xcc')]=function(_0x4adbd2,_0x55a4bb,_0x38807c){if(_0x4adbd2[_0x014a('0x7b')]['id']){delete _0x4adbd2['body']['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x4adbd2['params']['id']}})['then'](function(_0xf01aa6){if(!_0xf01aa6){logger[_0x014a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x014a('0xcc'),0x194,'entity\x20not\x20found');_0x55a4bb[_0x014a('0x36')](0x194);}else{if(_0xf01aa6[_0x014a('0x7a')]){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Interaction\x20already\x20assigned');}}return _0xf01aa6;})['then'](function(_0x5db9d1){if(_0x5db9d1){return _0x5db9d1['update']({'closed':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xcd')],'disposition':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xce')]})[_0x014a('0x1e')](function(_0x3e19c0){return _0x3e19c0;});}})[_0x014a('0x1e')](function(_0x3546e7){return respondWithRpcPromise(_0x014a('0xcf'),_0x014a('0xcc'),_0x4adbd2[_0x014a('0x7b')],client9004);})['then'](respondWithResult(_0x55a4bb,null))['catch'](handleError(_0x55a4bb,null));};exports['attachmentUpload']=function(_0x190839,_0x28f011,_0x4da4a1){_0x190839[_0x014a('0x7b')][_0x014a('0x38')]=_0x190839[_0x014a('0xd0')][_0x014a('0xd1')];_0x190839['body'][_0x014a('0xd2')]=_0x190839[_0x014a('0xd0')]['filename'];_0x190839[_0x014a('0x7b')][_0x014a('0x49')]=_0x190839['file'][_0x014a('0xd3')];return db[_0x014a('0xd4')][_0x014a('0xb7')](_0x190839[_0x014a('0x7b')])[_0x014a('0x1e')](respondWithResult(_0x28f011,0xc9))[_0x014a('0x28')](handleError(_0x28f011,null));};exports[_0x014a('0xd5')]=function(_0xd50ab0,_0x4cee0b,_0x129deb){return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0xb2')]['id']},'raw':!![]})[_0x014a('0x1e')](handleEntityNotFound(_0x4cee0b,null))[_0x014a('0x1e')](function(_0x2573bd){if(_0x2573bd){if(_0x2573bd[_0x014a('0xcd')]){return _0x4cee0b[_0x014a('0x29')](0x193)['json']({'status':0x193,'message':_0x014a('0xd6')});}return db['Attachment'][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0x4c')][_0x014a('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x4cee0b,null));}})['then'](function(_0x293ee3){if(_0x293ee3){var _0x4ce807=_0x293ee3['ChatOfflineMessageId']!==null;var _0x5c002b=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xda'));if(_0x4ce807){_0x5c002b=path['join'](_0x5c002b,_0x014a('0xdb'));}var _0x19a2ed=path['join'](_0x5c002b,_0x293ee3[_0x014a('0xd2')]);return _0x4cee0b[_0x014a('0xdc')](_0x19a2ed);}})[_0x014a('0x28')](handleError(_0x4cee0b,null));};exports['close']=function(_0x5b82f2,_0x2b622f){var _0x24e9d7=null;var _0x344adb=null;var _0x1441ed=null;var _0x34b528=null;if(_0x5b82f2[_0x014a('0x7b')]['id']){delete _0x5b82f2['body']['id'];}if(_0x5b82f2['body']['mailTranscript']){_0x34b528=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xdd'),util['format'](_0x014a('0xde'),Date[_0x014a('0xdf')]()));_0x5b82f2[_0x014a('0x7b')]['pathTranscript']=_0x34b528;}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x5b82f2[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xe0')],'as':'Messages','include':[{'model':db[_0x014a('0x76')],'as':'User'}]}]})[_0x014a('0x1e')](handleEntityNotFound(_0x2b622f,null))[_0x014a('0x1e')](saveUpdates(_0x5b82f2[_0x014a('0x7b')],null))['then'](function(_0xdd63f){if(_0xdd63f){_0x24e9d7=_0xdd63f;return db[_0x014a('0xba')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x7f')]}});}})[_0x014a('0x1e')](function(_0x49a1eb){if(_0x49a1eb){_0x1441ed=_0x49a1eb;return db[_0x014a('0xca')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x71')]}});}})[_0x014a('0x1e')](function(_0x2432ac){if(_0x2432ac){_0x344adb=_0x2432ac;if(_0x34b528){var _0xb91589=null;for(var _0x53260c=0x1;_0x53260c<_0x24e9d7[_0x014a('0xe1')][_0x014a('0x6f')];++_0x53260c){_0xb91589=_0x24e9d7['Messages'][_0x53260c];var _0x1b5b25=_0xb91589['UserId']?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');var _0x10b3c5=_0x5b82f2[_0x014a('0x7b')][_0x014a('0xe5')]||util[_0x014a('0xe2')]('%s%d','Visitor',_0xb91589[_0x014a('0x71')]);switch(_0x1441ed[_0x014a('0xe6')]){case'website_alias':_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')](_0x014a('0xe7'),_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):'System';break;case _0x014a('0xe8'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0xe9')]||_0xb91589['User'][_0x014a('0x41')]:'System';break;case _0x014a('0xea'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4');break;default:_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');}var _0x343b5e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0xb91589[_0x014a('0xeb')])[_0x014a('0xe2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xb91589[_0x014a('0xec')]==='in'?_0x10b3c5:_0x1b5b25,_0xb91589[_0x014a('0x7b')]);if(!_0xb91589[_0x014a('0xed')]){fs[_0x014a('0xee')](_0x34b528,_0x343b5e);}}return db[_0x014a('0xef')][_0x014a('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x014a('0xf0')],'as':_0x014a('0xf1'),'raw':!![]}]});}}})[_0x014a('0x1e')](function(_0x4ad0c6){if(_0x4ad0c6&&_0x4ad0c6[_0x014a('0xf1')]&&_0x5b82f2['body']){var _0x5f8d5b={'tls':{'rejectUnauthorized':![]}};if(_0x4ad0c6[_0x014a('0xf1')]['service']){_0x5f8d5b[_0x014a('0xf2')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf2')];}else{_0x5f8d5b[_0x014a('0xf3')]=_0x4ad0c6[_0x014a('0xf1')]['host'];_0x5f8d5b[_0x014a('0xf4')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf4')];_0x5f8d5b[_0x014a('0xf5')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf5')];}if(_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf6')]){_0x5f8d5b['auth']={'user':_0x4ad0c6[_0x014a('0xf1')]['user'],'pass':_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf7')]};}return respondWithRpcPromise(_0x014a('0xf8'),_0x014a('0xf9'),{'account':_0x5f8d5b,'message':{'from':util[_0x014a('0xe2')](_0x014a('0xfa'),_0x4ad0c6['name'],_0x4ad0c6[_0x014a('0xc0')]||_0x4ad0c6['Smtp'][_0x014a('0x98')]),'to':_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')],'subject':_0x014a('0xfc'),'text':util[_0x014a('0xe2')](_0x014a('0xfd'),_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')]),'attachments':[{'path':_0x34b528}]}})['then'](function(){return _0x24e9d7;})['catch'](function(_0xac886c){console[_0x014a('0x24')](_0xac886c);});}else{return _0x24e9d7;}})[_0x014a('0x1e')](respondWithStatusCode(_0x2b622f,0xc8))[_0x014a('0x28')](handleError(_0x2b622f,null));};exports[_0x014a('0xfe')]=function(_0x30aa7b,_0x451579,_0x3858a1){return db[_0x014a('0xe0')][_0x014a('0x6b')]({'where':{'id':_0x30aa7b[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x451579,null))[_0x014a('0x1e')](function(_0x57bd30){if(_0x57bd30){return _0x57bd30[_0x014a('0xfe')](_0x30aa7b[_0x014a('0x7b')][_0x014a('0xff')],_['omit'](_0x30aa7b[_0x014a('0x7b')],[_0x014a('0xff'),'id'])||{});}})[_0x014a('0x1e')](respondWithResult(_0x451579,null))[_0x014a('0x28')](handleError(_0x451579,null));};exports[_0x014a('0x100')]=function(_0x36c94d,_0x44cb05,_0x30a903){var _0x3bb1f={'raw':![],'where':{}};var _0x4775a4={};var _0x13ec10={'count':0x0,'rows':[]};return db[_0x014a('0x47')]['findOne']({'where':{'id':_0x36c94d['params']['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x44cb05,null))[_0x014a('0x1e')](function(_0x4a361b){if(_0x4a361b){_0x4775a4[_0x014a('0x4b')]=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x4775a4[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x36c94d[_0x014a('0x4c')]);_0x4775a4[_0x014a('0x4d')]=_['intersection'](_0x4775a4[_0x014a('0x4b')],_0x4775a4[_0x014a('0x4c')]);_0x3bb1f[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x4775a4['model'],qs[_0x014a('0x4f')](_0x36c94d[_0x014a('0x4c')][_0x014a('0x4f')]));_0x3bb1f['attributes']=_0x3bb1f[_0x014a('0x4e')][_0x014a('0x6f')]?_0x3bb1f['attributes']:_0x4775a4[_0x014a('0x4b')];if(!_0x36c94d[_0x014a('0x4c')][_0x014a('0x50')]('nolimit')){_0x3bb1f[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x36c94d[_0x014a('0x4c')]['limit']);_0x3bb1f[_0x014a('0x2b')]=qs['offset'](_0x36c94d[_0x014a('0x4c')]['offset']);}_0x3bb1f[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x36c94d['query'][_0x014a('0x53')]);_0x3bb1f['where']=qs[_0x014a('0x4d')](_[_0x014a('0x101')](_0x36c94d[_0x014a('0x4c')],_0x4775a4[_0x014a('0x4d')]));_0x3bb1f[_0x014a('0x80')]['ChatInteractionId']=_0x4a361b['id'];if(_0x36c94d[_0x014a('0x4c')][_0x014a('0x8c')]){_0x3bb1f[_0x014a('0x80')]=_['merge'](_0x3bb1f[_0x014a('0x80')],{'$or':_[_0x014a('0x40')](_0x3bb1f['attributes'],function(_0x565da5){var _0x309858={};_0x309858[_0x565da5]={'$like':'%'+_0x36c94d[_0x014a('0x4c')]['filter']+'%'};return _0x309858;})});}if(_0x36c94d[_0x014a('0x4c')]['$gte']){var _0x56bfaf=_0x36c94d[_0x014a('0x4c')][_0x014a('0x102')]['split'](',');var _0x5f14e4={};_0x5f14e4[_0x56bfaf[0x0]]={'$gte':moment(_0x56bfaf[0x1])['format'](_0x014a('0x103'))};_0x3bb1f[_0x014a('0x80')]=_[_0x014a('0x3a')](_0x3bb1f['where'],_0x5f14e4);}_0x3bb1f=_['merge']({},_0x3bb1f,_0x36c94d[_0x014a('0xb6')]);return db['ChatMessage'][_0x014a('0x2e')]({'where':_0x3bb1f[_0x014a('0x80')]})['then'](function(_0x4acfe9){_0x13ec10[_0x014a('0x2e')]=_0x4acfe9;if(_0x36c94d[_0x014a('0x4c')]['includeAll']){_0x3bb1f[_0x014a('0xb5')]=[{'all':!![]}];}return db['ChatMessage'][_0x014a('0x104')](_0x3bb1f);})['then'](function(_0x8c21a7){_0x13ec10[_0x014a('0xb0')]=_0x8c21a7;return _0x13ec10;});}})[_0x014a('0x1e')](respondWithFilteredResult(_0x44cb05,_0x3bb1f))[_0x014a('0x28')](handleError(_0x44cb05,null));};exports[_0x014a('0x105')]=function(_0x260f79,_0x68de07,_0x4126a3){var _0x4f1f23={'where':{}},_0x1ef9b0={},_0x11d0e9={'count':0x0,'rows':[]};return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0x260f79[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x68de07,null))[_0x014a('0x1e')](function(_0x4f7960){if(_0x4f7960){_0x1ef9b0['model']=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x1ef9b0[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x260f79[_0x014a('0x4c')]);_0x1ef9b0[_0x014a('0x4d')]=_[_0x014a('0xb3')](_0x1ef9b0[_0x014a('0x4b')],_0x1ef9b0[_0x014a('0x4c')]);_0x4f1f23[_0x014a('0x4e')]=_['intersection'](_0x1ef9b0[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x260f79[_0x014a('0x4c')][_0x014a('0x4f')]));_0x4f1f23[_0x014a('0x4e')]=_0x4f1f23[_0x014a('0x4e')][_0x014a('0x6f')]?_0x4f1f23['attributes']:_0x1ef9b0['model'];if(!_0x260f79[_0x014a('0x4c')][_0x014a('0x50')](_0x014a('0x51'))){_0x4f1f23[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x260f79['query'][_0x014a('0x2d')]);_0x4f1f23[_0x014a('0x2b')]=qs['offset'](_0x260f79[_0x014a('0x4c')][_0x014a('0x2b')]);}_0x4f1f23[_0x014a('0x52')]=qs['sort'](_0x260f79[_0x014a('0x4c')][_0x014a('0x53')]);_0x4f1f23[_0x014a('0x80')]=qs['filters'](_[_0x014a('0x101')](_0x260f79[_0x014a('0x4c')],_0x1ef9b0['filters']));_0x4f1f23[_0x014a('0x80')][_0x014a('0xaf')]=_0x4f7960['id'];if(_0x260f79[_0x014a('0x4c')]['filter']){_0x4f1f23[_0x014a('0x80')]=_['merge'](_0x4f1f23['where'],{'$or':_['map'](_0x4f1f23['attributes'],function(_0xf3e4fb){var _0x126084={};_0x126084[_0xf3e4fb]={'$like':'%'+_0x260f79[_0x014a('0x4c')][_0x014a('0x8c')]+'%'};return _0x126084;})});}_0x4f1f23[_0x014a('0x80')][_0x014a('0xed')]=![];if(_0x260f79[_0x014a('0x4c')]['id']){_0x4f1f23['where']['id']={'$gt':_0x260f79[_0x014a('0x4c')]['id']};}_0x4f1f23=_['merge']({},_0x4f1f23,_0x260f79[_0x014a('0xb6')]);return db[_0x014a('0xe0')][_0x014a('0x2e')]({'where':_0x4f1f23['where']})[_0x014a('0x1e')](function(_0x58421d){_0x11d0e9['count']=_0x58421d;_0x4f1f23[_0x014a('0xb5')]=[];if(_0x260f79[_0x014a('0x4c')][_0x014a('0x106')]){_0x4f1f23['include']['push']({'model':db[_0x014a('0x76')],'as':_0x014a('0x76'),'attributes':['id',_0x014a('0x41'),_0x014a('0xe9')]});}if(_0x260f79[_0x014a('0x4c')][_0x014a('0xb4')]){_0x4f1f23['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4f1f23);})[_0x014a('0x1e')](function(_0x40a47f){_0x11d0e9[_0x014a('0xb0')]=_0x40a47f;return _0x11d0e9;});}})['then'](respondWithFilteredResult(_0x68de07,_0x4f1f23))[_0x014a('0x28')](handleError(_0x68de07,null));};exports[_0x014a('0x107')]=function(_0x8a099,_0x81208d,_0x320be9){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x8a099[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x81208d,null))[_0x014a('0x1e')](function(_0x46a2c5){if(_0x46a2c5){return _0x46a2c5['setTags'](_0x8a099[_0x014a('0x7b')][_0x014a('0xff')],_[_0x014a('0x108')](_0x8a099['body'],[_0x014a('0xff'),'id'])||{})[_0x014a('0x109')](function(){return db['Tag'][_0x014a('0x104')]({'attributes':['id','name',_0x014a('0x55')],'where':{'id':_0x8a099[_0x014a('0x7b')][_0x014a('0xff')]}});})[_0x014a('0x1e')](function(_0x4f56a9){socket['emit'](_0x014a('0x10a'),{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]});return{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]};});}})[_0x014a('0x1e')](respondWithResult(_0x81208d,null))[_0x014a('0x28')](handleError(_0x81208d,null));};exports[_0x014a('0x10b')]=function(_0x32ba5d,_0x120047,_0x570898){return db['ChatInteraction']['find']({'where':{'id':_0x32ba5d[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x120047,null))[_0x014a('0x1e')](function(_0x47cd44){if(_0x47cd44){return _0x47cd44[_0x014a('0x10b')](_0x32ba5d[_0x014a('0x4c')][_0x014a('0xff')]);}})['then'](respondWithStatusCode(_0x120047,null))[_0x014a('0x28')](handleError(_0x120047,null));};exports['download']=function(_0x546af7,_0x4c492f){var _0x331ba9=moment()['unix']()[_0x014a('0x9d')]();var _0x3e7923=path['join'](config[_0x014a('0xd9')],'server',_0x014a('0x10c'),'tmp');var _0x387e49=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0x10d'),_0x014a('0x10c'),_0x014a('0x10e'));var _0x1c5606=path['join'](_0x3e7923,_0x331ba9);var _0x4b4336=util[_0x014a('0xe2')]('transcript-%d-%s.zip',_0x546af7[_0x014a('0xb2')]['id'],_0x331ba9);var _0x1b3f4d=path[_0x014a('0xd8')](_0x3e7923,_0x4b4336);var _0x5f58bd=[];_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0x76')],'as':'User','attributes':['id',_0x014a('0x41')],'raw':!![]});_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xca')],'as':_0x014a('0xcb'),'attributes':['id',_0x014a('0x10f'),_0x014a('0x110')],'raw':!![]});if(_0x546af7[_0x014a('0x4c')]['attachments']){_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xd4')],'as':'Attachment','raw':!![]});}var _0x5104b1=[{'model':db[_0x014a('0xe0')],'as':_0x014a('0xe1'),'attributes':['id',_0x014a('0x7b'),_0x014a('0xeb'),'direction',_0x014a('0xed'),_0x014a('0x87')],'include':_0x5f58bd}];_0x5104b1[_0x014a('0x46')]({'model':db[_0x014a('0xba')],'as':_0x014a('0x111'),'attributes':['id',_0x014a('0x38')]});_0x5104b1['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x014a('0x41')]});return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x546af7[_0x014a('0xb2')]['id']},'include':_0x5104b1})[_0x014a('0x1e')](handleEntityNotFound(_0x4c492f,null))['then'](function(_0x501d05){if(_0x501d05){var _0x48c669=_0x501d05[_0x014a('0x112')]({'plain':!![]});fs['mkdirSync'](_0x1c5606);var _0x5d4bae={'channel':_0x014a('0x113'),'account':_0x48c669[_0x014a('0x111')][_0x014a('0x38')],'agent':_0x48c669[_0x014a('0x114')]?_0x48c669[_0x014a('0x114')][_0x014a('0x41')]:_0x014a('0x115'),'createdAt':moment(_0x48c669[_0x014a('0xeb')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x48c669['closed']?moment(_0x48c669[_0x014a('0x116')])[_0x014a('0xe2')](_0x014a('0x103'))[_0x014a('0x9d')]():'','disposition':_0x48c669[_0x014a('0xce')],'chatInfo':{'browser':_0x48c669['browserName'],'os':_0x48c669[_0x014a('0x117')],'referer':_0x48c669[_0x014a('0x118')],'customerIp':_0x48c669['customerIp'],'customerPort':_0x48c669[_0x014a('0x119')]?_0x48c669[_0x014a('0x119')]:_0x014a('0x115')},'messages':_(_0x48c669[_0x014a('0xe1')])['tail']()[_0x014a('0x8c')]({'secret':![]})[_0x014a('0x40')](function(_0x5afb91){if(_0x5afb91[_0x014a('0xd4')]){var _0x172440=path[_0x014a('0xd8')](_0x387e49,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]);if(fs[_0x014a('0x11a')](_0x172440)){fs[_0x014a('0x11b')](_0x172440)[_0x014a('0x11c')](fs['createWriteStream'](path[_0x014a('0xd8')](_0x1c5606,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')])));}}return{'date':moment(_0x5afb91['createdAt'])['format'](_0x014a('0x103'))[_0x014a('0x9d')](),'sender':_0x5afb91[_0x014a('0xec')]==='out'?_0x5afb91[_0x014a('0x76')]?_0x5afb91[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4'):_0x5afb91[_0x014a('0xcb')][_0x014a('0x10f')]+(_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]?'\x20'+_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]:''),'body':_0x5afb91[_0x014a('0xd4')]?_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]:_0x5afb91[_0x014a('0x7b')],'direction':_0x5afb91[_0x014a('0xec')]===_0x014a('0x11d')?'A':'C','secret':_0x5afb91[_0x014a('0xed')],'read':_0x5afb91['read'],'attachment':_0x5afb91[_0x014a('0xd4')]};})[_0x014a('0x6d')]()};return ejs['renderFile'](path['join'](config['root'],_0x014a('0x10d'),_0x014a('0x11e'),'downloadInteraction.ejs'),{'interaction':_0x5d4bae})['then'](function(_0x374e3d){var _0x2d9178=path['join'](_0x1c5606,_0x014a('0x11f')+_0x48c669['id']+'-'+_0x331ba9+'.pdf');var _0x30c604={'path':_0x2d9178,'channel':'Chat','interactionId':_0x48c669['id']};return pdf['createPdfFromHTML'](_0x374e3d,_0x30c604);})[_0x014a('0x1e')](function(){return new BPromise(function(_0x321a17,_0x2f20e7){zipdir(_0x1c5606,{'saveTo':_0x1b3f4d},function(_0x18edd1,_0xcad1af){if(_0x18edd1)return _0x2f20e7(_0x18edd1);return _0x321a17(_0xcad1af);});})['then'](function(){return new BPromise(function(_0x42cd23,_0x82d77b){rimraf(_0x1c5606,function(_0x48bcec){if(_0x48bcec)_0x82d77b(_0x48bcec);return _0x42cd23();});});})[_0x014a('0x1e')](function(){return _0x4c492f[_0x014a('0xdc')](_0x1b3f4d,_0x4b4336,function(_0x1d8179){if(_0x1d8179){console[_0x014a('0x120')](_0x014a('0x121'),_0x1d8179);}else{fs[_0x014a('0x122')](_0x1b3f4d);}});});});}else{return _0x4c492f[_0x014a('0x36')](0xc8);}})['catch'](handleError(_0x4c492f,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 96719d0..193d83b 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 _0x16df=['getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','ChatMessage','setMaxListeners','save','remove'];(function(_0x5e4124,_0x303347){var _0x98fe64=function(_0x33e1e4){while(--_0x33e1e4){_0x5e4124['push'](_0x5e4124['shift']());}};_0x98fe64(++_0x303347);}(_0x16df,0x1cb));var _0xf16d=function(_0x1f551f,_0x4d6518){_0x1f551f=_0x1f551f-0x0;var _0x51b208=_0x16df[_0x1f551f];return _0x51b208;};'use strict';var EventEmitter=require(_0xf16d('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xf16d('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf16d('0x2')](0x0);var events={'afterCreate':_0xf16d('0x3'),'afterUpdate':'update','afterDestroy':_0xf16d('0x4')};function emitEvent(_0x181367){return function(_0x3b71e1,_0x3dbdaa,_0x3472c4){_0x3b71e1[_0xf16d('0x5')]({'attributes':['id'],'raw':!![]})[_0xf16d('0x6')](function(_0xc14870){_0x3b71e1['setDataValue'](_0xf16d('0x7'),_0xc14870[_0xf16d('0x8')](function(_0x5eebb6){return{'id':_0x5eebb6['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3b71e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x13e2d3){_0x3b71e1[_0xf16d('0x9')](_0xf16d('0xa'),_0x13e2d3[_0xf16d('0xb')]);ChatInteractionEvents['emit'](_0x181367+':'+_0x3b71e1['id'],_0x3b71e1);ChatInteractionEvents[_0xf16d('0xc')](_0x181367,_0x3b71e1);_0x3472c4(null);})[_0xf16d('0xd')](_0x3472c4(null));};}for(var e in events){if(events[_0xf16d('0xe')](e)){var event=events[e];ChatInteraction[_0xf16d('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x016e=['../../mysqldb','setMaxListeners','then','Users','setDataValue','unreadMessages','emit','exports'];(function(_0x23c45a,_0x3f81c4){var _0x3f7932=function(_0x284b62){while(--_0x284b62){_0x23c45a['push'](_0x23c45a['shift']());}};_0x3f7932(++_0x3f81c4);}(_0x016e,0x100));var _0xe016=function(_0x594dc7,_0x269225){_0x594dc7=_0x594dc7-0x0;var _0x2e287d=_0x016e[_0x594dc7];return _0x2e287d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xe016('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xe016('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe016('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x490787){return function(_0x5a0769,_0x375417,_0x38c81e){_0x5a0769['getUsers']({'attributes':['id'],'raw':!![]})[_0xe016('0x2')](function(_0x8ef383){_0x5a0769['setDataValue'](_0xe016('0x3'),_0x8ef383['map'](function(_0x26ee16){return{'id':_0x26ee16['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5a0769['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x329bac){_0x5a0769[_0xe016('0x4')](_0xe016('0x5'),_0x329bac['length']);ChatInteractionEvents[_0xe016('0x6')](_0x490787+':'+_0x5a0769['id'],_0x5a0769);ChatInteractionEvents[_0xe016('0x6')](_0x490787,_0x5a0769);_0x38c81e(null);})['catch'](_0x38c81e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xe016('0x7')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 72a3d7b..4076b3d 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 _0xbd32=['../../config/environment','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3490a4,_0x11bc5b){var _0x5504c4=function(_0x400b68){while(--_0x400b68){_0x3490a4['push'](_0x3490a4['shift']());}};_0x5504c4(++_0x11bc5b);}(_0xbd32,0x1d5));var _0x2bd3=function(_0x2a9f7c,_0x367208){_0x2a9f7c=_0x2a9f7c-0x0;var _0x466a1f=_0xbd32[_0x2a9f7c];return _0x466a1f;};'use strict';var _=require(_0x2bd3('0x0'));var util=require(_0x2bd3('0x1'));var logger=require(_0x2bd3('0x2'))(_0x2bd3('0x3'));var moment=require(_0x2bd3('0x4'));var BPromise=require(_0x2bd3('0x5'));var rp=require(_0x2bd3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2bd3('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x2bd3('0x8')]=function(_0x19e092,_0x21522b){return _0x19e092[_0x2bd3('0x9')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb10d1c,_0xac0e0f,_0x52baba){if(_0xb10d1c[_0x2bd3('0xa')](_0x2bd3('0xb'))){_0xb10d1c[_0x2bd3('0xc')]=moment()[_0x2bd3('0xd')](_0x2bd3('0xe'));}_0x52baba(null,_0xb10d1c);}},'charset':_0x2bd3('0xf'),'collate':_0x2bd3('0x10')});};
\ No newline at end of file
+var _0xed99=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','api','moment','bluebird','request-promise','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x1a1667,_0x2224b1){var _0x45a134=function(_0x362be7){while(--_0x362be7){_0x1a1667['push'](_0x1a1667['shift']());}};_0x45a134(++_0x2224b1);}(_0xed99,0x1e3));var _0x9ed9=function(_0x2c6b7c,_0x25e121){_0x2c6b7c=_0x2c6b7c-0x0;var _0x371c91=_0xed99[_0x2c6b7c];return _0x371c91;};'use strict';var _=require('lodash');var util=require(_0x9ed9('0x0'));var logger=require('../../config/logger')(_0x9ed9('0x1'));var moment=require(_0x9ed9('0x2'));var BPromise=require(_0x9ed9('0x3'));var rp=require(_0x9ed9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ed9('0x5'));var attributes=require(_0x9ed9('0x6'));module['exports']=function(_0xa82ce0,_0x43e988){return _0xa82ce0[_0x9ed9('0x7')](_0x9ed9('0x8'),attributes,{'tableName':_0x9ed9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c911a,_0x2444c7,_0x4ffcd2){if(_0x3c911a[_0x9ed9('0xa')](_0x9ed9('0xb'))){_0x3c911a[_0x9ed9('0xc')]=moment()[_0x9ed9('0xd')](_0x9ed9('0xe'));}_0x4ffcd2(null,_0x3c911a);}},'charset':_0x9ed9('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b474d33..3d3463c 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 _0x7a88=['code','ChatInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','raw','where','attributes','then','info','UpdateChatInteraction','debug','stringify','AddTagsToChatInteraction','ChatInteraction','addTags','omit','ids','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x7a88,0x1d9));var _0x87a8=function(_0x92b4dc,_0x20f18a){_0x92b4dc=_0x92b4dc-0x0;var _0xe68d92=_0x7a88[_0x92b4dc];return _0xe68d92;};'use strict';var _=require(_0x87a8('0x0'));var util=require(_0x87a8('0x1'));var moment=require(_0x87a8('0x2'));var BPromise=require('bluebird');var rs=require(_0x87a8('0x3'));var fs=require('fs');var Redis=require(_0x87a8('0x4'));var db=require(_0x87a8('0x5'))['db'];var utils=require(_0x87a8('0x6'));var logger=require(_0x87a8('0x7'))(_0x87a8('0x8'));var config=require(_0x87a8('0x9'));var jayson=require(_0x87a8('0xa'));var client=jayson[_0x87a8('0xb')][_0x87a8('0xc')]({'port':0x232a});config['redis']=_[_0x87a8('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x87a8('0xe'))(new Redis(config[_0x87a8('0xf')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x437fdd,_0x5672be,_0x437a09){return new BPromise(function(_0x435fa5,_0x415e35){return client['request'](_0x437fdd,_0x437a09)['then'](function(_0x49cc5f){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5672be,_0x87a8('0x10'));logger['debug'](_0x87a8('0x11'),_0x5672be,'request\x20sent',JSON['stringify'](_0x49cc5f));if(_0x49cc5f[_0x87a8('0x12')]){if(_0x49cc5f[_0x87a8('0x12')][_0x87a8('0x13')]===0x1f4){logger[_0x87a8('0x12')](_0x87a8('0x14'),_0x5672be,_0x49cc5f[_0x87a8('0x12')]['message']);return _0x415e35(_0x49cc5f[_0x87a8('0x12')][_0x87a8('0x15')]);}logger[_0x87a8('0x12')](_0x87a8('0x14'),_0x5672be,_0x49cc5f[_0x87a8('0x12')][_0x87a8('0x15')]);return _0x435fa5(_0x49cc5f[_0x87a8('0x12')]['message']);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5672be,_0x87a8('0x10'));_0x435fa5(_0x49cc5f[_0x87a8('0x16')]['message']);}})[_0x87a8('0x17')](function(_0x107a9a){logger['error'](_0x87a8('0x14'),_0x5672be,_0x107a9a);_0x415e35(_0x107a9a);});});}exports['UpdateChatInteraction']=function(_0x4050e0){var _0x40431a=this;return new Promise(function(_0x2987a8,_0x233a30){return db['ChatInteraction'][_0x87a8('0x18')](_0x4050e0[_0x87a8('0x19')],{'raw':_0x4050e0[_0x87a8('0x1a')]?_0x4050e0[_0x87a8('0x1a')][_0x87a8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4050e0[_0x87a8('0x1a')]?_0x4050e0['options'][_0x87a8('0x1c')]||null:null,'attributes':_0x4050e0['options']?_0x4050e0[_0x87a8('0x1a')][_0x87a8('0x1d')]||null:null,'limit':_0x4050e0[_0x87a8('0x1a')]?_0x4050e0[_0x87a8('0x1a')]['limit']||null:null})[_0x87a8('0x1e')](function(_0x2ebb46){logger[_0x87a8('0x1f')](_0x87a8('0x20'),_0x4050e0);logger[_0x87a8('0x21')](_0x87a8('0x20'),_0x4050e0,JSON[_0x87a8('0x22')](_0x2ebb46));_0x2987a8(_0x2ebb46);})[_0x87a8('0x17')](function(_0x1a07d3){logger[_0x87a8('0x12')](_0x87a8('0x20'),_0x1a07d3[_0x87a8('0x15')],_0x4050e0);_0x233a30(_0x40431a[_0x87a8('0x12')](0x1f4,_0x1a07d3[_0x87a8('0x15')]));});});};exports[_0x87a8('0x23')]=function(_0x4a7e7f){return new Promise(function(_0x2ec171,_0x56dc56){return db[_0x87a8('0x24')]['find']({'where':_0x4a7e7f['options']?_0x4a7e7f['options'][_0x87a8('0x1c')]||null:null})['then'](function(_0x130600){if(_0x130600){return _0x130600[_0x87a8('0x25')](_0x4a7e7f[_0x87a8('0x19')]['ids'],_[_0x87a8('0x26')](_0x4a7e7f[_0x87a8('0x19')],[_0x87a8('0x27'),'id'])||{});}})['spread'](function(_0x5580dd){logger['info']('AddTags',_0x4a7e7f);logger[_0x87a8('0x21')]('AddTags',_0x4a7e7f,JSON[_0x87a8('0x22')](_0x5580dd));_0x2ec171(_0x5580dd);})['catch'](function(_0x1c0913){logger['error'](_0x87a8('0x28'),_0x1c0913[_0x87a8('0x15')],_0x4a7e7f);_0x56dc56(_this[_0x87a8('0x12')](0x1f4,_0x1c0913['message']));});});};
\ No newline at end of file
+var _0x1f0a=['socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','find','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x15b653,_0x1a71d0){var _0x48f628=function(_0x109087){while(--_0x109087){_0x15b653['push'](_0x15b653['shift']());}};_0x48f628(++_0x1a71d0);}(_0x1f0a,0xdc));var _0xa1f0=function(_0xe3c18c,_0x4628bb){_0xe3c18c=_0xe3c18c-0x0;var _0x50ccd0=_0x1f0a[_0xe3c18c];return _0x50ccd0;};'use strict';var _=require(_0xa1f0('0x0'));var util=require(_0xa1f0('0x1'));var moment=require('moment');var BPromise=require(_0xa1f0('0x2'));var rs=require(_0xa1f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1f0('0x4'))['db'];var utils=require(_0xa1f0('0x5'));var logger=require(_0xa1f0('0x6'))(_0xa1f0('0x7'));var config=require(_0xa1f0('0x8'));var jayson=require(_0xa1f0('0x9'));var client=jayson[_0xa1f0('0xa')][_0xa1f0('0xb')]({'port':0x232a});config[_0xa1f0('0xc')]=_['defaults'](config['redis'],{'host':_0xa1f0('0xd'),'port':0x18eb});var socket=require(_0xa1f0('0xe'))(new Redis(config[_0xa1f0('0xc')]));require(_0xa1f0('0xf'))['register'](socket);function respondWithRpcPromise(_0x53390e,_0x447751,_0x2d5a4a){return new BPromise(function(_0x4c9c58,_0x13a960){return client[_0xa1f0('0x10')](_0x53390e,_0x2d5a4a)[_0xa1f0('0x11')](function(_0x250faf){logger[_0xa1f0('0x12')](_0xa1f0('0x13'),_0x447751,_0xa1f0('0x14'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x447751,_0xa1f0('0x14'),JSON[_0xa1f0('0x15')](_0x250faf));if(_0x250faf[_0xa1f0('0x16')]){if(_0x250faf['error']['code']===0x1f4){logger['error'](_0xa1f0('0x13'),_0x447751,_0x250faf[_0xa1f0('0x16')][_0xa1f0('0x17')]);return _0x13a960(_0x250faf[_0xa1f0('0x16')][_0xa1f0('0x17')]);}logger[_0xa1f0('0x16')](_0xa1f0('0x13'),_0x447751,_0x250faf[_0xa1f0('0x16')][_0xa1f0('0x17')]);return _0x4c9c58(_0x250faf[_0xa1f0('0x16')][_0xa1f0('0x17')]);}else{logger[_0xa1f0('0x12')](_0xa1f0('0x13'),_0x447751,_0xa1f0('0x14'));_0x4c9c58(_0x250faf[_0xa1f0('0x18')][_0xa1f0('0x17')]);}})[_0xa1f0('0x19')](function(_0x3bca77){logger[_0xa1f0('0x16')](_0xa1f0('0x13'),_0x447751,_0x3bca77);_0x13a960(_0x3bca77);});});}exports['UpdateChatInteraction']=function(_0x712456){var _0x471817=this;return new Promise(function(_0x3977ef,_0x44e9ad){return db[_0xa1f0('0x1a')][_0xa1f0('0x1b')](_0x712456[_0xa1f0('0x1c')],{'raw':_0x712456['options']?_0x712456[_0xa1f0('0x1d')][_0xa1f0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x712456[_0xa1f0('0x1d')]?_0x712456[_0xa1f0('0x1d')][_0xa1f0('0x1f')]||null:null,'attributes':_0x712456['options']?_0x712456['options'][_0xa1f0('0x20')]||null:null,'limit':_0x712456[_0xa1f0('0x1d')]?_0x712456[_0xa1f0('0x1d')][_0xa1f0('0x21')]||null:null})['then'](function(_0x7aaa14){logger[_0xa1f0('0x12')](_0xa1f0('0x22'),_0x712456);logger['debug'](_0xa1f0('0x22'),_0x712456,JSON[_0xa1f0('0x15')](_0x7aaa14));_0x3977ef(_0x7aaa14);})['catch'](function(_0x5e2b88){logger[_0xa1f0('0x16')]('UpdateChatInteraction',_0x5e2b88['message'],_0x712456);_0x44e9ad(_0x471817[_0xa1f0('0x16')](0x1f4,_0x5e2b88[_0xa1f0('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x3bcd92){return new Promise(function(_0x4d0dc2,_0x15bb0f){return db[_0xa1f0('0x1a')][_0xa1f0('0x23')]({'where':_0x3bcd92['options']?_0x3bcd92[_0xa1f0('0x1d')][_0xa1f0('0x1f')]||null:null})[_0xa1f0('0x11')](function(_0x2e2933){if(_0x2e2933){return _0x2e2933['addTags'](_0x3bcd92[_0xa1f0('0x1c')][_0xa1f0('0x24')],_['omit'](_0x3bcd92['body'],[_0xa1f0('0x24'),'id'])||{});}})[_0xa1f0('0x25')](function(_0x1ebba2){logger[_0xa1f0('0x12')](_0xa1f0('0x26'),_0x3bcd92);logger['debug'](_0xa1f0('0x26'),_0x3bcd92,JSON[_0xa1f0('0x15')](_0x1ebba2));_0x4d0dc2(_0x1ebba2);})[_0xa1f0('0x19')](function(_0x5ae79b){logger[_0xa1f0('0x16')]('AddTags',_0x5ae79b[_0xa1f0('0x17')],_0x3bcd92);_0x15bb0f(_this[_0xa1f0('0x16')](0x1f4,_0x5ae79b[_0xa1f0('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 1ba4449..d064e70 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 _0x3f04=['register','chatInteraction:','./chatInteraction.events','save','remove','emit','removeListener'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x3f04,0xd4));var _0x43f0=function(_0x3e8384,_0x1a7869){_0x3e8384=_0x3e8384-0x0;var _0xddc3eb=_0x3f04[_0x3e8384];return _0xddc3eb;};'use strict';var ChatInteractionEvents=require(_0x43f0('0x0'));var events=[_0x43f0('0x1'),_0x43f0('0x2'),'update'];function createListener(_0x56082c,_0x6f7e8c){return function(_0x312665){_0x6f7e8c[_0x43f0('0x3')](_0x56082c,_0x312665);};}function removeListener(_0x51bd36,_0x2ccd3c){return function(){ChatInteractionEvents[_0x43f0('0x4')](_0x51bd36,_0x2ccd3c);};}exports[_0x43f0('0x5')]=function(_0x253b37){for(var _0x2420dc=0x0,_0x526c77=events['length'];_0x2420dc<_0x526c77;_0x2420dc++){var _0xcd0dd=events[_0x2420dc];var _0x158860=createListener(_0x43f0('0x6')+_0xcd0dd,_0x253b37);ChatInteractionEvents['on'](_0xcd0dd,_0x158860);}};
\ No newline at end of file
+var _0x09b2=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x212337,_0x171d35){var _0x37be7d=function(_0x4fac79){while(--_0x4fac79){_0x212337['push'](_0x212337['shift']());}};_0x37be7d(++_0x171d35);}(_0x09b2,0x150));var _0x209b=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x09b2[_0x10dc60];return _0x47dec5;};'use strict';var ChatInteractionEvents=require(_0x209b('0x0'));var events=[_0x209b('0x1'),_0x209b('0x2'),_0x209b('0x3')];function createListener(_0x5ac987,_0x33ae6d){return function(_0x20bcc5){_0x33ae6d[_0x209b('0x4')](_0x5ac987,_0x20bcc5);};}function removeListener(_0x2e7bf8,_0x3f3ffa){return function(){ChatInteractionEvents[_0x209b('0x5')](_0x2e7bf8,_0x3f3ffa);};}exports[_0x209b('0x6')]=function(_0x3a8835){for(var _0x48d409=0x0,_0x2701a7=events[_0x209b('0x7')];_0x48d409<_0x2701a7;_0x48d409++){var _0x58803=events[_0x48d409];var _0x57fb0f=createListener(_0x209b('0x8')+_0x58803,_0x3a8835);ChatInteractionEvents['on'](_0x58803,_0x57fb0f);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 5202be3..4585661 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 _0xcd22=['download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xcd22,0x18c));var _0x2cd2=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0xcd22[_0x4d67b8];return _0x55af3b;};'use strict';var multer=require(_0x2cd2('0x0'));var util=require('util');var path=require(_0x2cd2('0x1'));var timeout=require(_0x2cd2('0x2'));var express=require(_0x2cd2('0x3'));var router=express[_0x2cd2('0x4')]();var fs_extra=require(_0x2cd2('0x5'));var auth=require(_0x2cd2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2cd2('0x7'));var controller=require(_0x2cd2('0x8'));router[_0x2cd2('0x9')]('/',auth[_0x2cd2('0xa')](),controller[_0x2cd2('0xb')]);router[_0x2cd2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2cd2('0xc')]);router[_0x2cd2('0x9')](_0x2cd2('0xd'),auth[_0x2cd2('0xe')](),controller[_0x2cd2('0xf')]);router[_0x2cd2('0x9')](_0x2cd2('0x10'),auth[_0x2cd2('0xe')](),controller[_0x2cd2('0x11')]);router[_0x2cd2('0x9')](_0x2cd2('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0x2cd2('0x9')]('/:id/my_messages',auth[_0x2cd2('0xe')](),controller[_0x2cd2('0x13')]);router['get']('/:id/download',auth[_0x2cd2('0xa')](),controller[_0x2cd2('0x14')]);router[_0x2cd2('0x15')]('/',auth[_0x2cd2('0xa')](),controller[_0x2cd2('0x16')]);router[_0x2cd2('0x15')](_0x2cd2('0x17'),auth[_0x2cd2('0xa')](),controller[_0x2cd2('0x18')]);var upload=multer({'storage':multer[_0x2cd2('0x19')]({'destination':function(_0x35bf5f,_0x293f8d,_0x1bfc07){_0x1bfc07(null,path[_0x2cd2('0x1a')](config['root'],_0x2cd2('0x1b')));},'filename':function(_0x5c58e3,_0x1e318d,_0x235b7e){_0x235b7e(null,util[_0x2cd2('0x1c')](_0x2cd2('0x1d'),Date[_0x2cd2('0x1e')](),_0x1e318d[_0x2cd2('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2cd2('0x15')](_0x2cd2('0x20'),upload[_0x2cd2('0x21')](_0x2cd2('0x22')),controller['attachmentUpload']);router[_0x2cd2('0x15')](_0x2cd2('0x12'),auth[_0x2cd2('0xe')](),controller[_0x2cd2('0x23')]);router[_0x2cd2('0x15')](_0x2cd2('0x24'),auth[_0x2cd2('0xa')](),interaction['tracked'](_0x2cd2('0x25'),_0x2cd2('0x26')),controller[_0x2cd2('0x27')]);router[_0x2cd2('0x28')](_0x2cd2('0xd'),auth['isAuthenticated'](),interaction[_0x2cd2('0x29')](_0x2cd2('0x25'),_0x2cd2('0x2a')),controller['update']);router[_0x2cd2('0x28')](_0x2cd2('0x2b'),controller[_0x2cd2('0x2c')]);router['put'](_0x2cd2('0x2d'),auth[_0x2cd2('0xe')](),controller[_0x2cd2('0x2e')]);router['put'](_0x2cd2('0x2f'),controller['close']);router[_0x2cd2('0x30')](_0x2cd2('0xd'),auth[_0x2cd2('0xa')](),interaction['tracked']('chat',_0x2cd2('0x31')),controller[_0x2cd2('0x32')]);router['delete']('/:id/tags',auth[_0x2cd2('0xa')](),controller['removeTags']);module[_0x2cd2('0x33')]=router;
\ No newline at end of file
+var _0x32ac=['tracked','chat','chatinteraction:addtags','put','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x32ac,0xd8));var _0xc32a=function(_0x5078af,_0x51ac71){_0x5078af=_0x5078af-0x0;var _0x5a180f=_0x32ac[_0x5078af];return _0x5a180f;};'use strict';var multer=require(_0xc32a('0x0'));var util=require(_0xc32a('0x1'));var path=require(_0xc32a('0x2'));var timeout=require(_0xc32a('0x3'));var express=require('express');var router=express[_0xc32a('0x4')]();var fs_extra=require(_0xc32a('0x5'));var auth=require(_0xc32a('0x6'));var interaction=require(_0xc32a('0x7'));var config=require(_0xc32a('0x8'));var controller=require(_0xc32a('0x9'));router['get']('/',auth[_0xc32a('0xa')](),controller[_0xc32a('0xb')]);router[_0xc32a('0xc')](_0xc32a('0xd'),auth[_0xc32a('0xa')](),controller[_0xc32a('0xe')]);router['get'](_0xc32a('0xf'),auth[_0xc32a('0x10')](),controller[_0xc32a('0x11')]);router['get']('/:id/attachment_download',auth[_0xc32a('0x10')](),controller[_0xc32a('0x12')]);router[_0xc32a('0xc')](_0xc32a('0x13'),auth[_0xc32a('0xa')](),controller[_0xc32a('0x14')]);router[_0xc32a('0xc')](_0xc32a('0x15'),auth[_0xc32a('0x10')](),controller[_0xc32a('0x16')]);router['get'](_0xc32a('0x17'),auth['isAuthenticated'](),controller[_0xc32a('0x18')]);router[_0xc32a('0x19')]('/',auth[_0xc32a('0xa')](),controller[_0xc32a('0x1a')]);router[_0xc32a('0x19')](_0xc32a('0x1b'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2682c2,_0x524456,_0x87ae48){_0x87ae48(null,path[_0xc32a('0x1c')](config['root'],_0xc32a('0x1d')));},'filename':function(_0x988d9c,_0x3c981d,_0x535ffc){_0x535ffc(null,util[_0xc32a('0x1e')]('%s-%s',Date[_0xc32a('0x1f')](),_0x3c981d[_0xc32a('0x20')][_0xc32a('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xc32a('0x22'),upload[_0xc32a('0x23')](_0xc32a('0x24')),controller[_0xc32a('0x25')]);router['post'](_0xc32a('0x13'),auth[_0xc32a('0x10')](),controller[_0xc32a('0x26')]);router[_0xc32a('0x19')]('/:id/tags',auth[_0xc32a('0xa')](),interaction[_0xc32a('0x27')](_0xc32a('0x28'),_0xc32a('0x29')),controller['addTags']);router[_0xc32a('0x2a')]('/:id',auth[_0xc32a('0xa')](),interaction['tracked'](_0xc32a('0x28'),'chatinteraction:update'),controller['update']);router[_0xc32a('0x2a')]('/:id/custom_update',controller[_0xc32a('0x2b')]);router['put'](_0xc32a('0x2c'),auth[_0xc32a('0x10')](),controller[_0xc32a('0x2d')]);router[_0xc32a('0x2a')](_0xc32a('0x2e'),controller[_0xc32a('0x2f')]);router[_0xc32a('0x30')](_0xc32a('0xf'),auth[_0xc32a('0xa')](),interaction['tracked'](_0xc32a('0x28'),'chatinteraction:destroy'),controller[_0xc32a('0x31')]);router[_0xc32a('0x30')]('/:id/tags',auth[_0xc32a('0xa')](),controller['removeTags']);module[_0xc32a('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 6ccefda..33f33f6 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 _0x2d2b=['BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x2d2b,0x82));var _0xb2d2=function(_0xb51b1,_0x11c8b8){_0xb51b1=_0xb51b1-0x0;var _0x3bbf58=_0x2d2b[_0xb51b1];return _0x3bbf58;};'use strict';var Sequelize=require(_0xb2d2('0x0'));module['exports']={'body':{'type':Sequelize[_0xb2d2('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb2d2('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb2d2('0x3')]}};
\ No newline at end of file
+var _0x750e=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x15f236,_0x59a12b){var _0x3645c0=function(_0x574879){while(--_0x574879){_0x15f236['push'](_0x15f236['shift']());}};_0x3645c0(++_0x59a12b);}(_0x750e,0x108));var _0xe750=function(_0x4b5b9b,_0x363731){_0x4b5b9b=_0x4b5b9b-0x0;var _0x1ae607=_0x750e[_0x4b5b9b];return _0x1ae607;};'use strict';var Sequelize=require(_0xe750('0x0'));module[_0xe750('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe750('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe750('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe750('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ab3eda1..b66276b 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 _0x47c7=['to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','describe','get','messages','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','role','UserProfileSection','userProfileId','autoAssociation','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox'];(function(_0x3dbf54,_0x5dc6c9){var _0x3cd01f=function(_0x1ebff8){while(--_0x1ebff8){_0x3dbf54['push'](_0x3dbf54['shift']());}};_0x3cd01f(++_0x5dc6c9);}(_0x47c7,0xc2));var _0x747c=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x47c7[_0x5627e1];return _0x2f013f;};'use strict';var emlformat=require(_0x747c('0x0'));var rimraf=require(_0x747c('0x1'));var zipdir=require(_0x747c('0x2'));var jsonpatch=require(_0x747c('0x3'));var rp=require('request-promise');var moment=require(_0x747c('0x4'));var BPromise=require(_0x747c('0x5'));var Mustache=require(_0x747c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x747c('0x7'));var csv=require(_0x747c('0x8'));var ejs=require(_0x747c('0x9'));var fs=require('fs');var fs_extra=require(_0x747c('0xa'));var _=require(_0x747c('0xb'));var squel=require('squel');var crypto=require(_0x747c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x747c('0xd'));var toCsv=require(_0x747c('0x8'));var querystring=require(_0x747c('0xe'));var Papa=require('papaparse');var Redis=require(_0x747c('0xf'));var authService=require(_0x747c('0x10'));var qs=require(_0x747c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x747c('0x12'))('api');var utils=require(_0x747c('0x13'));var config=require(_0x747c('0x14'));var licenseUtil=require(_0x747c('0x15'));var db=require(_0x747c('0x16'))['db'];config[_0x747c('0x17')]=_['defaults'](config[_0x747c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x747c('0x18'))(new Redis(config[_0x747c('0x17')]));require('./chatInternalMessage.socket')[_0x747c('0x19')](socket);function respondWithStatusCode(_0x11aa4d,_0x5c61dc){_0x5c61dc=_0x5c61dc||0xcc;return function(_0x4d4d4f){if(_0x4d4d4f){return _0x11aa4d[_0x747c('0x1a')](_0x5c61dc);}return _0x11aa4d[_0x747c('0x1b')](_0x5c61dc)[_0x747c('0x1c')]();};}function respondWithResult(_0x5eb4c0,_0x4aba3d){_0x4aba3d=_0x4aba3d||0xc8;return function(_0x550cef){if(_0x550cef){return _0x5eb4c0['status'](_0x4aba3d)[_0x747c('0x1d')](_0x550cef);}};}function respondWithFilteredResult(_0x240e6e,_0x4dbc24){return function(_0x509564){if(_0x509564){var _0x5d36dd=typeof _0x4dbc24[_0x747c('0x1e')]===_0x747c('0x1f')&&typeof _0x4dbc24[_0x747c('0x20')]===_0x747c('0x1f');var _0xcf5fcb=_0x509564[_0x747c('0x21')];var _0x25bc85=_0x5d36dd?0x0:_0x4dbc24[_0x747c('0x1e')];var _0x382fb9=_0x5d36dd?_0x509564[_0x747c('0x21')]:_0x4dbc24['offset']+_0x4dbc24[_0x747c('0x20')];var _0x2a2369;if(_0x382fb9>=_0xcf5fcb){_0x382fb9=_0xcf5fcb;_0x2a2369=0xc8;}else{_0x2a2369=0xce;}_0x240e6e[_0x747c('0x1b')](_0x2a2369);return _0x240e6e[_0x747c('0x22')](_0x747c('0x23'),_0x25bc85+'-'+_0x382fb9+'/'+_0xcf5fcb)[_0x747c('0x1d')](_0x509564);}return null;};}function patchUpdates(_0x3fb0d5){return function(_0x5be6e8){try{jsonpatch[_0x747c('0x24')](_0x5be6e8,_0x3fb0d5,!![]);}catch(_0x1ecda0){return BPromise['reject'](_0x1ecda0);}return _0x5be6e8[_0x747c('0x25')]();};}function saveUpdates(_0x5245a6,_0x34d992){return function(_0x137fcc){if(_0x137fcc){return _0x137fcc[_0x747c('0x26')](_0x5245a6)[_0x747c('0x27')](function(_0x411d93){return _0x411d93;});}return null;};}function removeEntity(_0x2182a9,_0x56a6d7){return function(_0x1c3c49){if(_0x1c3c49){return _0x1c3c49['destroy']()[_0x747c('0x27')](function(){_0x2182a9['status'](0xcc)[_0x747c('0x1c')]();});}};}function handleEntityNotFound(_0x2dbf2c,_0x5e2f33){return function(_0x451cde){if(!_0x451cde){_0x2dbf2c[_0x747c('0x1a')](0x194);}return _0x451cde;};}function handleError(_0x43a544,_0x12d3f0){_0x12d3f0=_0x12d3f0||0x1f4;return function(_0x3b2b4b){logger[_0x747c('0x28')](_0x3b2b4b[_0x747c('0x29')]);if(_0x3b2b4b[_0x747c('0x2a')]){delete _0x3b2b4b[_0x747c('0x2a')];}_0x43a544[_0x747c('0x1b')](_0x12d3f0)['send'](_0x3b2b4b);};}exports['index']=function(_0x2ef85f,_0x3d07cf){var _0x5b5966={},_0x20da09={},_0xfa56d8={'count':0x0,'rows':[]};var _0x50d6be=_[_0x747c('0x2b')](db[_0x747c('0x2c')][_0x747c('0x2d')],function(_0x11ed70){return{'name':_0x11ed70[_0x747c('0x2e')],'type':_0x11ed70[_0x747c('0x2f')]['key']};});_0x20da09[_0x747c('0x30')]=_[_0x747c('0x2b')](_0x50d6be,'name');_0x20da09['query']=_[_0x747c('0x31')](_0x2ef85f[_0x747c('0x32')]);_0x20da09[_0x747c('0x33')]=_[_0x747c('0x34')](_0x20da09[_0x747c('0x30')],_0x20da09[_0x747c('0x32')]);_0x5b5966['attributes']=_[_0x747c('0x34')](_0x20da09[_0x747c('0x30')],qs[_0x747c('0x35')](_0x2ef85f[_0x747c('0x32')][_0x747c('0x35')]));_0x5b5966[_0x747c('0x36')]=_0x5b5966[_0x747c('0x36')][_0x747c('0x37')]?_0x5b5966[_0x747c('0x36')]:_0x20da09[_0x747c('0x30')];if(!_0x2ef85f[_0x747c('0x32')]['hasOwnProperty']('nolimit')){_0x5b5966[_0x747c('0x20')]=qs[_0x747c('0x20')](_0x2ef85f['query'][_0x747c('0x20')]);_0x5b5966[_0x747c('0x1e')]=qs['offset'](_0x2ef85f['query'][_0x747c('0x1e')]);}_0x5b5966['order']=qs['sort'](_0x2ef85f['query'][_0x747c('0x38')]);_0x5b5966[_0x747c('0x39')]=qs[_0x747c('0x33')](_['pick'](_0x2ef85f[_0x747c('0x32')],_0x20da09[_0x747c('0x33')]),_0x50d6be);if(_0x2ef85f[_0x747c('0x32')][_0x747c('0x3a')]){_0x5b5966[_0x747c('0x39')]=_['merge'](_0x5b5966['where'],{'$or':_['map'](_0x50d6be,function(_0x2827b8){if(_0x2827b8[_0x747c('0x2f')]!==_0x747c('0x3b')){var _0x1a4d0f={};_0x1a4d0f[_0x2827b8[_0x747c('0x2a')]]={'$like':'%'+_0x2ef85f[_0x747c('0x32')][_0x747c('0x3a')]+'%'};return _0x1a4d0f;}})});}_0x5b5966=_[_0x747c('0x3c')]({},_0x5b5966,_0x2ef85f[_0x747c('0x3d')]);var _0x213f38={'where':_0x5b5966[_0x747c('0x39')]};return db[_0x747c('0x2c')][_0x747c('0x21')](_0x213f38)[_0x747c('0x27')](function(_0xa662c0){_0xfa56d8[_0x747c('0x21')]=_0xa662c0;if(_0x2ef85f[_0x747c('0x32')]['includeAll']){_0x5b5966[_0x747c('0x3e')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x747c('0x3f')](_0x5b5966);})[_0x747c('0x27')](function(_0x5b4411){_0xfa56d8[_0x747c('0x40')]=_0x5b4411;return _0xfa56d8;})[_0x747c('0x27')](respondWithFilteredResult(_0x3d07cf,_0x5b5966))[_0x747c('0x41')](handleError(_0x3d07cf,null));};exports['show']=function(_0x25f84b,_0x20e65d){var _0x33ce9f={'raw':!![],'where':{'id':_0x25f84b[_0x747c('0x42')]['id']}},_0x250aab={};_0x250aab[_0x747c('0x30')]=_[_0x747c('0x31')](db[_0x747c('0x2c')][_0x747c('0x2d')]);_0x250aab[_0x747c('0x32')]=_[_0x747c('0x31')](_0x25f84b[_0x747c('0x32')]);_0x250aab[_0x747c('0x33')]=_[_0x747c('0x34')](_0x250aab['model'],_0x250aab[_0x747c('0x32')]);_0x33ce9f[_0x747c('0x36')]=_[_0x747c('0x34')](_0x250aab[_0x747c('0x30')],qs[_0x747c('0x35')](_0x25f84b[_0x747c('0x32')]['fields']));_0x33ce9f[_0x747c('0x36')]=_0x33ce9f[_0x747c('0x36')]['length']?_0x33ce9f['attributes']:_0x250aab[_0x747c('0x30')];if(_0x25f84b[_0x747c('0x32')][_0x747c('0x43')]){_0x33ce9f['include']=[{'all':!![]}];}_0x33ce9f=_[_0x747c('0x3c')]({},_0x33ce9f,_0x25f84b[_0x747c('0x3d')]);return db[_0x747c('0x2c')][_0x747c('0x44')](_0x33ce9f)['then'](handleEntityNotFound(_0x20e65d,null))['then'](respondWithResult(_0x20e65d,null))[_0x747c('0x41')](handleError(_0x20e65d,null));};exports[_0x747c('0x45')]=function(_0x3f509b,_0x1513d2){return db[_0x747c('0x2c')]['create'](_0x3f509b[_0x747c('0x46')],{})['then'](respondWithResult(_0x1513d2,0xc9))[_0x747c('0x41')](handleError(_0x1513d2,null));};exports['update']=function(_0x469d5f,_0x5ebdd9){if(_0x469d5f[_0x747c('0x46')]['id']){delete _0x469d5f['body']['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x469d5f['params']['id']}})[_0x747c('0x27')](handleEntityNotFound(_0x5ebdd9,null))['then'](saveUpdates(_0x469d5f['body'],null))[_0x747c('0x27')](respondWithResult(_0x5ebdd9,null))[_0x747c('0x41')](handleError(_0x5ebdd9,null));};exports[_0x747c('0x47')]=function(_0x31ea3,_0x3faa4c){return db[_0x747c('0x2c')]['find']({'where':{'id':_0x31ea3[_0x747c('0x42')]['id']}})[_0x747c('0x27')](handleEntityNotFound(_0x3faa4c,null))[_0x747c('0x27')](removeEntity(_0x3faa4c,null))[_0x747c('0x41')](handleError(_0x3faa4c,null));};exports['describe']=function(_0x2a41ae,_0x4399cc){return db[_0x747c('0x2c')][_0x747c('0x48')]()['then'](respondWithResult(_0x4399cc,null))[_0x747c('0x41')](handleError(_0x4399cc,null));};function wrapUser(_0x4242ac){return function(_0x4514fc){var _0x3a6f6f=_0x4242ac[_0x747c('0x49')]({'plain':!![]});_0x3a6f6f[_0x747c('0x4a')]=[];if(_0x4514fc){_0x3a6f6f['lastMessageAt']=_0x4514fc[_0x747c('0x4b')];_0x3a6f6f[_0x747c('0x4c')]=_0x4514fc;}else{_0x3a6f6f['lastMessageAt']=moment(0x0)[_0x747c('0x4d')](_0x747c('0x4e'));_0x3a6f6f['lastMessage']={};}return _0x3a6f6f;};}exports[_0x747c('0x4f')]=function(_0x573f03,_0x52f54a,_0x5ec490){var _0x2f7c39=[];return db[_0x747c('0x50')][_0x747c('0x3f')]({'where':{'role':[_0x747c('0x51'),_0x747c('0x52'),_0x747c('0x53')]},'attributes':['id','fullname',_0x747c('0x2a'),'role',_0x747c('0x54'),_0x747c('0x55'),_0x747c('0x56'),_0x747c('0x57'),_0x747c('0x58'),'showWebBar'],'order':qs['sort'](_0x747c('0x59')),'include':[{'model':db[_0x747c('0x5a')],'as':_0x747c('0x5b'),'attributes':['id','name',_0x747c('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x115a11){if(_0x115a11){var _0x17e4fd=_0x573f03['user'][_0x747c('0x49')]({'plain':!![]});if(!_0x17e4fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17e4fd[_0x747c('0x5c')]===_0x747c('0x53')){return db[_0x747c('0x5d')][_0x747c('0x44')]({'where':{'name':'Agents','userProfileId':_0x17e4fd[_0x747c('0x5e')]},'raw':!![]})['then'](function(_0x2abca2){if(_0x2abca2){if(_0x2abca2[_0x747c('0x5f')]===0x0){return db['UserProfileResource'][_0x747c('0x3f')]({'where':{'sectionId':_0x2abca2['id']},'raw':!![]})['then'](function(_0x423675){var _0x1ab706=[];if(_['isEmpty'](_0x423675)){_0x1ab706=_[_0x747c('0x3a')](_0x115a11,function(_0x5552d1){if(_0x5552d1[_0x747c('0x5c')]!==_0x747c('0x51')){return _0x5552d1;}});return _0x1ab706;}else{for(var _0xf5f73b=0x0;_0xf5f73b<_0x115a11[_0x747c('0x37')];_0xf5f73b++){var _0x44a561=_0x115a11[_0xf5f73b];if(_0x44a561['role']===_0x747c('0x51')){var _0x3b7562=_['find'](_0x423675,function(_0x52d835){return _0x52d835['resourceId']===_0x44a561['id'];});if(_0x3b7562)_0x1ab706[_0x747c('0x60')](_0x44a561);}else{_0x1ab706[_0x747c('0x60')](_0x44a561);}}return _0x1ab706;}});}else{return _0x115a11;}}else{var _0x55b5a6=_['filter'](_0x115a11,function(_0x14774a){if(_0x14774a[_0x747c('0x5c')]!==_0x747c('0x51')){return _0x14774a;}});return _0x55b5a6;}});}else{return _0x115a11;}}})[_0x747c('0x27')](function(_0x378f74){var _0x39064c=[];if(_0x378f74){_0x2f7c39=_0x378f74;for(var _0x377ac9=0x0;_0x377ac9<_0x378f74['length'];_0x377ac9+=0x1){_0x2f7c39[_0x377ac9][_0x747c('0x4a')]=[];_0x39064c[_0x747c('0x60')](db['ChatInternalMessage'][_0x747c('0x44')]({'where':{'FromId':[_0x573f03[_0x747c('0x53')]['id'],_0x378f74[_0x377ac9]['id']],'ToId':[_0x573f03['user']['id'],_0x378f74[_0x377ac9]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x747c('0x61'),_0x747c('0x62'),_0x747c('0x63'),_0x747c('0x46')],'order':qs[_0x747c('0x38')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x747c('0x27')](wrapUser(_0x378f74[_0x377ac9])));}return BPromise[_0x747c('0x64')](_0x39064c);}return[];})['then'](function(_0x4e8ce9){return{'rows':_0x4e8ce9,'count':_0x4e8ce9[_0x747c('0x37')]};})[_0x747c('0x27')](respondWithResult(_0x52f54a,null))[_0x747c('0x41')](handleError(_0x52f54a,null));};
\ No newline at end of file
+var _0xf438=['include','rows','show','params','length','find','catch','create','body','describe','get','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','fullname','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','findAll','isEmpty','role','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','ChatInternalMessage','rawAttributes','type','key','query','keys','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll'];(function(_0x424e80,_0x2044fd){var _0x3569c3=function(_0x56e5e5){while(--_0x56e5e5){_0x424e80['push'](_0x424e80['shift']());}};_0x3569c3(++_0x2044fd);}(_0xf438,0x102));var _0x8f43=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xf438[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0x8f43('0x0'));var rimraf=require(_0x8f43('0x1'));var zipdir=require(_0x8f43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f43('0x3'));var moment=require('moment');var BPromise=require(_0x8f43('0x4'));var Mustache=require(_0x8f43('0x5'));var util=require(_0x8f43('0x6'));var path=require(_0x8f43('0x7'));var sox=require(_0x8f43('0x8'));var csv=require(_0x8f43('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f43('0xa'));var _=require(_0x8f43('0xb'));var squel=require(_0x8f43('0xc'));var crypto=require('crypto');var jsforce=require(_0x8f43('0xd'));var deskjs=require(_0x8f43('0xe'));var toCsv=require(_0x8f43('0x9'));var querystring=require(_0x8f43('0xf'));var Papa=require(_0x8f43('0x10'));var Redis=require('ioredis');var authService=require(_0x8f43('0x11'));var qs=require(_0x8f43('0x12'));var as=require(_0x8f43('0x13'));var hardwareService=require(_0x8f43('0x14'));var logger=require('../../config/logger')(_0x8f43('0x15'));var utils=require(_0x8f43('0x16'));var config=require(_0x8f43('0x17'));var licenseUtil=require(_0x8f43('0x18'));var db=require(_0x8f43('0x19'))['db'];config['redis']=_[_0x8f43('0x1a')](config[_0x8f43('0x1b')],{'host':_0x8f43('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f43('0x1b')]));require(_0x8f43('0x1d'))[_0x8f43('0x1e')](socket);function respondWithStatusCode(_0x1c9dc4,_0xf4bb66){_0xf4bb66=_0xf4bb66||0xcc;return function(_0x5a8068){if(_0x5a8068){return _0x1c9dc4[_0x8f43('0x1f')](_0xf4bb66);}return _0x1c9dc4[_0x8f43('0x20')](_0xf4bb66)[_0x8f43('0x21')]();};}function respondWithResult(_0x325f21,_0x1c629a){_0x1c629a=_0x1c629a||0xc8;return function(_0x5cced7){if(_0x5cced7){return _0x325f21[_0x8f43('0x20')](_0x1c629a)['json'](_0x5cced7);}};}function respondWithFilteredResult(_0x26671a,_0x47f094){return function(_0x5ae9a9){if(_0x5ae9a9){var _0x322e4e=typeof _0x47f094['offset']==='undefined'&&typeof _0x47f094[_0x8f43('0x22')]===_0x8f43('0x23');var _0x4b8418=_0x5ae9a9['count'];var _0x474889=_0x322e4e?0x0:_0x47f094[_0x8f43('0x24')];var _0x17c9b2=_0x322e4e?_0x5ae9a9[_0x8f43('0x25')]:_0x47f094[_0x8f43('0x24')]+_0x47f094[_0x8f43('0x22')];var _0x110d0c;if(_0x17c9b2>=_0x4b8418){_0x17c9b2=_0x4b8418;_0x110d0c=0xc8;}else{_0x110d0c=0xce;}_0x26671a[_0x8f43('0x20')](_0x110d0c);return _0x26671a[_0x8f43('0x26')](_0x8f43('0x27'),_0x474889+'-'+_0x17c9b2+'/'+_0x4b8418)[_0x8f43('0x28')](_0x5ae9a9);}return null;};}function patchUpdates(_0xb73a49){return function(_0x15b77f){try{jsonpatch[_0x8f43('0x29')](_0x15b77f,_0xb73a49,!![]);}catch(_0x41d69f){return BPromise[_0x8f43('0x2a')](_0x41d69f);}return _0x15b77f[_0x8f43('0x2b')]();};}function saveUpdates(_0x3a0f5e,_0x33e690){return function(_0x38943c){if(_0x38943c){return _0x38943c[_0x8f43('0x2c')](_0x3a0f5e)[_0x8f43('0x2d')](function(_0x1440b6){return _0x1440b6;});}return null;};}function removeEntity(_0x26b5b5,_0x18ce84){return function(_0x4babf1){if(_0x4babf1){return _0x4babf1[_0x8f43('0x2e')]()[_0x8f43('0x2d')](function(){_0x26b5b5[_0x8f43('0x20')](0xcc)[_0x8f43('0x21')]();});}};}function handleEntityNotFound(_0x27608f,_0x3f8eee){return function(_0x38b87e){if(!_0x38b87e){_0x27608f[_0x8f43('0x1f')](0x194);}return _0x38b87e;};}function handleError(_0x526e1f,_0x458f91){_0x458f91=_0x458f91||0x1f4;return function(_0xcb38a0){logger['error'](_0xcb38a0[_0x8f43('0x2f')]);if(_0xcb38a0[_0x8f43('0x30')]){delete _0xcb38a0['name'];}_0x526e1f['status'](_0x458f91)[_0x8f43('0x31')](_0xcb38a0);};}exports['index']=function(_0x28401d,_0x46a525){var _0x1c836b={},_0x391b6f={},_0x14512e={'count':0x0,'rows':[]};var _0x44896a=_[_0x8f43('0x32')](db[_0x8f43('0x33')][_0x8f43('0x34')],function(_0x51ef14){return{'name':_0x51ef14['fieldName'],'type':_0x51ef14[_0x8f43('0x35')][_0x8f43('0x36')]};});_0x391b6f['model']=_['map'](_0x44896a,_0x8f43('0x30'));_0x391b6f[_0x8f43('0x37')]=_[_0x8f43('0x38')](_0x28401d[_0x8f43('0x37')]);_0x391b6f['filters']=_['intersection'](_0x391b6f['model'],_0x391b6f['query']);_0x1c836b['attributes']=_[_0x8f43('0x39')](_0x391b6f['model'],qs['fields'](_0x28401d[_0x8f43('0x37')][_0x8f43('0x3a')]));_0x1c836b[_0x8f43('0x3b')]=_0x1c836b[_0x8f43('0x3b')]['length']?_0x1c836b[_0x8f43('0x3b')]:_0x391b6f[_0x8f43('0x3c')];if(!_0x28401d[_0x8f43('0x37')][_0x8f43('0x3d')](_0x8f43('0x3e'))){_0x1c836b['limit']=qs[_0x8f43('0x22')](_0x28401d[_0x8f43('0x37')][_0x8f43('0x22')]);_0x1c836b[_0x8f43('0x24')]=qs['offset'](_0x28401d[_0x8f43('0x37')][_0x8f43('0x24')]);}_0x1c836b[_0x8f43('0x3f')]=qs[_0x8f43('0x40')](_0x28401d[_0x8f43('0x37')]['sort']);_0x1c836b[_0x8f43('0x41')]=qs[_0x8f43('0x42')](_['pick'](_0x28401d[_0x8f43('0x37')],_0x391b6f['filters']),_0x44896a);if(_0x28401d['query'][_0x8f43('0x43')]){_0x1c836b['where']=_['merge'](_0x1c836b[_0x8f43('0x41')],{'$or':_[_0x8f43('0x32')](_0x44896a,function(_0x596df3){if(_0x596df3[_0x8f43('0x35')]!==_0x8f43('0x44')){var _0x475e58={};_0x475e58[_0x596df3['name']]={'$like':'%'+_0x28401d[_0x8f43('0x37')][_0x8f43('0x43')]+'%'};return _0x475e58;}})});}_0x1c836b=_[_0x8f43('0x45')]({},_0x1c836b,_0x28401d[_0x8f43('0x46')]);var _0x536f6d={'where':_0x1c836b['where']};return db[_0x8f43('0x33')]['count'](_0x536f6d)[_0x8f43('0x2d')](function(_0x231488){_0x14512e[_0x8f43('0x25')]=_0x231488;if(_0x28401d[_0x8f43('0x37')][_0x8f43('0x47')]){_0x1c836b[_0x8f43('0x48')]=[{'all':!![]}];}return db[_0x8f43('0x33')]['findAll'](_0x1c836b);})['then'](function(_0x260410){_0x14512e[_0x8f43('0x49')]=_0x260410;return _0x14512e;})[_0x8f43('0x2d')](respondWithFilteredResult(_0x46a525,_0x1c836b))['catch'](handleError(_0x46a525,null));};exports[_0x8f43('0x4a')]=function(_0x214650,_0x46cafc){var _0x14fa12={'raw':!![],'where':{'id':_0x214650[_0x8f43('0x4b')]['id']}},_0x336fcb={};_0x336fcb['model']=_[_0x8f43('0x38')](db[_0x8f43('0x33')][_0x8f43('0x34')]);_0x336fcb[_0x8f43('0x37')]=_[_0x8f43('0x38')](_0x214650[_0x8f43('0x37')]);_0x336fcb['filters']=_[_0x8f43('0x39')](_0x336fcb[_0x8f43('0x3c')],_0x336fcb[_0x8f43('0x37')]);_0x14fa12[_0x8f43('0x3b')]=_[_0x8f43('0x39')](_0x336fcb[_0x8f43('0x3c')],qs['fields'](_0x214650[_0x8f43('0x37')][_0x8f43('0x3a')]));_0x14fa12[_0x8f43('0x3b')]=_0x14fa12[_0x8f43('0x3b')][_0x8f43('0x4c')]?_0x14fa12['attributes']:_0x336fcb[_0x8f43('0x3c')];if(_0x214650[_0x8f43('0x37')][_0x8f43('0x47')]){_0x14fa12[_0x8f43('0x48')]=[{'all':!![]}];}_0x14fa12=_[_0x8f43('0x45')]({},_0x14fa12,_0x214650[_0x8f43('0x46')]);return db[_0x8f43('0x33')][_0x8f43('0x4d')](_0x14fa12)[_0x8f43('0x2d')](handleEntityNotFound(_0x46cafc,null))[_0x8f43('0x2d')](respondWithResult(_0x46cafc,null))[_0x8f43('0x4e')](handleError(_0x46cafc,null));};exports[_0x8f43('0x4f')]=function(_0x273d79,_0x7f5b42){return db[_0x8f43('0x33')][_0x8f43('0x4f')](_0x273d79[_0x8f43('0x50')],{})['then'](respondWithResult(_0x7f5b42,0xc9))[_0x8f43('0x4e')](handleError(_0x7f5b42,null));};exports[_0x8f43('0x2c')]=function(_0x3ab66f,_0x47a516){if(_0x3ab66f['body']['id']){delete _0x3ab66f['body']['id'];}return db[_0x8f43('0x33')][_0x8f43('0x4d')]({'where':{'id':_0x3ab66f['params']['id']}})[_0x8f43('0x2d')](handleEntityNotFound(_0x47a516,null))[_0x8f43('0x2d')](saveUpdates(_0x3ab66f[_0x8f43('0x50')],null))['then'](respondWithResult(_0x47a516,null))[_0x8f43('0x4e')](handleError(_0x47a516,null));};exports[_0x8f43('0x2e')]=function(_0x7a6ffa,_0x236570){return db[_0x8f43('0x33')][_0x8f43('0x4d')]({'where':{'id':_0x7a6ffa[_0x8f43('0x4b')]['id']}})[_0x8f43('0x2d')](handleEntityNotFound(_0x236570,null))[_0x8f43('0x2d')](removeEntity(_0x236570,null))['catch'](handleError(_0x236570,null));};exports[_0x8f43('0x51')]=function(_0x37f9ca,_0x51c808){return db[_0x8f43('0x33')][_0x8f43('0x51')]()['then'](respondWithResult(_0x51c808,null))[_0x8f43('0x4e')](handleError(_0x51c808,null));};function wrapUser(_0x5d593d){return function(_0x1eae21){var _0x546d8e=_0x5d593d[_0x8f43('0x52')]({'plain':!![]});_0x546d8e['messages']=[];if(_0x1eae21){_0x546d8e['lastMessageAt']=_0x1eae21[_0x8f43('0x53')];_0x546d8e['lastMessage']=_0x1eae21;}else{_0x546d8e['lastMessageAt']=moment(0x0)[_0x8f43('0x54')](_0x8f43('0x55'));_0x546d8e['lastMessage']={};}return _0x546d8e;};}exports['getUsers']=function(_0x21b98a,_0x217c27,_0x1dd3e9){var _0x559b00=[];return db['User']['findAll']({'where':{'role':[_0x8f43('0x56'),'admin','user']},'attributes':['id',_0x8f43('0x57'),_0x8f43('0x30'),'role',_0x8f43('0x58'),_0x8f43('0x59'),_0x8f43('0x5a'),_0x8f43('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0x8f43('0x40')](_0x8f43('0x5c')),'include':[{'model':db[_0x8f43('0x5d')],'as':_0x8f43('0x5e'),'attributes':['id','name',_0x8f43('0x35')],'through':{'attributes':[]}}]})[_0x8f43('0x2d')](function(_0x15ba99){if(_0x15ba99){var _0x543f06=_0x21b98a[_0x8f43('0x5f')]['get']({'plain':!![]});if(!_0x543f06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x543f06['role']===_0x8f43('0x5f')){return db[_0x8f43('0x60')][_0x8f43('0x4d')]({'where':{'name':_0x8f43('0x61'),'userProfileId':_0x543f06['userProfileId']},'raw':!![]})[_0x8f43('0x2d')](function(_0x3a1a1a){if(_0x3a1a1a){if(_0x3a1a1a[_0x8f43('0x62')]===0x0){return db[_0x8f43('0x63')][_0x8f43('0x64')]({'where':{'sectionId':_0x3a1a1a['id']},'raw':!![]})[_0x8f43('0x2d')](function(_0x5a96e9){var _0x1bb732=[];if(_[_0x8f43('0x65')](_0x5a96e9)){_0x1bb732=_[_0x8f43('0x43')](_0x15ba99,function(_0xb97bb7){if(_0xb97bb7[_0x8f43('0x66')]!==_0x8f43('0x56')){return _0xb97bb7;}});return _0x1bb732;}else{for(var _0x2b354e=0x0;_0x2b354e<_0x15ba99['length'];_0x2b354e++){var _0x32c6f0=_0x15ba99[_0x2b354e];if(_0x32c6f0[_0x8f43('0x66')]===_0x8f43('0x56')){var _0x287094=_['find'](_0x5a96e9,function(_0x320fa1){return _0x320fa1[_0x8f43('0x67')]===_0x32c6f0['id'];});if(_0x287094)_0x1bb732[_0x8f43('0x68')](_0x32c6f0);}else{_0x1bb732[_0x8f43('0x68')](_0x32c6f0);}}return _0x1bb732;}});}else{return _0x15ba99;}}else{var _0x1ca6e7=_[_0x8f43('0x43')](_0x15ba99,function(_0x26ee09){if(_0x26ee09[_0x8f43('0x66')]!=='agent'){return _0x26ee09;}});return _0x1ca6e7;}});}else{return _0x15ba99;}}})[_0x8f43('0x2d')](function(_0x596d2f){var _0x3f1cbe=[];if(_0x596d2f){_0x559b00=_0x596d2f;for(var _0xae17a3=0x0;_0xae17a3<_0x596d2f['length'];_0xae17a3+=0x1){_0x559b00[_0xae17a3][_0x8f43('0x69')]=[];_0x3f1cbe[_0x8f43('0x68')](db[_0x8f43('0x33')][_0x8f43('0x4d')]({'where':{'FromId':[_0x21b98a[_0x8f43('0x5f')]['id'],_0x596d2f[_0xae17a3]['id']],'ToId':[_0x21b98a[_0x8f43('0x5f')]['id'],_0x596d2f[_0xae17a3]['id']],'ChatGroupId':null},'attributes':['id',_0x8f43('0x53'),'FromId',_0x8f43('0x6a'),_0x8f43('0x6b'),_0x8f43('0x50')],'order':qs[_0x8f43('0x40')](_0x8f43('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8f43('0x2d')](wrapUser(_0x596d2f[_0xae17a3])));}return BPromise[_0x8f43('0x6d')](_0x3f1cbe);}return[];})[_0x8f43('0x2d')](function(_0x4a64c7){return{'rows':_0x4a64c7,'count':_0x4a64c7[_0x8f43('0x4c')]};})[_0x8f43('0x2d')](respondWithResult(_0x217c27,null))[_0x8f43('0x4e')](handleError(_0x217c27,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 1a4b7e0..0ac0f53 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 _0x9285=['save','emit','hasOwnProperty','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x9285,0x1a0));var _0x5928=function(_0x5c7781,_0x39f165){_0x5c7781=_0x5c7781-0x0;var _0x393ca4=_0x9285[_0x5c7781];return _0x393ca4;};'use strict';var EventEmitter=require(_0x5928('0x0'));var ChatInternalMessage=require(_0x5928('0x1'))['db'][_0x5928('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5928('0x3')](0x0);var events={'afterCreate':_0x5928('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2eb264){return function(_0xd98591,_0x2c69fa,_0x1885af){ChatInternalMessageEvents[_0x5928('0x5')](_0x2eb264+':'+_0xd98591['id'],_0xd98591);ChatInternalMessageEvents[_0x5928('0x5')](_0x2eb264,_0xd98591);_0x1885af(null);};}for(var e in events){if(events[_0x5928('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x1c5e=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x30f07a,_0x98341){var _0xb38461=function(_0x7b287a){while(--_0x7b287a){_0x30f07a['push'](_0x30f07a['shift']());}};_0xb38461(++_0x98341);}(_0x1c5e,0x141));var _0xe1c5=function(_0xf1f37e,_0x159a20){_0xf1f37e=_0xf1f37e-0x0;var _0x2e3a6d=_0x1c5e[_0xf1f37e];return _0x2e3a6d;};'use strict';var EventEmitter=require(_0xe1c5('0x0'));var ChatInternalMessage=require(_0xe1c5('0x1'))['db'][_0xe1c5('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1c5('0x3'),'afterUpdate':'update','afterDestroy':_0xe1c5('0x4')};function emitEvent(_0x2aded1){return function(_0x1dfbf5,_0xd3fa19,_0x456481){ChatInternalMessageEvents['emit'](_0x2aded1+':'+_0x1dfbf5['id'],_0x1dfbf5);ChatInternalMessageEvents[_0xe1c5('0x5')](_0x2aded1,_0x1dfbf5);_0x456481(null);};}for(var e in events){if(events[_0xe1c5('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe1c5('0x7')](e,emitEvent(event));}}module[_0xe1c5('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 1743505..cd1c6d5 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 _0x985a=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','util','moment'];(function(_0x25122d,_0x12606e){var _0x3e33c7=function(_0x36f9b4){while(--_0x36f9b4){_0x25122d['push'](_0x25122d['shift']());}};_0x3e33c7(++_0x12606e);}(_0x985a,0x14e));var _0xa985=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x985a[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xa985('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa985('0x1'));var BPromise=require(_0xa985('0x2'));var rp=require(_0xa985('0x3'));var fs=require('fs');var path=require(_0xa985('0x4'));var rimraf=require(_0xa985('0x5'));var config=require(_0xa985('0x6'));var attributes=require(_0xa985('0x7'));module[_0xa985('0x8')]=function(_0x32e190,_0x14053a){return _0x32e190['define'](_0xa985('0x9'),attributes,{'tableName':_0xa985('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa985('0xb')});};
\ No newline at end of file
+var _0x2020=['../../config/environment','exports','define','chat_internal_messages','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x2020,0x1cd));var _0x0202=function(_0x421c9b,_0x43b13f){_0x421c9b=_0x421c9b-0x0;var _0x190389=_0x2020[_0x421c9b];return _0x190389;};'use strict';var _=require(_0x0202('0x0'));var util=require('util');var logger=require(_0x0202('0x1'))('api');var moment=require(_0x0202('0x2'));var BPromise=require(_0x0202('0x3'));var rp=require(_0x0202('0x4'));var fs=require('fs');var path=require(_0x0202('0x5'));var rimraf=require(_0x0202('0x6'));var config=require(_0x0202('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x0202('0x8')]=function(_0x4f1fd2,_0x44fb9a){return _0x4f1fd2[_0x0202('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x0202('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0202('0xb'),'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 2ac85f5..2708a7f 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 _0x56e7=['defaults','localhost','./chatInternalMessage.socket','register','request','info','debug','request\x20sent','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x57a170,_0x47bcbf){var _0x2a4147=function(_0x2f0aef){while(--_0x2f0aef){_0x57a170['push'](_0x57a170['shift']());}};_0x2a4147(++_0x47bcbf);}(_0x56e7,0x7b));var _0x756e=function(_0x2094d0,_0x56c2b6){_0x2094d0=_0x2094d0-0x0;var _0x2c1e4c=_0x56e7[_0x2094d0];return _0x2c1e4c;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));var BPromise=require('bluebird');var rs=require(_0x756e('0x2'));var fs=require('fs');var Redis=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];var utils=require(_0x756e('0x5'));var logger=require(_0x756e('0x6'))(_0x756e('0x7'));var config=require(_0x756e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x756e('0x9')][_0x756e('0xa')]({'port':0x232a});config[_0x756e('0xb')]=_[_0x756e('0xc')](config['redis'],{'host':_0x756e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x756e('0xb')]));require(_0x756e('0xe'))[_0x756e('0xf')](socket);function respondWithRpcPromise(_0x4738dc,_0x4adf8f,_0x5d5b90){return new BPromise(function(_0x324d36,_0x2be615){return client[_0x756e('0x10')](_0x4738dc,_0x5d5b90)['then'](function(_0x330076){logger[_0x756e('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x4adf8f,'request\x20sent');logger[_0x756e('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4adf8f,_0x756e('0x13'),JSON[_0x756e('0x14')](_0x330076));if(_0x330076[_0x756e('0x15')]){if(_0x330076[_0x756e('0x15')][_0x756e('0x16')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x2be615(_0x330076[_0x756e('0x15')]['message']);}logger['error'](_0x756e('0x18'),_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x324d36(_0x330076[_0x756e('0x15')][_0x756e('0x17')]);}else{logger[_0x756e('0x11')](_0x756e('0x18'),_0x4adf8f,_0x756e('0x13'));_0x324d36(_0x330076[_0x756e('0x19')]['message']);}})[_0x756e('0x1a')](function(_0x47c3c4){logger['error'](_0x756e('0x18'),_0x4adf8f,_0x47c3c4);_0x2be615(_0x47c3c4);});});}
\ No newline at end of file
+var _0x3b5f=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x3b5f,0x1bf));var _0xf3b5=function(_0x35778f,_0x57eb18){_0x35778f=_0x35778f-0x0;var _0x13d10b=_0x3b5f[_0x35778f];return _0x13d10b;};'use strict';var _=require(_0xf3b5('0x0'));var util=require(_0xf3b5('0x1'));var moment=require(_0xf3b5('0x2'));var BPromise=require(_0xf3b5('0x3'));var rs=require(_0xf3b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf3b5('0x5'));var logger=require(_0xf3b5('0x6'))(_0xf3b5('0x7'));var config=require(_0xf3b5('0x8'));var jayson=require(_0xf3b5('0x9'));var client=jayson[_0xf3b5('0xa')]['http']({'port':0x232a});config[_0xf3b5('0xb')]=_[_0xf3b5('0xc')](config[_0xf3b5('0xb')],{'host':_0xf3b5('0xd'),'port':0x18eb});var socket=require(_0xf3b5('0xe'))(new Redis(config['redis']));require(_0xf3b5('0xf'))[_0xf3b5('0x10')](socket);function respondWithRpcPromise(_0x1d1a02,_0x8113b8,_0x40be5a){return new BPromise(function(_0x2d5083,_0x15bc1a){return client[_0xf3b5('0x11')](_0x1d1a02,_0x40be5a)[_0xf3b5('0x12')](function(_0x5460da){logger[_0xf3b5('0x13')](_0xf3b5('0x14'),_0x8113b8,_0xf3b5('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x8113b8,_0xf3b5('0x15'),JSON[_0xf3b5('0x16')](_0x5460da));if(_0x5460da[_0xf3b5('0x17')]){if(_0x5460da[_0xf3b5('0x17')][_0xf3b5('0x18')]===0x1f4){logger[_0xf3b5('0x17')](_0xf3b5('0x14'),_0x8113b8,_0x5460da[_0xf3b5('0x17')]['message']);return _0x15bc1a(_0x5460da[_0xf3b5('0x17')][_0xf3b5('0x19')]);}logger['error'](_0xf3b5('0x14'),_0x8113b8,_0x5460da['error'][_0xf3b5('0x19')]);return _0x2d5083(_0x5460da['error'][_0xf3b5('0x19')]);}else{logger['info'](_0xf3b5('0x14'),_0x8113b8,'request\x20sent');_0x2d5083(_0x5460da['result'][_0xf3b5('0x19')]);}})[_0xf3b5('0x1a')](function(_0x32ac29){logger[_0xf3b5('0x17')](_0xf3b5('0x14'),_0x8113b8,_0x32ac29);_0x15bc1a(_0x32ac29);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 6a0f5d6..075e353 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 _0xcfcb=['removeListener','register','length','chatInternalMessage:','save','remove'];(function(_0x3b9b57,_0x40744a){var _0x26e311=function(_0xffe41d){while(--_0xffe41d){_0x3b9b57['push'](_0x3b9b57['shift']());}};_0x26e311(++_0x40744a);}(_0xcfcb,0xb2));var _0xbcfc=function(_0x23651b,_0x5741ae){_0x23651b=_0x23651b-0x0;var _0xd5c714=_0xcfcb[_0x23651b];return _0xd5c714;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xbcfc('0x0'),_0xbcfc('0x1'),'update'];function createListener(_0x390ba9,_0x27af00){return function(_0x2a7606){_0x27af00['emit'](_0x390ba9,_0x2a7606);};}function removeListener(_0x2a9912,_0x58f000){return function(){ChatInternalMessageEvents[_0xbcfc('0x2')](_0x2a9912,_0x58f000);};}exports[_0xbcfc('0x3')]=function(_0x1d8d24){for(var _0x219215=0x0,_0x11fd19=events[_0xbcfc('0x4')];_0x219215<_0x11fd19;_0x219215++){var _0x455d3e=events[_0x219215];var _0x50e9d6=createListener(_0xbcfc('0x5')+_0x455d3e,_0x1d8d24);ChatInternalMessageEvents['on'](_0x455d3e,_0x50e9d6);}};
\ No newline at end of file
+var _0x317a=['save','remove','update','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x261cb0,_0x37dc6c){var _0x7f0e1=function(_0x13688b){while(--_0x13688b){_0x261cb0['push'](_0x261cb0['shift']());}};_0x7f0e1(++_0x37dc6c);}(_0x317a,0x117));var _0xa317=function(_0x3ebaf0,_0x2e47af){_0x3ebaf0=_0x3ebaf0-0x0;var _0x4abc4f=_0x317a[_0x3ebaf0];return _0x4abc4f;};'use strict';var ChatInternalMessageEvents=require(_0xa317('0x0'));var events=[_0xa317('0x1'),_0xa317('0x2'),_0xa317('0x3')];function createListener(_0x10b9ff,_0x5f5bf5){return function(_0x5a2c20){_0x5f5bf5['emit'](_0x10b9ff,_0x5a2c20);};}function removeListener(_0x59f812,_0x2d44be){return function(){ChatInternalMessageEvents['removeListener'](_0x59f812,_0x2d44be);};}exports[_0xa317('0x4')]=function(_0x4761f9){for(var _0x23e3b0=0x0,_0x6d4875=events[_0xa317('0x5')];_0x23e3b0<_0x6d4875;_0x23e3b0++){var _0x4af570=events[_0x23e3b0];var _0x1b2a23=createListener(_0xa317('0x6')+_0x4af570,_0x4761f9);ChatInternalMessageEvents['on'](_0x4af570,_0x1b2a23);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 6c00f4a..4d3c09d 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 _0x9a9d=['describe','getUsers','show','create','update','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','/describe'];(function(_0x25b459,_0x347064){var _0x4da043=function(_0x408140){while(--_0x408140){_0x25b459['push'](_0x25b459['shift']());}};_0x4da043(++_0x347064);}(_0x9a9d,0x19e));var _0xd9a9=function(_0x5c2433,_0x51613d){_0x5c2433=_0x5c2433-0x0;var _0x2fd8d7=_0x9a9d[_0x5c2433];return _0x2fd8d7;};'use strict';var multer=require('multer');var util=require(_0xd9a9('0x0'));var path=require(_0xd9a9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd9a9('0x2'));var router=express['Router']();var fs_extra=require(_0xd9a9('0x3'));var auth=require(_0xd9a9('0x4'));var interaction=require(_0xd9a9('0x5'));var config=require(_0xd9a9('0x6'));var controller=require(_0xd9a9('0x7'));router['get']('/',auth[_0xd9a9('0x8')](),controller['index']);router[_0xd9a9('0x9')](_0xd9a9('0xa'),auth[_0xd9a9('0x8')](),controller[_0xd9a9('0xb')]);router[_0xd9a9('0x9')]('/users',auth[_0xd9a9('0x8')](),controller[_0xd9a9('0xc')]);router[_0xd9a9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd9a9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd9a9('0xe')]);router['put']('/:id',controller[_0xd9a9('0xf')]);router['delete']('/:id',auth[_0xd9a9('0x8')](),controller[_0xd9a9('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x8e62=['index','/describe','describe','/users','getUsers','/:id','show','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0x8e62,0x171));var _0x28e6=function(_0x5df532,_0x14cbbe){_0x5df532=_0x5df532-0x0;var _0x143974=_0x8e62[_0x5df532];return _0x143974;};'use strict';var multer=require('multer');var util=require(_0x28e6('0x0'));var path=require('path');var timeout=require(_0x28e6('0x1'));var express=require('express');var router=express[_0x28e6('0x2')]();var fs_extra=require(_0x28e6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x28e6('0x4'));var config=require(_0x28e6('0x5'));var controller=require(_0x28e6('0x6'));router[_0x28e6('0x7')]('/',auth[_0x28e6('0x8')](),controller[_0x28e6('0x9')]);router[_0x28e6('0x7')](_0x28e6('0xa'),auth[_0x28e6('0x8')](),controller[_0x28e6('0xb')]);router[_0x28e6('0x7')](_0x28e6('0xc'),auth['isAuthenticated'](),controller[_0x28e6('0xd')]);router[_0x28e6('0x7')](_0x28e6('0xe'),auth[_0x28e6('0x8')](),controller[_0x28e6('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x28e6('0x10')](_0x28e6('0xe'),controller[_0x28e6('0x11')]);router[_0x28e6('0x12')](_0x28e6('0xe'),auth[_0x28e6('0x8')](),controller[_0x28e6('0x13')]);module[_0x28e6('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 4b69391..28dc109 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 _0xce3a=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x141aae,_0x4e9b4e){var _0x392ee3=function(_0x56692c){while(--_0x56692c){_0x141aae['push'](_0x141aae['shift']());}};_0x392ee3(++_0x4e9b4e);}(_0xce3a,0x194));var _0xace3=function(_0x2a4424,_0x425915){_0x2a4424=_0x2a4424-0x0;var _0x4361ee=_0xce3a[_0x2a4424];return _0x4361ee;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'body':{'type':Sequelize[_0xace3('0x2')](_0xace3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xace3('0x5')]('in',_0xace3('0x6')),'defaultValue':_0xace3('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xace3('0x7')]},'providerName':{'type':Sequelize[_0xace3('0x8')]},'providerResponse':{'type':Sequelize[_0xace3('0x2')]}};
\ No newline at end of file
+var _0x7916=['out','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3c78e7,_0x19a615){var _0x46c763=function(_0x5484a1){while(--_0x5484a1){_0x3c78e7['push'](_0x3c78e7['shift']());}};_0x46c763(++_0x19a615);}(_0x7916,0x128));var _0x6791=function(_0x4b04e7,_0x3b680b){_0x4b04e7=_0x4b04e7-0x0;var _0x2b41a3=_0x7916[_0x4b04e7];return _0x2b41a3;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'body':{'type':Sequelize[_0x6791('0x1')](_0x6791('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6791('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6791('0x4')]('in',_0x6791('0x5')),'defaultValue':_0x6791('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6791('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 3aa16d5..94084b6 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 _0xa262=['motionChannel','EventManager','formData','../../config/logger','ChatInteraction','ChatInteractionId','role','rejectMessage','ContactId','SELECT','contact','parse','rimraf','zip-dir','fast-json-patch','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','name','index','ChatMessage','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','includeAll','include','rows','show','rawAttributes','options','find','create','body','params','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel'];(function(_0x47e2df,_0x3691ca){var _0x272689=function(_0x181657){while(--_0x181657){_0x47e2df['push'](_0x47e2df['shift']());}};_0x272689(++_0x3691ca);}(_0xa262,0x8c));var _0x2a26=function(_0x5a7644,_0x1dd1ac){_0x5a7644=_0x5a7644-0x0;var _0x203fe3=_0xa262[_0x5a7644];return _0x203fe3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a26('0x0'));var zipdir=require(_0x2a26('0x1'));var jsonpatch=require(_0x2a26('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a26('0x3'));var path=require(_0x2a26('0x4'));var sox=require('sox');var csv=require(_0x2a26('0x5'));var ejs=require(_0x2a26('0x6'));var fs=require('fs');var fs_extra=require(_0x2a26('0x7'));var _=require(_0x2a26('0x8'));var squel=require(_0x2a26('0x9'));var crypto=require(_0x2a26('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2a26('0xb'));var toCsv=require(_0x2a26('0x5'));var querystring=require(_0x2a26('0xc'));var Papa=require(_0x2a26('0xd'));var Redis=require(_0x2a26('0xe'));var authService=require(_0x2a26('0xf'));var qs=require(_0x2a26('0x10'));var as=require(_0x2a26('0x11'));var hardwareService=require(_0x2a26('0x12'));var logger=require('../../config/logger')(_0x2a26('0x13'));var utils=require(_0x2a26('0x14'));var config=require(_0x2a26('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2a26('0x16')]=_[_0x2a26('0x17')](config[_0x2a26('0x16')],{'host':_0x2a26('0x18'),'port':0x18eb});var socket=require(_0x2a26('0x19'))(new Redis(config[_0x2a26('0x16')]));require('./chatMessage.socket')[_0x2a26('0x1a')](socket);var jayson=require(_0x2a26('0x1b'));var client=jayson[_0x2a26('0x1c')][_0x2a26('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2211db,_0x47df05,_0x116dcd,_0x2044b2){return new BPromise(function(_0x170a82,_0xbac4ca){var _0x42cd3d=_0x2044b2||client;return _0x42cd3d[_0x2a26('0x1e')](_0x2211db,_0x116dcd)[_0x2a26('0x1f')](function(_0x53dcf2){logger[_0x2a26('0x20')](_0x2a26('0x21'),_0x47df05,_0x2a26('0x22'));logger[_0x2a26('0x23')](_0x2a26('0x24'),_0x47df05,_0x2a26('0x22'),JSON['stringify'](_0x53dcf2));if(_0x53dcf2[_0x2a26('0x25')]){if(_0x53dcf2[_0x2a26('0x25')][_0x2a26('0x26')]===0x1f4){logger['error'](_0x2a26('0x21'),_0x47df05,_0x53dcf2['error'][_0x2a26('0x27')]);return _0xbac4ca(_0x53dcf2[_0x2a26('0x25')]['message']);}logger[_0x2a26('0x25')](_0x2a26('0x21'),_0x47df05,_0x53dcf2['error'][_0x2a26('0x27')]);return _0x170a82(_0x53dcf2[_0x2a26('0x25')][_0x2a26('0x27')]);}else{logger[_0x2a26('0x20')](_0x2a26('0x21'),_0x47df05,_0x2a26('0x22'));_0x170a82(_0x53dcf2[_0x2a26('0x28')][_0x2a26('0x27')]);}})[_0x2a26('0x29')](function(_0xb36c9){logger[_0x2a26('0x25')](_0x2a26('0x21'),_0x47df05,_0xb36c9);_0xbac4ca(_0xb36c9);});});}function respondWithStatusCode(_0x5315b0,_0xce47f6){_0xce47f6=_0xce47f6||0xcc;return function(_0x370cdd){if(_0x370cdd){return _0x5315b0[_0x2a26('0x2a')](_0xce47f6);}return _0x5315b0[_0x2a26('0x2b')](_0xce47f6)[_0x2a26('0x2c')]();};}function respondWithResult(_0x1220b1,_0x566eb9){_0x566eb9=_0x566eb9||0xc8;return function(_0x35fabc){if(_0x35fabc){return _0x1220b1[_0x2a26('0x2b')](_0x566eb9)[_0x2a26('0x2d')](_0x35fabc);}};}function respondWithFilteredResult(_0x364942,_0x305bb1){return function(_0x31b1c0){if(_0x31b1c0){var _0x304eed=typeof _0x305bb1['offset']===_0x2a26('0x2e')&&typeof _0x305bb1[_0x2a26('0x2f')]===_0x2a26('0x2e');var _0x5c08a1=_0x31b1c0[_0x2a26('0x30')];var _0x5a8b5d=_0x304eed?0x0:_0x305bb1['offset'];var _0xb6332a=_0x304eed?_0x31b1c0['count']:_0x305bb1[_0x2a26('0x31')]+_0x305bb1['limit'];var _0x31bbcd;if(_0xb6332a>=_0x5c08a1){_0xb6332a=_0x5c08a1;_0x31bbcd=0xc8;}else{_0x31bbcd=0xce;}_0x364942[_0x2a26('0x2b')](_0x31bbcd);return _0x364942[_0x2a26('0x32')](_0x2a26('0x33'),_0x5a8b5d+'-'+_0xb6332a+'/'+_0x5c08a1)[_0x2a26('0x2d')](_0x31b1c0);}return null;};}function patchUpdates(_0x532b57){return function(_0x2c2c41){try{jsonpatch['apply'](_0x2c2c41,_0x532b57,!![]);}catch(_0x112f04){return BPromise[_0x2a26('0x34')](_0x112f04);}return _0x2c2c41[_0x2a26('0x35')]();};}function saveUpdates(_0x47ddb6,_0x3e1ee9){return function(_0x4cdf0a){if(_0x4cdf0a){return _0x4cdf0a[_0x2a26('0x36')](_0x47ddb6)[_0x2a26('0x1f')](function(_0x55448c){return _0x55448c;});}return null;};}function removeEntity(_0x3cdd1d,_0x5b1c27){return function(_0x285283){if(_0x285283){return _0x285283[_0x2a26('0x37')]()['then'](function(){_0x3cdd1d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35d58f,_0x5b7f51){return function(_0x5bc46a){if(!_0x5bc46a){_0x35d58f[_0x2a26('0x2a')](0x194);}return _0x5bc46a;};}function handleError(_0x45b4d1,_0x30ce7b){_0x30ce7b=_0x30ce7b||0x1f4;return function(_0x419352){logger['error'](_0x419352['stack']);if(_0x419352[_0x2a26('0x38')]){delete _0x419352[_0x2a26('0x38')];}_0x45b4d1[_0x2a26('0x2b')](_0x30ce7b)['send'](_0x419352);};}exports[_0x2a26('0x39')]=function(_0x3e0dfa,_0x4d4eca){var _0x38e994={},_0x147d3={},_0x31deeb={'count':0x0,'rows':[]};var _0x15d8f3=_['map'](db[_0x2a26('0x3a')]['rawAttributes'],function(_0x4d0bc0){return{'name':_0x4d0bc0[_0x2a26('0x3b')],'type':_0x4d0bc0['type'][_0x2a26('0x3c')]};});_0x147d3[_0x2a26('0x3d')]=_['map'](_0x15d8f3,_0x2a26('0x38'));_0x147d3[_0x2a26('0x3e')]=_[_0x2a26('0x3f')](_0x3e0dfa['query']);_0x147d3[_0x2a26('0x40')]=_[_0x2a26('0x41')](_0x147d3[_0x2a26('0x3d')],_0x147d3[_0x2a26('0x3e')]);_0x38e994[_0x2a26('0x42')]=_[_0x2a26('0x41')](_0x147d3[_0x2a26('0x3d')],qs[_0x2a26('0x43')](_0x3e0dfa[_0x2a26('0x3e')]['fields']));_0x38e994['attributes']=_0x38e994[_0x2a26('0x42')]['length']?_0x38e994[_0x2a26('0x42')]:_0x147d3[_0x2a26('0x3d')];if(!_0x3e0dfa[_0x2a26('0x3e')][_0x2a26('0x44')](_0x2a26('0x45'))){_0x38e994['limit']=qs[_0x2a26('0x2f')](_0x3e0dfa[_0x2a26('0x3e')][_0x2a26('0x2f')]);_0x38e994['offset']=qs[_0x2a26('0x31')](_0x3e0dfa[_0x2a26('0x3e')][_0x2a26('0x31')]);}_0x38e994[_0x2a26('0x46')]=qs['sort'](_0x3e0dfa['query'][_0x2a26('0x47')]);_0x38e994[_0x2a26('0x48')]=qs[_0x2a26('0x40')](_[_0x2a26('0x49')](_0x3e0dfa[_0x2a26('0x3e')],_0x147d3['filters']),_0x15d8f3);if(_0x3e0dfa[_0x2a26('0x3e')][_0x2a26('0x4a')]){_0x38e994[_0x2a26('0x48')]=_['merge'](_0x38e994[_0x2a26('0x48')],{'$or':_[_0x2a26('0x4b')](_0x15d8f3,function(_0x1d8610){if(_0x1d8610['type']!=='VIRTUAL'){var _0x2e075b={};_0x2e075b[_0x1d8610[_0x2a26('0x38')]]={'$like':'%'+_0x3e0dfa[_0x2a26('0x3e')][_0x2a26('0x4a')]+'%'};return _0x2e075b;}})});}_0x38e994=_[_0x2a26('0x4c')]({},_0x38e994,_0x3e0dfa['options']);var _0x4da64f={'where':_0x38e994[_0x2a26('0x48')]};return db[_0x2a26('0x3a')]['count'](_0x4da64f)[_0x2a26('0x1f')](function(_0x124ba7){_0x31deeb[_0x2a26('0x30')]=_0x124ba7;if(_0x3e0dfa['query'][_0x2a26('0x4d')]){_0x38e994[_0x2a26('0x4e')]=[{'all':!![]}];}return db[_0x2a26('0x3a')]['findAll'](_0x38e994);})[_0x2a26('0x1f')](function(_0x256f64){_0x31deeb[_0x2a26('0x4f')]=_0x256f64;return _0x31deeb;})['then'](respondWithFilteredResult(_0x4d4eca,_0x38e994))['catch'](handleError(_0x4d4eca,null));};exports[_0x2a26('0x50')]=function(_0x336920,_0x53bd73){var _0x4282be={'raw':!![],'where':{'id':_0x336920['params']['id']}},_0x1f653f={};_0x1f653f[_0x2a26('0x3d')]=_['keys'](db[_0x2a26('0x3a')][_0x2a26('0x51')]);_0x1f653f[_0x2a26('0x3e')]=_[_0x2a26('0x3f')](_0x336920[_0x2a26('0x3e')]);_0x1f653f[_0x2a26('0x40')]=_['intersection'](_0x1f653f[_0x2a26('0x3d')],_0x1f653f[_0x2a26('0x3e')]);_0x4282be[_0x2a26('0x42')]=_['intersection'](_0x1f653f[_0x2a26('0x3d')],qs[_0x2a26('0x43')](_0x336920['query'][_0x2a26('0x43')]));_0x4282be['attributes']=_0x4282be[_0x2a26('0x42')]['length']?_0x4282be['attributes']:_0x1f653f[_0x2a26('0x3d')];if(_0x336920[_0x2a26('0x3e')][_0x2a26('0x4d')]){_0x4282be[_0x2a26('0x4e')]=[{'all':!![]}];}_0x4282be=_[_0x2a26('0x4c')]({},_0x4282be,_0x336920[_0x2a26('0x52')]);return db[_0x2a26('0x3a')][_0x2a26('0x53')](_0x4282be)[_0x2a26('0x1f')](handleEntityNotFound(_0x53bd73,null))[_0x2a26('0x1f')](respondWithResult(_0x53bd73,null))['catch'](handleError(_0x53bd73,null));};exports['create']=function(_0x3773a8,_0x5d10d6){return db['ChatMessage'][_0x2a26('0x54')](_0x3773a8[_0x2a26('0x55')],{})[_0x2a26('0x1f')](respondWithResult(_0x5d10d6,0xc9))[_0x2a26('0x29')](handleError(_0x5d10d6,null));};exports['update']=function(_0x255f96,_0x1f9599){if(_0x255f96[_0x2a26('0x55')]['id']){delete _0x255f96['body']['id'];}return db['ChatMessage'][_0x2a26('0x53')]({'where':{'id':_0x255f96['params']['id']}})[_0x2a26('0x1f')](handleEntityNotFound(_0x1f9599,null))[_0x2a26('0x1f')](saveUpdates(_0x255f96['body'],null))[_0x2a26('0x1f')](respondWithResult(_0x1f9599,null))[_0x2a26('0x29')](handleError(_0x1f9599,null));};exports[_0x2a26('0x37')]=function(_0x5a1d1b,_0x2ca34d){return db[_0x2a26('0x3a')][_0x2a26('0x53')]({'where':{'id':_0x5a1d1b[_0x2a26('0x56')]['id']}})[_0x2a26('0x1f')](handleEntityNotFound(_0x2ca34d,null))[_0x2a26('0x1f')](removeEntity(_0x2ca34d,null))[_0x2a26('0x29')](handleError(_0x2ca34d,null));};exports[_0x2a26('0x57')]=function(_0x1c6f34,_0x43c0c1){return db[_0x2a26('0x3a')]['describe']()[_0x2a26('0x1f')](respondWithResult(_0x43c0c1,null))['catch'](handleError(_0x43c0c1,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x2a26('0x58')]=function(_0x309d27,_0x37bf54,_0x561d77){var _0x34a5ad={'agent':{},'channel':_0x2a26('0x59')};if(_0x309d27['body']['id']){delete _0x309d27['body']['id'];}_0x309d27[_0x2a26('0x55')][_0x2a26('0x5a')]=!![];_0x309d27[_0x2a26('0x55')]['readAt']=moment()[_0x2a26('0x5b')](_0x2a26('0x5c'));_0x309d27[_0x2a26('0x55')][_0x2a26('0x5d')]=_0x309d27[_0x2a26('0x55')][_0x2a26('0x5d')]||_0x309d27[_0x2a26('0x5e')]['id'];_0x34a5ad[_0x2a26('0x5f')]['id']=_0x309d27[_0x2a26('0x55')][_0x2a26('0x5d')];return db[_0x2a26('0x3a')]['find']({'where':{'id':_0x309d27[_0x2a26('0x56')]['id'],'UserId':null}})[_0x2a26('0x1f')](handleEntityNotFound(_0x37bf54,null))[_0x2a26('0x1f')](saveUpdates(_0x309d27[_0x2a26('0x55')],null))[_0x2a26('0x1f')](function(_0x3ca62a){if(_0x3ca62a){_0x34a5ad[_0x2a26('0x27')]=_0x3ca62a[_0x2a26('0x60')]({'plain':!![]});return db['ChatInteraction'][_0x2a26('0x53')]({'where':{'id':_0x3ca62a['ChatInteractionId']}});}return null;})[_0x2a26('0x1f')](handleEntityNotFound(_0x37bf54,null))[_0x2a26('0x1f')](function(_0x502f87){if(_0x502f87){return _0x502f87['update']({'UserId':_0x309d27[_0x2a26('0x55')][_0x2a26('0x5d')],'read1stAt':_[_0x2a26('0x61')](_0x502f87[_0x2a26('0x62')])?moment()['format'](_0x2a26('0x5c')):undefined});}return null;})[_0x2a26('0x1f')](function(_0x2cc738){if(_0x2cc738){_0x34a5ad['interaction']=_0x2cc738[_0x2a26('0x60')]({'plain':!![]});interaction_log['info'](_0x2a26('0x63'),_0x309d27[_0x2a26('0x5e')]['id'],_0x309d27['user']['name'],_0x309d27['user']['role'],_0x34a5ad[_0x2a26('0x64')]['id'],_0x309d27['body']?JSON[_0x2a26('0x65')](_0x309d27[_0x2a26('0x55')]):_0x2a26('0x66'));return respondWithRpcPromise(_0x2a26('0x67'),'acceptMessage',_0x34a5ad);}return null;})[_0x2a26('0x1f')](function(_0x260efa){var _0x4a7560=_0x2a26('0x68')+_0x260efa[_0x2a26('0x27')]['ContactId'];return db[_0x2a26('0x69')][_0x2a26('0x3e')](_0x4a7560,{'type':db[_0x2a26('0x6a')][_0x2a26('0x6b')]['SELECT'],'raw':!![]})[_0x2a26('0x1f')](function(_0xe12ba2){return _0xe12ba2;});})[_0x2a26('0x1f')](function(_0x56b00a){if(_0x56b00a){_0x34a5ad[_0x2a26('0x27')]['contact']=_0x56b00a[0x0];if(!_0x309d27[_0x2a26('0x55')][_0x2a26('0x5d')])return;return db[_0x2a26('0x6c')]['find']({'where':{'id':_0x309d27[_0x2a26('0x55')]['UserId'],'role':_0x2a26('0x5f')},'attributes':['id',_0x2a26('0x38'),_0x2a26('0x6d'),_0x2a26('0x6e'),_0x2a26('0x6f')],'raw':!![]});}return null;})[_0x2a26('0x1f')](function(_0x4e63c8){if(!_0x4e63c8)return null;_0x34a5ad['message']['agent']=_0x4e63c8;return _0x34a5ad;})[_0x2a26('0x1f')](function(_0x94c687){if(_0x94c687){if(_0x309d27[_0x2a26('0x55')][_0x2a26('0x70')]){_0x34a5ad[_0x2a26('0x27')][_0x2a26('0x71')]=util['format'](_0x2a26('0x72'),_0x309d27['user'][_0x2a26('0x38')]);_0x34a5ad[_0x2a26('0x27')][_0x2a26('0x73')]=_0x34a5ad[_0x2a26('0x73')];_0x34a5ad[_0x2a26('0x27')][_0x2a26('0x74')]=_0x34a5ad[_0x2a26('0x73')];_0x34a5ad['message']['event']='accept';return respondWithRpcPromise(_0x2a26('0x75'),_0x2a26('0x75'),{'event':'acceptmessage','message':_[_0x2a26('0x4c')](_0x34a5ad[_0x2a26('0x27')],JSON['parse'](_0x34a5ad['interaction'][_0x2a26('0x76')]))},client9002)[_0x2a26('0x1f')](function(){return _0x34a5ad;});}return _0x34a5ad;}return null;})[_0x2a26('0x1f')](respondWithResult(_0x37bf54,null))[_0x2a26('0x29')](handleError(_0x37bf54,null));};var interaction_log=require(_0x2a26('0x77'))('chat-interactions');exports[_0x2a26('0x34')]=function(_0x3f0200,_0x12a11b,_0x5ec636){var _0x49503a={'agent':{},'channel':'chat'};if(_0x3f0200['body']['id']){delete _0x3f0200[_0x2a26('0x55')]['id'];}_0x3f0200[_0x2a26('0x55')][_0x2a26('0x5d')]=_0x3f0200['body'][_0x2a26('0x5d')]||_0x3f0200[_0x2a26('0x5e')]['id'];_0x49503a[_0x2a26('0x5f')]['id']=_0x3f0200['body'][_0x2a26('0x5d')];return db[_0x2a26('0x3a')][_0x2a26('0x53')]({'where':{'id':_0x3f0200['params']['id'],'UserId':null}})[_0x2a26('0x1f')](handleEntityNotFound(_0x12a11b,null))[_0x2a26('0x1f')](function(_0x39a391){if(_0x39a391){_0x49503a[_0x2a26('0x27')]=_0x39a391['get']({'plain':!![]});return db[_0x2a26('0x78')][_0x2a26('0x53')]({'where':{'id':_0x39a391[_0x2a26('0x79')]}});}return null;})[_0x2a26('0x1f')](handleEntityNotFound(_0x12a11b,null))[_0x2a26('0x1f')](function(_0x2d833f){if(_0x2d833f){_0x49503a[_0x2a26('0x64')]=_0x2d833f[_0x2a26('0x60')]({'plain':!![]});interaction_log[_0x2a26('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3f0200['user']['id'],_0x3f0200[_0x2a26('0x5e')]['name'],_0x3f0200[_0x2a26('0x5e')][_0x2a26('0x7a')],_0x49503a['interaction']['id'],_0x3f0200[_0x2a26('0x55')]?JSON[_0x2a26('0x65')](_0x3f0200['body']):'null');return respondWithRpcPromise('RejectMessage',_0x2a26('0x7b'),_0x49503a);}return null;})[_0x2a26('0x1f')](function(_0x563895){var _0x55c97c=_0x2a26('0x68')+_0x563895['message'][_0x2a26('0x7c')];return db[_0x2a26('0x69')]['query'](_0x55c97c,{'type':db[_0x2a26('0x6a')][_0x2a26('0x6b')][_0x2a26('0x7d')],'raw':!![]})[_0x2a26('0x1f')](function(_0x51c6db){return _0x51c6db;});})[_0x2a26('0x1f')](function(_0x450b9a){if(_0x450b9a){_0x49503a[_0x2a26('0x27')][_0x2a26('0x7e')]=_0x450b9a[0x0];if(!_0x3f0200[_0x2a26('0x55')][_0x2a26('0x5d')])return;return db[_0x2a26('0x6c')][_0x2a26('0x53')]({'where':{'id':_0x3f0200['body'][_0x2a26('0x5d')],'role':'agent'},'attributes':['id',_0x2a26('0x38'),_0x2a26('0x6d'),_0x2a26('0x6e'),_0x2a26('0x6f')],'raw':!![]});}return null;})[_0x2a26('0x1f')](function(_0x30aa24){if(!_0x30aa24)return null;_0x49503a['message'][_0x2a26('0x5f')]=_0x30aa24;return _0x49503a;})[_0x2a26('0x1f')](function(_0x3a1357){if(_0x3a1357){_0x3a1357[_0x2a26('0x27')][_0x2a26('0x71')]=util[_0x2a26('0x5b')](_0x2a26('0x72'),_0x3f0200[_0x2a26('0x5e')][_0x2a26('0x38')]);_0x3a1357[_0x2a26('0x27')][_0x2a26('0x73')]=_0x49503a[_0x2a26('0x73')];_0x3a1357[_0x2a26('0x27')][_0x2a26('0x74')]=_0x49503a['channel'];_0x3a1357['message']['event']=_0x2a26('0x34');respondWithRpcPromise(_0x2a26('0x75'),_0x2a26('0x75'),{'event':'rejectmessage','message':_[_0x2a26('0x4c')](_0x49503a[_0x2a26('0x27')],JSON[_0x2a26('0x7f')](_0x49503a['interaction']['formData']))},client9002);return _0x49503a;}return null;})[_0x2a26('0x1f')](respondWithResult(_0x12a11b,null))[_0x2a26('0x29')](handleError(_0x12a11b,null));};
\ No newline at end of file
+var _0x5c84=['http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','stack','name','send','index','map','ChatMessage','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','accept','chat','read','readAt','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','agent','fullname','email','internal','manual','interface','format','SIP/%s','channel','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','SELECT','contact','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./chatMessage.socket','register','client'];(function(_0x1d0dc3,_0x350fda){var _0x57d44b=function(_0x467a52){while(--_0x467a52){_0x1d0dc3['push'](_0x1d0dc3['shift']());}};_0x57d44b(++_0x350fda);}(_0x5c84,0x1ec));var _0x45c8=function(_0x137ca4,_0x328c3d){_0x137ca4=_0x137ca4-0x0;var _0x13223f=_0x5c84[_0x137ca4];return _0x13223f;};'use strict';var emlformat=require(_0x45c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45c8('0x1'));var jsonpatch=require(_0x45c8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x45c8('0x3'));var Mustache=require(_0x45c8('0x4'));var util=require(_0x45c8('0x5'));var path=require(_0x45c8('0x6'));var sox=require(_0x45c8('0x7'));var csv=require('to-csv');var ejs=require(_0x45c8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45c8('0x9'));var squel=require(_0x45c8('0xa'));var crypto=require(_0x45c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x45c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x45c8('0xd'));var Papa=require(_0x45c8('0xe'));var Redis=require(_0x45c8('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x45c8('0x10'));var hardwareService=require(_0x45c8('0x11'));var logger=require(_0x45c8('0x12'))(_0x45c8('0x13'));var utils=require(_0x45c8('0x14'));var config=require(_0x45c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x45c8('0x16')](config[_0x45c8('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x45c8('0x18'))(new Redis(config[_0x45c8('0x17')]));require(_0x45c8('0x19'))[_0x45c8('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x45c8('0x1b')][_0x45c8('0x1c')]({'port':0x232c});var client9002=jayson[_0x45c8('0x1b')][_0x45c8('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x518d6d,_0x4ae0fe,_0x5859d6,_0x32d163){return new BPromise(function(_0x44998e,_0x2b6971){var _0xec19c4=_0x32d163||client;return _0xec19c4['request'](_0x518d6d,_0x5859d6)[_0x45c8('0x1d')](function(_0x26d227){logger['info'](_0x45c8('0x1e'),_0x4ae0fe,_0x45c8('0x1f'));logger[_0x45c8('0x20')](_0x45c8('0x21'),_0x4ae0fe,_0x45c8('0x1f'),JSON[_0x45c8('0x22')](_0x26d227));if(_0x26d227['error']){if(_0x26d227[_0x45c8('0x23')][_0x45c8('0x24')]===0x1f4){logger[_0x45c8('0x23')](_0x45c8('0x1e'),_0x4ae0fe,_0x26d227[_0x45c8('0x23')]['message']);return _0x2b6971(_0x26d227[_0x45c8('0x23')][_0x45c8('0x25')]);}logger[_0x45c8('0x23')](_0x45c8('0x1e'),_0x4ae0fe,_0x26d227[_0x45c8('0x23')]['message']);return _0x44998e(_0x26d227['error'][_0x45c8('0x25')]);}else{logger[_0x45c8('0x26')](_0x45c8('0x1e'),_0x4ae0fe,'request\x20sent');_0x44998e(_0x26d227['result'][_0x45c8('0x25')]);}})['catch'](function(_0x4ff838){logger[_0x45c8('0x23')](_0x45c8('0x1e'),_0x4ae0fe,_0x4ff838);_0x2b6971(_0x4ff838);});});}function respondWithStatusCode(_0x3d7cfb,_0x12ba2a){_0x12ba2a=_0x12ba2a||0xcc;return function(_0x6ad881){if(_0x6ad881){return _0x3d7cfb[_0x45c8('0x27')](_0x12ba2a);}return _0x3d7cfb[_0x45c8('0x28')](_0x12ba2a)[_0x45c8('0x29')]();};}function respondWithResult(_0x58bffa,_0x4c861b){_0x4c861b=_0x4c861b||0xc8;return function(_0x5a298b){if(_0x5a298b){return _0x58bffa[_0x45c8('0x28')](_0x4c861b)[_0x45c8('0x2a')](_0x5a298b);}};}function respondWithFilteredResult(_0x5ed15c,_0x936741){return function(_0xa28acf){if(_0xa28acf){var _0x12aa5f=typeof _0x936741[_0x45c8('0x2b')]==='undefined'&&typeof _0x936741['limit']==='undefined';var _0xdda1bd=_0xa28acf['count'];var _0x433b2b=_0x12aa5f?0x0:_0x936741['offset'];var _0x3ae69c=_0x12aa5f?_0xa28acf['count']:_0x936741[_0x45c8('0x2b')]+_0x936741['limit'];var _0x218e6a;if(_0x3ae69c>=_0xdda1bd){_0x3ae69c=_0xdda1bd;_0x218e6a=0xc8;}else{_0x218e6a=0xce;}_0x5ed15c[_0x45c8('0x28')](_0x218e6a);return _0x5ed15c['set'](_0x45c8('0x2c'),_0x433b2b+'-'+_0x3ae69c+'/'+_0xdda1bd)[_0x45c8('0x2a')](_0xa28acf);}return null;};}function patchUpdates(_0x14cbe2){return function(_0x203e88){try{jsonpatch[_0x45c8('0x2d')](_0x203e88,_0x14cbe2,!![]);}catch(_0x16374c){return BPromise[_0x45c8('0x2e')](_0x16374c);}return _0x203e88[_0x45c8('0x2f')]();};}function saveUpdates(_0x43322e,_0x51391d){return function(_0x3dcedd){if(_0x3dcedd){return _0x3dcedd[_0x45c8('0x30')](_0x43322e)[_0x45c8('0x1d')](function(_0x23bc34){return _0x23bc34;});}return null;};}function removeEntity(_0x404378,_0x4139d4){return function(_0x322ed4){if(_0x322ed4){return _0x322ed4['destroy']()[_0x45c8('0x1d')](function(){_0x404378[_0x45c8('0x28')](0xcc)[_0x45c8('0x29')]();});}};}function handleEntityNotFound(_0x5472ca,_0x2c3a9e){return function(_0x1f9820){if(!_0x1f9820){_0x5472ca[_0x45c8('0x27')](0x194);}return _0x1f9820;};}function handleError(_0x3d1334,_0x51ddbb){_0x51ddbb=_0x51ddbb||0x1f4;return function(_0x2d5701){logger[_0x45c8('0x23')](_0x2d5701[_0x45c8('0x31')]);if(_0x2d5701['name']){delete _0x2d5701[_0x45c8('0x32')];}_0x3d1334[_0x45c8('0x28')](_0x51ddbb)[_0x45c8('0x33')](_0x2d5701);};}exports[_0x45c8('0x34')]=function(_0x470490,_0x3b81e6){var _0x461a1e={},_0x5e4974={},_0xa5327a={'count':0x0,'rows':[]};var _0x2469a8=_[_0x45c8('0x35')](db[_0x45c8('0x36')]['rawAttributes'],function(_0x4ef8b3){return{'name':_0x4ef8b3[_0x45c8('0x37')],'type':_0x4ef8b3[_0x45c8('0x38')]['key']};});_0x5e4974[_0x45c8('0x39')]=_[_0x45c8('0x35')](_0x2469a8,_0x45c8('0x32'));_0x5e4974[_0x45c8('0x3a')]=_[_0x45c8('0x3b')](_0x470490['query']);_0x5e4974['filters']=_[_0x45c8('0x3c')](_0x5e4974[_0x45c8('0x39')],_0x5e4974[_0x45c8('0x3a')]);_0x461a1e[_0x45c8('0x3d')]=_[_0x45c8('0x3c')](_0x5e4974[_0x45c8('0x39')],qs[_0x45c8('0x3e')](_0x470490[_0x45c8('0x3a')][_0x45c8('0x3e')]));_0x461a1e['attributes']=_0x461a1e[_0x45c8('0x3d')]['length']?_0x461a1e[_0x45c8('0x3d')]:_0x5e4974['model'];if(!_0x470490[_0x45c8('0x3a')]['hasOwnProperty'](_0x45c8('0x3f'))){_0x461a1e[_0x45c8('0x40')]=qs[_0x45c8('0x40')](_0x470490[_0x45c8('0x3a')][_0x45c8('0x40')]);_0x461a1e[_0x45c8('0x2b')]=qs['offset'](_0x470490['query']['offset']);}_0x461a1e[_0x45c8('0x41')]=qs[_0x45c8('0x42')](_0x470490['query'][_0x45c8('0x42')]);_0x461a1e[_0x45c8('0x43')]=qs[_0x45c8('0x44')](_[_0x45c8('0x45')](_0x470490['query'],_0x5e4974['filters']),_0x2469a8);if(_0x470490[_0x45c8('0x3a')][_0x45c8('0x46')]){_0x461a1e[_0x45c8('0x43')]=_[_0x45c8('0x47')](_0x461a1e[_0x45c8('0x43')],{'$or':_[_0x45c8('0x35')](_0x2469a8,function(_0x3c1d4f){if(_0x3c1d4f[_0x45c8('0x38')]!=='VIRTUAL'){var _0x5153d4={};_0x5153d4[_0x3c1d4f[_0x45c8('0x32')]]={'$like':'%'+_0x470490['query']['filter']+'%'};return _0x5153d4;}})});}_0x461a1e=_['merge']({},_0x461a1e,_0x470490['options']);var _0x9ad7f3={'where':_0x461a1e[_0x45c8('0x43')]};return db[_0x45c8('0x36')][_0x45c8('0x48')](_0x9ad7f3)['then'](function(_0x5623ac){_0xa5327a[_0x45c8('0x48')]=_0x5623ac;if(_0x470490[_0x45c8('0x3a')][_0x45c8('0x49')]){_0x461a1e[_0x45c8('0x4a')]=[{'all':!![]}];}return db['ChatMessage'][_0x45c8('0x4b')](_0x461a1e);})['then'](function(_0x55600e){_0xa5327a[_0x45c8('0x4c')]=_0x55600e;return _0xa5327a;})[_0x45c8('0x1d')](respondWithFilteredResult(_0x3b81e6,_0x461a1e))[_0x45c8('0x4d')](handleError(_0x3b81e6,null));};exports[_0x45c8('0x4e')]=function(_0x3cba60,_0x4050b8){var _0xbac25f={'raw':!![],'where':{'id':_0x3cba60[_0x45c8('0x4f')]['id']}},_0x59f908={};_0x59f908[_0x45c8('0x39')]=_[_0x45c8('0x3b')](db[_0x45c8('0x36')][_0x45c8('0x50')]);_0x59f908['query']=_[_0x45c8('0x3b')](_0x3cba60[_0x45c8('0x3a')]);_0x59f908[_0x45c8('0x44')]=_[_0x45c8('0x3c')](_0x59f908[_0x45c8('0x39')],_0x59f908[_0x45c8('0x3a')]);_0xbac25f['attributes']=_[_0x45c8('0x3c')](_0x59f908['model'],qs[_0x45c8('0x3e')](_0x3cba60['query']['fields']));_0xbac25f[_0x45c8('0x3d')]=_0xbac25f[_0x45c8('0x3d')][_0x45c8('0x51')]?_0xbac25f['attributes']:_0x59f908[_0x45c8('0x39')];if(_0x3cba60[_0x45c8('0x3a')][_0x45c8('0x49')]){_0xbac25f[_0x45c8('0x4a')]=[{'all':!![]}];}_0xbac25f=_['merge']({},_0xbac25f,_0x3cba60['options']);return db[_0x45c8('0x36')][_0x45c8('0x52')](_0xbac25f)[_0x45c8('0x1d')](handleEntityNotFound(_0x4050b8,null))[_0x45c8('0x1d')](respondWithResult(_0x4050b8,null))[_0x45c8('0x4d')](handleError(_0x4050b8,null));};exports[_0x45c8('0x53')]=function(_0x209e21,_0x3df2c5){return db[_0x45c8('0x36')]['create'](_0x209e21[_0x45c8('0x54')],{})[_0x45c8('0x1d')](respondWithResult(_0x3df2c5,0xc9))[_0x45c8('0x4d')](handleError(_0x3df2c5,null));};exports[_0x45c8('0x30')]=function(_0x5cb703,_0x5f4f71){if(_0x5cb703[_0x45c8('0x54')]['id']){delete _0x5cb703[_0x45c8('0x54')]['id'];}return db['ChatMessage'][_0x45c8('0x52')]({'where':{'id':_0x5cb703['params']['id']}})[_0x45c8('0x1d')](handleEntityNotFound(_0x5f4f71,null))['then'](saveUpdates(_0x5cb703[_0x45c8('0x54')],null))[_0x45c8('0x1d')](respondWithResult(_0x5f4f71,null))[_0x45c8('0x4d')](handleError(_0x5f4f71,null));};exports[_0x45c8('0x55')]=function(_0x6c57d5,_0x119377){return db[_0x45c8('0x36')]['find']({'where':{'id':_0x6c57d5[_0x45c8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x119377,null))[_0x45c8('0x1d')](removeEntity(_0x119377,null))[_0x45c8('0x4d')](handleError(_0x119377,null));};exports[_0x45c8('0x56')]=function(_0x14a12b,_0x4348e4){return db['ChatMessage']['describe']()[_0x45c8('0x1d')](respondWithResult(_0x4348e4,null))[_0x45c8('0x4d')](handleError(_0x4348e4,null));};var interaction_log=require(_0x45c8('0x12'))('chat-interactions');exports[_0x45c8('0x57')]=function(_0x3cd442,_0x35f551,_0x51f2d3){var _0xb5c4e0={'agent':{},'channel':_0x45c8('0x58')};if(_0x3cd442[_0x45c8('0x54')]['id']){delete _0x3cd442[_0x45c8('0x54')]['id'];}_0x3cd442[_0x45c8('0x54')][_0x45c8('0x59')]=!![];_0x3cd442[_0x45c8('0x54')][_0x45c8('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3cd442[_0x45c8('0x54')]['UserId']=_0x3cd442[_0x45c8('0x54')][_0x45c8('0x5b')]||_0x3cd442[_0x45c8('0x5c')]['id'];_0xb5c4e0['agent']['id']=_0x3cd442[_0x45c8('0x54')]['UserId'];return db['ChatMessage'][_0x45c8('0x52')]({'where':{'id':_0x3cd442[_0x45c8('0x4f')]['id'],'UserId':null}})[_0x45c8('0x1d')](handleEntityNotFound(_0x35f551,null))[_0x45c8('0x1d')](saveUpdates(_0x3cd442[_0x45c8('0x54')],null))[_0x45c8('0x1d')](function(_0x2890ee){if(_0x2890ee){_0xb5c4e0['message']=_0x2890ee[_0x45c8('0x5d')]({'plain':!![]});return db[_0x45c8('0x5e')][_0x45c8('0x52')]({'where':{'id':_0x2890ee[_0x45c8('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x35f551,null))['then'](function(_0x56b42b){if(_0x56b42b){return _0x56b42b[_0x45c8('0x30')]({'UserId':_0x3cd442['body'][_0x45c8('0x5b')],'read1stAt':_[_0x45c8('0x60')](_0x56b42b[_0x45c8('0x61')])?moment()['format'](_0x45c8('0x62')):undefined});}return null;})[_0x45c8('0x1d')](function(_0x1d6851){if(_0x1d6851){_0xb5c4e0[_0x45c8('0x63')]=_0x1d6851[_0x45c8('0x5d')]({'plain':!![]});interaction_log[_0x45c8('0x26')](_0x45c8('0x64'),_0x3cd442[_0x45c8('0x5c')]['id'],_0x3cd442[_0x45c8('0x5c')][_0x45c8('0x32')],_0x3cd442[_0x45c8('0x5c')]['role'],_0xb5c4e0[_0x45c8('0x63')]['id'],_0x3cd442[_0x45c8('0x54')]?JSON[_0x45c8('0x22')](_0x3cd442[_0x45c8('0x54')]):_0x45c8('0x65'));return respondWithRpcPromise(_0x45c8('0x66'),_0x45c8('0x67'),_0xb5c4e0);}return null;})['then'](function(_0x13bdb9){var _0x1e369f=_0x45c8('0x68')+_0x13bdb9[_0x45c8('0x25')][_0x45c8('0x69')];return db['sequelize'][_0x45c8('0x3a')](_0x1e369f,{'type':db[_0x45c8('0x6a')][_0x45c8('0x6b')]['SELECT'],'raw':!![]})[_0x45c8('0x1d')](function(_0x1e184f){return _0x1e184f;});})[_0x45c8('0x1d')](function(_0x15a8bc){if(_0x15a8bc){_0xb5c4e0['message']['contact']=_0x15a8bc[0x0];if(!_0x3cd442[_0x45c8('0x54')][_0x45c8('0x5b')])return;return db['User']['find']({'where':{'id':_0x3cd442[_0x45c8('0x54')][_0x45c8('0x5b')],'role':_0x45c8('0x6c')},'attributes':['id','name',_0x45c8('0x6d'),_0x45c8('0x6e'),_0x45c8('0x6f')],'raw':!![]});}return null;})['then'](function(_0x4f5a88){if(!_0x4f5a88)return null;_0xb5c4e0['message'][_0x45c8('0x6c')]=_0x4f5a88;return _0xb5c4e0;})[_0x45c8('0x1d')](function(_0x1baf8c){if(_0x1baf8c){if(_0x3cd442[_0x45c8('0x54')][_0x45c8('0x70')]){_0xb5c4e0[_0x45c8('0x25')][_0x45c8('0x71')]=util[_0x45c8('0x72')](_0x45c8('0x73'),_0x3cd442['user'][_0x45c8('0x32')]);_0xb5c4e0[_0x45c8('0x25')]['channel']=_0xb5c4e0[_0x45c8('0x74')];_0xb5c4e0[_0x45c8('0x25')]['motionChannel']=_0xb5c4e0['channel'];_0xb5c4e0[_0x45c8('0x25')]['event']=_0x45c8('0x57');return respondWithRpcPromise(_0x45c8('0x75'),_0x45c8('0x75'),{'event':_0x45c8('0x76'),'message':_['merge'](_0xb5c4e0[_0x45c8('0x25')],JSON[_0x45c8('0x77')](_0xb5c4e0[_0x45c8('0x63')][_0x45c8('0x78')]))},client9002)[_0x45c8('0x1d')](function(){return _0xb5c4e0;});}return _0xb5c4e0;}return null;})[_0x45c8('0x1d')](respondWithResult(_0x35f551,null))[_0x45c8('0x4d')](handleError(_0x35f551,null));};var interaction_log=require('../../config/logger')(_0x45c8('0x79'));exports[_0x45c8('0x2e')]=function(_0x392a08,_0x2fd384,_0x1bb324){var _0x13043c={'agent':{},'channel':_0x45c8('0x58')};if(_0x392a08[_0x45c8('0x54')]['id']){delete _0x392a08['body']['id'];}_0x392a08[_0x45c8('0x54')][_0x45c8('0x5b')]=_0x392a08['body'][_0x45c8('0x5b')]||_0x392a08[_0x45c8('0x5c')]['id'];_0x13043c[_0x45c8('0x6c')]['id']=_0x392a08[_0x45c8('0x54')]['UserId'];return db[_0x45c8('0x36')][_0x45c8('0x52')]({'where':{'id':_0x392a08[_0x45c8('0x4f')]['id'],'UserId':null}})[_0x45c8('0x1d')](handleEntityNotFound(_0x2fd384,null))[_0x45c8('0x1d')](function(_0x2f95f8){if(_0x2f95f8){_0x13043c['message']=_0x2f95f8['get']({'plain':!![]});return db[_0x45c8('0x5e')][_0x45c8('0x52')]({'where':{'id':_0x2f95f8[_0x45c8('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x2fd384,null))[_0x45c8('0x1d')](function(_0x1d368f){if(_0x1d368f){_0x13043c[_0x45c8('0x63')]=_0x1d368f[_0x45c8('0x5d')]({'plain':!![]});interaction_log[_0x45c8('0x26')](_0x45c8('0x7a'),_0x392a08[_0x45c8('0x5c')]['id'],_0x392a08[_0x45c8('0x5c')][_0x45c8('0x32')],_0x392a08[_0x45c8('0x5c')]['role'],_0x13043c[_0x45c8('0x63')]['id'],_0x392a08['body']?JSON['stringify'](_0x392a08[_0x45c8('0x54')]):_0x45c8('0x65'));return respondWithRpcPromise(_0x45c8('0x7b'),_0x45c8('0x7c'),_0x13043c);}return null;})['then'](function(_0x8bc46e){var _0x31d2a3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x8bc46e[_0x45c8('0x25')][_0x45c8('0x69')];return db[_0x45c8('0x7d')][_0x45c8('0x3a')](_0x31d2a3,{'type':db['Sequelize'][_0x45c8('0x6b')][_0x45c8('0x7e')],'raw':!![]})[_0x45c8('0x1d')](function(_0x5ee2c9){return _0x5ee2c9;});})[_0x45c8('0x1d')](function(_0xfbe54){if(_0xfbe54){_0x13043c[_0x45c8('0x25')][_0x45c8('0x7f')]=_0xfbe54[0x0];if(!_0x392a08['body'][_0x45c8('0x5b')])return;return db['User'][_0x45c8('0x52')]({'where':{'id':_0x392a08['body'][_0x45c8('0x5b')],'role':_0x45c8('0x6c')},'attributes':['id','name','fullname',_0x45c8('0x6e'),_0x45c8('0x6f')],'raw':!![]});}return null;})[_0x45c8('0x1d')](function(_0x1453c0){if(!_0x1453c0)return null;_0x13043c[_0x45c8('0x25')]['agent']=_0x1453c0;return _0x13043c;})[_0x45c8('0x1d')](function(_0x2d3c41){if(_0x2d3c41){_0x2d3c41['message']['interface']=util[_0x45c8('0x72')](_0x45c8('0x73'),_0x392a08[_0x45c8('0x5c')]['name']);_0x2d3c41[_0x45c8('0x25')]['channel']=_0x13043c['channel'];_0x2d3c41[_0x45c8('0x25')][_0x45c8('0x80')]=_0x13043c[_0x45c8('0x74')];_0x2d3c41['message']['event']=_0x45c8('0x2e');respondWithRpcPromise(_0x45c8('0x75'),'EventManager',{'event':_0x45c8('0x81'),'message':_[_0x45c8('0x47')](_0x13043c[_0x45c8('0x25')],JSON[_0x45c8('0x77')](_0x13043c[_0x45c8('0x63')][_0x45c8('0x78')]))},client9002);return _0x13043c;}return null;})[_0x45c8('0x1d')](respondWithResult(_0x2fd384,null))['catch'](handleError(_0x2fd384,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 29e4778..7c54fd7 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 _0xe551=['../../mysqldb','setMaxListeners','update','emit','hook','exports','events'];(function(_0x5c08b0,_0x4e7ac1){var _0xdecb64=function(_0x4896d8){while(--_0x4896d8){_0x5c08b0['push'](_0x5c08b0['shift']());}};_0xdecb64(++_0x4e7ac1);}(_0xe551,0x1c6));var _0x1e55=function(_0x468a6c,_0x3300bd){_0x468a6c=_0x468a6c-0x0;var _0xd45630=_0xe551[_0x468a6c];return _0xd45630;};'use strict';var EventEmitter=require(_0x1e55('0x0'));var ChatMessage=require(_0x1e55('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1e55('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e55('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47b1c3){return function(_0x158918,_0x13b7f9,_0x590001){ChatMessageEvents[_0x1e55('0x4')](_0x47b1c3+':'+_0x158918['id'],_0x158918);ChatMessageEvents[_0x1e55('0x4')](_0x47b1c3,_0x158918);_0x590001(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1e55('0x5')](e,emitEvent(event));}}module[_0x1e55('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x7acd=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x5b0aef,_0x2d7d6f){var _0x14e3d2=function(_0x3947aa){while(--_0x3947aa){_0x5b0aef['push'](_0x5b0aef['shift']());}};_0x14e3d2(++_0x2d7d6f);}(_0x7acd,0x12c));var _0xd7ac=function(_0x11b240,_0xcd8bcf){_0x11b240=_0x11b240-0x0;var _0x35db6b=_0x7acd[_0x11b240];return _0x35db6b;};'use strict';var EventEmitter=require(_0xd7ac('0x0'));var ChatMessage=require(_0xd7ac('0x1'))['db'][_0xd7ac('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd7ac('0x3'),'afterUpdate':_0xd7ac('0x4'),'afterDestroy':_0xd7ac('0x5')};function emitEvent(_0x93d375){return function(_0x1ed461,_0x13e88c,_0x17d958){ChatMessageEvents[_0xd7ac('0x6')](_0x93d375+':'+_0x1ed461['id'],_0x1ed461);ChatMessageEvents['emit'](_0x93d375,_0x1ed461);_0x17d958(null);};}for(var e in events){if(events[_0xd7ac('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xd7ac('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 8053667..07e29c8 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 _0xed05=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','models','direction','toLowerCase','secret','isNil','UserId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4cb500,_0x1c2845){var _0x35263c=function(_0x3a78cc){while(--_0x3a78cc){_0x4cb500['push'](_0x4cb500['shift']());}};_0x35263c(++_0x1c2845);}(_0xed05,0xcd));var _0x5ed0=function(_0x1716fb,_0xe6dcff){_0x1716fb=_0x1716fb-0x0;var _0x196932=_0xed05[_0x1716fb];return _0x196932;};'use strict';var _=require(_0x5ed0('0x0'));var util=require(_0x5ed0('0x1'));var logger=require(_0x5ed0('0x2'))(_0x5ed0('0x3'));var moment=require(_0x5ed0('0x4'));var BPromise=require(_0x5ed0('0x5'));var rp=require(_0x5ed0('0x6'));var fs=require('fs');var path=require(_0x5ed0('0x7'));var rimraf=require(_0x5ed0('0x8'));var config=require(_0x5ed0('0x9'));var attributes=require(_0x5ed0('0xa'));module[_0x5ed0('0xb')]=function(_0x5b9994,_0x4712b3){return _0x5b9994['define'](_0x5ed0('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x5ed0('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3aee4c,_0x36d4e2,_0x5a1295){var _0x18f1be=_0x5b9994[_0x5ed0('0xe')];var _0x36ee24=_0x3aee4c['get']({'plain':!![]});if(_0x36ee24[_0x5ed0('0xf')][_0x5ed0('0x10')]()==='in'||_0x36ee24[_0x5ed0('0xf')][_0x5ed0('0x10')]()==='out'&&!_0x36ee24[_0x5ed0('0x11')]&&!_[_0x5ed0('0x12')](_0x36ee24[_0x5ed0('0x13')])){_0x18f1be['ChatInteraction']['findOne']({'where':{'id':_0x36ee24['ChatInteractionId']}})[_0x5ed0('0x14')](function(_0x454192){if(_0x454192){_0x454192[_0x5ed0('0x15')]({'lastMsgAt':_0x36ee24['createdAt'],'lastMsgDirection':_0x36ee24[_0x5ed0('0xf')][_0x5ed0('0x10')]()});}})[_0x5ed0('0x16')](function(_0x56cadd){console[_0x5ed0('0x17')](_0x56cadd);});}_0x5a1295();}},'charset':_0x5ed0('0x18'),'collate':_0x5ed0('0x19')});};
\ No newline at end of file
+var _0xb879=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x2cd9f6,_0x450d32){var _0x35182a=function(_0x9943b1){while(--_0x9943b1){_0x2cd9f6['push'](_0x2cd9f6['shift']());}};_0x35182a(++_0x450d32);}(_0xb879,0x1e1));var _0x9b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb879[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9b87('0x0'));var logger=require('../../config/logger')(_0x9b87('0x1'));var moment=require(_0x9b87('0x2'));var BPromise=require(_0x9b87('0x3'));var rp=require(_0x9b87('0x4'));var fs=require('fs');var path=require(_0x9b87('0x5'));var rimraf=require(_0x9b87('0x6'));var config=require(_0x9b87('0x7'));var attributes=require(_0x9b87('0x8'));module['exports']=function(_0x5472a8,_0x551383){return _0x5472a8['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9b87('0x9'),'fields':[_0x9b87('0xa')],'type':_0x9b87('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d83d2,_0xdc7751,_0x3f4379){var _0x5bb989=_0x5472a8[_0x9b87('0xc')];var _0x147b83=_0x1d83d2['get']({'plain':!![]});if(_0x147b83[_0x9b87('0xd')][_0x9b87('0xe')]()==='in'||_0x147b83[_0x9b87('0xd')][_0x9b87('0xe')]()===_0x9b87('0xf')&&!_0x147b83[_0x9b87('0x10')]&&!_[_0x9b87('0x11')](_0x147b83['UserId'])){_0x5bb989['ChatInteraction']['findOne']({'where':{'id':_0x147b83['ChatInteractionId']}})['then'](function(_0x5401c9){if(_0x5401c9){_0x5401c9['update']({'lastMsgAt':_0x147b83[_0x9b87('0x12')],'lastMsgDirection':_0x147b83[_0x9b87('0xd')][_0x9b87('0xe')]()});}})['catch'](function(_0x352342){console[_0x9b87('0x13')](_0x352342);});}_0x3f4379();}},'charset':_0x9b87('0x14'),'collate':_0x9b87('0x15')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 39c182b..4f7b727 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 _0xc03a=['result','catch','ChatMessage','body','options','raw','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3a6eb9,_0x2355df){var _0x16add3=function(_0x3324b2){while(--_0x3324b2){_0x3a6eb9['push'](_0x3a6eb9['shift']());}};_0x16add3(++_0x2355df);}(_0xc03a,0x1e3));var _0xac03=function(_0x30fb19,_0x42e71e){_0x30fb19=_0x30fb19-0x0;var _0x2f2695=_0xc03a[_0x30fb19];return _0x2f2695;};'use strict';var _=require(_0xac03('0x0'));var util=require(_0xac03('0x1'));var moment=require(_0xac03('0x2'));var BPromise=require('bluebird');var rs=require(_0xac03('0x3'));var fs=require('fs');var Redis=require(_0xac03('0x4'));var db=require(_0xac03('0x5'))['db'];var utils=require(_0xac03('0x6'));var logger=require(_0xac03('0x7'))(_0xac03('0x8'));var config=require(_0xac03('0x9'));var jayson=require(_0xac03('0xa'));var client=jayson[_0xac03('0xb')][_0xac03('0xc')]({'port':0x232a});config[_0xac03('0xd')]=_['defaults'](config[_0xac03('0xd')],{'host':_0xac03('0xe'),'port':0x18eb});var socket=require(_0xac03('0xf'))(new Redis(config[_0xac03('0xd')]));require('./chatMessage.socket')[_0xac03('0x10')](socket);function respondWithRpcPromise(_0x2cb197,_0x323771,_0x61fb5c){return new BPromise(function(_0x2dfcb4,_0x2c13f4){return client[_0xac03('0x11')](_0x2cb197,_0x61fb5c)[_0xac03('0x12')](function(_0x25c7a0){logger[_0xac03('0x13')](_0xac03('0x14'),_0x323771,_0xac03('0x15'));logger[_0xac03('0x16')](_0xac03('0x17'),_0x323771,'request\x20sent',JSON[_0xac03('0x18')](_0x25c7a0));if(_0x25c7a0['error']){if(_0x25c7a0[_0xac03('0x19')]['code']===0x1f4){logger['error'](_0xac03('0x14'),_0x323771,_0x25c7a0['error'][_0xac03('0x1a')]);return _0x2c13f4(_0x25c7a0[_0xac03('0x19')][_0xac03('0x1a')]);}logger['error'](_0xac03('0x14'),_0x323771,_0x25c7a0[_0xac03('0x19')][_0xac03('0x1a')]);return _0x2dfcb4(_0x25c7a0['error'][_0xac03('0x1a')]);}else{logger[_0xac03('0x13')](_0xac03('0x14'),_0x323771,_0xac03('0x15'));_0x2dfcb4(_0x25c7a0[_0xac03('0x1b')]['message']);}})[_0xac03('0x1c')](function(_0xe05c4c){logger[_0xac03('0x19')](_0xac03('0x14'),_0x323771,_0xe05c4c);_0x2c13f4(_0xe05c4c);});});}exports['CreateChatMessage']=function(_0x486f23){var _0x38de5f=this;return new Promise(function(_0x5e6e77,_0x2a830b){return db[_0xac03('0x1d')]['create'](_0x486f23[_0xac03('0x1e')],{'raw':_0x486f23[_0xac03('0x1f')]?_0x486f23['options'][_0xac03('0x20')]===undefined?!![]:![]:!![]})[_0xac03('0x12')](function(_0x4d0c65){logger[_0xac03('0x13')](_0xac03('0x21'),_0x486f23);logger[_0xac03('0x16')]('CreateChatMessage',_0x486f23,JSON[_0xac03('0x18')](_0x4d0c65));_0x5e6e77(_0x4d0c65);})['catch'](function(_0x2cdba8){logger['error'](_0xac03('0x21'),_0x2cdba8[_0xac03('0x1a')],_0x486f23);_0x2a830b(_0x38de5f['error'](0x1f4,_0x2cdba8[_0xac03('0x1a')]));});});};
\ No newline at end of file
+var _0xdbb9=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatMessage','options','raw','CreateChatMessage'];(function(_0x5f132e,_0x3432c2){var _0x1efc2a=function(_0x47ca58){while(--_0x47ca58){_0x5f132e['push'](_0x5f132e['shift']());}};_0x1efc2a(++_0x3432c2);}(_0xdbb9,0xf9));var _0x9dbb=function(_0xd58b1a,_0xf139f4){_0xd58b1a=_0xd58b1a-0x0;var _0x2832d5=_0xdbb9[_0xd58b1a];return _0x2832d5;};'use strict';var _=require('lodash');var util=require(_0x9dbb('0x0'));var moment=require(_0x9dbb('0x1'));var BPromise=require(_0x9dbb('0x2'));var rs=require(_0x9dbb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dbb('0x4'))['db'];var utils=require(_0x9dbb('0x5'));var logger=require(_0x9dbb('0x6'))(_0x9dbb('0x7'));var config=require(_0x9dbb('0x8'));var jayson=require(_0x9dbb('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9dbb('0xa')](config[_0x9dbb('0xb')],{'host':_0x9dbb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9dbb('0xd'))[_0x9dbb('0xe')](socket);function respondWithRpcPromise(_0x37f00d,_0x502a4c,_0x40bc14){return new BPromise(function(_0x22f3b0,_0x5b9290){return client[_0x9dbb('0xf')](_0x37f00d,_0x40bc14)['then'](function(_0x435a9c){logger[_0x9dbb('0x10')](_0x9dbb('0x11'),_0x502a4c,_0x9dbb('0x12'));logger[_0x9dbb('0x13')](_0x9dbb('0x14'),_0x502a4c,_0x9dbb('0x12'),JSON[_0x9dbb('0x15')](_0x435a9c));if(_0x435a9c[_0x9dbb('0x16')]){if(_0x435a9c[_0x9dbb('0x16')][_0x9dbb('0x17')]===0x1f4){logger[_0x9dbb('0x16')](_0x9dbb('0x11'),_0x502a4c,_0x435a9c[_0x9dbb('0x16')][_0x9dbb('0x18')]);return _0x5b9290(_0x435a9c[_0x9dbb('0x16')]['message']);}logger[_0x9dbb('0x16')](_0x9dbb('0x11'),_0x502a4c,_0x435a9c[_0x9dbb('0x16')][_0x9dbb('0x18')]);return _0x22f3b0(_0x435a9c[_0x9dbb('0x16')]['message']);}else{logger[_0x9dbb('0x10')](_0x9dbb('0x11'),_0x502a4c,_0x9dbb('0x12'));_0x22f3b0(_0x435a9c[_0x9dbb('0x19')][_0x9dbb('0x18')]);}})['catch'](function(_0x3dfd6c){logger['error'](_0x9dbb('0x11'),_0x502a4c,_0x3dfd6c);_0x5b9290(_0x3dfd6c);});});}exports['CreateChatMessage']=function(_0x5b0cde){var _0x5d8250=this;return new Promise(function(_0x259cb6,_0x192eb5){return db[_0x9dbb('0x1a')]['create'](_0x5b0cde['body'],{'raw':_0x5b0cde['options']?_0x5b0cde[_0x9dbb('0x1b')][_0x9dbb('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4a07ef){logger['info'](_0x9dbb('0x1d'),_0x5b0cde);logger[_0x9dbb('0x13')](_0x9dbb('0x1d'),_0x5b0cde,JSON['stringify'](_0x4a07ef));_0x259cb6(_0x4a07ef);})[_0x9dbb('0x1e')](function(_0x130d84){logger[_0x9dbb('0x16')](_0x9dbb('0x1d'),_0x130d84[_0x9dbb('0x18')],_0x5b0cde);_0x192eb5(_0x5d8250[_0x9dbb('0x16')](0x1f4,_0x130d84[_0x9dbb('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index d8d263e..da7057e 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 _0x8a8b=['update','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x4bf0f2,_0x3aa38b){var _0x7b0d6e=function(_0x57b762){while(--_0x57b762){_0x4bf0f2['push'](_0x4bf0f2['shift']());}};_0x7b0d6e(++_0x3aa38b);}(_0x8a8b,0xae));var _0xb8a8=function(_0x318e7d,_0x488b03){_0x318e7d=_0x318e7d-0x0;var _0x34c556=_0x8a8b[_0x318e7d];return _0x34c556;};'use strict';var ChatMessageEvents=require(_0xb8a8('0x0'));var events=['save','remove',_0xb8a8('0x1')];function createListener(_0x308da3,_0x4f56d4){return function(_0x13bc8b){_0x4f56d4['emit'](_0x308da3,_0x13bc8b);};}function removeListener(_0xca9854,_0x4fe301){return function(){ChatMessageEvents[_0xb8a8('0x2')](_0xca9854,_0x4fe301);};}exports[_0xb8a8('0x3')]=function(_0xcca5ca){for(var _0x578e1b=0x0,_0x37e48d=events['length'];_0x578e1b<_0x37e48d;_0x578e1b++){var _0x32d542=events[_0x578e1b];var _0x4c46e9=createListener(_0xb8a8('0x4')+_0x32d542,_0xcca5ca);ChatMessageEvents['on'](_0x32d542,_0x4c46e9);}};
\ No newline at end of file
+var _0x2123=['./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3ac5ce,_0x51a92a){var _0x455386=function(_0x2b0fb6){while(--_0x2b0fb6){_0x3ac5ce['push'](_0x3ac5ce['shift']());}};_0x455386(++_0x51a92a);}(_0x2123,0x190));var _0x3212=function(_0x49dbe9,_0x52d2da){_0x49dbe9=_0x49dbe9-0x0;var _0x13c5bb=_0x2123[_0x49dbe9];return _0x13c5bb;};'use strict';var ChatMessageEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatMessageEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatMessage:'+_0x4b35e9,_0x5d9d36);ChatMessageEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ebb7f01..ce416ba 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 _0xca5b=['chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','tracked','chat'];(function(_0x3d7e4d,_0x972ff8){var _0x52fc1c=function(_0x1d9b2d){while(--_0x1d9b2d){_0x3d7e4d['push'](_0x3d7e4d['shift']());}};_0x52fc1c(++_0x972ff8);}(_0xca5b,0xca));var _0xbca5=function(_0x5545f7,_0x570414){_0x5545f7=_0x5545f7-0x0;var _0x52a979=_0xca5b[_0x5545f7];return _0x52a979;};'use strict';var multer=require(_0xbca5('0x0'));var util=require(_0xbca5('0x1'));var path=require(_0xbca5('0x2'));var timeout=require('connect-timeout');var express=require(_0xbca5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbca5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbca5('0x5'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbca5('0x6')]);router[_0xbca5('0x7')]('/describe',auth[_0xbca5('0x8')](),controller[_0xbca5('0x9')]);router['get'](_0xbca5('0xa'),auth[_0xbca5('0x8')](),controller[_0xbca5('0xb')]);router['post']('/',auth[_0xbca5('0x8')](),interaction[_0xbca5('0xc')](_0xbca5('0xd'),_0xbca5('0xe')),controller[_0xbca5('0xf')]);router[_0xbca5('0x10')](_0xbca5('0xa'),controller[_0xbca5('0x11')]);router[_0xbca5('0x10')](_0xbca5('0x12'),auth['isAuthenticated'](),controller[_0xbca5('0x13')]);router['put'](_0xbca5('0x14'),auth[_0xbca5('0x8')](),controller[_0xbca5('0x15')]);router['delete'](_0xbca5('0xa'),auth[_0xbca5('0x8')](),controller[_0xbca5('0x16')]);module[_0xbca5('0x17')]=router;
\ No newline at end of file
+var _0x3740=['describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x1e9b13,_0x78c34b){var _0x27254f=function(_0x3aa64d){while(--_0x3aa64d){_0x1e9b13['push'](_0x1e9b13['shift']());}};_0x27254f(++_0x78c34b);}(_0x3740,0x1be));var _0x0374=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x3740[_0x41382c];return _0x4da35b;};'use strict';var multer=require(_0x0374('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0374('0x1'));var express=require(_0x0374('0x2'));var router=express['Router']();var fs_extra=require(_0x0374('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0374('0x4'));var config=require('../../config/environment');var controller=require(_0x0374('0x5'));router[_0x0374('0x6')]('/',auth[_0x0374('0x7')](),controller[_0x0374('0x8')]);router[_0x0374('0x6')](_0x0374('0x9'),auth[_0x0374('0x7')](),controller[_0x0374('0xa')]);router[_0x0374('0x6')](_0x0374('0xb'),auth[_0x0374('0x7')](),controller[_0x0374('0xc')]);router[_0x0374('0xd')]('/',auth[_0x0374('0x7')](),interaction[_0x0374('0xe')](_0x0374('0xf'),_0x0374('0x10')),controller[_0x0374('0x11')]);router[_0x0374('0x12')](_0x0374('0xb'),controller[_0x0374('0x13')]);router[_0x0374('0x12')](_0x0374('0x14'),auth[_0x0374('0x7')](),controller['accept']);router[_0x0374('0x12')](_0x0374('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0x0374('0x16')](_0x0374('0xb'),auth[_0x0374('0x7')](),controller['destroy']);module[_0x0374('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 43e53b3..a79baea 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 _0xe6b8=['exports','medium','sequelize'];(function(_0x940767,_0x1db6f0){var _0x383f30=function(_0x5d2048){while(--_0x5d2048){_0x940767['push'](_0x940767['shift']());}};_0x383f30(++_0x1db6f0);}(_0xe6b8,0x140));var _0x8e6b=function(_0x15e7b3,_0x39008d){_0x15e7b3=_0x15e7b3-0x0;var _0x53d9b5=_0xe6b8[_0x15e7b3];return _0x53d9b5;};'use strict';var Sequelize=require(_0x8e6b('0x0'));module[_0x8e6b('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8e6b('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x4dd2=['medium','exports','TEXT'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x4dd2,0xf1));var _0x24dd=function(_0x4bc4c8,_0x3139d3){_0x4bc4c8=_0x4bc4c8-0x0;var _0x3bb121=_0x4dd2[_0x4bc4c8];return _0x3bb121;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'body':{'type':Sequelize[_0x24dd('0x1')](_0x24dd('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index aa3a96a..d21e299 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 _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(_0x5eab2d,_0xe39035){var _0x21a8cd=function(_0x178eb9){while(--_0x178eb9){_0x5eab2d['push'](_0x5eab2d['shift']());}};_0x21a8cd(++_0xe39035);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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
+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(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x7a54,0x106));var _0x47a5=function(_0x254099,_0x8117ce){_0x254099=_0x254099-0x0;var _0x5b60ee=_0x7a54[_0x254099];return _0x5b60ee;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 2fa61fc..e410d25 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 _0x21b8=['request-promise','path','./chatOfflineMessage.attributes','ChatOfflineMessage','utf8mb4','lodash','util','api','bluebird'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x21b8,0x176));var _0x821b=function(_0x20085e,_0x1aaa2c){_0x20085e=_0x20085e-0x0;var _0x334a97=_0x21b8[_0x20085e];return _0x334a97;};'use strict';var _=require(_0x821b('0x0'));var util=require(_0x821b('0x1'));var logger=require('../../config/logger')(_0x821b('0x2'));var moment=require('moment');var BPromise=require(_0x821b('0x3'));var rp=require(_0x821b('0x4'));var fs=require('fs');var path=require(_0x821b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x821b('0x6'));module['exports']=function(_0x3b0c07,_0x48cf38){return _0x3b0c07['define'](_0x821b('0x7'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x821b('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc49f=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4508e8,_0x154547){var _0x11d273=function(_0x381f23){while(--_0x381f23){_0x4508e8['push'](_0x4508e8['shift']());}};_0x11d273(++_0x154547);}(_0xc49f,0x1d7));var _0xfc49=function(_0x3caa85,_0x516248){_0x3caa85=_0x3caa85-0x0;var _0x59bdf3=_0xc49f[_0x3caa85];return _0x59bdf3;};'use strict';var _=require(_0xfc49('0x0'));var util=require('util');var logger=require(_0xfc49('0x1'))(_0xfc49('0x2'));var moment=require('moment');var BPromise=require(_0xfc49('0x3'));var rp=require(_0xfc49('0x4'));var fs=require('fs');var path=require(_0xfc49('0x5'));var rimraf=require(_0xfc49('0x6'));var config=require(_0xfc49('0x7'));var attributes=require(_0xfc49('0x8'));module[_0xfc49('0x9')]=function(_0x5c3636,_0x397dae){return _0x5c3636[_0xfc49('0xa')](_0xfc49('0xb'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc49('0xc'),'collate':_0xfc49('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 6c65c6d..f995228 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 _0xfd27=['../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0xfd27,0x1cf));var _0x7fd2=function(_0x4a32e7,_0x1a8572){_0x4a32e7=_0x4a32e7-0x0;var _0x4b9700=_0xfd27[_0x4a32e7];return _0x4b9700;};'use strict';var _=require(_0x7fd2('0x0'));var util=require('util');var moment=require(_0x7fd2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fd2('0x2'));var db=require(_0x7fd2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fd2('0x4'))('rpc');var config=require(_0x7fd2('0x5'));var jayson=require(_0x7fd2('0x6'));var client=jayson[_0x7fd2('0x7')][_0x7fd2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ef3b1,_0x26dc02,_0x3e3878){return new BPromise(function(_0x42eb3e,_0x1f4c5d){return client[_0x7fd2('0x9')](_0x4ef3b1,_0x3e3878)['then'](function(_0x4befd0){logger['info'](_0x7fd2('0xa'),_0x26dc02,_0x7fd2('0xb'));logger['debug'](_0x7fd2('0xc'),_0x26dc02,'request\x20sent',JSON[_0x7fd2('0xd')](_0x4befd0));if(_0x4befd0[_0x7fd2('0xe')]){if(_0x4befd0[_0x7fd2('0xe')]['code']===0x1f4){logger[_0x7fd2('0xe')](_0x7fd2('0xa'),_0x26dc02,_0x4befd0['error'][_0x7fd2('0xf')]);return _0x1f4c5d(_0x4befd0[_0x7fd2('0xe')][_0x7fd2('0xf')]);}logger[_0x7fd2('0xe')](_0x7fd2('0xa'),_0x26dc02,_0x4befd0[_0x7fd2('0xe')][_0x7fd2('0xf')]);return _0x42eb3e(_0x4befd0[_0x7fd2('0xe')][_0x7fd2('0xf')]);}else{logger[_0x7fd2('0x10')](_0x7fd2('0xa'),_0x26dc02,_0x7fd2('0xb'));_0x42eb3e(_0x4befd0[_0x7fd2('0x11')][_0x7fd2('0xf')]);}})['catch'](function(_0x54b7f9){logger[_0x7fd2('0xe')](_0x7fd2('0xa'),_0x26dc02,_0x54b7f9);_0x1f4c5d(_0x54b7f9);});});}
\ No newline at end of file
+var _0xb719=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x137c34,_0x2ebd98){var _0x145d9b=function(_0x1b7701){while(--_0x1b7701){_0x137c34['push'](_0x137c34['shift']());}};_0x145d9b(++_0x2ebd98);}(_0xb719,0x1f4));var _0x9b71=function(_0x38622b,_0x3cfdf7){_0x38622b=_0x38622b-0x0;var _0x2c1a7a=_0xb719[_0x38622b];return _0x2c1a7a;};'use strict';var _=require(_0x9b71('0x0'));var util=require(_0x9b71('0x1'));var moment=require(_0x9b71('0x2'));var BPromise=require(_0x9b71('0x3'));var rs=require(_0x9b71('0x4'));var fs=require('fs');var Redis=require(_0x9b71('0x5'));var db=require(_0x9b71('0x6'))['db'];var utils=require(_0x9b71('0x7'));var logger=require('../../config/logger')(_0x9b71('0x8'));var config=require(_0x9b71('0x9'));var jayson=require(_0x9b71('0xa'));var client=jayson['client'][_0x9b71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39e280,_0x2d9fcb,_0x4cd350){return new BPromise(function(_0x5e3951,_0x2a4d12){return client[_0x9b71('0xc')](_0x39e280,_0x4cd350)[_0x9b71('0xd')](function(_0x18bc6c){logger[_0x9b71('0xe')](_0x9b71('0xf'),_0x2d9fcb,_0x9b71('0x10'));logger[_0x9b71('0x11')](_0x9b71('0x12'),_0x2d9fcb,'request\x20sent',JSON[_0x9b71('0x13')](_0x18bc6c));if(_0x18bc6c[_0x9b71('0x14')]){if(_0x18bc6c[_0x9b71('0x14')][_0x9b71('0x15')]===0x1f4){logger[_0x9b71('0x14')](_0x9b71('0xf'),_0x2d9fcb,_0x18bc6c[_0x9b71('0x14')][_0x9b71('0x16')]);return _0x2a4d12(_0x18bc6c[_0x9b71('0x14')]['message']);}logger[_0x9b71('0x14')](_0x9b71('0xf'),_0x2d9fcb,_0x18bc6c[_0x9b71('0x14')]['message']);return _0x5e3951(_0x18bc6c[_0x9b71('0x14')]['message']);}else{logger[_0x9b71('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2d9fcb,_0x9b71('0x10'));_0x5e3951(_0x18bc6c[_0x9b71('0x17')][_0x9b71('0x16')]);}})[_0x9b71('0x18')](function(_0x10b0cc){logger['error'](_0x9b71('0xf'),_0x2d9fcb,_0x10b0cc);_0x2a4d12(_0x10b0cc);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d8dcdbe..25c5734 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 _0xc921=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x50ad33,_0x368a00){var _0x125443=function(_0x38296a){while(--_0x38296a){_0x50ad33['push'](_0x50ad33['shift']());}};_0x125443(++_0x368a00);}(_0xc921,0x125));var _0x1c92=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0xc921[_0x1795df];return _0x3f13c0;};'use strict';var multer=require(_0x1c92('0x0'));var util=require(_0x1c92('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c92('0x2')]();var fs_extra=require(_0x1c92('0x3'));var auth=require(_0x1c92('0x4'));var interaction=require(_0x1c92('0x5'));var config=require('../../config/environment');var controller=require(_0x1c92('0x6'));router[_0x1c92('0x7')]('/',auth[_0x1c92('0x8')](),controller[_0x1c92('0x9')]);router['get'](_0x1c92('0xa'),auth[_0x1c92('0x8')](),controller[_0x1c92('0xb')]);router[_0x1c92('0x7')](_0x1c92('0xc'),auth[_0x1c92('0x8')](),controller[_0x1c92('0xd')]);router[_0x1c92('0xe')]('/',auth['isAuthenticated'](),controller[_0x1c92('0xf')]);router[_0x1c92('0x10')]('/:id',auth[_0x1c92('0x8')](),controller[_0x1c92('0x11')]);router[_0x1c92('0x12')]('/:id',auth[_0x1c92('0x8')](),controller[_0x1c92('0x13')]);module[_0x1c92('0x14')]=router;
\ No newline at end of file
+var _0x8b1c=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','put','update','delete','/:id','destroy'];(function(_0x2c81b5,_0x1e6869){var _0x57c97f=function(_0x359537){while(--_0x359537){_0x2c81b5['push'](_0x2c81b5['shift']());}};_0x57c97f(++_0x1e6869);}(_0x8b1c,0xc7));var _0xc8b1=function(_0x12bf4c,_0x5cf024){_0x12bf4c=_0x12bf4c-0x0;var _0x3afed8=_0x8b1c[_0x12bf4c];return _0x3afed8;};'use strict';var multer=require(_0xc8b1('0x0'));var util=require(_0xc8b1('0x1'));var path=require(_0xc8b1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc8b1('0x3'));var router=express[_0xc8b1('0x4')]();var fs_extra=require(_0xc8b1('0x5'));var auth=require(_0xc8b1('0x6'));var interaction=require(_0xc8b1('0x7'));var config=require(_0xc8b1('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0xc8b1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc8b1('0xa')]);router[_0xc8b1('0x9')](_0xc8b1('0xb'),auth[_0xc8b1('0xc')](),controller[_0xc8b1('0xd')]);router[_0xc8b1('0x9')]('/:id',auth[_0xc8b1('0xc')](),controller[_0xc8b1('0xe')]);router[_0xc8b1('0xf')]('/',auth[_0xc8b1('0xc')](),controller['create']);router[_0xc8b1('0x10')]('/:id',auth[_0xc8b1('0xc')](),controller[_0xc8b1('0x11')]);router[_0xc8b1('0x12')](_0xc8b1('0x13'),auth['isAuthenticated'](),controller[_0xc8b1('0x14')]);module[_0xc8b1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 3fb5eba..065c0c9 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 _0x5144=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5144,0x12b));var _0x4514=function(_0x2cb3aa,_0x3e1442){_0x2cb3aa=_0x2cb3aa-0x0;var _0x7df597=_0x5144[_0x2cb3aa];return _0x7df597;};'use strict';var Sequelize=require(_0x4514('0x0'));module[_0x4514('0x1')]={'name':{'type':Sequelize[_0x4514('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4514('0x3'),_0x4514('0x4')),'defaultValue':_0x4514('0x3')},'selector':{'type':Sequelize[_0x4514('0x2')]},'timeout':{'type':Sequelize[_0x4514('0x5')]}};
\ No newline at end of file
+var _0xb0ef=['timeout','mouseOver','sequelize','STRING','ENUM'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xb0ef,0x7f));var _0xfb0e=function(_0x631c4,_0x592943){_0x631c4=_0x631c4-0x0;var _0xa5ba19=_0xb0ef[_0x631c4];return _0xa5ba19;};'use strict';var Sequelize=require(_0xfb0e('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb0e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfb0e('0x2')]('mouseOver',_0xfb0e('0x3')),'defaultValue':_0xfb0e('0x4')},'selector':{'type':Sequelize[_0xfb0e('0x1')]},'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 84e7e1f..33b3c7c 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 _0xaa7c=['find','catch','create','body','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x5d1b9c,_0x242953){_0x5d1b9c=_0x5d1b9c-0x0;var _0x3b95e7=_0xaa7c[_0x5d1b9c];return _0x3b95e7;};'use strict';var emlformat=require(_0xcaa7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcaa7('0x1'));var BPromise=require(_0xcaa7('0x2'));var Mustache=require('mustache');var util=require(_0xcaa7('0x3'));var path=require(_0xcaa7('0x4'));var sox=require(_0xcaa7('0x5'));var csv=require(_0xcaa7('0x6'));var ejs=require(_0xcaa7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcaa7('0x9'));var deskjs=require(_0xcaa7('0xa'));var toCsv=require(_0xcaa7('0x6'));var querystring=require('querystring');var Papa=require(_0xcaa7('0xb'));var Redis=require(_0xcaa7('0xc'));var authService=require(_0xcaa7('0xd'));var qs=require(_0xcaa7('0xe'));var as=require(_0xcaa7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa7('0x10'))(_0xcaa7('0x11'));var utils=require(_0xcaa7('0x12'));var config=require(_0xcaa7('0x13'));var licenseUtil=require(_0xcaa7('0x14'));var db=require(_0xcaa7('0x15'))['db'];function respondWithStatusCode(_0x563f57,_0x24d3b0){_0x24d3b0=_0x24d3b0||0xcc;return function(_0x128cfb){if(_0x128cfb){return _0x563f57[_0xcaa7('0x16')](_0x24d3b0);}return _0x563f57[_0xcaa7('0x17')](_0x24d3b0)[_0xcaa7('0x18')]();};}function respondWithResult(_0x2eb4ff,_0x299490){_0x299490=_0x299490||0xc8;return function(_0x4a1d5a){if(_0x4a1d5a){return _0x2eb4ff['status'](_0x299490)[_0xcaa7('0x19')](_0x4a1d5a);}};}function respondWithFilteredResult(_0x1c1286,_0x1155fb){return function(_0x1b2c4f){if(_0x1b2c4f){var _0x49a218=typeof _0x1155fb[_0xcaa7('0x1a')]===_0xcaa7('0x1b')&&typeof _0x1155fb[_0xcaa7('0x1c')]===_0xcaa7('0x1b');var _0x46d9b4=_0x1b2c4f[_0xcaa7('0x1d')];var _0x20ede0=_0x49a218?0x0:_0x1155fb['offset'];var _0x53e1cb=_0x49a218?_0x1b2c4f[_0xcaa7('0x1d')]:_0x1155fb[_0xcaa7('0x1a')]+_0x1155fb[_0xcaa7('0x1c')];var _0x3bc53b;if(_0x53e1cb>=_0x46d9b4){_0x53e1cb=_0x46d9b4;_0x3bc53b=0xc8;}else{_0x3bc53b=0xce;}_0x1c1286[_0xcaa7('0x17')](_0x3bc53b);return _0x1c1286[_0xcaa7('0x1e')](_0xcaa7('0x1f'),_0x20ede0+'-'+_0x53e1cb+'/'+_0x46d9b4)['json'](_0x1b2c4f);}return null;};}function patchUpdates(_0x89e8a0){return function(_0x3650ac){try{jsonpatch[_0xcaa7('0x20')](_0x3650ac,_0x89e8a0,!![]);}catch(_0x11cbbf){return BPromise[_0xcaa7('0x21')](_0x11cbbf);}return _0x3650ac[_0xcaa7('0x22')]();};}function saveUpdates(_0x3119d5,_0x4259b7){return function(_0x2a9a79){if(_0x2a9a79){return _0x2a9a79[_0xcaa7('0x23')](_0x3119d5)[_0xcaa7('0x24')](function(_0x140c5a){return _0x140c5a;});}return null;};}function removeEntity(_0x24a18c,_0x56ee3a){return function(_0x97a507){if(_0x97a507){return _0x97a507[_0xcaa7('0x25')]()['then'](function(){_0x24a18c[_0xcaa7('0x17')](0xcc)[_0xcaa7('0x18')]();});}};}function handleEntityNotFound(_0x146e6f,_0x10b638){return function(_0x58384f){if(!_0x58384f){_0x146e6f['sendStatus'](0x194);}return _0x58384f;};}function handleError(_0x3c0b15,_0x3e1f78){_0x3e1f78=_0x3e1f78||0x1f4;return function(_0x3369f2){logger[_0xcaa7('0x26')](_0x3369f2[_0xcaa7('0x27')]);if(_0x3369f2['name']){delete _0x3369f2[_0xcaa7('0x28')];}_0x3c0b15['status'](_0x3e1f78)['send'](_0x3369f2);};}exports[_0xcaa7('0x29')]=function(_0x492362,_0x34a30d){var _0x623f17={'raw':!![],'where':{'id':_0x492362[_0xcaa7('0x2a')]['id']}},_0x748bda={};_0x748bda[_0xcaa7('0x2b')]=_[_0xcaa7('0x2c')](db[_0xcaa7('0x2d')][_0xcaa7('0x2e')]);_0x748bda['query']=_[_0xcaa7('0x2c')](_0x492362[_0xcaa7('0x2f')]);_0x748bda[_0xcaa7('0x30')]=_[_0xcaa7('0x31')](_0x748bda[_0xcaa7('0x2b')],_0x748bda['query']);_0x623f17[_0xcaa7('0x32')]=_[_0xcaa7('0x31')](_0x748bda[_0xcaa7('0x2b')],qs[_0xcaa7('0x33')](_0x492362[_0xcaa7('0x2f')]['fields']));_0x623f17[_0xcaa7('0x32')]=_0x623f17['attributes'][_0xcaa7('0x34')]?_0x623f17[_0xcaa7('0x32')]:_0x748bda[_0xcaa7('0x2b')];if(_0x492362['query'][_0xcaa7('0x35')]){_0x623f17[_0xcaa7('0x36')]=[{'all':!![]}];}_0x623f17=_[_0xcaa7('0x37')]({},_0x623f17,_0x492362[_0xcaa7('0x38')]);return db[_0xcaa7('0x2d')][_0xcaa7('0x39')](_0x623f17)['then'](handleEntityNotFound(_0x34a30d,null))[_0xcaa7('0x24')](respondWithResult(_0x34a30d,null))[_0xcaa7('0x3a')](handleError(_0x34a30d,null));};exports['create']=function(_0x455f6e,_0x43b8de){return db[_0xcaa7('0x2d')][_0xcaa7('0x3b')](_0x455f6e['body'],{})[_0xcaa7('0x24')](respondWithResult(_0x43b8de,0xc9))[_0xcaa7('0x3a')](handleError(_0x43b8de,null));};exports[_0xcaa7('0x23')]=function(_0x25bc49,_0x321e12){if(_0x25bc49[_0xcaa7('0x3c')]['id']){delete _0x25bc49[_0xcaa7('0x3c')]['id'];}return db[_0xcaa7('0x2d')][_0xcaa7('0x39')]({'where':{'id':_0x25bc49[_0xcaa7('0x2a')]['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x321e12,null))[_0xcaa7('0x24')](saveUpdates(_0x25bc49['body'],null))[_0xcaa7('0x24')](respondWithResult(_0x321e12,null))[_0xcaa7('0x3a')](handleError(_0x321e12,null));};exports[_0xcaa7('0x25')]=function(_0x2e4262,_0x5f1028){return db['ChatProactiveAction'][_0xcaa7('0x39')]({'where':{'id':_0x2e4262[_0xcaa7('0x2a')]['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x5f1028,null))['then'](removeEntity(_0x5f1028,null))[_0xcaa7('0x3a')](handleError(_0x5f1028,null));};
\ No newline at end of file
+var _0x9a6b=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','update','destroy','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','then','create','body','catch'];(function(_0x2f0b82,_0xa07e26){var _0x5d6fb1=function(_0x178f3f){while(--_0x178f3f){_0x2f0b82['push'](_0x2f0b82['shift']());}};_0x5d6fb1(++_0xa07e26);}(_0x9a6b,0x77));var _0xb9a6=function(_0x27ff4e,_0xf0b05a){_0x27ff4e=_0x27ff4e-0x0;var _0xfe567d=_0x9a6b[_0x27ff4e];return _0xfe567d;};'use strict';var emlformat=require(_0xb9a6('0x0'));var rimraf=require(_0xb9a6('0x1'));var zipdir=require(_0xb9a6('0x2'));var jsonpatch=require(_0xb9a6('0x3'));var rp=require(_0xb9a6('0x4'));var moment=require(_0xb9a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb9a6('0x6'));var util=require('util');var path=require(_0xb9a6('0x7'));var sox=require(_0xb9a6('0x8'));var csv=require(_0xb9a6('0x9'));var ejs=require(_0xb9a6('0xa'));var fs=require('fs');var fs_extra=require(_0xb9a6('0xb'));var _=require(_0xb9a6('0xc'));var squel=require(_0xb9a6('0xd'));var crypto=require(_0xb9a6('0xe'));var jsforce=require(_0xb9a6('0xf'));var deskjs=require(_0xb9a6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb9a6('0x11'));var Papa=require(_0xb9a6('0x12'));var Redis=require('ioredis');var authService=require(_0xb9a6('0x13'));var qs=require(_0xb9a6('0x14'));var as=require(_0xb9a6('0x15'));var hardwareService=require(_0xb9a6('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb9a6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9a6('0x18'))['db'];function respondWithStatusCode(_0x57b620,_0x3f4ce1){_0x3f4ce1=_0x3f4ce1||0xcc;return function(_0x21a637){if(_0x21a637){return _0x57b620[_0xb9a6('0x19')](_0x3f4ce1);}return _0x57b620[_0xb9a6('0x1a')](_0x3f4ce1)[_0xb9a6('0x1b')]();};}function respondWithResult(_0x6cbcc4,_0x3e140e){_0x3e140e=_0x3e140e||0xc8;return function(_0x158d6c){if(_0x158d6c){return _0x6cbcc4[_0xb9a6('0x1a')](_0x3e140e)['json'](_0x158d6c);}};}function respondWithFilteredResult(_0x463f33,_0x136d5d){return function(_0x414f37){if(_0x414f37){var _0x3342d2=typeof _0x136d5d['offset']===_0xb9a6('0x1c')&&typeof _0x136d5d[_0xb9a6('0x1d')]===_0xb9a6('0x1c');var _0x5b3395=_0x414f37[_0xb9a6('0x1e')];var _0x3b9a3b=_0x3342d2?0x0:_0x136d5d[_0xb9a6('0x1f')];var _0x1843e2=_0x3342d2?_0x414f37[_0xb9a6('0x1e')]:_0x136d5d['offset']+_0x136d5d[_0xb9a6('0x1d')];var _0x28e01a;if(_0x1843e2>=_0x5b3395){_0x1843e2=_0x5b3395;_0x28e01a=0xc8;}else{_0x28e01a=0xce;}_0x463f33[_0xb9a6('0x1a')](_0x28e01a);return _0x463f33[_0xb9a6('0x20')]('Content-Range',_0x3b9a3b+'-'+_0x1843e2+'/'+_0x5b3395)['json'](_0x414f37);}return null;};}function patchUpdates(_0x1cb89e){return function(_0x449b39){try{jsonpatch[_0xb9a6('0x21')](_0x449b39,_0x1cb89e,!![]);}catch(_0x49c74b){return BPromise[_0xb9a6('0x22')](_0x49c74b);}return _0x449b39['save']();};}function saveUpdates(_0xc15e48,_0x36c6c1){return function(_0x50d3d4){if(_0x50d3d4){return _0x50d3d4[_0xb9a6('0x23')](_0xc15e48)['then'](function(_0x526721){return _0x526721;});}return null;};}function removeEntity(_0x3bc642,_0x1b838a){return function(_0x73dee3){if(_0x73dee3){return _0x73dee3[_0xb9a6('0x24')]()['then'](function(){_0x3bc642[_0xb9a6('0x1a')](0xcc)[_0xb9a6('0x1b')]();});}};}function handleEntityNotFound(_0x373f62,_0x1d36e3){return function(_0x4b0be8){if(!_0x4b0be8){_0x373f62[_0xb9a6('0x19')](0x194);}return _0x4b0be8;};}function handleError(_0x3896c1,_0x3ebdcd){_0x3ebdcd=_0x3ebdcd||0x1f4;return function(_0x427890){logger[_0xb9a6('0x25')](_0x427890[_0xb9a6('0x26')]);if(_0x427890[_0xb9a6('0x27')]){delete _0x427890['name'];}_0x3896c1[_0xb9a6('0x1a')](_0x3ebdcd)[_0xb9a6('0x28')](_0x427890);};}exports['show']=function(_0x429830,_0x4c2abb){var _0x1fdb38={'raw':!![],'where':{'id':_0x429830[_0xb9a6('0x29')]['id']}},_0x5d75ce={};_0x5d75ce[_0xb9a6('0x2a')]=_['keys'](db[_0xb9a6('0x2b')][_0xb9a6('0x2c')]);_0x5d75ce[_0xb9a6('0x2d')]=_[_0xb9a6('0x2e')](_0x429830[_0xb9a6('0x2d')]);_0x5d75ce[_0xb9a6('0x2f')]=_[_0xb9a6('0x30')](_0x5d75ce['model'],_0x5d75ce[_0xb9a6('0x2d')]);_0x1fdb38[_0xb9a6('0x31')]=_[_0xb9a6('0x30')](_0x5d75ce[_0xb9a6('0x2a')],qs['fields'](_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x32')]));_0x1fdb38['attributes']=_0x1fdb38[_0xb9a6('0x31')][_0xb9a6('0x33')]?_0x1fdb38[_0xb9a6('0x31')]:_0x5d75ce[_0xb9a6('0x2a')];if(_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x34')]){_0x1fdb38[_0xb9a6('0x35')]=[{'all':!![]}];}_0x1fdb38=_['merge']({},_0x1fdb38,_0x429830['options']);return db['ChatProactiveAction']['find'](_0x1fdb38)['then'](handleEntityNotFound(_0x4c2abb,null))[_0xb9a6('0x36')](respondWithResult(_0x4c2abb,null))['catch'](handleError(_0x4c2abb,null));};exports[_0xb9a6('0x37')]=function(_0x56945d,_0x287329){return db[_0xb9a6('0x2b')][_0xb9a6('0x37')](_0x56945d[_0xb9a6('0x38')],{})[_0xb9a6('0x36')](respondWithResult(_0x287329,0xc9))[_0xb9a6('0x39')](handleError(_0x287329,null));};exports[_0xb9a6('0x23')]=function(_0xc96b8,_0x1e2835){if(_0xc96b8[_0xb9a6('0x38')]['id']){delete _0xc96b8[_0xb9a6('0x38')]['id'];}return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xc96b8[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x1e2835,null))[_0xb9a6('0x36')](saveUpdates(_0xc96b8[_0xb9a6('0x38')],null))['then'](respondWithResult(_0x1e2835,null))[_0xb9a6('0x39')](handleError(_0x1e2835,null));};exports[_0xb9a6('0x24')]=function(_0xdc704f,_0x5a8bf2){return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xdc704f[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x5a8bf2,null))[_0xb9a6('0x36')](removeEntity(_0x5a8bf2,null))[_0xb9a6('0x39')](handleError(_0x5a8bf2,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 25085a8..08f0bd6 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 _0x8a90=['ChatProactiveAction','chat_proactive_actions','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x3c26e8,_0x2c3478){var _0x26d412=function(_0xf4d7ca){while(--_0xf4d7ca){_0x3c26e8['push'](_0x3c26e8['shift']());}};_0x26d412(++_0x2c3478);}(_0x8a90,0x1a2));var _0x08a9=function(_0x5218c0,_0x2591df){_0x5218c0=_0x5218c0-0x0;var _0xc5dba=_0x8a90[_0x5218c0];return _0xc5dba;};'use strict';var _=require('lodash');var util=require(_0x08a9('0x0'));var logger=require('../../config/logger')(_0x08a9('0x1'));var moment=require(_0x08a9('0x2'));var BPromise=require(_0x08a9('0x3'));var rp=require(_0x08a9('0x4'));var fs=require('fs');var path=require(_0x08a9('0x5'));var rimraf=require(_0x08a9('0x6'));var config=require(_0x08a9('0x7'));var attributes=require(_0x08a9('0x8'));module[_0x08a9('0x9')]=function(_0x9733e9,_0x17d9b4){return _0x9733e9[_0x08a9('0xa')](_0x08a9('0xb'),attributes,{'tableName':_0x08a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea9e=['request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','util','../../config/logger','moment','bluebird'];(function(_0x1366fd,_0x193698){var _0x4b2c7c=function(_0x1eb56b){while(--_0x1eb56b){_0x1366fd['push'](_0x1366fd['shift']());}};_0x4b2c7c(++_0x193698);}(_0xea9e,0x151));var _0xeea9=function(_0x2d8bfc,_0x2be61d){_0x2d8bfc=_0x2d8bfc-0x0;var _0x1f68b8=_0xea9e[_0x2d8bfc];return _0x1f68b8;};'use strict';var _=require('lodash');var util=require(_0xeea9('0x0'));var logger=require(_0xeea9('0x1'))('api');var moment=require(_0xeea9('0x2'));var BPromise=require(_0xeea9('0x3'));var rp=require(_0xeea9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeea9('0x5'));var config=require(_0xeea9('0x6'));var attributes=require(_0xeea9('0x7'));module[_0xeea9('0x8')]=function(_0xb8ea86,_0x3db553){return _0xb8ea86[_0xeea9('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xeea9('0xa'),'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 5b22066..73060be 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 _0x708b=['error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x171e04,_0x37a737){var _0x17ca0f=function(_0x1a6327){while(--_0x1a6327){_0x171e04['push'](_0x171e04['shift']());}};_0x17ca0f(++_0x37a737);}(_0x708b,0xa6));var _0xb708=function(_0xe231ae,_0x4cc8c0){_0xe231ae=_0xe231ae-0x0;var _0x216dc9=_0x708b[_0xe231ae];return _0x216dc9;};'use strict';var _=require(_0xb708('0x0'));var util=require('util');var moment=require(_0xb708('0x1'));var BPromise=require(_0xb708('0x2'));var rs=require(_0xb708('0x3'));var fs=require('fs');var Redis=require(_0xb708('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb708('0x5'));var logger=require(_0xb708('0x6'))('rpc');var config=require(_0xb708('0x7'));var jayson=require(_0xb708('0x8'));var client=jayson[_0xb708('0x9')][_0xb708('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35fd0c,_0x10ddcd,_0x384854){return new BPromise(function(_0x4d4fdc,_0x1e0d3b){return client[_0xb708('0xb')](_0x35fd0c,_0x384854)['then'](function(_0x5670d3){logger['info'](_0xb708('0xc'),_0x10ddcd,_0xb708('0xd'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x10ddcd,_0xb708('0xd'),JSON['stringify'](_0x5670d3));if(_0x5670d3['error']){if(_0x5670d3[_0xb708('0xe')][_0xb708('0xf')]===0x1f4){logger[_0xb708('0xe')](_0xb708('0xc'),_0x10ddcd,_0x5670d3[_0xb708('0xe')][_0xb708('0x10')]);return _0x1e0d3b(_0x5670d3[_0xb708('0xe')]['message']);}logger[_0xb708('0xe')](_0xb708('0xc'),_0x10ddcd,_0x5670d3[_0xb708('0xe')]['message']);return _0x4d4fdc(_0x5670d3['error'][_0xb708('0x10')]);}else{logger['info'](_0xb708('0xc'),_0x10ddcd,'request\x20sent');_0x4d4fdc(_0x5670d3['result']['message']);}})[_0xb708('0x11')](function(_0x1ac715){logger[_0xb708('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x10ddcd,_0x1ac715);_0x1e0d3b(_0x1ac715);});});}
\ No newline at end of file
+var _0x8750=['message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8750,0x14c));var _0x0875=function(_0x50cdae,_0x160da3){_0x50cdae=_0x50cdae-0x0;var _0x195454=_0x8750[_0x50cdae];return _0x195454;};'use strict';var _=require(_0x0875('0x0'));var util=require('util');var moment=require(_0x0875('0x1'));var BPromise=require(_0x0875('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0875('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0875('0x4'));var logger=require(_0x0875('0x5'))(_0x0875('0x6'));var config=require(_0x0875('0x7'));var jayson=require(_0x0875('0x8'));var client=jayson[_0x0875('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x562cb8,_0x2bbaba,_0x3ae6c7){return new BPromise(function(_0x3fcd20,_0x30f229){return client[_0x0875('0xa')](_0x562cb8,_0x3ae6c7)[_0x0875('0xb')](function(_0xf126d3){logger[_0x0875('0xc')](_0x0875('0xd'),_0x2bbaba,_0x0875('0xe'));logger[_0x0875('0xf')](_0x0875('0x10'),_0x2bbaba,'request\x20sent',JSON[_0x0875('0x11')](_0xf126d3));if(_0xf126d3[_0x0875('0x12')]){if(_0xf126d3[_0x0875('0x12')][_0x0875('0x13')]===0x1f4){logger[_0x0875('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bbaba,_0xf126d3['error']['message']);return _0x30f229(_0xf126d3[_0x0875('0x12')][_0x0875('0x14')]);}logger[_0x0875('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bbaba,_0xf126d3[_0x0875('0x12')]['message']);return _0x3fcd20(_0xf126d3['error'][_0x0875('0x14')]);}else{logger[_0x0875('0xc')](_0x0875('0xd'),_0x2bbaba,'request\x20sent');_0x3fcd20(_0xf126d3[_0x0875('0x15')][_0x0875('0x14')]);}})['catch'](function(_0x371ee5){logger[_0x0875('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bbaba,_0x371ee5);_0x30f229(_0x371ee5);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f9cd86c..cb2ab96 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 _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x293954,_0xd94ca4){var _0x5cea29=function(_0x12b251){while(--_0x12b251){_0x293954['push'](_0x293954['shift']());}};_0x5cea29(++_0xd94ca4);}(_0xeda8,0x104));var _0x8eda=function(_0xf6b530,_0x5c1d3c){_0xf6b530=_0xf6b530-0x0;var _0x3e38a1=_0xeda8[_0xf6b530];return _0x3e38a1;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router;
\ No newline at end of file
+var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xabce,0x103));var _0xeabc=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xabce[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 856ef8a..a67d5ac 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 _0x6c86=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x558be8,_0x105e9a){var _0xe82f86=function(_0x37d240){while(--_0x37d240){_0x558be8['push'](_0x558be8['shift']());}};_0xe82f86(++_0x105e9a);}(_0x6c86,0x15f));var _0x66c8=function(_0x4aeb7a,_0x34b7ea){_0x4aeb7a=_0x4aeb7a-0x0;var _0x5df071=_0x6c86[_0x4aeb7a];return _0x5df071;};'use strict';var Sequelize=require(_0x66c8('0x0'));module[_0x66c8('0x1')]={'name':{'type':Sequelize[_0x66c8('0x2')],'unique':_0x66c8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x66c8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x66c8('0x5')](_0x66c8('0x6'),'beepall',_0x66c8('0x7'))}};
\ No newline at end of file
+var _0xc11a=['beepall','roundrobin','sequelize','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x442dcb,_0x179c35){var _0x593554=function(_0x244b57){while(--_0x244b57){_0x442dcb['push'](_0x442dcb['shift']());}};_0x593554(++_0x179c35);}(_0xc11a,0x11a));var _0xac11=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc11a[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xac11('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xac11('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac11('0x2')]},'timeout':{'type':Sequelize[_0xac11('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac11('0x4')](_0xac11('0x5'),_0xac11('0x6'),_0xac11('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index dbcdd0c..634bcc7 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 _0x7328=['includes','compact','value','removeTeams','isEmpty','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','ChatQueues','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','type','filter','merge','include','ChatQueue','findAll','rows','params','keys','intersection','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','Team','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every'];(function(_0xaf34bc,_0xb3d3ce){var _0x318c36=function(_0x3073b4){while(--_0x3073b4){_0xaf34bc['push'](_0xaf34bc['shift']());}};_0x318c36(++_0xb3d3ce);}(_0x7328,0xa5));var _0x8732=function(_0x44d132,_0x542053){_0x44d132=_0x44d132-0x0;var _0x13e1b7=_0x7328[_0x44d132];return _0x13e1b7;};'use strict';var emlformat=require(_0x8732('0x0'));var rimraf=require(_0x8732('0x1'));var zipdir=require(_0x8732('0x2'));var jsonpatch=require(_0x8732('0x3'));var rp=require(_0x8732('0x4'));var moment=require(_0x8732('0x5'));var BPromise=require(_0x8732('0x6'));var Mustache=require('mustache');var util=require(_0x8732('0x7'));var path=require(_0x8732('0x8'));var sox=require('sox');var csv=require(_0x8732('0x9'));var ejs=require(_0x8732('0xa'));var fs=require('fs');var fs_extra=require(_0x8732('0xb'));var _=require(_0x8732('0xc'));var squel=require(_0x8732('0xd'));var crypto=require(_0x8732('0xe'));var jsforce=require(_0x8732('0xf'));var deskjs=require(_0x8732('0x10'));var toCsv=require(_0x8732('0x9'));var querystring=require(_0x8732('0x11'));var Papa=require(_0x8732('0x12'));var Redis=require(_0x8732('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8732('0x14'));var as=require(_0x8732('0x15'));var hardwareService=require(_0x8732('0x16'));var logger=require(_0x8732('0x17'))(_0x8732('0x18'));var utils=require('../../config/utils');var config=require(_0x8732('0x19'));var licenseUtil=require(_0x8732('0x1a'));var db=require(_0x8732('0x1b'))['db'];config['redis']=_[_0x8732('0x1c')](config[_0x8732('0x1d')],{'host':_0x8732('0x1e'),'port':0x18eb});var socket=require(_0x8732('0x1f'))(new Redis(config['redis']));require(_0x8732('0x20'))[_0x8732('0x21')](socket);var jayson=require(_0x8732('0x22'));var client=jayson[_0x8732('0x23')][_0x8732('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x28a32e,_0x245208,_0x1642fd,_0x5a1563){return new BPromise(function(_0x57b09a,_0x41c440){var _0x343f97=_0x5a1563||client;return _0x343f97[_0x8732('0x25')](_0x28a32e,_0x1642fd)['then'](function(_0x5d3592){logger[_0x8732('0x26')]('ChatQueue,\x20%s,\x20%s',_0x245208,_0x8732('0x27'));logger[_0x8732('0x28')](_0x8732('0x29'),_0x245208,_0x8732('0x27'),JSON[_0x8732('0x2a')](_0x5d3592));if(_0x5d3592[_0x8732('0x2b')]){if(_0x5d3592['error']['code']===0x1f4){logger['error'](_0x8732('0x2c'),_0x245208,_0x5d3592['error'][_0x8732('0x2d')]);return _0x41c440(_0x5d3592[_0x8732('0x2b')][_0x8732('0x2d')]);}logger[_0x8732('0x2b')](_0x8732('0x2c'),_0x245208,_0x5d3592[_0x8732('0x2b')][_0x8732('0x2d')]);return _0x57b09a(_0x5d3592[_0x8732('0x2b')][_0x8732('0x2d')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x245208,_0x8732('0x27'));_0x57b09a(_0x5d3592[_0x8732('0x2e')][_0x8732('0x2d')]);}})[_0x8732('0x2f')](function(_0x3d5fe9){logger[_0x8732('0x2b')](_0x8732('0x2c'),_0x245208,_0x3d5fe9);_0x41c440(_0x3d5fe9);});});}function respondWithStatusCode(_0x271a55,_0xcd6b75){_0xcd6b75=_0xcd6b75||0xcc;return function(_0x910ecd){if(_0x910ecd){return _0x271a55[_0x8732('0x30')](_0xcd6b75);}return _0x271a55['status'](_0xcd6b75)[_0x8732('0x31')]();};}function respondWithResult(_0x3edbde,_0x4b3be0){_0x4b3be0=_0x4b3be0||0xc8;return function(_0x1d5ffe){if(_0x1d5ffe){return _0x3edbde[_0x8732('0x32')](_0x4b3be0)['json'](_0x1d5ffe);}};}function respondWithFilteredResult(_0x17d9b2,_0x5e3d19){return function(_0xba1c28){if(_0xba1c28){var _0x3315ba=typeof _0x5e3d19[_0x8732('0x33')]==='undefined'&&typeof _0x5e3d19[_0x8732('0x34')]===_0x8732('0x35');var _0x359a8e=_0xba1c28['count'];var _0x13cfb8=_0x3315ba?0x0:_0x5e3d19['offset'];var _0x2bec53=_0x3315ba?_0xba1c28[_0x8732('0x36')]:_0x5e3d19[_0x8732('0x33')]+_0x5e3d19[_0x8732('0x34')];var _0x5d11b0;if(_0x2bec53>=_0x359a8e){_0x2bec53=_0x359a8e;_0x5d11b0=0xc8;}else{_0x5d11b0=0xce;}_0x17d9b2[_0x8732('0x32')](_0x5d11b0);return _0x17d9b2[_0x8732('0x37')](_0x8732('0x38'),_0x13cfb8+'-'+_0x2bec53+'/'+_0x359a8e)[_0x8732('0x39')](_0xba1c28);}return null;};}function patchUpdates(_0x19579f){return function(_0x3c3eb9){try{jsonpatch[_0x8732('0x3a')](_0x3c3eb9,_0x19579f,!![]);}catch(_0x2d6404){return BPromise[_0x8732('0x3b')](_0x2d6404);}return _0x3c3eb9[_0x8732('0x3c')]();};}function saveUpdates(_0x4b354f,_0x490e35){return function(_0xf1e715){if(_0xf1e715){return _0xf1e715[_0x8732('0x3d')](_0x4b354f)[_0x8732('0x3e')](function(_0x442b3d){return _0x442b3d;});}return null;};}function removeEntity(_0x52d90d,_0x4d0247){return function(_0x3185f1){if(_0x3185f1){return _0x3185f1['destroy']()['then'](function(){var _0x23d796=_0x3185f1['get']({'plain':!![]});var _0x3343ef=_0x8732('0x3f');return db[_0x8732('0x40')][_0x8732('0x41')]({'where':{'type':_0x3343ef,'resourceId':_0x23d796['id']}})[_0x8732('0x3e')](function(){return _0x3185f1;});})[_0x8732('0x3e')](function(){_0x52d90d[_0x8732('0x32')](0xcc)[_0x8732('0x31')]();});}};}function handleEntityNotFound(_0x5039c4,_0x3cca8d){return function(_0x53d363){if(!_0x53d363){_0x5039c4[_0x8732('0x30')](0x194);}return _0x53d363;};}function handleError(_0x263fd2,_0x26712f){_0x26712f=_0x26712f||0x1f4;return function(_0x90bc37){logger[_0x8732('0x2b')](_0x90bc37[_0x8732('0x42')]);if(_0x90bc37[_0x8732('0x43')]){delete _0x90bc37[_0x8732('0x43')];}_0x263fd2[_0x8732('0x32')](_0x26712f)['send'](_0x90bc37);};}exports[_0x8732('0x44')]=function(_0x561fb3,_0x2f20bc){var _0x511e25={},_0x5a7d7c={},_0x5e5ab5={'count':0x0,'rows':[]};var _0x4ad0c2=_[_0x8732('0x45')](db['ChatQueue'][_0x8732('0x46')],function(_0x124119){return{'name':_0x124119[_0x8732('0x47')],'type':_0x124119['type'][_0x8732('0x48')]};});_0x5a7d7c[_0x8732('0x49')]=_[_0x8732('0x45')](_0x4ad0c2,_0x8732('0x43'));_0x5a7d7c[_0x8732('0x4a')]=_['keys'](_0x561fb3[_0x8732('0x4a')]);_0x5a7d7c[_0x8732('0x4b')]=_['intersection'](_0x5a7d7c['model'],_0x5a7d7c[_0x8732('0x4a')]);_0x511e25[_0x8732('0x4c')]=_['intersection'](_0x5a7d7c[_0x8732('0x49')],qs[_0x8732('0x4d')](_0x561fb3[_0x8732('0x4a')]['fields']));_0x511e25[_0x8732('0x4c')]=_0x511e25[_0x8732('0x4c')][_0x8732('0x4e')]?_0x511e25[_0x8732('0x4c')]:_0x5a7d7c[_0x8732('0x49')];if(!_0x561fb3[_0x8732('0x4a')][_0x8732('0x4f')]('nolimit')){_0x511e25['limit']=qs[_0x8732('0x34')](_0x561fb3[_0x8732('0x4a')][_0x8732('0x34')]);_0x511e25['offset']=qs[_0x8732('0x33')](_0x561fb3[_0x8732('0x4a')][_0x8732('0x33')]);}_0x511e25['order']=qs[_0x8732('0x50')](_0x561fb3[_0x8732('0x4a')][_0x8732('0x50')]);_0x511e25[_0x8732('0x51')]=qs[_0x8732('0x4b')](_[_0x8732('0x52')](_0x561fb3[_0x8732('0x4a')],_0x5a7d7c[_0x8732('0x4b')]),_0x4ad0c2);if(_0x561fb3[_0x8732('0x4a')]['filter']){_0x511e25[_0x8732('0x51')]=_['merge'](_0x511e25[_0x8732('0x51')],{'$or':_['map'](_0x4ad0c2,function(_0x4985f6){if(_0x4985f6[_0x8732('0x53')]!=='VIRTUAL'){var _0x538fc4={};_0x538fc4[_0x4985f6[_0x8732('0x43')]]={'$like':'%'+_0x561fb3[_0x8732('0x4a')][_0x8732('0x54')]+'%'};return _0x538fc4;}})});}_0x511e25=_[_0x8732('0x55')]({},_0x511e25,_0x561fb3['options']);var _0xf868d={'where':_0x511e25[_0x8732('0x51')]};return db['ChatQueue'][_0x8732('0x36')](_0xf868d)[_0x8732('0x3e')](function(_0x3a4f92){_0x5e5ab5['count']=_0x3a4f92;if(_0x561fb3['query']['includeAll']){_0x511e25[_0x8732('0x56')]=[{'all':!![]}];}return db[_0x8732('0x57')][_0x8732('0x58')](_0x511e25);})['then'](function(_0x30e19f){_0x5e5ab5[_0x8732('0x59')]=_0x30e19f;return _0x5e5ab5;})[_0x8732('0x3e')](respondWithFilteredResult(_0x2f20bc,_0x511e25))[_0x8732('0x2f')](handleError(_0x2f20bc,null));};exports['show']=function(_0x4d6879,_0x1a3497){var _0x5ab82a={'raw':!![],'where':{'id':_0x4d6879[_0x8732('0x5a')]['id']}},_0x262580={};_0x262580['model']=_[_0x8732('0x5b')](db[_0x8732('0x57')][_0x8732('0x46')]);_0x262580[_0x8732('0x4a')]=_[_0x8732('0x5b')](_0x4d6879['query']);_0x262580[_0x8732('0x4b')]=_['intersection'](_0x262580[_0x8732('0x49')],_0x262580[_0x8732('0x4a')]);_0x5ab82a[_0x8732('0x4c')]=_[_0x8732('0x5c')](_0x262580[_0x8732('0x49')],qs[_0x8732('0x4d')](_0x4d6879[_0x8732('0x4a')][_0x8732('0x4d')]));_0x5ab82a[_0x8732('0x4c')]=_0x5ab82a['attributes'][_0x8732('0x4e')]?_0x5ab82a['attributes']:_0x262580['model'];if(_0x4d6879[_0x8732('0x4a')]['includeAll']){_0x5ab82a['include']=[{'all':!![]}];}_0x5ab82a=_[_0x8732('0x55')]({},_0x5ab82a,_0x4d6879[_0x8732('0x5d')]);return db[_0x8732('0x57')]['find'](_0x5ab82a)['then'](handleEntityNotFound(_0x1a3497,null))['then'](respondWithResult(_0x1a3497,null))['catch'](handleError(_0x1a3497,null));};exports[_0x8732('0x5e')]=function(_0x2bd11a,_0x3d22d5){return db['ChatQueue'][_0x8732('0x5e')](_0x2bd11a[_0x8732('0x5f')],{})[_0x8732('0x3e')](function(_0x23a1a7){var _0x45276e=_0x2bd11a[_0x8732('0x60')][_0x8732('0x61')]({'plain':!![]});if(!_0x45276e)throw new Error(_0x8732('0x62'));if(_0x45276e[_0x8732('0x63')]===_0x8732('0x60')){var _0x339e76=_0x23a1a7[_0x8732('0x61')]({'plain':!![]});var _0x62b9b3=_0x8732('0x3f');return db[_0x8732('0x64')][_0x8732('0x65')]({'where':{'name':_0x62b9b3,'userProfileId':_0x45276e[_0x8732('0x66')]},'raw':!![]})[_0x8732('0x3e')](function(_0xb1bce4){if(_0xb1bce4&&_0xb1bce4[_0x8732('0x67')]===0x0){return db[_0x8732('0x40')][_0x8732('0x5e')]({'name':_0x339e76[_0x8732('0x43')],'resourceId':_0x339e76['id'],'type':_0xb1bce4[_0x8732('0x43')],'sectionId':_0xb1bce4['id']},{})[_0x8732('0x3e')](function(){return _0x23a1a7;});}else{return _0x23a1a7;}})[_0x8732('0x2f')](function(_0x4d652c){logger[_0x8732('0x2b')](_0x8732('0x68'),_0x4d652c);throw _0x4d652c;});}return _0x23a1a7;})['then'](respondWithResult(_0x3d22d5,0xc9))[_0x8732('0x2f')](handleError(_0x3d22d5,null));};exports[_0x8732('0x3d')]=function(_0x933873,_0x567ed0){if(_0x933873[_0x8732('0x5f')]['id']){delete _0x933873[_0x8732('0x5f')]['id'];}return db[_0x8732('0x57')]['find']({'where':{'id':_0x933873[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](handleEntityNotFound(_0x567ed0,null))[_0x8732('0x3e')](saveUpdates(_0x933873[_0x8732('0x5f')],null))['then'](respondWithResult(_0x567ed0,null))['catch'](handleError(_0x567ed0,null));};exports[_0x8732('0x41')]=function(_0x242b2f,_0x57087a){return db[_0x8732('0x57')][_0x8732('0x65')]({'where':{'id':_0x242b2f[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](handleEntityNotFound(_0x57087a,null))[_0x8732('0x3e')](removeEntity(_0x57087a,null))[_0x8732('0x2f')](handleError(_0x57087a,null));};exports[_0x8732('0x69')]=function(_0x3a1c8b,_0x362549){return db['ChatQueue'][_0x8732('0x69')]()['then'](respondWithResult(_0x362549,null))[_0x8732('0x2f')](handleError(_0x362549,null));};exports[_0x8732('0x6a')]=function(_0x122f2e,_0x1892c4,_0x48aee6){var _0x307c0d={'raw':!![],'where':{}},_0x16c65d={},_0x2c984d;return db['ChatQueue'][_0x8732('0x6b')]({'where':{'id':_0x122f2e['params']['id']}})[_0x8732('0x3e')](handleEntityNotFound(_0x1892c4,null))[_0x8732('0x3e')](function(_0x13e0a7){if(_0x13e0a7){_0x2c984d=_0x13e0a7[_0x8732('0x61')]({'plain':!![]});_0x16c65d[_0x8732('0x49')]=_[_0x8732('0x5b')](db[_0x8732('0x6c')][_0x8732('0x46')]);_0x16c65d['query']=_[_0x8732('0x5b')](_0x122f2e['query']);_0x16c65d['filters']=_['intersection'](_0x16c65d[_0x8732('0x49')],_0x16c65d['query']);_0x307c0d[_0x8732('0x4c')]=_[_0x8732('0x5c')](_0x16c65d['model'],qs[_0x8732('0x4d')](_0x122f2e[_0x8732('0x4a')][_0x8732('0x4d')]));_0x307c0d[_0x8732('0x4c')]=_0x307c0d['attributes']['length']?_0x307c0d['attributes']:_0x16c65d[_0x8732('0x49')];if(!_0x122f2e['query'][_0x8732('0x4f')]('nolimit')){_0x307c0d[_0x8732('0x34')]=qs['limit'](_0x122f2e['query'][_0x8732('0x34')]);_0x307c0d[_0x8732('0x33')]=qs[_0x8732('0x33')](_0x122f2e[_0x8732('0x4a')][_0x8732('0x33')]);}_0x307c0d[_0x8732('0x6d')]=qs[_0x8732('0x50')](_0x122f2e[_0x8732('0x4a')][_0x8732('0x50')]);_0x307c0d[_0x8732('0x51')]=qs[_0x8732('0x4b')](_['pick'](_0x122f2e[_0x8732('0x4a')],_0x16c65d[_0x8732('0x4b')]));_0x307c0d['where'][_0x8732('0x6e')]=_0x13e0a7['id'];if(_0x122f2e[_0x8732('0x4a')][_0x8732('0x54')]){_0x307c0d[_0x8732('0x51')]=_[_0x8732('0x55')](_0x307c0d[_0x8732('0x51')],{'$or':_['map'](_0x307c0d[_0x8732('0x4c')],function(_0x549dd7){var _0x26627e={};_0x26627e[_0x549dd7]={'$like':'%'+_0x122f2e[_0x8732('0x4a')][_0x8732('0x54')]+'%'};return _0x26627e;})});}_0x307c0d=_[_0x8732('0x55')]({},_0x307c0d,_0x122f2e['options']);return db[_0x8732('0x6c')][_0x8732('0x58')](_0x307c0d);}})[_0x8732('0x3e')](function(_0x2ae8c4){if(_0x2ae8c4){return db['User'][_0x8732('0x6f')]({'where':{'id':_[_0x8732('0x45')](_0x2ae8c4,_0x8732('0x70')),'role':'agent'},'attributes':['id',_0x8732('0x43'),'chatPause',_0x8732('0x71'),_0x8732('0x72')]});}})[_0x8732('0x3e')](function(_0xec96b3){if(_0xec96b3){return{'count':_0xec96b3[_0x8732('0x36')],'rows':_[_0x8732('0x45')](_0xec96b3[_0x8732('0x59')],function(_0x85374a){return{'membername':_0x85374a['name'],'UserId':_0x85374a['id'],'queue_name':_0x2c984d[_0x8732('0x43')],'ChatQueueId':_0x2c984d['id'],'interface':util[_0x8732('0x73')](_0x8732('0x74'),_0x8732('0x75'),_0x85374a[_0x8732('0x43')]),'penalty':0x0,'paused':_0x85374a['chatPause'],'createdAt':_0x85374a[_0x8732('0x72')],'updatedAt':_0x85374a[_0x8732('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8732('0x3e')](respondWithFilteredResult(_0x1892c4,_0x307c0d))[_0x8732('0x2f')](handleError(_0x1892c4,null));};exports[_0x8732('0x76')]=function(_0x107332,_0x4caa3e,_0x3439a5){var _0x2f9617={};var _0x57e65e={};var _0x7d12fc;var _0x233806;return db[_0x8732('0x57')][_0x8732('0x6b')]({'where':{'id':_0x107332[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](handleEntityNotFound(_0x4caa3e,null))['then'](function(_0x12969b){if(_0x12969b){_0x7d12fc=_0x12969b;_0x57e65e['model']=_[_0x8732('0x5b')](db['Team']['rawAttributes']);_0x57e65e[_0x8732('0x4a')]=_[_0x8732('0x5b')](_0x107332[_0x8732('0x4a')]);_0x57e65e[_0x8732('0x4b')]=_[_0x8732('0x5c')](_0x57e65e[_0x8732('0x49')],_0x57e65e[_0x8732('0x4a')]);_0x2f9617['attributes']=_[_0x8732('0x5c')](_0x57e65e['model'],qs['fields'](_0x107332[_0x8732('0x4a')][_0x8732('0x4d')]));_0x2f9617['attributes']=_0x2f9617['attributes'][_0x8732('0x4e')]?_0x2f9617[_0x8732('0x4c')]:_0x57e65e[_0x8732('0x49')];_0x2f9617[_0x8732('0x6d')]=qs[_0x8732('0x50')](_0x107332[_0x8732('0x4a')][_0x8732('0x50')]);_0x2f9617[_0x8732('0x51')]=qs[_0x8732('0x4b')](_[_0x8732('0x52')](_0x107332[_0x8732('0x4a')],_0x57e65e['filters']));if(_0x107332[_0x8732('0x4a')][_0x8732('0x54')]){_0x2f9617[_0x8732('0x51')]=_['merge'](_0x2f9617[_0x8732('0x51')],{'$or':_['map'](_0x2f9617[_0x8732('0x4c')],function(_0x2e8e38){var _0xaef19b={};_0xaef19b[_0x2e8e38]={'$like':'%'+_0x107332[_0x8732('0x4a')]['filter']+'%'};return _0xaef19b;})});}_0x2f9617=_[_0x8732('0x55')]({},_0x2f9617,_0x107332['options']);return _0x7d12fc[_0x8732('0x76')](_0x2f9617);}})['then'](function(_0x2da448){if(_0x2da448){_0x233806=_0x2da448[_0x8732('0x4e')];if(!_0x107332[_0x8732('0x4a')][_0x8732('0x4f')](_0x8732('0x77'))){_0x2f9617['limit']=qs[_0x8732('0x34')](_0x107332[_0x8732('0x4a')][_0x8732('0x34')]);_0x2f9617[_0x8732('0x33')]=qs['offset'](_0x107332[_0x8732('0x4a')][_0x8732('0x33')]);}return _0x7d12fc['getTeams'](_0x2f9617);}})[_0x8732('0x3e')](function(_0x3fb253){if(_0x3fb253){return _0x3fb253?{'count':_0x233806,'rows':_0x3fb253}:null;}})[_0x8732('0x3e')](respondWithResult(_0x4caa3e,null))[_0x8732('0x2f')](handleError(_0x4caa3e,null));};exports['addTeams']=function(_0x6996a3,_0x40c068,_0x4af391){var _0x3347fb=_0x6996a3[_0x8732('0x5f')][_0x8732('0x78')];return db['Team'][_0x8732('0x58')]({'where':{'id':_0x3347fb},'attributes':['id'],'include':[{'model':db[_0x8732('0x79')],'as':_0x8732('0x7a'),'attributes':['id',_0x8732('0x43'),_0x8732('0x7b'),_0x8732('0x7c'),_0x8732('0x7d')],'raw':!![]}]})[_0x8732('0x3e')](function(_0xad9638){if(_0xad9638){var _0x5666b1=_[_0x8732('0x7e')](_0xad9638,function(_0x583d87){var _0x15b131=_0x583d87[_0x8732('0x61')]({'plain':!![]});return _0x15b131[_0x8732('0x7a')];});return db[_0x8732('0x57')][_0x8732('0x65')]({'where':{'id':_0x6996a3[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](function(_0x3e6e57){return db[_0x8732('0x7f')][_0x8732('0x80')](function(_0x348407){return _0x3e6e57[_0x8732('0x81')](_0x3347fb,{'transaction':_0x348407})['then'](function(){return BPromise[_0x8732('0x82')](_0x5666b1,function(_0x3474e6){return db[_0x8732('0x6c')][_0x8732('0x83')]({'where':{'UserId':_0x3474e6['id'],'ChatQueueId':_0x6996a3[_0x8732('0x5a')]['id']},'transaction':_0x348407});});})['then'](function(){_0x5666b1[_0x8732('0x84')](function(_0x40f263){socket[_0x8732('0x85')](_0x8732('0x86'),{'UserId':_0x40f263['id'],'ChatQueueId':_0x3e6e57['id']});});});});});}})[_0x8732('0x3e')](respondWithStatusCode(_0x40c068,null))['catch'](handleError(_0x40c068,null));};exports['removeTeams']=function(_0x55f4ea,_0x5a0758,_0x2bf995){return db[_0x8732('0x87')][_0x8732('0x58')]({'where':{'id':_0x55f4ea[_0x8732('0x4a')][_0x8732('0x78')]},'attributes':['id'],'include':[{'model':db[_0x8732('0x79')],'as':_0x8732('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0758,null))[_0x8732('0x3e')](function(_0x25f81a){var _0x1b0e2b=_['map'](_0x25f81a,'id');var _0x35f264=[];var _0x388dd0=[];var _0x29417d=squel[_0x8732('0x88')]();_0x29417d[_0x8732('0x89')](_0x8732('0x8a'))[_0x8732('0x8b')](_0x8732('0x8c'),'tq')[_0x8732('0x8d')]('user_has_teams','ut',_0x8732('0x8e'))[_0x8732('0x51')](_0x8732('0x8f'),_0x55f4ea['params']['id']);for(var _0x55d4a0=0x0;_0x55d4a0<_0x25f81a['length'];_0x55d4a0+=0x1){let _0x477a1e=_0x25f81a[_0x55d4a0];for(var _0x58c397=0x0;_0x58c397<_0x477a1e['Agents'][_0x8732('0x4e')];_0x58c397+=0x1){let _0x3c15db=_0x477a1e[_0x8732('0x7a')][_0x58c397];var _0x1b9a6d=_0x29417d[_0x8732('0x90')]();_0x1b9a6d[_0x8732('0x51')](_0x8732('0x91'),_0x3c15db['id']);_0x388dd0[_0x8732('0x92')](db[_0x8732('0x7f')][_0x8732('0x4a')](_0x1b9a6d[_0x8732('0x93')](),{'type':db[_0x8732('0x7f')]['QueryTypes']['SELECT']})[_0x8732('0x3e')](function(_0x4915eb){if(_0x4915eb[_0x8732('0x4e')]===0x1){return _0x3c15db['id'];}else{var _0x3a27fe=_[_0x8732('0x94')](_[_0x8732('0x45')](_0x4915eb,'TeamId'),function(_0x2b2e52){return _[_0x8732('0x95')](_0x1b0e2b,_0x2b2e52);});if(_0x3a27fe){return _0x3c15db['id'];}}}));}}return BPromise['all'](_0x388dd0)['then'](function(_0x258ad7){_0x35f264=_(_0x35f264)['union'](_0x258ad7)[_0x8732('0x96')]()[_0x8732('0x97')]();return db[_0x8732('0x57')]['find']({'where':{'id':_0x55f4ea[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](function(_0x4684f1){return db[_0x8732('0x7f')][_0x8732('0x80')](function(_0x5933a3){return _0x4684f1[_0x8732('0x98')](_0x55f4ea[_0x8732('0x4a')][_0x8732('0x78')],{'transaction':_0x5933a3})[_0x8732('0x3e')](function(){if(!_[_0x8732('0x99')](_0x35f264)){return _0x4684f1['removeAgents'](_0x35f264,{'transaction':_0x5933a3});}})[_0x8732('0x3e')](function(){_0x35f264[_0x8732('0x84')](function(_0x35133f){socket[_0x8732('0x85')]('userChatQueue:remove',{'UserId':_0x35133f,'ChatQueueId':_0x4684f1['id']});});});});});});})[_0x8732('0x3e')](respondWithStatusCode(_0x5a0758,null))['catch'](handleError(_0x5a0758,null));};exports[_0x8732('0x9a')]=function(_0xe1df05,_0x32121f,_0xba9908){return db[_0x8732('0x57')][_0x8732('0x65')]({'where':{'id':_0xe1df05[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](handleEntityNotFound(_0x32121f,null))[_0x8732('0x3e')](function(_0x203936){if(_0x203936){return _0x203936[_0x8732('0x9a')](_0xe1df05[_0x8732('0x5f')][_0x8732('0x78')],_[_0x8732('0x9b')](_0xe1df05[_0x8732('0x5f')],[_0x8732('0x78'),'id'])||{})['spread'](function(_0x2e0b34){for(var _0x1a4b37=0x0;_0x1a4b37<_0xe1df05[_0x8732('0x5f')]['ids'][_0x8732('0x4e')];_0x1a4b37+=0x1){socket[_0x8732('0x85')](_0x8732('0x86'),{'UserId':Number(_0xe1df05['body'][_0x8732('0x78')][_0x1a4b37]),'ChatQueueId':Number(_0xe1df05[_0x8732('0x5a')]['id'])});}return _0x2e0b34;});}})[_0x8732('0x3e')](respondWithResult(_0x32121f,null))[_0x8732('0x2f')](handleError(_0x32121f,null));};exports['removeAgents']=function(_0x524bd5,_0x1f2e79,_0x555341){return db[_0x8732('0x57')][_0x8732('0x65')]({'where':{'id':_0x524bd5[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](handleEntityNotFound(_0x1f2e79,null))[_0x8732('0x3e')](function(_0x41edb3){if(_0x41edb3){return _0x41edb3['removeAgents'](_0x524bd5[_0x8732('0x4a')]['ids'])['then'](function(){if(_['isArray'](_0x524bd5['query']['ids'])){for(var _0x49c847=0x0;_0x49c847<_0x524bd5['query'][_0x8732('0x78')][_0x8732('0x4e')];_0x49c847+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x524bd5[_0x8732('0x4a')][_0x8732('0x78')][_0x49c847]),'ChatQueueId':Number(_0x524bd5[_0x8732('0x5a')]['id'])});}}else{socket[_0x8732('0x85')]('userChatQueue:remove',{'UserId':Number(_0x524bd5['query'][_0x8732('0x78')]),'ChatQueueId':Number(_0x524bd5[_0x8732('0x5a')]['id'])});}});}})[_0x8732('0x3e')](respondWithStatusCode(_0x1f2e79,null))['catch'](handleError(_0x1f2e79,null));};exports[_0x8732('0x9c')]=function(_0x31c038,_0x6cc12d,_0x544e47){var _0x1567cd={};var _0x31ac4e={};var _0x7f821a;var _0x24573f;return db['ChatQueue'][_0x8732('0x6b')]({'where':{'id':_0x31c038[_0x8732('0x5a')]['id']}})[_0x8732('0x3e')](handleEntityNotFound(_0x6cc12d,null))[_0x8732('0x3e')](function(_0x35be46){if(_0x35be46){_0x7f821a=_0x35be46;_0x31ac4e[_0x8732('0x49')]=_[_0x8732('0x5b')](db[_0x8732('0x79')][_0x8732('0x46')]);_0x31ac4e[_0x8732('0x4a')]=_[_0x8732('0x5b')](_0x31c038[_0x8732('0x4a')]);_0x31ac4e[_0x8732('0x4b')]=_[_0x8732('0x5c')](_0x31ac4e[_0x8732('0x49')],_0x31ac4e[_0x8732('0x4a')]);_0x1567cd[_0x8732('0x4c')]=_[_0x8732('0x5c')](_0x31ac4e[_0x8732('0x49')],qs['fields'](_0x31c038['query'][_0x8732('0x4d')]));_0x1567cd['attributes']=_0x1567cd[_0x8732('0x4c')]['length']?_0x1567cd[_0x8732('0x4c')]:_0x31ac4e[_0x8732('0x49')];_0x1567cd['order']=qs[_0x8732('0x50')](_0x31c038['query']['sort']);_0x1567cd[_0x8732('0x51')]=qs[_0x8732('0x4b')](_[_0x8732('0x52')](_0x31c038[_0x8732('0x4a')],_0x31ac4e[_0x8732('0x4b')]));if(_0x31c038[_0x8732('0x4a')][_0x8732('0x54')]){_0x1567cd[_0x8732('0x51')]=_[_0x8732('0x55')](_0x1567cd[_0x8732('0x51')],{'$or':_[_0x8732('0x45')](_0x1567cd[_0x8732('0x4c')],function(_0x7df400){var _0x657bca={};_0x657bca[_0x7df400]={'$like':'%'+_0x31c038['query'][_0x8732('0x54')]+'%'};return _0x657bca;})});}_0x1567cd=_[_0x8732('0x55')]({},_0x1567cd,_0x31c038['options']);return _0x7f821a[_0x8732('0x9c')](_0x1567cd);}})['then'](function(_0x1fb14a){if(_0x1fb14a){_0x24573f=_0x1fb14a[_0x8732('0x4e')];if(!_0x31c038[_0x8732('0x4a')][_0x8732('0x4f')]('nolimit')){_0x1567cd[_0x8732('0x34')]=qs['limit'](_0x31c038[_0x8732('0x4a')]['limit']);_0x1567cd[_0x8732('0x33')]=qs[_0x8732('0x33')](_0x31c038[_0x8732('0x4a')][_0x8732('0x33')]);}return _0x7f821a[_0x8732('0x9c')](_0x1567cd);}})['then'](function(_0xb43ac3){if(_0xb43ac3){return _0xb43ac3?{'count':_0x24573f,'rows':_0xb43ac3}:null;}})[_0x8732('0x3e')](respondWithResult(_0x6cc12d,null))[_0x8732('0x2f')](handleError(_0x6cc12d,null));};
\ No newline at end of file
+var _0x90de=['moment','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','then','get','ChatQueues','destroy','stack','name','send','map','fieldName','key','query','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','ChatQueue','includeAll','findAll','rows','params','model','keys','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','pick','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','format','%s/%s','SIP','getTeams','rawAttributes','addTeams','ids','Agents','online','voicePause','flatMap','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x90de,0x94));var _0xe90d=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x90de[_0xb0de07];return _0x4633d8;};'use strict';var emlformat=require(_0xe90d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe90d('0x1'));var jsonpatch=require(_0xe90d('0x2'));var rp=require(_0xe90d('0x3'));var moment=require(_0xe90d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe90d('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe90d('0x6'));var fs=require('fs');var fs_extra=require(_0xe90d('0x7'));var _=require(_0xe90d('0x8'));var squel=require(_0xe90d('0x9'));var crypto=require('crypto');var jsforce=require(_0xe90d('0xa'));var deskjs=require(_0xe90d('0xb'));var toCsv=require(_0xe90d('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe90d('0xd'));var authService=require(_0xe90d('0xe'));var qs=require(_0xe90d('0xf'));var as=require(_0xe90d('0x10'));var hardwareService=require(_0xe90d('0x11'));var logger=require(_0xe90d('0x12'))(_0xe90d('0x13'));var utils=require(_0xe90d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe90d('0x15'));var db=require(_0xe90d('0x16'))['db'];config[_0xe90d('0x17')]=_[_0xe90d('0x18')](config[_0xe90d('0x17')],{'host':_0xe90d('0x19'),'port':0x18eb});var socket=require(_0xe90d('0x1a'))(new Redis(config[_0xe90d('0x17')]));require(_0xe90d('0x1b'))[_0xe90d('0x1c')](socket);var jayson=require(_0xe90d('0x1d'));var client=jayson['client'][_0xe90d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x25cf4d,_0x52131b,_0x406e7e,_0x31cc0a){return new BPromise(function(_0x148a41,_0x421ebb){var _0x468e70=_0x31cc0a||client;return _0x468e70[_0xe90d('0x1f')](_0x25cf4d,_0x406e7e)['then'](function(_0x15ca80){logger['info'](_0xe90d('0x20'),_0x52131b,_0xe90d('0x21'));logger[_0xe90d('0x22')](_0xe90d('0x23'),_0x52131b,_0xe90d('0x21'),JSON[_0xe90d('0x24')](_0x15ca80));if(_0x15ca80[_0xe90d('0x25')]){if(_0x15ca80[_0xe90d('0x25')][_0xe90d('0x26')]===0x1f4){logger[_0xe90d('0x25')](_0xe90d('0x20'),_0x52131b,_0x15ca80['error'][_0xe90d('0x27')]);return _0x421ebb(_0x15ca80['error']['message']);}logger[_0xe90d('0x25')](_0xe90d('0x20'),_0x52131b,_0x15ca80['error'][_0xe90d('0x27')]);return _0x148a41(_0x15ca80[_0xe90d('0x25')]['message']);}else{logger[_0xe90d('0x28')](_0xe90d('0x20'),_0x52131b,_0xe90d('0x21'));_0x148a41(_0x15ca80[_0xe90d('0x29')][_0xe90d('0x27')]);}})[_0xe90d('0x2a')](function(_0x5ba6d5){logger[_0xe90d('0x25')](_0xe90d('0x20'),_0x52131b,_0x5ba6d5);_0x421ebb(_0x5ba6d5);});});}function respondWithStatusCode(_0x5758b8,_0x48ab7b){_0x48ab7b=_0x48ab7b||0xcc;return function(_0x23348d){if(_0x23348d){return _0x5758b8[_0xe90d('0x2b')](_0x48ab7b);}return _0x5758b8[_0xe90d('0x2c')](_0x48ab7b)[_0xe90d('0x2d')]();};}function respondWithResult(_0x309fdc,_0x4bd233){_0x4bd233=_0x4bd233||0xc8;return function(_0x2af6b0){if(_0x2af6b0){return _0x309fdc[_0xe90d('0x2c')](_0x4bd233)['json'](_0x2af6b0);}};}function respondWithFilteredResult(_0x5c649e,_0x56bb6a){return function(_0x4aff82){if(_0x4aff82){var _0x1323f6=typeof _0x56bb6a[_0xe90d('0x2e')]==='undefined'&&typeof _0x56bb6a['limit']===_0xe90d('0x2f');var _0x410ad5=_0x4aff82[_0xe90d('0x30')];var _0x2fae1c=_0x1323f6?0x0:_0x56bb6a[_0xe90d('0x2e')];var _0x3310d9=_0x1323f6?_0x4aff82[_0xe90d('0x30')]:_0x56bb6a[_0xe90d('0x2e')]+_0x56bb6a[_0xe90d('0x31')];var _0x183e59;if(_0x3310d9>=_0x410ad5){_0x3310d9=_0x410ad5;_0x183e59=0xc8;}else{_0x183e59=0xce;}_0x5c649e['status'](_0x183e59);return _0x5c649e[_0xe90d('0x32')]('Content-Range',_0x2fae1c+'-'+_0x3310d9+'/'+_0x410ad5)[_0xe90d('0x33')](_0x4aff82);}return null;};}function patchUpdates(_0x1a7e36){return function(_0x5aaf7a){try{jsonpatch[_0xe90d('0x34')](_0x5aaf7a,_0x1a7e36,!![]);}catch(_0x5688dc){return BPromise['reject'](_0x5688dc);}return _0x5aaf7a[_0xe90d('0x35')]();};}function saveUpdates(_0x1349ac,_0x5c86ab){return function(_0x14cf1c){if(_0x14cf1c){return _0x14cf1c['update'](_0x1349ac)['then'](function(_0x3b9b31){return _0x3b9b31;});}return null;};}function removeEntity(_0x5b438f,_0x2b32b6){return function(_0x305db4){if(_0x305db4){return _0x305db4['destroy']()[_0xe90d('0x36')](function(){var _0x380ce1=_0x305db4[_0xe90d('0x37')]({'plain':!![]});var _0x238ed5=_0xe90d('0x38');return db['UserProfileResource'][_0xe90d('0x39')]({'where':{'type':_0x238ed5,'resourceId':_0x380ce1['id']}})[_0xe90d('0x36')](function(){return _0x305db4;});})[_0xe90d('0x36')](function(){_0x5b438f['status'](0xcc)[_0xe90d('0x2d')]();});}};}function handleEntityNotFound(_0x4d89bd,_0x1bf2e0){return function(_0x4bc75f){if(!_0x4bc75f){_0x4d89bd[_0xe90d('0x2b')](0x194);}return _0x4bc75f;};}function handleError(_0x3b0744,_0x1fea12){_0x1fea12=_0x1fea12||0x1f4;return function(_0x5bccfd){logger[_0xe90d('0x25')](_0x5bccfd[_0xe90d('0x3a')]);if(_0x5bccfd[_0xe90d('0x3b')]){delete _0x5bccfd[_0xe90d('0x3b')];}_0x3b0744['status'](_0x1fea12)[_0xe90d('0x3c')](_0x5bccfd);};}exports['index']=function(_0x742db6,_0x148483){var _0x2aaa25={},_0x237abb={},_0x1f37b7={'count':0x0,'rows':[]};var _0x19828b=_[_0xe90d('0x3d')](db['ChatQueue']['rawAttributes'],function(_0x5ccddd){return{'name':_0x5ccddd[_0xe90d('0x3e')],'type':_0x5ccddd['type'][_0xe90d('0x3f')]};});_0x237abb['model']=_[_0xe90d('0x3d')](_0x19828b,_0xe90d('0x3b'));_0x237abb[_0xe90d('0x40')]=_['keys'](_0x742db6[_0xe90d('0x40')]);_0x237abb['filters']=_[_0xe90d('0x41')](_0x237abb['model'],_0x237abb[_0xe90d('0x40')]);_0x2aaa25[_0xe90d('0x42')]=_[_0xe90d('0x41')](_0x237abb['model'],qs['fields'](_0x742db6[_0xe90d('0x40')][_0xe90d('0x43')]));_0x2aaa25['attributes']=_0x2aaa25[_0xe90d('0x42')]['length']?_0x2aaa25[_0xe90d('0x42')]:_0x237abb['model'];if(!_0x742db6[_0xe90d('0x40')]['hasOwnProperty'](_0xe90d('0x44'))){_0x2aaa25[_0xe90d('0x31')]=qs[_0xe90d('0x31')](_0x742db6[_0xe90d('0x40')][_0xe90d('0x31')]);_0x2aaa25[_0xe90d('0x2e')]=qs[_0xe90d('0x2e')](_0x742db6[_0xe90d('0x40')][_0xe90d('0x2e')]);}_0x2aaa25[_0xe90d('0x45')]=qs[_0xe90d('0x46')](_0x742db6['query'][_0xe90d('0x46')]);_0x2aaa25[_0xe90d('0x47')]=qs[_0xe90d('0x48')](_['pick'](_0x742db6[_0xe90d('0x40')],_0x237abb[_0xe90d('0x48')]),_0x19828b);if(_0x742db6[_0xe90d('0x40')][_0xe90d('0x49')]){_0x2aaa25['where']=_['merge'](_0x2aaa25['where'],{'$or':_['map'](_0x19828b,function(_0x508aa7){if(_0x508aa7['type']!==_0xe90d('0x4a')){var _0x50e4c5={};_0x50e4c5[_0x508aa7[_0xe90d('0x3b')]]={'$like':'%'+_0x742db6[_0xe90d('0x40')][_0xe90d('0x49')]+'%'};return _0x50e4c5;}})});}_0x2aaa25=_[_0xe90d('0x4b')]({},_0x2aaa25,_0x742db6[_0xe90d('0x4c')]);var _0xd0063f={'where':_0x2aaa25['where']};return db[_0xe90d('0x4d')][_0xe90d('0x30')](_0xd0063f)[_0xe90d('0x36')](function(_0x524213){_0x1f37b7[_0xe90d('0x30')]=_0x524213;if(_0x742db6[_0xe90d('0x40')][_0xe90d('0x4e')]){_0x2aaa25['include']=[{'all':!![]}];}return db[_0xe90d('0x4d')][_0xe90d('0x4f')](_0x2aaa25);})[_0xe90d('0x36')](function(_0x5bcc22){_0x1f37b7[_0xe90d('0x50')]=_0x5bcc22;return _0x1f37b7;})['then'](respondWithFilteredResult(_0x148483,_0x2aaa25))[_0xe90d('0x2a')](handleError(_0x148483,null));};exports['show']=function(_0x43f844,_0x2cdd3a){var _0x153c04={'raw':!![],'where':{'id':_0x43f844[_0xe90d('0x51')]['id']}},_0x133bfb={};_0x133bfb[_0xe90d('0x52')]=_[_0xe90d('0x53')](db[_0xe90d('0x4d')]['rawAttributes']);_0x133bfb['query']=_['keys'](_0x43f844[_0xe90d('0x40')]);_0x133bfb['filters']=_[_0xe90d('0x41')](_0x133bfb['model'],_0x133bfb[_0xe90d('0x40')]);_0x153c04[_0xe90d('0x42')]=_['intersection'](_0x133bfb[_0xe90d('0x52')],qs[_0xe90d('0x43')](_0x43f844['query'][_0xe90d('0x43')]));_0x153c04[_0xe90d('0x42')]=_0x153c04['attributes'][_0xe90d('0x54')]?_0x153c04['attributes']:_0x133bfb[_0xe90d('0x52')];if(_0x43f844[_0xe90d('0x40')][_0xe90d('0x4e')]){_0x153c04[_0xe90d('0x55')]=[{'all':!![]}];}_0x153c04=_[_0xe90d('0x4b')]({},_0x153c04,_0x43f844[_0xe90d('0x4c')]);return db[_0xe90d('0x4d')][_0xe90d('0x56')](_0x153c04)[_0xe90d('0x36')](handleEntityNotFound(_0x2cdd3a,null))[_0xe90d('0x36')](respondWithResult(_0x2cdd3a,null))[_0xe90d('0x2a')](handleError(_0x2cdd3a,null));};exports[_0xe90d('0x57')]=function(_0x15fd59,_0x5bd3ec){return db[_0xe90d('0x4d')][_0xe90d('0x57')](_0x15fd59[_0xe90d('0x58')],{})[_0xe90d('0x36')](function(_0x1aa5ae){var _0xe9f4e5=_0x15fd59['user'][_0xe90d('0x37')]({'plain':!![]});if(!_0xe9f4e5)throw new Error(_0xe90d('0x59'));if(_0xe9f4e5['role']===_0xe90d('0x5a')){var _0x5c30ca=_0x1aa5ae[_0xe90d('0x37')]({'plain':!![]});var _0x377689='ChatQueues';return db[_0xe90d('0x5b')][_0xe90d('0x56')]({'where':{'name':_0x377689,'userProfileId':_0xe9f4e5[_0xe90d('0x5c')]},'raw':!![]})[_0xe90d('0x36')](function(_0x52597a){if(_0x52597a&&_0x52597a[_0xe90d('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c30ca['name'],'resourceId':_0x5c30ca['id'],'type':_0x52597a[_0xe90d('0x3b')],'sectionId':_0x52597a['id']},{})[_0xe90d('0x36')](function(){return _0x1aa5ae;});}else{return _0x1aa5ae;}})['catch'](function(_0x5399b7){logger['error'](_0xe90d('0x5e'),_0x5399b7);throw _0x5399b7;});}return _0x1aa5ae;})[_0xe90d('0x36')](respondWithResult(_0x5bd3ec,0xc9))[_0xe90d('0x2a')](handleError(_0x5bd3ec,null));};exports[_0xe90d('0x5f')]=function(_0x5ed07a,_0x2f69e9){if(_0x5ed07a[_0xe90d('0x58')]['id']){delete _0x5ed07a['body']['id'];}return db['ChatQueue'][_0xe90d('0x56')]({'where':{'id':_0x5ed07a['params']['id']}})[_0xe90d('0x36')](handleEntityNotFound(_0x2f69e9,null))[_0xe90d('0x36')](saveUpdates(_0x5ed07a['body'],null))[_0xe90d('0x36')](respondWithResult(_0x2f69e9,null))[_0xe90d('0x2a')](handleError(_0x2f69e9,null));};exports[_0xe90d('0x39')]=function(_0x48a044,_0x29aeb3){return db[_0xe90d('0x4d')][_0xe90d('0x56')]({'where':{'id':_0x48a044[_0xe90d('0x51')]['id']}})[_0xe90d('0x36')](handleEntityNotFound(_0x29aeb3,null))[_0xe90d('0x36')](removeEntity(_0x29aeb3,null))[_0xe90d('0x2a')](handleError(_0x29aeb3,null));};exports[_0xe90d('0x60')]=function(_0x52b59e,_0x3fb2d5){return db[_0xe90d('0x4d')][_0xe90d('0x60')]()['then'](respondWithResult(_0x3fb2d5,null))['catch'](handleError(_0x3fb2d5,null));};exports[_0xe90d('0x61')]=function(_0x55d448,_0x31b7c6,_0x39c214){var _0x17c0d1={'raw':!![],'where':{}},_0x36366e={},_0x28e138;return db[_0xe90d('0x4d')][_0xe90d('0x62')]({'where':{'id':_0x55d448[_0xe90d('0x51')]['id']}})[_0xe90d('0x36')](handleEntityNotFound(_0x31b7c6,null))[_0xe90d('0x36')](function(_0x18fa2e){if(_0x18fa2e){_0x28e138=_0x18fa2e[_0xe90d('0x37')]({'plain':!![]});_0x36366e[_0xe90d('0x52')]=_[_0xe90d('0x53')](db[_0xe90d('0x63')]['rawAttributes']);_0x36366e[_0xe90d('0x40')]=_[_0xe90d('0x53')](_0x55d448[_0xe90d('0x40')]);_0x36366e[_0xe90d('0x48')]=_[_0xe90d('0x41')](_0x36366e[_0xe90d('0x52')],_0x36366e[_0xe90d('0x40')]);_0x17c0d1[_0xe90d('0x42')]=_[_0xe90d('0x41')](_0x36366e[_0xe90d('0x52')],qs[_0xe90d('0x43')](_0x55d448['query']['fields']));_0x17c0d1[_0xe90d('0x42')]=_0x17c0d1[_0xe90d('0x42')][_0xe90d('0x54')]?_0x17c0d1[_0xe90d('0x42')]:_0x36366e[_0xe90d('0x52')];if(!_0x55d448[_0xe90d('0x40')][_0xe90d('0x64')](_0xe90d('0x44'))){_0x17c0d1[_0xe90d('0x31')]=qs['limit'](_0x55d448['query']['limit']);_0x17c0d1[_0xe90d('0x2e')]=qs[_0xe90d('0x2e')](_0x55d448['query'][_0xe90d('0x2e')]);}_0x17c0d1[_0xe90d('0x45')]=qs[_0xe90d('0x46')](_0x55d448[_0xe90d('0x40')][_0xe90d('0x46')]);_0x17c0d1[_0xe90d('0x47')]=qs['filters'](_[_0xe90d('0x65')](_0x55d448[_0xe90d('0x40')],_0x36366e[_0xe90d('0x48')]));_0x17c0d1['where'][_0xe90d('0x66')]=_0x18fa2e['id'];if(_0x55d448['query'][_0xe90d('0x49')]){_0x17c0d1[_0xe90d('0x47')]=_['merge'](_0x17c0d1[_0xe90d('0x47')],{'$or':_[_0xe90d('0x3d')](_0x17c0d1[_0xe90d('0x42')],function(_0x430a15){var _0x52928b={};_0x52928b[_0x430a15]={'$like':'%'+_0x55d448['query'][_0xe90d('0x49')]+'%'};return _0x52928b;})});}_0x17c0d1=_[_0xe90d('0x4b')]({},_0x17c0d1,_0x55d448['options']);return db[_0xe90d('0x63')][_0xe90d('0x4f')](_0x17c0d1);}})[_0xe90d('0x36')](function(_0x3d364e){if(_0x3d364e){return db[_0xe90d('0x67')][_0xe90d('0x68')]({'where':{'id':_['map'](_0x3d364e,'UserId'),'role':_0xe90d('0x69')},'attributes':['id','name',_0xe90d('0x6a'),_0xe90d('0x6b'),'createdAt']});}})[_0xe90d('0x36')](function(_0x3e62e7){if(_0x3e62e7){return{'count':_0x3e62e7[_0xe90d('0x30')],'rows':_[_0xe90d('0x3d')](_0x3e62e7[_0xe90d('0x50')],function(_0x36e456){return{'membername':_0x36e456[_0xe90d('0x3b')],'UserId':_0x36e456['id'],'queue_name':_0x28e138[_0xe90d('0x3b')],'ChatQueueId':_0x28e138['id'],'interface':util[_0xe90d('0x6c')](_0xe90d('0x6d'),_0xe90d('0x6e'),_0x36e456[_0xe90d('0x3b')]),'penalty':0x0,'paused':_0x36e456[_0xe90d('0x6a')],'createdAt':_0x36e456['createdAt'],'updatedAt':_0x36e456['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe90d('0x36')](respondWithFilteredResult(_0x31b7c6,_0x17c0d1))['catch'](handleError(_0x31b7c6,null));};exports[_0xe90d('0x6f')]=function(_0x40e72f,_0x1a74ae,_0x4e1fba){var _0xb7e23a={};var _0x1ef47b={};var _0x333421;var _0x3a0f95;return db[_0xe90d('0x4d')]['findOne']({'where':{'id':_0x40e72f['params']['id']}})[_0xe90d('0x36')](handleEntityNotFound(_0x1a74ae,null))[_0xe90d('0x36')](function(_0x3f05eb){if(_0x3f05eb){_0x333421=_0x3f05eb;_0x1ef47b[_0xe90d('0x52')]=_[_0xe90d('0x53')](db['Team'][_0xe90d('0x70')]);_0x1ef47b[_0xe90d('0x40')]=_[_0xe90d('0x53')](_0x40e72f[_0xe90d('0x40')]);_0x1ef47b['filters']=_[_0xe90d('0x41')](_0x1ef47b['model'],_0x1ef47b[_0xe90d('0x40')]);_0xb7e23a[_0xe90d('0x42')]=_[_0xe90d('0x41')](_0x1ef47b[_0xe90d('0x52')],qs['fields'](_0x40e72f[_0xe90d('0x40')][_0xe90d('0x43')]));_0xb7e23a[_0xe90d('0x42')]=_0xb7e23a['attributes'][_0xe90d('0x54')]?_0xb7e23a[_0xe90d('0x42')]:_0x1ef47b[_0xe90d('0x52')];_0xb7e23a['order']=qs[_0xe90d('0x46')](_0x40e72f['query'][_0xe90d('0x46')]);_0xb7e23a[_0xe90d('0x47')]=qs[_0xe90d('0x48')](_[_0xe90d('0x65')](_0x40e72f[_0xe90d('0x40')],_0x1ef47b[_0xe90d('0x48')]));if(_0x40e72f[_0xe90d('0x40')][_0xe90d('0x49')]){_0xb7e23a[_0xe90d('0x47')]=_[_0xe90d('0x4b')](_0xb7e23a[_0xe90d('0x47')],{'$or':_[_0xe90d('0x3d')](_0xb7e23a[_0xe90d('0x42')],function(_0x566982){var _0x2b5c91={};_0x2b5c91[_0x566982]={'$like':'%'+_0x40e72f[_0xe90d('0x40')]['filter']+'%'};return _0x2b5c91;})});}_0xb7e23a=_[_0xe90d('0x4b')]({},_0xb7e23a,_0x40e72f[_0xe90d('0x4c')]);return _0x333421[_0xe90d('0x6f')](_0xb7e23a);}})[_0xe90d('0x36')](function(_0x3cf91a){if(_0x3cf91a){_0x3a0f95=_0x3cf91a[_0xe90d('0x54')];if(!_0x40e72f[_0xe90d('0x40')][_0xe90d('0x64')](_0xe90d('0x44'))){_0xb7e23a['limit']=qs[_0xe90d('0x31')](_0x40e72f[_0xe90d('0x40')][_0xe90d('0x31')]);_0xb7e23a[_0xe90d('0x2e')]=qs['offset'](_0x40e72f[_0xe90d('0x40')][_0xe90d('0x2e')]);}return _0x333421['getTeams'](_0xb7e23a);}})['then'](function(_0x36a9e1){if(_0x36a9e1){return _0x36a9e1?{'count':_0x3a0f95,'rows':_0x36a9e1}:null;}})['then'](respondWithResult(_0x1a74ae,null))[_0xe90d('0x2a')](handleError(_0x1a74ae,null));};exports[_0xe90d('0x71')]=function(_0x1d5f71,_0x1418c5,_0x2e62a7){var _0x5ace3e=_0x1d5f71[_0xe90d('0x58')][_0xe90d('0x72')];return db['Team'][_0xe90d('0x4f')]({'where':{'id':_0x5ace3e},'attributes':['id'],'include':[{'model':db[_0xe90d('0x67')],'as':_0xe90d('0x73'),'attributes':['id',_0xe90d('0x3b'),_0xe90d('0x74'),_0xe90d('0x75'),'interface'],'raw':!![]}]})[_0xe90d('0x36')](function(_0x52aff0){if(_0x52aff0){var _0x21809c=_[_0xe90d('0x76')](_0x52aff0,function(_0x5c9cdc){var _0x3e778e=_0x5c9cdc[_0xe90d('0x37')]({'plain':!![]});return _0x3e778e[_0xe90d('0x73')];});return db[_0xe90d('0x4d')]['find']({'where':{'id':_0x1d5f71[_0xe90d('0x51')]['id']}})[_0xe90d('0x36')](function(_0x469e28){return db['sequelize']['transaction'](function(_0x4fde0e){return _0x469e28['addTeams'](_0x5ace3e,{'transaction':_0x4fde0e})[_0xe90d('0x36')](function(){return BPromise['each'](_0x21809c,function(_0x3064e4){return db[_0xe90d('0x63')][_0xe90d('0x77')]({'where':{'UserId':_0x3064e4['id'],'ChatQueueId':_0x1d5f71[_0xe90d('0x51')]['id']},'transaction':_0x4fde0e});});})['then'](function(){_0x21809c[_0xe90d('0x78')](function(_0x4527de){socket[_0xe90d('0x79')](_0xe90d('0x7a'),{'UserId':_0x4527de['id'],'ChatQueueId':_0x469e28['id']});});});});});}})[_0xe90d('0x36')](respondWithStatusCode(_0x1418c5,null))[_0xe90d('0x2a')](handleError(_0x1418c5,null));};exports[_0xe90d('0x7b')]=function(_0x1e1f5e,_0x4e0a4c,_0x18c1a3){return db[_0xe90d('0x7c')][_0xe90d('0x4f')]({'where':{'id':_0x1e1f5e[_0xe90d('0x40')][_0xe90d('0x72')]},'attributes':['id'],'include':[{'model':db[_0xe90d('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe90d('0x36')](handleEntityNotFound(_0x4e0a4c,null))[_0xe90d('0x36')](function(_0x2c4f96){var _0x3a85ca=_[_0xe90d('0x3d')](_0x2c4f96,'id');var _0x4ce357=[];var _0x1db97e=[];var _0x1b4264=squel['select']();_0x1b4264[_0xe90d('0x7d')](_0xe90d('0x7e'))[_0xe90d('0x7f')](_0xe90d('0x80'),'tq')['join'](_0xe90d('0x81'),'ut',_0xe90d('0x82'))[_0xe90d('0x47')](_0xe90d('0x83'),_0x1e1f5e[_0xe90d('0x51')]['id']);for(var _0x473c46=0x0;_0x473c46<_0x2c4f96[_0xe90d('0x54')];_0x473c46+=0x1){let _0x2161d2=_0x2c4f96[_0x473c46];for(var _0x1ce42f=0x0;_0x1ce42f<_0x2161d2[_0xe90d('0x73')][_0xe90d('0x54')];_0x1ce42f+=0x1){let _0x2d410f=_0x2161d2[_0xe90d('0x73')][_0x1ce42f];var _0x49d381=_0x1b4264['clone']();_0x49d381[_0xe90d('0x47')]('ut.UserId\x20=\x20?',_0x2d410f['id']);_0x1db97e[_0xe90d('0x84')](db[_0xe90d('0x85')]['query'](_0x49d381[_0xe90d('0x86')](),{'type':db[_0xe90d('0x85')]['QueryTypes'][_0xe90d('0x87')]})[_0xe90d('0x36')](function(_0x45d940){if(_0x45d940['length']===0x1){return _0x2d410f['id'];}else{var _0x128463=_[_0xe90d('0x88')](_[_0xe90d('0x3d')](_0x45d940,_0xe90d('0x89')),function(_0x2bea34){return _[_0xe90d('0x8a')](_0x3a85ca,_0x2bea34);});if(_0x128463){return _0x2d410f['id'];}}}));}}return BPromise[_0xe90d('0x8b')](_0x1db97e)[_0xe90d('0x36')](function(_0x551f00){_0x4ce357=_(_0x4ce357)[_0xe90d('0x8c')](_0x551f00)[_0xe90d('0x8d')]()[_0xe90d('0x8e')]();return db[_0xe90d('0x4d')]['find']({'where':{'id':_0x1e1f5e[_0xe90d('0x51')]['id']}})['then'](function(_0x2a9362){return db[_0xe90d('0x85')][_0xe90d('0x8f')](function(_0x53dac6){return _0x2a9362[_0xe90d('0x7b')](_0x1e1f5e[_0xe90d('0x40')][_0xe90d('0x72')],{'transaction':_0x53dac6})['then'](function(){if(!_[_0xe90d('0x90')](_0x4ce357)){return _0x2a9362[_0xe90d('0x91')](_0x4ce357,{'transaction':_0x53dac6});}})['then'](function(){_0x4ce357[_0xe90d('0x78')](function(_0x566dc2){socket[_0xe90d('0x79')](_0xe90d('0x92'),{'UserId':_0x566dc2,'ChatQueueId':_0x2a9362['id']});});});});});});})['then'](respondWithStatusCode(_0x4e0a4c,null))[_0xe90d('0x2a')](handleError(_0x4e0a4c,null));};exports[_0xe90d('0x93')]=function(_0x43a535,_0x3cd39a,_0x233e8c){return db['ChatQueue'][_0xe90d('0x56')]({'where':{'id':_0x43a535[_0xe90d('0x51')]['id']}})[_0xe90d('0x36')](handleEntityNotFound(_0x3cd39a,null))[_0xe90d('0x36')](function(_0x3a8e8f){if(_0x3a8e8f){return _0x3a8e8f[_0xe90d('0x93')](_0x43a535[_0xe90d('0x58')]['ids'],_[_0xe90d('0x94')](_0x43a535['body'],['ids','id'])||{})[_0xe90d('0x95')](function(_0xec2c7e){for(var _0x1155fa=0x0;_0x1155fa<_0x43a535['body'][_0xe90d('0x72')][_0xe90d('0x54')];_0x1155fa+=0x1){socket[_0xe90d('0x79')](_0xe90d('0x7a'),{'UserId':Number(_0x43a535['body']['ids'][_0x1155fa]),'ChatQueueId':Number(_0x43a535['params']['id'])});}return _0xec2c7e;});}})[_0xe90d('0x36')](respondWithResult(_0x3cd39a,null))['catch'](handleError(_0x3cd39a,null));};exports['removeAgents']=function(_0x1f58df,_0x4e917e,_0x588683){return db[_0xe90d('0x4d')][_0xe90d('0x56')]({'where':{'id':_0x1f58df[_0xe90d('0x51')]['id']}})[_0xe90d('0x36')](handleEntityNotFound(_0x4e917e,null))[_0xe90d('0x36')](function(_0x43ca74){if(_0x43ca74){return _0x43ca74['removeAgents'](_0x1f58df['query']['ids'])[_0xe90d('0x36')](function(){if(_[_0xe90d('0x96')](_0x1f58df[_0xe90d('0x40')][_0xe90d('0x72')])){for(var _0x287643=0x0;_0x287643<_0x1f58df[_0xe90d('0x40')][_0xe90d('0x72')][_0xe90d('0x54')];_0x287643+=0x1){socket[_0xe90d('0x79')](_0xe90d('0x92'),{'UserId':Number(_0x1f58df[_0xe90d('0x40')][_0xe90d('0x72')][_0x287643]),'ChatQueueId':Number(_0x1f58df['params']['id'])});}}else{socket[_0xe90d('0x79')]('userChatQueue:remove',{'UserId':Number(_0x1f58df[_0xe90d('0x40')][_0xe90d('0x72')]),'ChatQueueId':Number(_0x1f58df[_0xe90d('0x51')]['id'])});}});}})[_0xe90d('0x36')](respondWithStatusCode(_0x4e917e,null))['catch'](handleError(_0x4e917e,null));};exports[_0xe90d('0x97')]=function(_0x1a9870,_0x281581,_0x19947b){var _0x2185ca={};var _0x5acf62={};var _0x10f0d3;var _0x49dd5d;return db[_0xe90d('0x4d')][_0xe90d('0x62')]({'where':{'id':_0x1a9870[_0xe90d('0x51')]['id']}})[_0xe90d('0x36')](handleEntityNotFound(_0x281581,null))[_0xe90d('0x36')](function(_0x1836ae){if(_0x1836ae){_0x10f0d3=_0x1836ae;_0x5acf62[_0xe90d('0x52')]=_[_0xe90d('0x53')](db[_0xe90d('0x67')][_0xe90d('0x70')]);_0x5acf62[_0xe90d('0x40')]=_[_0xe90d('0x53')](_0x1a9870['query']);_0x5acf62[_0xe90d('0x48')]=_[_0xe90d('0x41')](_0x5acf62['model'],_0x5acf62[_0xe90d('0x40')]);_0x2185ca['attributes']=_[_0xe90d('0x41')](_0x5acf62[_0xe90d('0x52')],qs[_0xe90d('0x43')](_0x1a9870['query'][_0xe90d('0x43')]));_0x2185ca[_0xe90d('0x42')]=_0x2185ca[_0xe90d('0x42')][_0xe90d('0x54')]?_0x2185ca[_0xe90d('0x42')]:_0x5acf62[_0xe90d('0x52')];_0x2185ca[_0xe90d('0x45')]=qs[_0xe90d('0x46')](_0x1a9870[_0xe90d('0x40')]['sort']);_0x2185ca['where']=qs[_0xe90d('0x48')](_['pick'](_0x1a9870[_0xe90d('0x40')],_0x5acf62[_0xe90d('0x48')]));if(_0x1a9870[_0xe90d('0x40')][_0xe90d('0x49')]){_0x2185ca[_0xe90d('0x47')]=_[_0xe90d('0x4b')](_0x2185ca[_0xe90d('0x47')],{'$or':_[_0xe90d('0x3d')](_0x2185ca[_0xe90d('0x42')],function(_0x171dc9){var _0x77e66b={};_0x77e66b[_0x171dc9]={'$like':'%'+_0x1a9870[_0xe90d('0x40')][_0xe90d('0x49')]+'%'};return _0x77e66b;})});}_0x2185ca=_[_0xe90d('0x4b')]({},_0x2185ca,_0x1a9870[_0xe90d('0x4c')]);return _0x10f0d3[_0xe90d('0x97')](_0x2185ca);}})['then'](function(_0x2586d9){if(_0x2586d9){_0x49dd5d=_0x2586d9[_0xe90d('0x54')];if(!_0x1a9870[_0xe90d('0x40')][_0xe90d('0x64')]('nolimit')){_0x2185ca[_0xe90d('0x31')]=qs[_0xe90d('0x31')](_0x1a9870[_0xe90d('0x40')][_0xe90d('0x31')]);_0x2185ca['offset']=qs['offset'](_0x1a9870[_0xe90d('0x40')][_0xe90d('0x2e')]);}return _0x10f0d3['getAgents'](_0x2185ca);}})[_0xe90d('0x36')](function(_0x3f931a){if(_0x3f931a){return _0x3f931a?{'count':_0x49dd5d,'rows':_0x3f931a}:null;}})[_0xe90d('0x36')](respondWithResult(_0x281581,null))[_0xe90d('0x2a')](handleError(_0x281581,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 01144d8..1679d0f 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 _0x095b=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x095b,0x15c));var _0xb095=function(_0x3e4f32,_0x42e124){_0x3e4f32=_0x3e4f32-0x0;var _0x56b8be=_0x095b[_0x3e4f32];return _0x56b8be;};'use strict';var EventEmitter=require(_0xb095('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb095('0x1')](0x0);var events={'afterCreate':_0xb095('0x2'),'afterUpdate':_0xb095('0x3'),'afterDestroy':_0xb095('0x4')};function emitEvent(_0x4116f1){return function(_0x216e89,_0x27156d,_0x3f526e){ChatQueueEvents[_0xb095('0x5')](_0x4116f1+':'+_0x216e89['id'],_0x216e89);ChatQueueEvents[_0xb095('0x5')](_0x4116f1,_0x216e89);_0x3f526e(null);};}for(var e in events){if(events[_0xb095('0x6')](e)){var event=events[e];ChatQueue[_0xb095('0x7')](e,emitEvent(event));}}module[_0xb095('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xb6b5=['ChatQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0xad39fd,_0x4c2a11){var _0x4cf584=function(_0x4aeace){while(--_0x4aeace){_0xad39fd['push'](_0xad39fd['shift']());}};_0x4cf584(++_0x4c2a11);}(_0xb6b5,0xaf));var _0x5b6b=function(_0x4b185e,_0x31c299){_0x4b185e=_0x4b185e-0x0;var _0x558b84=_0xb6b5[_0x4b185e];return _0x558b84;};'use strict';var EventEmitter=require(_0x5b6b('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x5b6b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5b6b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b6b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x180244){return function(_0x2602e9,_0x37b1e1,_0x3a3b29){ChatQueueEvents[_0x5b6b('0x4')](_0x180244+':'+_0x2602e9['id'],_0x2602e9);ChatQueueEvents[_0x5b6b('0x4')](_0x180244,_0x2602e9);_0x3a3b29(null);};}for(var e in events){if(events[_0x5b6b('0x5')](e)){var event=events[e];ChatQueue[_0x5b6b('0x6')](e,emitEvent(event));}}module[_0x5b6b('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index c78af95..bb08ffa 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 _0xb99c=['exports','define','chat_queues','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x2cbbc1,_0x2a97c2){var _0x6644a8=function(_0x4d75d4){while(--_0x4d75d4){_0x2cbbc1['push'](_0x2cbbc1['shift']());}};_0x6644a8(++_0x2a97c2);}(_0xb99c,0x1b0));var _0xcb99=function(_0x101504,_0x4598b0){_0x101504=_0x101504-0x0;var _0x1b7547=_0xb99c[_0x101504];return _0x1b7547;};'use strict';var _=require(_0xcb99('0x0'));var util=require(_0xcb99('0x1'));var logger=require(_0xcb99('0x2'))(_0xcb99('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb99('0x4'));var rimraf=require(_0xcb99('0x5'));var config=require(_0xcb99('0x6'));var attributes=require(_0xcb99('0x7'));module[_0xcb99('0x8')]=function(_0x446747,_0x41d380){return _0x446747[_0xcb99('0x9')]('ChatQueue',attributes,{'tableName':_0xcb99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0003=['../../config/logger','moment','rimraf','../../config/environment','define','chat_queues','lodash'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x0003,0x148));var _0x3000=function(_0x2311bf,_0x4edd75){_0x2311bf=_0x2311bf-0x0;var _0x1e49b3=_0x0003[_0x2311bf];return _0x1e49b3;};'use strict';var _=require(_0x3000('0x0'));var util=require('util');var logger=require(_0x3000('0x1'))('api');var moment=require(_0x3000('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3000('0x3'));var config=require(_0x3000('0x4'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x7b8026,_0x129e50){return _0x7b8026[_0x3000('0x5')]('ChatQueue',attributes,{'tableName':_0x3000('0x6'),'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 de496bd..1a68966 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 _0xf3f9=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetChatQueue','findAll','options','where','limit','map','include','model','ShowChatQueue','ChatQueue','find','attributes','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then'];(function(_0x5c7fa4,_0x310ea2){var _0x280569=function(_0x1b8cbf){while(--_0x1b8cbf){_0x5c7fa4['push'](_0x5c7fa4['shift']());}};_0x280569(++_0x310ea2);}(_0xf3f9,0x1de));var _0x9f3f=function(_0x4f8282,_0x3543ee){_0x4f8282=_0x4f8282-0x0;var _0x2ced9e=_0xf3f9[_0x4f8282];return _0x2ced9e;};'use strict';var _=require(_0x9f3f('0x0'));var util=require(_0x9f3f('0x1'));var moment=require('moment');var BPromise=require(_0x9f3f('0x2'));var rs=require(_0x9f3f('0x3'));var fs=require('fs');var Redis=require(_0x9f3f('0x4'));var db=require(_0x9f3f('0x5'))['db'];var utils=require(_0x9f3f('0x6'));var logger=require(_0x9f3f('0x7'))(_0x9f3f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f3f('0x9')]['http']({'port':0x232a});config[_0x9f3f('0xa')]=_['defaults'](config[_0x9f3f('0xa')],{'host':_0x9f3f('0xb'),'port':0x18eb});var socket=require(_0x9f3f('0xc'))(new Redis(config['redis']));require(_0x9f3f('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d8a08,_0x5add2e,_0x52806e){return new BPromise(function(_0x435966,_0x3cd7a8){return client[_0x9f3f('0xe')](_0x5d8a08,_0x52806e)[_0x9f3f('0xf')](function(_0xd63ce8){logger[_0x9f3f('0x10')](_0x9f3f('0x11'),_0x5add2e,_0x9f3f('0x12'));logger[_0x9f3f('0x13')](_0x9f3f('0x14'),_0x5add2e,_0x9f3f('0x12'),JSON[_0x9f3f('0x15')](_0xd63ce8));if(_0xd63ce8['error']){if(_0xd63ce8[_0x9f3f('0x16')][_0x9f3f('0x17')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5add2e,_0xd63ce8[_0x9f3f('0x16')][_0x9f3f('0x18')]);return _0x3cd7a8(_0xd63ce8[_0x9f3f('0x16')][_0x9f3f('0x18')]);}logger[_0x9f3f('0x16')](_0x9f3f('0x11'),_0x5add2e,_0xd63ce8['error'][_0x9f3f('0x18')]);return _0x435966(_0xd63ce8[_0x9f3f('0x16')][_0x9f3f('0x18')]);}else{logger[_0x9f3f('0x10')](_0x9f3f('0x11'),_0x5add2e,_0x9f3f('0x12'));_0x435966(_0xd63ce8['result'][_0x9f3f('0x18')]);}})['catch'](function(_0x1b8706){logger[_0x9f3f('0x16')]('ChatQueue,\x20%s,\x20%s',_0x5add2e,_0x1b8706);_0x3cd7a8(_0x1b8706);});});}exports[_0x9f3f('0x19')]=function(_0x8363f){var _0x420511=this;return new Promise(function(_0x43d9e6,_0x4ac7c0){return db['ChatQueue'][_0x9f3f('0x1a')]({'raw':_0x8363f['options']?_0x8363f[_0x9f3f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x8363f['options']?_0x8363f[_0x9f3f('0x1b')][_0x9f3f('0x1c')]||null:null,'attributes':_0x8363f['options']?_0x8363f[_0x9f3f('0x1b')]['attributes']||null:null,'limit':_0x8363f['options']?_0x8363f[_0x9f3f('0x1b')][_0x9f3f('0x1d')]||null:null,'include':_0x8363f[_0x9f3f('0x1b')]?_0x8363f[_0x9f3f('0x1b')]['include']?_[_0x9f3f('0x1e')](_0x8363f['options'][_0x9f3f('0x1f')],function(_0x1ef969){return{'model':db[_0x1ef969[_0x9f3f('0x20')]],'as':_0x1ef969['as'],'attributes':_0x1ef969['attributes'],'include':_0x1ef969[_0x9f3f('0x1f')]?_[_0x9f3f('0x1e')](_0x1ef969[_0x9f3f('0x1f')],function(_0x829555){return{'model':db[_0x829555[_0x9f3f('0x20')]],'as':_0x829555['as'],'attributes':_0x829555['attributes'],'include':_0x829555['include']?_[_0x9f3f('0x1e')](_0x829555['include'],function(_0x3b43c7){return{'model':db[_0x3b43c7[_0x9f3f('0x20')]],'as':_0x3b43c7['as'],'attributes':_0x3b43c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f3f('0xf')](function(_0x571c96){logger['info']('GetChatQueue',_0x8363f);logger['debug'](_0x9f3f('0x19'),_0x8363f,JSON[_0x9f3f('0x15')](_0x571c96));_0x43d9e6(_0x571c96);})['catch'](function(_0x3a5be4){logger[_0x9f3f('0x16')](_0x9f3f('0x19'),_0x3a5be4[_0x9f3f('0x18')],_0x8363f);_0x4ac7c0(_0x420511[_0x9f3f('0x16')](0x1f4,_0x3a5be4['message']));});});};exports[_0x9f3f('0x21')]=function(_0x239924){var _0x377a0=this;return new Promise(function(_0x416ccc,_0x979f84){return db[_0x9f3f('0x22')][_0x9f3f('0x23')]({'raw':_0x239924[_0x9f3f('0x1b')]?_0x239924[_0x9f3f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x239924[_0x9f3f('0x1b')]?_0x239924[_0x9f3f('0x1b')][_0x9f3f('0x1c')]||null:null,'attributes':_0x239924[_0x9f3f('0x1b')]?_0x239924[_0x9f3f('0x1b')][_0x9f3f('0x24')]||null:null,'include':_0x239924[_0x9f3f('0x1b')]?_0x239924[_0x9f3f('0x1b')][_0x9f3f('0x1f')]?_['map'](_0x239924['options'][_0x9f3f('0x1f')],function(_0x1e49ab){return{'model':db[_0x1e49ab[_0x9f3f('0x20')]],'as':_0x1e49ab['as'],'attributes':_0x1e49ab[_0x9f3f('0x24')],'include':_0x1e49ab[_0x9f3f('0x1f')]?_[_0x9f3f('0x1e')](_0x1e49ab[_0x9f3f('0x1f')],function(_0x10cb48){return{'model':db[_0x10cb48[_0x9f3f('0x20')]],'as':_0x10cb48['as'],'attributes':_0x10cb48[_0x9f3f('0x24')],'include':_0x10cb48['include']?_[_0x9f3f('0x1e')](_0x10cb48[_0x9f3f('0x1f')],function(_0x5b434c){return{'model':db[_0x5b434c['model']],'as':_0x5b434c['as'],'attributes':_0x5b434c[_0x9f3f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9f3f('0xf')](function(_0x1a393d){logger[_0x9f3f('0x10')](_0x9f3f('0x21'),_0x239924);logger[_0x9f3f('0x13')]('ShowChatQueue',_0x239924,JSON[_0x9f3f('0x15')](_0x1a393d));_0x416ccc(_0x1a393d);})[_0x9f3f('0x25')](function(_0x3674bf){logger[_0x9f3f('0x16')](_0x9f3f('0x21'),_0x3674bf[_0x9f3f('0x18')],_0x239924);_0x979f84(_0x377a0[_0x9f3f('0x16')](0x1f4,_0x3674bf[_0x9f3f('0x18')]));});});};
\ No newline at end of file
+var _0xa521=['request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','attributes','limit','include','model','map','GetChatQueue','find','where','ShowChatQueue','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','then','info','ChatQueue,\x20%s,\x20%s'];(function(_0xc18699,_0x242329){var _0x2ffa32=function(_0x1af89d){while(--_0x1af89d){_0xc18699['push'](_0xc18699['shift']());}};_0x2ffa32(++_0x242329);}(_0xa521,0xeb));var _0x1a52=function(_0x49361a,_0x9c19d2){_0x49361a=_0x49361a-0x0;var _0x3db465=_0xa521[_0x49361a];return _0x3db465;};'use strict';var _=require(_0x1a52('0x0'));var util=require(_0x1a52('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1a52('0x2'));var fs=require('fs');var Redis=require(_0x1a52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a52('0x4'));var logger=require(_0x1a52('0x5'))(_0x1a52('0x6'));var config=require(_0x1a52('0x7'));var jayson=require(_0x1a52('0x8'));var client=jayson[_0x1a52('0x9')][_0x1a52('0xa')]({'port':0x232a});config[_0x1a52('0xb')]=_[_0x1a52('0xc')](config[_0x1a52('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x1a52('0xd')](socket);function respondWithRpcPromise(_0x577463,_0x22dd37,_0x459066){return new BPromise(function(_0x234fbb,_0x3ecef9){return client['request'](_0x577463,_0x459066)[_0x1a52('0xe')](function(_0x4de7eb){logger[_0x1a52('0xf')](_0x1a52('0x10'),_0x22dd37,_0x1a52('0x11'));logger[_0x1a52('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x22dd37,_0x1a52('0x11'),JSON[_0x1a52('0x13')](_0x4de7eb));if(_0x4de7eb[_0x1a52('0x14')]){if(_0x4de7eb[_0x1a52('0x14')][_0x1a52('0x15')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x22dd37,_0x4de7eb['error']['message']);return _0x3ecef9(_0x4de7eb[_0x1a52('0x14')][_0x1a52('0x16')]);}logger[_0x1a52('0x14')](_0x1a52('0x10'),_0x22dd37,_0x4de7eb['error'][_0x1a52('0x16')]);return _0x234fbb(_0x4de7eb[_0x1a52('0x14')][_0x1a52('0x16')]);}else{logger[_0x1a52('0xf')](_0x1a52('0x10'),_0x22dd37,_0x1a52('0x11'));_0x234fbb(_0x4de7eb[_0x1a52('0x17')][_0x1a52('0x16')]);}})[_0x1a52('0x18')](function(_0x4392ff){logger[_0x1a52('0x14')]('ChatQueue,\x20%s,\x20%s',_0x22dd37,_0x4392ff);_0x3ecef9(_0x4392ff);});});}exports['GetChatQueue']=function(_0x28cb98){var _0x26334a=this;return new Promise(function(_0x104e97,_0x59db0a){return db['ChatQueue'][_0x1a52('0x19')]({'raw':_0x28cb98[_0x1a52('0x1a')]?_0x28cb98[_0x1a52('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x28cb98['options']?_0x28cb98[_0x1a52('0x1a')]['where']||null:null,'attributes':_0x28cb98[_0x1a52('0x1a')]?_0x28cb98[_0x1a52('0x1a')][_0x1a52('0x1b')]||null:null,'limit':_0x28cb98[_0x1a52('0x1a')]?_0x28cb98[_0x1a52('0x1a')][_0x1a52('0x1c')]||null:null,'include':_0x28cb98[_0x1a52('0x1a')]?_0x28cb98['options'][_0x1a52('0x1d')]?_['map'](_0x28cb98[_0x1a52('0x1a')][_0x1a52('0x1d')],function(_0x499a0){return{'model':db[_0x499a0[_0x1a52('0x1e')]],'as':_0x499a0['as'],'attributes':_0x499a0[_0x1a52('0x1b')],'include':_0x499a0[_0x1a52('0x1d')]?_['map'](_0x499a0[_0x1a52('0x1d')],function(_0x1fd2b5){return{'model':db[_0x1fd2b5[_0x1a52('0x1e')]],'as':_0x1fd2b5['as'],'attributes':_0x1fd2b5[_0x1a52('0x1b')],'include':_0x1fd2b5['include']?_[_0x1a52('0x1f')](_0x1fd2b5[_0x1a52('0x1d')],function(_0x2ea2ff){return{'model':db[_0x2ea2ff['model']],'as':_0x2ea2ff['as'],'attributes':_0x2ea2ff[_0x1a52('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c28e6){logger['info'](_0x1a52('0x20'),_0x28cb98);logger[_0x1a52('0x12')]('GetChatQueue',_0x28cb98,JSON['stringify'](_0x4c28e6));_0x104e97(_0x4c28e6);})[_0x1a52('0x18')](function(_0x4f5f9f){logger[_0x1a52('0x14')](_0x1a52('0x20'),_0x4f5f9f[_0x1a52('0x16')],_0x28cb98);_0x59db0a(_0x26334a[_0x1a52('0x14')](0x1f4,_0x4f5f9f[_0x1a52('0x16')]));});});};exports['ShowChatQueue']=function(_0x2c16de){var _0x369de0=this;return new Promise(function(_0x1dcc62,_0x22f58c){return db['ChatQueue'][_0x1a52('0x21')]({'raw':_0x2c16de[_0x1a52('0x1a')]?_0x2c16de['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c16de[_0x1a52('0x1a')]?_0x2c16de[_0x1a52('0x1a')][_0x1a52('0x22')]||null:null,'attributes':_0x2c16de[_0x1a52('0x1a')]?_0x2c16de[_0x1a52('0x1a')][_0x1a52('0x1b')]||null:null,'include':_0x2c16de[_0x1a52('0x1a')]?_0x2c16de[_0x1a52('0x1a')][_0x1a52('0x1d')]?_[_0x1a52('0x1f')](_0x2c16de['options'][_0x1a52('0x1d')],function(_0x1a899f){return{'model':db[_0x1a899f['model']],'as':_0x1a899f['as'],'attributes':_0x1a899f[_0x1a52('0x1b')],'include':_0x1a899f[_0x1a52('0x1d')]?_['map'](_0x1a899f['include'],function(_0x5e5748){return{'model':db[_0x5e5748[_0x1a52('0x1e')]],'as':_0x5e5748['as'],'attributes':_0x5e5748[_0x1a52('0x1b')],'include':_0x5e5748['include']?_[_0x1a52('0x1f')](_0x5e5748[_0x1a52('0x1d')],function(_0x41d88b){return{'model':db[_0x41d88b[_0x1a52('0x1e')]],'as':_0x41d88b['as'],'attributes':_0x41d88b[_0x1a52('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x257347){logger[_0x1a52('0xf')]('ShowChatQueue',_0x2c16de);logger[_0x1a52('0x12')](_0x1a52('0x23'),_0x2c16de,JSON[_0x1a52('0x13')](_0x257347));_0x1dcc62(_0x257347);})[_0x1a52('0x18')](function(_0x4fcc15){logger[_0x1a52('0x14')](_0x1a52('0x23'),_0x4fcc15[_0x1a52('0x16')],_0x2c16de);_0x22f58c(_0x369de0[_0x1a52('0x14')](0x1f4,_0x4fcc15[_0x1a52('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 46dbdc9..5bb6523 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 _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x784064,_0x46982d){var _0x17c3e5=function(_0x249d02){while(--_0x249d02){_0x784064['push'](_0x784064['shift']());}};_0x17c3e5(++_0x46982d);}(_0xa37e,0x97));var _0xea37=function(_0x119293,_0x3ab79c){_0x119293=_0x119293-0x0;var _0x3a9661=_0xa37e[_0x119293];return _0x3a9661;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}};
\ No newline at end of file
+var _0x5178=['remove','update','register','length','save'];(function(_0x649401,_0x43480a){var _0xaea28f=function(_0x5550c5){while(--_0x5550c5){_0x649401['push'](_0x649401['shift']());}};_0xaea28f(++_0x43480a);}(_0x5178,0x171));var _0x8517=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5178[_0x2dafbe];return _0x58a45a;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){ChatQueueEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('chatQueue:'+_0x10f918,_0x58ed7e);ChatQueueEvents['on'](_0x10f918,_0x25146d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index bf8d6d2..7b93dc5 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x43efc1,_0x2f1605){var _0x56aa9d=function(_0x540db6){while(--_0x540db6){_0x43efc1['push'](_0x43efc1['shift']());}};_0x56aa9d(++_0x2f1605);}(_0xe14b,0x93));var _0xbe14=function(_0x535d75,_0x4bae1d){_0x535d75=_0x535d75-0x0;var _0x517a0f=_0xe14b[_0x535d75];return _0x517a0f;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+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(_0xfd04b0,_0x431a5a){var _0x520b04=function(_0x465438){while(--_0x465438){_0xfd04b0['push'](_0xfd04b0['shift']());}};_0x520b04(++_0x431a5a);}(_0x008c,0x188));var _0xc008=function(_0x56e027,_0x496a98){_0x56e027=_0x56e027-0x0;var _0x33ffc4=_0x008c[_0x56e027];return _0x33ffc4;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e55cdcf..7f6107e 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 _0x2c40=['DATE','sequelize','exports','STRING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2c40,0xfd));var _0x02c4=function(_0x412b89,_0x1a57a7){_0x412b89=_0x412b89-0x0;var _0x164aac=_0x2c40[_0x412b89];return _0x164aac;};'use strict';var moment=require('moment');var Sequelize=require(_0x02c4('0x0'));module[_0x02c4('0x1')]={'uniqueid':{'type':Sequelize[_0x02c4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x02c4('0x2')]},'joinAt':{'type':Sequelize[_0x02c4('0x3')]},'leaveAt':{'type':Sequelize[_0x02c4('0x3')]},'acceptAt':{'type':Sequelize[_0x02c4('0x3')]},'exitAt':{'type':Sequelize[_0x02c4('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0f9f=['sequelize','exports','STRING','DATE','moment'];(function(_0x2b9e64,_0x405a2d){var _0x452cbe=function(_0x121721){while(--_0x121721){_0x2b9e64['push'](_0x2b9e64['shift']());}};_0x452cbe(++_0x405a2d);}(_0x0f9f,0xae));var _0xf0f9=function(_0x2b60bd,_0x49418d){_0x2b60bd=_0x2b60bd-0x0;var _0x3d9523=_0x0f9f[_0x2b60bd];return _0x3d9523;};'use strict';var moment=require(_0xf0f9('0x0'));var Sequelize=require(_0xf0f9('0x1'));module[_0xf0f9('0x2')]={'uniqueid':{'type':Sequelize[_0xf0f9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf0f9('0x3')]},'joinAt':{'type':Sequelize[_0xf0f9('0x4')]},'leaveAt':{'type':Sequelize[_0xf0f9('0x4')]},'acceptAt':{'type':Sequelize[_0xf0f9('0x4')]},'exitAt':{'type':Sequelize[_0xf0f9('0x4')]},'reason':{'type':Sequelize[_0xf0f9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 7ef8673..d6cd3c3 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 _0x7e02=['destroy','end','error','stack','name','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','then'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7e02,0x71));var _0x27e0=function(_0x543865,_0x502676){_0x543865=_0x543865-0x0;var _0x1d3e67=_0x7e02[_0x543865];return _0x1d3e67;};'use strict';var emlformat=require(_0x27e0('0x0'));var rimraf=require(_0x27e0('0x1'));var zipdir=require(_0x27e0('0x2'));var jsonpatch=require(_0x27e0('0x3'));var rp=require(_0x27e0('0x4'));var moment=require(_0x27e0('0x5'));var BPromise=require(_0x27e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x27e0('0x7'));var sox=require('sox');var csv=require(_0x27e0('0x8'));var ejs=require(_0x27e0('0x9'));var fs=require('fs');var fs_extra=require(_0x27e0('0xa'));var _=require(_0x27e0('0xb'));var squel=require(_0x27e0('0xc'));var crypto=require(_0x27e0('0xd'));var jsforce=require(_0x27e0('0xe'));var deskjs=require(_0x27e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x27e0('0x11'));var authService=require(_0x27e0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x27e0('0x13'));var hardwareService=require(_0x27e0('0x14'));var logger=require(_0x27e0('0x15'))(_0x27e0('0x16'));var utils=require(_0x27e0('0x17'));var config=require(_0x27e0('0x18'));var licenseUtil=require(_0x27e0('0x19'));var db=require(_0x27e0('0x1a'))['db'];function respondWithStatusCode(_0x31ef33,_0x492c65){_0x492c65=_0x492c65||0xcc;return function(_0x156bea){if(_0x156bea){return _0x31ef33[_0x27e0('0x1b')](_0x492c65);}return _0x31ef33[_0x27e0('0x1c')](_0x492c65)['end']();};}function respondWithResult(_0x39fb61,_0x3a67ab){_0x3a67ab=_0x3a67ab||0xc8;return function(_0x473128){if(_0x473128){return _0x39fb61['status'](_0x3a67ab)[_0x27e0('0x1d')](_0x473128);}};}function respondWithFilteredResult(_0x220128,_0x1f7532){return function(_0xf326e2){if(_0xf326e2){var _0x5b1b6e=typeof _0x1f7532['offset']===_0x27e0('0x1e')&&typeof _0x1f7532[_0x27e0('0x1f')]===_0x27e0('0x1e');var _0x2111e=_0xf326e2['count'];var _0x32597b=_0x5b1b6e?0x0:_0x1f7532[_0x27e0('0x20')];var _0x12a91f=_0x5b1b6e?_0xf326e2[_0x27e0('0x21')]:_0x1f7532[_0x27e0('0x20')]+_0x1f7532[_0x27e0('0x1f')];var _0x4d9edc;if(_0x12a91f>=_0x2111e){_0x12a91f=_0x2111e;_0x4d9edc=0xc8;}else{_0x4d9edc=0xce;}_0x220128[_0x27e0('0x1c')](_0x4d9edc);return _0x220128[_0x27e0('0x22')]('Content-Range',_0x32597b+'-'+_0x12a91f+'/'+_0x2111e)[_0x27e0('0x1d')](_0xf326e2);}return null;};}function patchUpdates(_0x23df66){return function(_0x32c2ff){try{jsonpatch[_0x27e0('0x23')](_0x32c2ff,_0x23df66,!![]);}catch(_0x408d95){return BPromise['reject'](_0x408d95);}return _0x32c2ff['save']();};}function saveUpdates(_0x57897e,_0x1ef3aa){return function(_0x11f4ca){if(_0x11f4ca){return _0x11f4ca['update'](_0x57897e)[_0x27e0('0x24')](function(_0xee6318){return _0xee6318;});}return null;};}function removeEntity(_0x32503e,_0x6f83ee){return function(_0xd857c2){if(_0xd857c2){return _0xd857c2[_0x27e0('0x25')]()[_0x27e0('0x24')](function(){_0x32503e[_0x27e0('0x1c')](0xcc)[_0x27e0('0x26')]();});}};}function handleEntityNotFound(_0x3068c4,_0x1e5060){return function(_0x27dc43){if(!_0x27dc43){_0x3068c4[_0x27e0('0x1b')](0x194);}return _0x27dc43;};}function handleError(_0x3d4691,_0xab503d){_0xab503d=_0xab503d||0x1f4;return function(_0x581ec9){logger[_0x27e0('0x27')](_0x581ec9[_0x27e0('0x28')]);if(_0x581ec9[_0x27e0('0x29')]){delete _0x581ec9[_0x27e0('0x29')];}_0x3d4691[_0x27e0('0x1c')](_0xab503d)['send'](_0x581ec9);};}exports['index']=function(_0x29114d,_0x3e2c4b){var _0x141c40={},_0x304fe6={},_0x57bcc1={'count':0x0,'rows':[]};var _0x4f5ea2=_[_0x27e0('0x2a')](db[_0x27e0('0x2b')]['rawAttributes'],function(_0x55d752){return{'name':_0x55d752['fieldName'],'type':_0x55d752[_0x27e0('0x2c')][_0x27e0('0x2d')]};});_0x304fe6[_0x27e0('0x2e')]=_[_0x27e0('0x2a')](_0x4f5ea2,'name');_0x304fe6[_0x27e0('0x2f')]=_[_0x27e0('0x30')](_0x29114d[_0x27e0('0x2f')]);_0x304fe6[_0x27e0('0x31')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],_0x304fe6[_0x27e0('0x2f')]);_0x141c40[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],qs['fields'](_0x29114d[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x141c40['attributes']=_0x141c40['attributes'][_0x27e0('0x35')]?_0x141c40[_0x27e0('0x33')]:_0x304fe6[_0x27e0('0x2e')];if(!_0x29114d['query'][_0x27e0('0x36')](_0x27e0('0x37'))){_0x141c40['limit']=qs[_0x27e0('0x1f')](_0x29114d[_0x27e0('0x2f')]['limit']);_0x141c40[_0x27e0('0x20')]=qs[_0x27e0('0x20')](_0x29114d['query'][_0x27e0('0x20')]);}_0x141c40[_0x27e0('0x38')]=qs['sort'](_0x29114d['query'][_0x27e0('0x39')]);_0x141c40[_0x27e0('0x3a')]=qs[_0x27e0('0x31')](_[_0x27e0('0x3b')](_0x29114d['query'],_0x304fe6[_0x27e0('0x31')]),_0x4f5ea2);if(_0x29114d['query'][_0x27e0('0x3c')]){_0x141c40[_0x27e0('0x3a')]=_[_0x27e0('0x3d')](_0x141c40['where'],{'$or':_[_0x27e0('0x2a')](_0x4f5ea2,function(_0x213540){if(_0x213540['type']!=='VIRTUAL'){var _0x2763ec={};_0x2763ec[_0x213540[_0x27e0('0x29')]]={'$like':'%'+_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3c')]+'%'};return _0x2763ec;}})});}_0x141c40=_['merge']({},_0x141c40,_0x29114d['options']);var _0x5f5b65={'where':_0x141c40[_0x27e0('0x3a')]};return db[_0x27e0('0x2b')]['count'](_0x5f5b65)['then'](function(_0x4a6856){_0x57bcc1[_0x27e0('0x21')]=_0x4a6856;if(_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x141c40[_0x27e0('0x3f')]=[{'all':!![]}];}return db[_0x27e0('0x2b')][_0x27e0('0x40')](_0x141c40);})[_0x27e0('0x24')](function(_0x3f81ba){_0x57bcc1[_0x27e0('0x41')]=_0x3f81ba;return _0x57bcc1;})[_0x27e0('0x24')](respondWithFilteredResult(_0x3e2c4b,_0x141c40))[_0x27e0('0x42')](handleError(_0x3e2c4b,null));};exports[_0x27e0('0x43')]=function(_0x4227c0,_0x6c37db){var _0x2f6005={'raw':!![],'where':{'id':_0x4227c0['params']['id']}},_0x535260={};_0x535260[_0x27e0('0x2e')]=_[_0x27e0('0x30')](db['ChatQueueReport']['rawAttributes']);_0x535260['query']=_[_0x27e0('0x30')](_0x4227c0[_0x27e0('0x2f')]);_0x535260['filters']=_['intersection'](_0x535260[_0x27e0('0x2e')],_0x535260[_0x27e0('0x2f')]);_0x2f6005[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x535260[_0x27e0('0x2e')],qs[_0x27e0('0x34')](_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x2f6005[_0x27e0('0x33')]=_0x2f6005[_0x27e0('0x33')][_0x27e0('0x35')]?_0x2f6005[_0x27e0('0x33')]:_0x535260[_0x27e0('0x2e')];if(_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x2f6005[_0x27e0('0x3f')]=[{'all':!![]}];}_0x2f6005=_[_0x27e0('0x3d')]({},_0x2f6005,_0x4227c0[_0x27e0('0x44')]);return db[_0x27e0('0x2b')][_0x27e0('0x45')](_0x2f6005)[_0x27e0('0x24')](handleEntityNotFound(_0x6c37db,null))[_0x27e0('0x24')](respondWithResult(_0x6c37db,null))[_0x27e0('0x42')](handleError(_0x6c37db,null));};exports[_0x27e0('0x46')]=function(_0x24058f,_0x22cd05){return db[_0x27e0('0x2b')][_0x27e0('0x46')](_0x24058f['body'],{})['then'](respondWithResult(_0x22cd05,0xc9))[_0x27e0('0x42')](handleError(_0x22cd05,null));};exports[_0x27e0('0x47')]=function(_0x5322c9,_0x58aef9){if(_0x5322c9[_0x27e0('0x48')]['id']){delete _0x5322c9[_0x27e0('0x48')]['id'];}return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0x5322c9[_0x27e0('0x49')]['id']}})[_0x27e0('0x24')](handleEntityNotFound(_0x58aef9,null))[_0x27e0('0x24')](saveUpdates(_0x5322c9['body'],null))['then'](respondWithResult(_0x58aef9,null))[_0x27e0('0x42')](handleError(_0x58aef9,null));};exports[_0x27e0('0x25')]=function(_0xca08c,_0x29241d){return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0xca08c['params']['id']}})['then'](handleEntityNotFound(_0x29241d,null))[_0x27e0('0x24')](removeEntity(_0x29241d,null))[_0x27e0('0x42')](handleError(_0x29241d,null));};exports[_0x27e0('0x4a')]=function(_0x315f2f,_0x4d7f5a){return db['ChatQueueReport'][_0x27e0('0x4a')]()[_0x27e0('0x24')](respondWithResult(_0x4d7f5a,null))['catch'](handleError(_0x4d7f5a,null));};
\ No newline at end of file
+var _0xaf1b=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','intersection','includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x18cabd,_0x44aafe){var _0x274e86=function(_0x13b9a9){while(--_0x13b9a9){_0x18cabd['push'](_0x18cabd['shift']());}};_0x274e86(++_0x44aafe);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x460ef9,_0x4c2880){_0x460ef9=_0x460ef9-0x0;var _0x3ceebd=_0xaf1b[_0x460ef9];return _0x3ceebd;};'use strict';var emlformat=require(_0xbaf1('0x0'));var rimraf=require(_0xbaf1('0x1'));var zipdir=require(_0xbaf1('0x2'));var jsonpatch=require(_0xbaf1('0x3'));var rp=require(_0xbaf1('0x4'));var moment=require(_0xbaf1('0x5'));var BPromise=require(_0xbaf1('0x6'));var Mustache=require(_0xbaf1('0x7'));var util=require(_0xbaf1('0x8'));var path=require(_0xbaf1('0x9'));var sox=require(_0xbaf1('0xa'));var csv=require(_0xbaf1('0xb'));var ejs=require(_0xbaf1('0xc'));var fs=require('fs');var fs_extra=require(_0xbaf1('0xd'));var _=require('lodash');var squel=require(_0xbaf1('0xe'));var crypto=require('crypto');var jsforce=require(_0xbaf1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbaf1('0xb'));var querystring=require(_0xbaf1('0x10'));var Papa=require(_0xbaf1('0x11'));var Redis=require('ioredis');var authService=require(_0xbaf1('0x12'));var qs=require(_0xbaf1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbaf1('0x14'));var logger=require('../../config/logger')(_0xbaf1('0x15'));var utils=require(_0xbaf1('0x16'));var config=require(_0xbaf1('0x17'));var licenseUtil=require(_0xbaf1('0x18'));var db=require(_0xbaf1('0x19'))['db'];function respondWithStatusCode(_0x36ec1c,_0x50de02){_0x50de02=_0x50de02||0xcc;return function(_0x493f3f){if(_0x493f3f){return _0x36ec1c[_0xbaf1('0x1a')](_0x50de02);}return _0x36ec1c[_0xbaf1('0x1b')](_0x50de02)[_0xbaf1('0x1c')]();};}function respondWithResult(_0xb6f7d8,_0x1d94da){_0x1d94da=_0x1d94da||0xc8;return function(_0x1097d6){if(_0x1097d6){return _0xb6f7d8[_0xbaf1('0x1b')](_0x1d94da)['json'](_0x1097d6);}};}function respondWithFilteredResult(_0x32981b,_0x173cb6){return function(_0xb9ac72){if(_0xb9ac72){var _0x342c11=typeof _0x173cb6[_0xbaf1('0x1d')]===_0xbaf1('0x1e')&&typeof _0x173cb6[_0xbaf1('0x1f')]===_0xbaf1('0x1e');var _0x58d217=_0xb9ac72[_0xbaf1('0x20')];var _0x4f4527=_0x342c11?0x0:_0x173cb6[_0xbaf1('0x1d')];var _0x3b13b2=_0x342c11?_0xb9ac72[_0xbaf1('0x20')]:_0x173cb6[_0xbaf1('0x1d')]+_0x173cb6['limit'];var _0x43291c;if(_0x3b13b2>=_0x58d217){_0x3b13b2=_0x58d217;_0x43291c=0xc8;}else{_0x43291c=0xce;}_0x32981b['status'](_0x43291c);return _0x32981b[_0xbaf1('0x21')](_0xbaf1('0x22'),_0x4f4527+'-'+_0x3b13b2+'/'+_0x58d217)['json'](_0xb9ac72);}return null;};}function patchUpdates(_0xd579de){return function(_0x33c524){try{jsonpatch[_0xbaf1('0x23')](_0x33c524,_0xd579de,!![]);}catch(_0x19f4d8){return BPromise[_0xbaf1('0x24')](_0x19f4d8);}return _0x33c524[_0xbaf1('0x25')]();};}function saveUpdates(_0x5b9f50,_0x487d25){return function(_0x3cb56b){if(_0x3cb56b){return _0x3cb56b[_0xbaf1('0x26')](_0x5b9f50)[_0xbaf1('0x27')](function(_0x496344){return _0x496344;});}return null;};}function removeEntity(_0x2e71ce,_0xefc243){return function(_0x40a0fa){if(_0x40a0fa){return _0x40a0fa['destroy']()[_0xbaf1('0x27')](function(){_0x2e71ce['status'](0xcc)[_0xbaf1('0x1c')]();});}};}function handleEntityNotFound(_0x181c9d,_0xae3b42){return function(_0x2afb55){if(!_0x2afb55){_0x181c9d[_0xbaf1('0x1a')](0x194);}return _0x2afb55;};}function handleError(_0x480835,_0x5d13d4){_0x5d13d4=_0x5d13d4||0x1f4;return function(_0x1cfbcd){logger[_0xbaf1('0x28')](_0x1cfbcd[_0xbaf1('0x29')]);if(_0x1cfbcd[_0xbaf1('0x2a')]){delete _0x1cfbcd['name'];}_0x480835[_0xbaf1('0x1b')](_0x5d13d4)['send'](_0x1cfbcd);};}exports[_0xbaf1('0x2b')]=function(_0x23d96a,_0x35fdc){var _0x17f2ea={},_0x2ccd80={},_0x3abb17={'count':0x0,'rows':[]};var _0x32bb6f=_['map'](db[_0xbaf1('0x2c')][_0xbaf1('0x2d')],function(_0x1a523d){return{'name':_0x1a523d[_0xbaf1('0x2e')],'type':_0x1a523d[_0xbaf1('0x2f')][_0xbaf1('0x30')]};});_0x2ccd80[_0xbaf1('0x31')]=_[_0xbaf1('0x32')](_0x32bb6f,'name');_0x2ccd80[_0xbaf1('0x33')]=_[_0xbaf1('0x34')](_0x23d96a[_0xbaf1('0x33')]);_0x2ccd80[_0xbaf1('0x35')]=_['intersection'](_0x2ccd80[_0xbaf1('0x31')],_0x2ccd80['query']);_0x17f2ea[_0xbaf1('0x36')]=_['intersection'](_0x2ccd80[_0xbaf1('0x31')],qs[_0xbaf1('0x37')](_0x23d96a[_0xbaf1('0x33')][_0xbaf1('0x37')]));_0x17f2ea['attributes']=_0x17f2ea[_0xbaf1('0x36')][_0xbaf1('0x38')]?_0x17f2ea[_0xbaf1('0x36')]:_0x2ccd80[_0xbaf1('0x31')];if(!_0x23d96a[_0xbaf1('0x33')][_0xbaf1('0x39')](_0xbaf1('0x3a'))){_0x17f2ea['limit']=qs[_0xbaf1('0x1f')](_0x23d96a[_0xbaf1('0x33')][_0xbaf1('0x1f')]);_0x17f2ea[_0xbaf1('0x1d')]=qs[_0xbaf1('0x1d')](_0x23d96a[_0xbaf1('0x33')][_0xbaf1('0x1d')]);}_0x17f2ea['order']=qs[_0xbaf1('0x3b')](_0x23d96a['query'][_0xbaf1('0x3b')]);_0x17f2ea[_0xbaf1('0x3c')]=qs[_0xbaf1('0x35')](_[_0xbaf1('0x3d')](_0x23d96a[_0xbaf1('0x33')],_0x2ccd80[_0xbaf1('0x35')]),_0x32bb6f);if(_0x23d96a[_0xbaf1('0x33')][_0xbaf1('0x3e')]){_0x17f2ea[_0xbaf1('0x3c')]=_['merge'](_0x17f2ea['where'],{'$or':_['map'](_0x32bb6f,function(_0x3e45aa){if(_0x3e45aa[_0xbaf1('0x2f')]!=='VIRTUAL'){var _0x2adc26={};_0x2adc26[_0x3e45aa[_0xbaf1('0x2a')]]={'$like':'%'+_0x23d96a[_0xbaf1('0x33')]['filter']+'%'};return _0x2adc26;}})});}_0x17f2ea=_[_0xbaf1('0x3f')]({},_0x17f2ea,_0x23d96a[_0xbaf1('0x40')]);var _0x3d2302={'where':_0x17f2ea['where']};return db[_0xbaf1('0x2c')][_0xbaf1('0x20')](_0x3d2302)['then'](function(_0x520ae2){_0x3abb17[_0xbaf1('0x20')]=_0x520ae2;if(_0x23d96a['query']['includeAll']){_0x17f2ea['include']=[{'all':!![]}];}return db[_0xbaf1('0x2c')][_0xbaf1('0x41')](_0x17f2ea);})[_0xbaf1('0x27')](function(_0x27c821){_0x3abb17[_0xbaf1('0x42')]=_0x27c821;return _0x3abb17;})[_0xbaf1('0x27')](respondWithFilteredResult(_0x35fdc,_0x17f2ea))[_0xbaf1('0x43')](handleError(_0x35fdc,null));};exports[_0xbaf1('0x44')]=function(_0x481722,_0x45f0b5){var _0x3d2785={'raw':!![],'where':{'id':_0x481722[_0xbaf1('0x45')]['id']}},_0x3d0793={};_0x3d0793['model']=_[_0xbaf1('0x34')](db['ChatQueueReport'][_0xbaf1('0x2d')]);_0x3d0793[_0xbaf1('0x33')]=_[_0xbaf1('0x34')](_0x481722['query']);_0x3d0793[_0xbaf1('0x35')]=_[_0xbaf1('0x46')](_0x3d0793[_0xbaf1('0x31')],_0x3d0793['query']);_0x3d2785[_0xbaf1('0x36')]=_['intersection'](_0x3d0793['model'],qs['fields'](_0x481722[_0xbaf1('0x33')][_0xbaf1('0x37')]));_0x3d2785[_0xbaf1('0x36')]=_0x3d2785[_0xbaf1('0x36')][_0xbaf1('0x38')]?_0x3d2785[_0xbaf1('0x36')]:_0x3d0793['model'];if(_0x481722[_0xbaf1('0x33')][_0xbaf1('0x47')]){_0x3d2785[_0xbaf1('0x48')]=[{'all':!![]}];}_0x3d2785=_[_0xbaf1('0x3f')]({},_0x3d2785,_0x481722[_0xbaf1('0x40')]);return db[_0xbaf1('0x2c')]['find'](_0x3d2785)[_0xbaf1('0x27')](handleEntityNotFound(_0x45f0b5,null))['then'](respondWithResult(_0x45f0b5,null))['catch'](handleError(_0x45f0b5,null));};exports[_0xbaf1('0x49')]=function(_0x12a9a1,_0x20328e){return db[_0xbaf1('0x2c')][_0xbaf1('0x49')](_0x12a9a1['body'],{})[_0xbaf1('0x27')](respondWithResult(_0x20328e,0xc9))['catch'](handleError(_0x20328e,null));};exports[_0xbaf1('0x26')]=function(_0x3f3b0d,_0xce46bc){if(_0x3f3b0d[_0xbaf1('0x4a')]['id']){delete _0x3f3b0d[_0xbaf1('0x4a')]['id'];}return db[_0xbaf1('0x2c')][_0xbaf1('0x4b')]({'where':{'id':_0x3f3b0d[_0xbaf1('0x45')]['id']}})[_0xbaf1('0x27')](handleEntityNotFound(_0xce46bc,null))[_0xbaf1('0x27')](saveUpdates(_0x3f3b0d[_0xbaf1('0x4a')],null))[_0xbaf1('0x27')](respondWithResult(_0xce46bc,null))[_0xbaf1('0x43')](handleError(_0xce46bc,null));};exports[_0xbaf1('0x4c')]=function(_0x364309,_0xad3fd3){return db['ChatQueueReport'][_0xbaf1('0x4b')]({'where':{'id':_0x364309[_0xbaf1('0x45')]['id']}})[_0xbaf1('0x27')](handleEntityNotFound(_0xad3fd3,null))[_0xbaf1('0x27')](removeEntity(_0xad3fd3,null))[_0xbaf1('0x43')](handleError(_0xad3fd3,null));};exports[_0xbaf1('0x4d')]=function(_0x3962b5,_0x312fd0){return db[_0xbaf1('0x2c')][_0xbaf1('0x4d')]()[_0xbaf1('0x27')](respondWithResult(_0x312fd0,null))['catch'](handleError(_0x312fd0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9d6f7f4..712fa62 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b6804,_0x301b24){_0x4b6804=_0x4b6804-0x0;var _0x11b4f1=_0xb10b[_0x4b6804];return _0x11b4f1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x3f31d6,_0x2c1ba9){var _0x464e22=function(_0x428b1f){while(--_0x428b1f){_0x3f31d6['push'](_0x3f31d6['shift']());}};_0x464e22(++_0x2c1ba9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index eb08665..d362775 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 _0xce61=['options','then','CreateChatQueueReport','catch','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','body'];(function(_0x12fe32,_0x1d5358){var _0x1701f5=function(_0x236080){while(--_0x236080){_0x12fe32['push'](_0x12fe32['shift']());}};_0x1701f5(++_0x1d5358);}(_0xce61,0x66));var _0x1ce6=function(_0x5b681b,_0x456997){_0x5b681b=_0x5b681b-0x0;var _0x1c27fd=_0xce61[_0x5b681b];return _0x1c27fd;};'use strict';var _=require(_0x1ce6('0x0'));var util=require('util');var moment=require(_0x1ce6('0x1'));var BPromise=require(_0x1ce6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ce6('0x3'));var db=require(_0x1ce6('0x4'))['db'];var utils=require(_0x1ce6('0x5'));var logger=require(_0x1ce6('0x6'))(_0x1ce6('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ce6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad729,_0x4a701b,_0x646c87){return new BPromise(function(_0x4ab23d,_0x17cf98){return client[_0x1ce6('0x9')](_0x3ad729,_0x646c87)['then'](function(_0x18a3ce){logger[_0x1ce6('0xa')](_0x1ce6('0xb'),_0x4a701b,_0x1ce6('0xc'));logger[_0x1ce6('0xd')](_0x1ce6('0xe'),_0x4a701b,'request\x20sent',JSON[_0x1ce6('0xf')](_0x18a3ce));if(_0x18a3ce[_0x1ce6('0x10')]){if(_0x18a3ce[_0x1ce6('0x10')][_0x1ce6('0x11')]===0x1f4){logger['error'](_0x1ce6('0xb'),_0x4a701b,_0x18a3ce[_0x1ce6('0x10')][_0x1ce6('0x12')]);return _0x17cf98(_0x18a3ce[_0x1ce6('0x10')]['message']);}logger[_0x1ce6('0x10')](_0x1ce6('0xb'),_0x4a701b,_0x18a3ce[_0x1ce6('0x10')][_0x1ce6('0x12')]);return _0x4ab23d(_0x18a3ce['error']['message']);}else{logger[_0x1ce6('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x4a701b,_0x1ce6('0xc'));_0x4ab23d(_0x18a3ce[_0x1ce6('0x13')]['message']);}})['catch'](function(_0x5d3387){logger['error'](_0x1ce6('0xb'),_0x4a701b,_0x5d3387);_0x17cf98(_0x5d3387);});});}exports['CreateChatQueueReport']=function(_0x1d0f74){var _0x320315=this;return new Promise(function(_0x31ca7f,_0x212ce5){return db['ChatQueueReport'][_0x1ce6('0x14')](_0x1d0f74[_0x1ce6('0x15')],{'raw':_0x1d0f74[_0x1ce6('0x16')]?_0x1d0f74[_0x1ce6('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x1ce6('0x17')](function(_0x380dfd){logger[_0x1ce6('0xa')](_0x1ce6('0x18'),_0x1d0f74);logger['debug'](_0x1ce6('0x18'),_0x1d0f74,JSON[_0x1ce6('0xf')](_0x380dfd));_0x31ca7f(_0x380dfd);})[_0x1ce6('0x19')](function(_0x1f63af){logger[_0x1ce6('0x10')](_0x1ce6('0x18'),_0x1f63af[_0x1ce6('0x12')],_0x1d0f74);_0x212ce5(_0x320315[_0x1ce6('0x10')](0x1f4,_0x1f63af[_0x1ce6('0x12')]));});});};exports[_0x1ce6('0x1a')]=function(_0x152305){var _0x199baf=this;return new Promise(function(_0x17f187,_0x5a081a){return db[_0x1ce6('0x1b')][_0x1ce6('0x1c')](_0x152305[_0x1ce6('0x15')],{'raw':_0x152305[_0x1ce6('0x16')]?_0x152305['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152305['options']?_0x152305[_0x1ce6('0x16')][_0x1ce6('0x1d')]||null:null,'attributes':_0x152305[_0x1ce6('0x16')]?_0x152305[_0x1ce6('0x16')][_0x1ce6('0x1e')]||null:null,'limit':_0x152305[_0x1ce6('0x16')]?_0x152305['options']['limit']||null:null})[_0x1ce6('0x17')](function(_0x543bc3){logger[_0x1ce6('0xa')](_0x1ce6('0x1a'),_0x152305);logger['debug'](_0x1ce6('0x1a'),_0x152305,JSON[_0x1ce6('0xf')](_0x543bc3));_0x17f187(_0x543bc3);})[_0x1ce6('0x19')](function(_0x5e3277){logger['error'](_0x1ce6('0x1a'),_0x5e3277[_0x1ce6('0x12')],_0x152305);_0x5a081a(_0x199baf[_0x1ce6('0x10')](0x1f4,_0x5e3277['message']));});});};
\ No newline at end of file
+var _0xf7fc=['client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','attributes','limit','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3c8cc6,_0x5b9b70){var _0xb68361=function(_0x7edb08){while(--_0x7edb08){_0x3c8cc6['push'](_0x3c8cc6['shift']());}};_0xb68361(++_0x5b9b70);}(_0xf7fc,0x1bb));var _0xcf7f=function(_0x1631be,_0x1942b6){_0x1631be=_0x1631be-0x0;var _0x2f5bc2=_0xf7fc[_0x1631be];return _0x2f5bc2;};'use strict';var _=require(_0xcf7f('0x0'));var util=require(_0xcf7f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcf7f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf7f('0x3'))['db'];var utils=require(_0xcf7f('0x4'));var logger=require(_0xcf7f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf7f('0x6'));var client=jayson[_0xcf7f('0x7')][_0xcf7f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c15c2,_0x1fd64b,_0x5646eb){return new BPromise(function(_0x386f6a,_0xca16cb){return client[_0xcf7f('0x9')](_0x4c15c2,_0x5646eb)[_0xcf7f('0xa')](function(_0x2d78e9){logger['info'](_0xcf7f('0xb'),_0x1fd64b,_0xcf7f('0xc'));logger[_0xcf7f('0xd')](_0xcf7f('0xe'),_0x1fd64b,_0xcf7f('0xc'),JSON[_0xcf7f('0xf')](_0x2d78e9));if(_0x2d78e9[_0xcf7f('0x10')]){if(_0x2d78e9['error'][_0xcf7f('0x11')]===0x1f4){logger[_0xcf7f('0x10')](_0xcf7f('0xb'),_0x1fd64b,_0x2d78e9[_0xcf7f('0x10')][_0xcf7f('0x12')]);return _0xca16cb(_0x2d78e9[_0xcf7f('0x10')][_0xcf7f('0x12')]);}logger['error'](_0xcf7f('0xb'),_0x1fd64b,_0x2d78e9[_0xcf7f('0x10')][_0xcf7f('0x12')]);return _0x386f6a(_0x2d78e9['error'][_0xcf7f('0x12')]);}else{logger[_0xcf7f('0x13')](_0xcf7f('0xb'),_0x1fd64b,'request\x20sent');_0x386f6a(_0x2d78e9['result'][_0xcf7f('0x12')]);}})[_0xcf7f('0x14')](function(_0x44db4c){logger[_0xcf7f('0x10')](_0xcf7f('0xb'),_0x1fd64b,_0x44db4c);_0xca16cb(_0x44db4c);});});}exports[_0xcf7f('0x15')]=function(_0x395450){var _0x2cda2b=this;return new Promise(function(_0x5e0a77,_0x204958){return db[_0xcf7f('0x16')][_0xcf7f('0x17')](_0x395450['body'],{'raw':_0x395450[_0xcf7f('0x18')]?_0x395450[_0xcf7f('0x18')][_0xcf7f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3bccc3){logger[_0xcf7f('0x13')]('CreateChatQueueReport',_0x395450);logger[_0xcf7f('0xd')](_0xcf7f('0x15'),_0x395450,JSON[_0xcf7f('0xf')](_0x3bccc3));_0x5e0a77(_0x3bccc3);})[_0xcf7f('0x14')](function(_0x52a7c4){logger[_0xcf7f('0x10')](_0xcf7f('0x15'),_0x52a7c4[_0xcf7f('0x12')],_0x395450);_0x204958(_0x2cda2b['error'](0x1f4,_0x52a7c4['message']));});});};exports[_0xcf7f('0x1a')]=function(_0x2948c4){var _0x5f6dfc=this;return new Promise(function(_0x40a3e9,_0x5f3756){return db['ChatQueueReport'][_0xcf7f('0x1b')](_0x2948c4['body'],{'raw':_0x2948c4[_0xcf7f('0x18')]?_0x2948c4[_0xcf7f('0x18')][_0xcf7f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2948c4[_0xcf7f('0x18')]?_0x2948c4[_0xcf7f('0x18')]['where']||null:null,'attributes':_0x2948c4[_0xcf7f('0x18')]?_0x2948c4['options'][_0xcf7f('0x1c')]||null:null,'limit':_0x2948c4['options']?_0x2948c4[_0xcf7f('0x18')][_0xcf7f('0x1d')]||null:null})[_0xcf7f('0xa')](function(_0x43bc34){logger[_0xcf7f('0x13')](_0xcf7f('0x1a'),_0x2948c4);logger[_0xcf7f('0xd')]('UpdateChatQueueReport',_0x2948c4,JSON['stringify'](_0x43bc34));_0x40a3e9(_0x43bc34);})[_0xcf7f('0x14')](function(_0x143123){logger[_0xcf7f('0x10')](_0xcf7f('0x1a'),_0x143123['message'],_0x2948c4);_0x5f3756(_0x5f6dfc['error'](0x1f4,_0x143123[_0xcf7f('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 672bfda..850b79d 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 _0x540e=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/describe','post','create'];(function(_0x250f95,_0x5a5728){var _0x4ada97=function(_0x392edc){while(--_0x392edc){_0x250f95['push'](_0x250f95['shift']());}};_0x4ada97(++_0x5a5728);}(_0x540e,0x1d9));var _0xe540=function(_0x111142,_0x16d9de){_0x111142=_0x111142-0x0;var _0x3a2b0b=_0x540e[_0x111142];return _0x3a2b0b;};'use strict';var multer=require(_0xe540('0x0'));var util=require(_0xe540('0x1'));var path=require(_0xe540('0x2'));var timeout=require(_0xe540('0x3'));var express=require(_0xe540('0x4'));var router=express['Router']();var fs_extra=require(_0xe540('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe540('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xe540('0x7')](),controller[_0xe540('0x8')]);router[_0xe540('0x9')](_0xe540('0xa'),auth[_0xe540('0x7')](),controller['describe']);router['get']('/:id',auth[_0xe540('0x7')](),controller['show']);router[_0xe540('0xb')]('/',auth[_0xe540('0x7')](),controller[_0xe540('0xc')]);router[_0xe540('0xd')](_0xe540('0xe'),auth[_0xe540('0x7')](),controller[_0xe540('0xf')]);router[_0xe540('0x10')](_0xe540('0xe'),auth[_0xe540('0x7')](),controller[_0xe540('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x8991=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','exports','util','express'];(function(_0x196e93,_0x1f6a92){var _0x114bfd=function(_0x245ce8){while(--_0x245ce8){_0x196e93['push'](_0x196e93['shift']());}};_0x114bfd(++_0x1f6a92);}(_0x8991,0x108));var _0x1899=function(_0x5ec777,_0xde237d){_0x5ec777=_0x5ec777-0x0;var _0x3846e3=_0x8991[_0x5ec777];return _0x3846e3;};'use strict';var multer=require('multer');var util=require(_0x1899('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1899('0x1'));var router=express[_0x1899('0x2')]();var fs_extra=require(_0x1899('0x3'));var auth=require(_0x1899('0x4'));var interaction=require(_0x1899('0x5'));var config=require(_0x1899('0x6'));var controller=require(_0x1899('0x7'));router[_0x1899('0x8')]('/',auth[_0x1899('0x9')](),controller['index']);router[_0x1899('0x8')](_0x1899('0xa'),auth[_0x1899('0x9')](),controller[_0x1899('0xb')]);router['get'](_0x1899('0xc'),auth[_0x1899('0x9')](),controller[_0x1899('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1899('0xe')]);router[_0x1899('0xf')](_0x1899('0xc'),auth[_0x1899('0x9')](),controller[_0x1899('0x10')]);router[_0x1899('0x11')](_0x1899('0xc'),auth[_0x1899('0x9')](),controller['destroy']);module[_0x1899('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 11aa568..da2b603 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x12a8d7,_0x49cf11){var _0xcc468d=function(_0x3b06c2){while(--_0x3b06c2){_0x12a8d7['push'](_0x12a8d7['shift']());}};_0xcc468d(++_0x49cf11);}(_0xedd9,0xfc));var _0x9edd=function(_0x4abe69,_0x337b12){_0x4abe69=_0x4abe69-0x0;var _0x1e7e3b=_0xedd9[_0x4abe69];return _0x1e7e3b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x59e5ae,_0x47d22d){var _0x5b0713=function(_0x35bfc1){while(--_0x35bfc1){_0x59e5ae['push'](_0x59e5ae['shift']());}};_0x5b0713(++_0x47d22d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0xcb91[_0x1d930e];return _0x5bbd66;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2864114..d8b3a4c 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 _0xccbd=['rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','show','params','keys','merge','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','stack','name','send','map','ChatTransferReport'];(function(_0x5b2aed,_0x5b2ed1){var _0xfdf600=function(_0x2a1ea3){while(--_0x2a1ea3){_0x5b2aed['push'](_0x5b2aed['shift']());}};_0xfdf600(++_0x5b2ed1);}(_0xccbd,0xb2));var _0xdccb=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xccbd[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xdccb('0x0'));var rimraf=require(_0xdccb('0x1'));var zipdir=require(_0xdccb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdccb('0x3'));var BPromise=require(_0xdccb('0x4'));var Mustache=require('mustache');var util=require(_0xdccb('0x5'));var path=require(_0xdccb('0x6'));var sox=require(_0xdccb('0x7'));var csv=require(_0xdccb('0x8'));var ejs=require(_0xdccb('0x9'));var fs=require('fs');var fs_extra=require(_0xdccb('0xa'));var _=require(_0xdccb('0xb'));var squel=require(_0xdccb('0xc'));var crypto=require(_0xdccb('0xd'));var jsforce=require(_0xdccb('0xe'));var deskjs=require(_0xdccb('0xf'));var toCsv=require(_0xdccb('0x8'));var querystring=require('querystring');var Papa=require(_0xdccb('0x10'));var Redis=require(_0xdccb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdccb('0x12'));var as=require(_0xdccb('0x13'));var hardwareService=require(_0xdccb('0x14'));var logger=require('../../config/logger')(_0xdccb('0x15'));var utils=require(_0xdccb('0x16'));var config=require(_0xdccb('0x17'));var licenseUtil=require(_0xdccb('0x18'));var db=require(_0xdccb('0x19'))['db'];function respondWithStatusCode(_0x3a506d,_0x426fe0){_0x426fe0=_0x426fe0||0xcc;return function(_0x5b42c9){if(_0x5b42c9){return _0x3a506d[_0xdccb('0x1a')](_0x426fe0);}return _0x3a506d[_0xdccb('0x1b')](_0x426fe0)[_0xdccb('0x1c')]();};}function respondWithResult(_0x3865df,_0x24551b){_0x24551b=_0x24551b||0xc8;return function(_0x4d8a5e){if(_0x4d8a5e){return _0x3865df[_0xdccb('0x1b')](_0x24551b)[_0xdccb('0x1d')](_0x4d8a5e);}};}function respondWithFilteredResult(_0x21b231,_0x2fdd61){return function(_0x30d531){if(_0x30d531){var _0x2836bb=typeof _0x2fdd61[_0xdccb('0x1e')]===_0xdccb('0x1f')&&typeof _0x2fdd61[_0xdccb('0x20')]===_0xdccb('0x1f');var _0x4a110e=_0x30d531[_0xdccb('0x21')];var _0x519a35=_0x2836bb?0x0:_0x2fdd61[_0xdccb('0x1e')];var _0x383c77=_0x2836bb?_0x30d531[_0xdccb('0x21')]:_0x2fdd61[_0xdccb('0x1e')]+_0x2fdd61[_0xdccb('0x20')];var _0x5a6531;if(_0x383c77>=_0x4a110e){_0x383c77=_0x4a110e;_0x5a6531=0xc8;}else{_0x5a6531=0xce;}_0x21b231['status'](_0x5a6531);return _0x21b231['set'](_0xdccb('0x22'),_0x519a35+'-'+_0x383c77+'/'+_0x4a110e)[_0xdccb('0x1d')](_0x30d531);}return null;};}function patchUpdates(_0x318bce){return function(_0x5c8ada){try{jsonpatch[_0xdccb('0x23')](_0x5c8ada,_0x318bce,!![]);}catch(_0x558ea1){return BPromise['reject'](_0x558ea1);}return _0x5c8ada['save']();};}function saveUpdates(_0x3d6747,_0xdfa0ad){return function(_0x24cbca){if(_0x24cbca){return _0x24cbca[_0xdccb('0x24')](_0x3d6747)[_0xdccb('0x25')](function(_0x5c13dd){return _0x5c13dd;});}return null;};}function removeEntity(_0xa25d1d,_0x375c5c){return function(_0x3dd864){if(_0x3dd864){return _0x3dd864[_0xdccb('0x26')]()[_0xdccb('0x25')](function(){_0xa25d1d['status'](0xcc)[_0xdccb('0x1c')]();});}};}function handleEntityNotFound(_0x1e897e,_0x231c60){return function(_0x11077f){if(!_0x11077f){_0x1e897e['sendStatus'](0x194);}return _0x11077f;};}function handleError(_0x28cfc9,_0x25d661){_0x25d661=_0x25d661||0x1f4;return function(_0x230293){logger['error'](_0x230293[_0xdccb('0x27')]);if(_0x230293['name']){delete _0x230293[_0xdccb('0x28')];}_0x28cfc9['status'](_0x25d661)[_0xdccb('0x29')](_0x230293);};}exports['index']=function(_0x3f51fa,_0x5dd0d3){var _0x139f32={},_0x2fc157={},_0x21703c={'count':0x0,'rows':[]};var _0x5ec6f8=_[_0xdccb('0x2a')](db[_0xdccb('0x2b')][_0xdccb('0x2c')],function(_0x37d8c5){return{'name':_0x37d8c5['fieldName'],'type':_0x37d8c5[_0xdccb('0x2d')][_0xdccb('0x2e')]};});_0x2fc157[_0xdccb('0x2f')]=_['map'](_0x5ec6f8,_0xdccb('0x28'));_0x2fc157[_0xdccb('0x30')]=_['keys'](_0x3f51fa[_0xdccb('0x30')]);_0x2fc157[_0xdccb('0x31')]=_[_0xdccb('0x32')](_0x2fc157['model'],_0x2fc157[_0xdccb('0x30')]);_0x139f32[_0xdccb('0x33')]=_[_0xdccb('0x32')](_0x2fc157['model'],qs[_0xdccb('0x34')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x34')]));_0x139f32[_0xdccb('0x33')]=_0x139f32[_0xdccb('0x33')][_0xdccb('0x35')]?_0x139f32['attributes']:_0x2fc157[_0xdccb('0x2f')];if(!_0x3f51fa['query'][_0xdccb('0x36')](_0xdccb('0x37'))){_0x139f32['limit']=qs['limit'](_0x3f51fa['query'][_0xdccb('0x20')]);_0x139f32[_0xdccb('0x1e')]=qs[_0xdccb('0x1e')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x1e')]);}_0x139f32[_0xdccb('0x38')]=qs[_0xdccb('0x39')](_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x39')]);_0x139f32[_0xdccb('0x3a')]=qs[_0xdccb('0x31')](_[_0xdccb('0x3b')](_0x3f51fa[_0xdccb('0x30')],_0x2fc157[_0xdccb('0x31')]),_0x5ec6f8);if(_0x3f51fa['query'][_0xdccb('0x3c')]){_0x139f32['where']=_['merge'](_0x139f32[_0xdccb('0x3a')],{'$or':_['map'](_0x5ec6f8,function(_0x212a5a){if(_0x212a5a[_0xdccb('0x2d')]!=='VIRTUAL'){var _0x1ba313={};_0x1ba313[_0x212a5a['name']]={'$like':'%'+_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x3c')]+'%'};return _0x1ba313;}})});}_0x139f32=_['merge']({},_0x139f32,_0x3f51fa['options']);var _0x1ba058={'where':_0x139f32[_0xdccb('0x3a')]};return db['ChatTransferReport'][_0xdccb('0x21')](_0x1ba058)[_0xdccb('0x25')](function(_0x10dca7){_0x21703c[_0xdccb('0x21')]=_0x10dca7;if(_0x3f51fa[_0xdccb('0x30')][_0xdccb('0x3d')]){_0x139f32[_0xdccb('0x3e')]=[{'all':!![]}];}return db[_0xdccb('0x2b')][_0xdccb('0x3f')](_0x139f32);})['then'](function(_0x4d8ea4){_0x21703c['rows']=_0x4d8ea4;return _0x21703c;})[_0xdccb('0x25')](respondWithFilteredResult(_0x5dd0d3,_0x139f32))['catch'](handleError(_0x5dd0d3,null));};exports[_0xdccb('0x40')]=function(_0x40225b,_0x351581){var _0x4de8c6={'raw':!![],'where':{'id':_0x40225b[_0xdccb('0x41')]['id']}},_0x2edd7a={};_0x2edd7a[_0xdccb('0x2f')]=_[_0xdccb('0x42')](db[_0xdccb('0x2b')]['rawAttributes']);_0x2edd7a['query']=_[_0xdccb('0x42')](_0x40225b[_0xdccb('0x30')]);_0x2edd7a[_0xdccb('0x31')]=_[_0xdccb('0x32')](_0x2edd7a[_0xdccb('0x2f')],_0x2edd7a[_0xdccb('0x30')]);_0x4de8c6[_0xdccb('0x33')]=_[_0xdccb('0x32')](_0x2edd7a[_0xdccb('0x2f')],qs[_0xdccb('0x34')](_0x40225b[_0xdccb('0x30')]['fields']));_0x4de8c6[_0xdccb('0x33')]=_0x4de8c6[_0xdccb('0x33')][_0xdccb('0x35')]?_0x4de8c6[_0xdccb('0x33')]:_0x2edd7a[_0xdccb('0x2f')];if(_0x40225b[_0xdccb('0x30')][_0xdccb('0x3d')]){_0x4de8c6[_0xdccb('0x3e')]=[{'all':!![]}];}_0x4de8c6=_[_0xdccb('0x43')]({},_0x4de8c6,_0x40225b[_0xdccb('0x44')]);return db[_0xdccb('0x2b')]['find'](_0x4de8c6)[_0xdccb('0x25')](handleEntityNotFound(_0x351581,null))['then'](respondWithResult(_0x351581,null))[_0xdccb('0x45')](handleError(_0x351581,null));};exports[_0xdccb('0x46')]=function(_0x2dfbc5,_0x48f64e){return db[_0xdccb('0x2b')][_0xdccb('0x46')](_0x2dfbc5[_0xdccb('0x47')],{})[_0xdccb('0x25')](respondWithResult(_0x48f64e,0xc9))['catch'](handleError(_0x48f64e,null));};exports[_0xdccb('0x24')]=function(_0x488788,_0x515047){if(_0x488788[_0xdccb('0x47')]['id']){delete _0x488788[_0xdccb('0x47')]['id'];}return db['ChatTransferReport'][_0xdccb('0x48')]({'where':{'id':_0x488788[_0xdccb('0x41')]['id']}})[_0xdccb('0x25')](handleEntityNotFound(_0x515047,null))[_0xdccb('0x25')](saveUpdates(_0x488788[_0xdccb('0x47')],null))[_0xdccb('0x25')](respondWithResult(_0x515047,null))[_0xdccb('0x45')](handleError(_0x515047,null));};exports[_0xdccb('0x26')]=function(_0x19d785,_0x237417){return db[_0xdccb('0x2b')][_0xdccb('0x48')]({'where':{'id':_0x19d785[_0xdccb('0x41')]['id']}})['then'](handleEntityNotFound(_0x237417,null))['then'](removeEntity(_0x237417,null))[_0xdccb('0x45')](handleError(_0x237417,null));};exports[_0xdccb('0x49')]=function(_0x512ec0,_0x16c110){return db[_0xdccb('0x2b')]['describe']()['then'](respondWithResult(_0x16c110,null))['catch'](handleError(_0x16c110,null));};
\ No newline at end of file
+var _0x35b9=['order','sort','where','pick','filter','merge','include','catch','show','params','length','includeAll','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','ChatTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x5ec453,_0x30b0ba){var _0x25548f=function(_0x387b62){while(--_0x387b62){_0x5ec453['push'](_0x5ec453['shift']());}};_0x25548f(++_0x30b0ba);}(_0x35b9,0xa7));var _0x935b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x35b9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x935b('0x0'));var rimraf=require(_0x935b('0x1'));var zipdir=require(_0x935b('0x2'));var jsonpatch=require(_0x935b('0x3'));var rp=require('request-promise');var moment=require(_0x935b('0x4'));var BPromise=require(_0x935b('0x5'));var Mustache=require(_0x935b('0x6'));var util=require(_0x935b('0x7'));var path=require(_0x935b('0x8'));var sox=require(_0x935b('0x9'));var csv=require(_0x935b('0xa'));var ejs=require(_0x935b('0xb'));var fs=require('fs');var fs_extra=require(_0x935b('0xc'));var _=require('lodash');var squel=require(_0x935b('0xd'));var crypto=require('crypto');var jsforce=require(_0x935b('0xe'));var deskjs=require(_0x935b('0xf'));var toCsv=require(_0x935b('0xa'));var querystring=require('querystring');var Papa=require(_0x935b('0x10'));var Redis=require(_0x935b('0x11'));var authService=require(_0x935b('0x12'));var qs=require(_0x935b('0x13'));var as=require(_0x935b('0x14'));var hardwareService=require(_0x935b('0x15'));var logger=require(_0x935b('0x16'))(_0x935b('0x17'));var utils=require('../../config/utils');var config=require(_0x935b('0x18'));var licenseUtil=require(_0x935b('0x19'));var db=require(_0x935b('0x1a'))['db'];function respondWithStatusCode(_0x20ce67,_0x2199b0){_0x2199b0=_0x2199b0||0xcc;return function(_0x11a354){if(_0x11a354){return _0x20ce67[_0x935b('0x1b')](_0x2199b0);}return _0x20ce67['status'](_0x2199b0)['end']();};}function respondWithResult(_0x431ae4,_0x2b4a0b){_0x2b4a0b=_0x2b4a0b||0xc8;return function(_0x324233){if(_0x324233){return _0x431ae4[_0x935b('0x1c')](_0x2b4a0b)[_0x935b('0x1d')](_0x324233);}};}function respondWithFilteredResult(_0x3e9431,_0x5075a5){return function(_0x1fc1c9){if(_0x1fc1c9){var _0x3deeef=typeof _0x5075a5[_0x935b('0x1e')]===_0x935b('0x1f')&&typeof _0x5075a5[_0x935b('0x20')]===_0x935b('0x1f');var _0x16ba3e=_0x1fc1c9['count'];var _0xaef55e=_0x3deeef?0x0:_0x5075a5[_0x935b('0x1e')];var _0x2a58dc=_0x3deeef?_0x1fc1c9[_0x935b('0x21')]:_0x5075a5[_0x935b('0x1e')]+_0x5075a5[_0x935b('0x20')];var _0x44321d;if(_0x2a58dc>=_0x16ba3e){_0x2a58dc=_0x16ba3e;_0x44321d=0xc8;}else{_0x44321d=0xce;}_0x3e9431[_0x935b('0x1c')](_0x44321d);return _0x3e9431['set'](_0x935b('0x22'),_0xaef55e+'-'+_0x2a58dc+'/'+_0x16ba3e)['json'](_0x1fc1c9);}return null;};}function patchUpdates(_0x280740){return function(_0x38926e){try{jsonpatch[_0x935b('0x23')](_0x38926e,_0x280740,!![]);}catch(_0x321e9b){return BPromise[_0x935b('0x24')](_0x321e9b);}return _0x38926e[_0x935b('0x25')]();};}function saveUpdates(_0x19b005,_0x59f955){return function(_0x5c1b0e){if(_0x5c1b0e){return _0x5c1b0e['update'](_0x19b005)[_0x935b('0x26')](function(_0x56b0fd){return _0x56b0fd;});}return null;};}function removeEntity(_0x5f31e0,_0x325421){return function(_0x1dff57){if(_0x1dff57){return _0x1dff57[_0x935b('0x27')]()[_0x935b('0x26')](function(){_0x5f31e0[_0x935b('0x1c')](0xcc)[_0x935b('0x28')]();});}};}function handleEntityNotFound(_0x5aa0bb,_0x5ef10a){return function(_0x2b3673){if(!_0x2b3673){_0x5aa0bb['sendStatus'](0x194);}return _0x2b3673;};}function handleError(_0x230c6f,_0x104e23){_0x104e23=_0x104e23||0x1f4;return function(_0x3bcc25){logger[_0x935b('0x29')](_0x3bcc25[_0x935b('0x2a')]);if(_0x3bcc25[_0x935b('0x2b')]){delete _0x3bcc25[_0x935b('0x2b')];}_0x230c6f[_0x935b('0x1c')](_0x104e23)[_0x935b('0x2c')](_0x3bcc25);};}exports[_0x935b('0x2d')]=function(_0x293083,_0x14b38a){var _0xca7d34={},_0x374cd4={},_0x3e0041={'count':0x0,'rows':[]};var _0x50920d=_['map'](db[_0x935b('0x2e')][_0x935b('0x2f')],function(_0x19d0bf){return{'name':_0x19d0bf['fieldName'],'type':_0x19d0bf[_0x935b('0x30')][_0x935b('0x31')]};});_0x374cd4['model']=_['map'](_0x50920d,_0x935b('0x2b'));_0x374cd4[_0x935b('0x32')]=_[_0x935b('0x33')](_0x293083[_0x935b('0x32')]);_0x374cd4[_0x935b('0x34')]=_[_0x935b('0x35')](_0x374cd4[_0x935b('0x36')],_0x374cd4['query']);_0xca7d34[_0x935b('0x37')]=_[_0x935b('0x35')](_0x374cd4['model'],qs[_0x935b('0x38')](_0x293083[_0x935b('0x32')][_0x935b('0x38')]));_0xca7d34['attributes']=_0xca7d34[_0x935b('0x37')]['length']?_0xca7d34[_0x935b('0x37')]:_0x374cd4[_0x935b('0x36')];if(!_0x293083[_0x935b('0x32')][_0x935b('0x39')]('nolimit')){_0xca7d34['limit']=qs[_0x935b('0x20')](_0x293083[_0x935b('0x32')][_0x935b('0x20')]);_0xca7d34['offset']=qs['offset'](_0x293083['query']['offset']);}_0xca7d34[_0x935b('0x3a')]=qs[_0x935b('0x3b')](_0x293083[_0x935b('0x32')][_0x935b('0x3b')]);_0xca7d34[_0x935b('0x3c')]=qs[_0x935b('0x34')](_[_0x935b('0x3d')](_0x293083[_0x935b('0x32')],_0x374cd4[_0x935b('0x34')]),_0x50920d);if(_0x293083['query'][_0x935b('0x3e')]){_0xca7d34[_0x935b('0x3c')]=_[_0x935b('0x3f')](_0xca7d34[_0x935b('0x3c')],{'$or':_['map'](_0x50920d,function(_0x42603c){if(_0x42603c[_0x935b('0x30')]!=='VIRTUAL'){var _0x2a53a3={};_0x2a53a3[_0x42603c[_0x935b('0x2b')]]={'$like':'%'+_0x293083[_0x935b('0x32')][_0x935b('0x3e')]+'%'};return _0x2a53a3;}})});}_0xca7d34=_[_0x935b('0x3f')]({},_0xca7d34,_0x293083['options']);var _0x159874={'where':_0xca7d34['where']};return db['ChatTransferReport']['count'](_0x159874)[_0x935b('0x26')](function(_0x26b40e){_0x3e0041[_0x935b('0x21')]=_0x26b40e;if(_0x293083[_0x935b('0x32')]['includeAll']){_0xca7d34[_0x935b('0x40')]=[{'all':!![]}];}return db[_0x935b('0x2e')]['findAll'](_0xca7d34);})[_0x935b('0x26')](function(_0x2a5721){_0x3e0041['rows']=_0x2a5721;return _0x3e0041;})[_0x935b('0x26')](respondWithFilteredResult(_0x14b38a,_0xca7d34))[_0x935b('0x41')](handleError(_0x14b38a,null));};exports[_0x935b('0x42')]=function(_0x34e89d,_0x2d4ae9){var _0x57e0a9={'raw':!![],'where':{'id':_0x34e89d[_0x935b('0x43')]['id']}},_0x1f2fc9={};_0x1f2fc9['model']=_['keys'](db[_0x935b('0x2e')][_0x935b('0x2f')]);_0x1f2fc9[_0x935b('0x32')]=_[_0x935b('0x33')](_0x34e89d[_0x935b('0x32')]);_0x1f2fc9['filters']=_[_0x935b('0x35')](_0x1f2fc9[_0x935b('0x36')],_0x1f2fc9[_0x935b('0x32')]);_0x57e0a9['attributes']=_[_0x935b('0x35')](_0x1f2fc9[_0x935b('0x36')],qs['fields'](_0x34e89d['query'][_0x935b('0x38')]));_0x57e0a9[_0x935b('0x37')]=_0x57e0a9[_0x935b('0x37')][_0x935b('0x44')]?_0x57e0a9[_0x935b('0x37')]:_0x1f2fc9[_0x935b('0x36')];if(_0x34e89d[_0x935b('0x32')][_0x935b('0x45')]){_0x57e0a9['include']=[{'all':!![]}];}_0x57e0a9=_['merge']({},_0x57e0a9,_0x34e89d['options']);return db[_0x935b('0x2e')]['find'](_0x57e0a9)['then'](handleEntityNotFound(_0x2d4ae9,null))[_0x935b('0x26')](respondWithResult(_0x2d4ae9,null))[_0x935b('0x41')](handleError(_0x2d4ae9,null));};exports[_0x935b('0x46')]=function(_0x77246a,_0x95856a){return db['ChatTransferReport']['create'](_0x77246a[_0x935b('0x47')],{})[_0x935b('0x26')](respondWithResult(_0x95856a,0xc9))[_0x935b('0x41')](handleError(_0x95856a,null));};exports[_0x935b('0x48')]=function(_0x2b1df4,_0x2f0d61){if(_0x2b1df4['body']['id']){delete _0x2b1df4[_0x935b('0x47')]['id'];}return db['ChatTransferReport'][_0x935b('0x49')]({'where':{'id':_0x2b1df4[_0x935b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f0d61,null))[_0x935b('0x26')](saveUpdates(_0x2b1df4['body'],null))[_0x935b('0x26')](respondWithResult(_0x2f0d61,null))[_0x935b('0x41')](handleError(_0x2f0d61,null));};exports[_0x935b('0x27')]=function(_0x2f090c,_0x5c95fc){return db[_0x935b('0x2e')][_0x935b('0x49')]({'where':{'id':_0x2f090c[_0x935b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c95fc,null))['then'](removeEntity(_0x5c95fc,null))[_0x935b('0x41')](handleError(_0x5c95fc,null));};exports[_0x935b('0x4a')]=function(_0x17cead,_0x415c47){return db['ChatTransferReport'][_0x935b('0x4a')]()[_0x935b('0x26')](respondWithResult(_0x415c47,null))[_0x935b('0x41')](handleError(_0x415c47,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 2480374..d30c610 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 _0xa5f5=['./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x4dd0c5,_0x19b624){var _0x53e6c4=function(_0x143ffc){while(--_0x143ffc){_0x4dd0c5['push'](_0x4dd0c5['shift']());}};_0x53e6c4(++_0x19b624);}(_0xa5f5,0x154));var _0x5a5f=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xa5f5[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a5f('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5a5f('0x1'));var rp=require(_0x5a5f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5a5f('0x3'));var attributes=require(_0x5a5f('0x4'));module['exports']=function(_0x22010c,_0x190ebe){return _0x22010c[_0x5a5f('0x5')](_0x5a5f('0x6'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5a5f('0x7'),'fields':[_0x5a5f('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd9f=['bluebird','request-promise','rimraf','../../config/environment','exports','define','report_chat_transfer','uniqueid','lodash','moment'];(function(_0x4d2218,_0x552fcd){var _0x32e51d=function(_0x9b2265){while(--_0x9b2265){_0x4d2218['push'](_0x4d2218['shift']());}};_0x32e51d(++_0x552fcd);}(_0xcd9f,0x152));var _0xfcd9=function(_0x4c3025,_0x556f28){_0x4c3025=_0x4c3025-0x0;var _0x31fb41=_0xcd9f[_0x4c3025];return _0x31fb41;};'use strict';var _=require(_0xfcd9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfcd9('0x1'));var BPromise=require(_0xfcd9('0x2'));var rp=require(_0xfcd9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcd9('0x4'));var config=require(_0xfcd9('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0xfcd9('0x6')]=function(_0x7d4b6,_0x4614ba){return _0x7d4b6[_0xfcd9('0x7')]('ChatTransferReport',attributes,{'tableName':_0xfcd9('0x8'),'paranoid':![],'indexes':[{'name':_0xfcd9('0x9'),'fields':[_0xfcd9('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 c36db65..61c4a5d 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 _0xd343=['stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x712490,_0x52a6dc){var _0x36e214=function(_0x26f784){while(--_0x26f784){_0x712490['push'](_0x712490['shift']());}};_0x36e214(++_0x52a6dc);}(_0xd343,0x16b));var _0x3d34=function(_0x5d170e,_0x360717){_0x5d170e=_0x5d170e-0x0;var _0x21c0de=_0xd343[_0x5d170e];return _0x21c0de;};'use strict';var _=require('lodash');var util=require(_0x3d34('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3d34('0x1'));var fs=require('fs');var Redis=require(_0x3d34('0x2'));var db=require(_0x3d34('0x3'))['db'];var utils=require(_0x3d34('0x4'));var logger=require(_0x3d34('0x5'))(_0x3d34('0x6'));var config=require(_0x3d34('0x7'));var jayson=require(_0x3d34('0x8'));var client=jayson['client'][_0x3d34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x476c06,_0x35cf11,_0x4ae13c){return new BPromise(function(_0x4739f2,_0x16a858){return client['request'](_0x476c06,_0x4ae13c)[_0x3d34('0xa')](function(_0x533d34){logger[_0x3d34('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x35cf11,_0x3d34('0xc'));logger[_0x3d34('0xd')](_0x3d34('0xe'),_0x35cf11,'request\x20sent',JSON[_0x3d34('0xf')](_0x533d34));if(_0x533d34[_0x3d34('0x10')]){if(_0x533d34[_0x3d34('0x10')][_0x3d34('0x11')]===0x1f4){logger[_0x3d34('0x10')](_0x3d34('0x12'),_0x35cf11,_0x533d34[_0x3d34('0x10')][_0x3d34('0x13')]);return _0x16a858(_0x533d34['error'][_0x3d34('0x13')]);}logger['error'](_0x3d34('0x12'),_0x35cf11,_0x533d34[_0x3d34('0x10')][_0x3d34('0x13')]);return _0x4739f2(_0x533d34['error']['message']);}else{logger[_0x3d34('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x35cf11,_0x3d34('0xc'));_0x4739f2(_0x533d34['result']['message']);}})[_0x3d34('0x14')](function(_0x2d2543){logger[_0x3d34('0x10')](_0x3d34('0x12'),_0x35cf11,_0x2d2543);_0x16a858(_0x2d2543);});});}
\ No newline at end of file
+var _0xac1b=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xd2e2fd,_0x4241ea){var _0x5eb092=function(_0x393e86){while(--_0x393e86){_0xd2e2fd['push'](_0xd2e2fd['shift']());}};_0x5eb092(++_0x4241ea);}(_0xac1b,0x79));var _0xbac1=function(_0x109f42,_0x44c1ff){_0x109f42=_0x109f42-0x0;var _0x3ccdd4=_0xac1b[_0x109f42];return _0x3ccdd4;};'use strict';var _=require(_0xbac1('0x0'));var util=require(_0xbac1('0x1'));var moment=require(_0xbac1('0x2'));var BPromise=require(_0xbac1('0x3'));var rs=require(_0xbac1('0x4'));var fs=require('fs');var Redis=require(_0xbac1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbac1('0x6'));var logger=require(_0xbac1('0x7'))(_0xbac1('0x8'));var config=require(_0xbac1('0x9'));var jayson=require(_0xbac1('0xa'));var client=jayson[_0xbac1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x278c10,_0x5ad6b1,_0x12fe42){return new BPromise(function(_0x23d917,_0x1d3b95){return client[_0xbac1('0xc')](_0x278c10,_0x12fe42)['then'](function(_0x28c251){logger['info'](_0xbac1('0xd'),_0x5ad6b1,_0xbac1('0xe'));logger[_0xbac1('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5ad6b1,_0xbac1('0xe'),JSON[_0xbac1('0x10')](_0x28c251));if(_0x28c251[_0xbac1('0x11')]){if(_0x28c251[_0xbac1('0x11')][_0xbac1('0x12')]===0x1f4){logger[_0xbac1('0x11')](_0xbac1('0xd'),_0x5ad6b1,_0x28c251[_0xbac1('0x11')]['message']);return _0x1d3b95(_0x28c251[_0xbac1('0x11')][_0xbac1('0x13')]);}logger['error'](_0xbac1('0xd'),_0x5ad6b1,_0x28c251['error'][_0xbac1('0x13')]);return _0x23d917(_0x28c251[_0xbac1('0x11')][_0xbac1('0x13')]);}else{logger[_0xbac1('0x14')](_0xbac1('0xd'),_0x5ad6b1,'request\x20sent');_0x23d917(_0x28c251[_0xbac1('0x15')][_0xbac1('0x13')]);}})[_0xbac1('0x16')](function(_0x1242ad){logger[_0xbac1('0x11')](_0xbac1('0xd'),_0x5ad6b1,_0x1242ad);_0x1d3b95(_0x1242ad);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9035f9c..c5c0fbd 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 _0x27c2=['get','/describe','/:id','show','post','create','put','update','delete','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0xdba291,_0x2b1d39){var _0x2d7c10=function(_0x127e7c){while(--_0x127e7c){_0xdba291['push'](_0xdba291['shift']());}};_0x2d7c10(++_0x2b1d39);}(_0x27c2,0xc7));var _0x227c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x27c2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x227c('0x0'));var path=require(_0x227c('0x1'));var timeout=require('connect-timeout');var express=require(_0x227c('0x2'));var router=express[_0x227c('0x3')]();var fs_extra=require(_0x227c('0x4'));var auth=require(_0x227c('0x5'));var interaction=require(_0x227c('0x6'));var config=require(_0x227c('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x227c('0x8')](),controller[_0x227c('0x9')]);router[_0x227c('0xa')](_0x227c('0xb'),auth[_0x227c('0x8')](),controller['describe']);router[_0x227c('0xa')](_0x227c('0xc'),auth[_0x227c('0x8')](),controller[_0x227c('0xd')]);router[_0x227c('0xe')]('/',auth['isAuthenticated'](),controller[_0x227c('0xf')]);router[_0x227c('0x10')](_0x227c('0xc'),auth['isAuthenticated'](),controller[_0x227c('0x11')]);router[_0x227c('0x12')](_0x227c('0xc'),auth[_0x227c('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xff15=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','create'];(function(_0x2e566c,_0x13523e){var _0x551203=function(_0x555426){while(--_0x555426){_0x2e566c['push'](_0x2e566c['shift']());}};_0x551203(++_0x13523e);}(_0xff15,0x130));var _0x5ff1=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0xff15[_0x86c6cb];return _0x1b1592;};'use strict';var multer=require('multer');var util=require(_0x5ff1('0x0'));var path=require(_0x5ff1('0x1'));var timeout=require(_0x5ff1('0x2'));var express=require(_0x5ff1('0x3'));var router=express[_0x5ff1('0x4')]();var fs_extra=require(_0x5ff1('0x5'));var auth=require(_0x5ff1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5ff1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5ff1('0x8')]);router[_0x5ff1('0x9')](_0x5ff1('0xa'),auth['isAuthenticated'](),controller[_0x5ff1('0xb')]);router[_0x5ff1('0x9')](_0x5ff1('0xc'),auth[_0x5ff1('0xd')](),controller[_0x5ff1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5ff1('0xf')]);router['put']('/:id',auth[_0x5ff1('0xd')](),controller[_0x5ff1('0x10')]);router[_0x5ff1('0x11')](_0x5ff1('0xc'),auth[_0x5ff1('0xd')](),controller[_0x5ff1('0x12')]);module[_0x5ff1('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 587da79..5c3cd74 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 _0x5cde=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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'];(function(_0x2a302a,_0x3670c4){var _0x283f7f=function(_0x4afe0c){while(--_0x4afe0c){_0x2a302a['push'](_0x2a302a['shift']());}};_0x283f7f(++_0x3670c4);}(_0x5cde,0x75));var _0xe5cd=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x5cde[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0xe5cd('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xe5cd('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe5cd('0x2')},'description':{'type':Sequelize[_0xe5cd('0x1')]},'mapKey':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x3')},'mapKeyOffline':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x3')},'key':{'type':Sequelize[_0xe5cd('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe5cd('0x4')},'customerAlias':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe5cd('0x1')],'allowNull':![],'defaultValue':_0xe5cd('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe5cd('0x1')],'allowNull':![],'defaultValue':_0xe5cd('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe5cd('0x1')],'allowNull':![],'defaultValue':_0xe5cd('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe5cd('0x8')]('rounded',_0xe5cd('0x9')),'defaultValue':_0xe5cd('0xa')},'header_online':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe5cd('0xc')},'offline_chat_button':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0xd')},'header_offline':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0xe')},'download_transcript':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe5cd('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe5cd('0x11')]},'closingQuestion':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe5cd('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe5cd('0x15')},'placeholderMessage':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x16')},'closingMessage':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x18')},'conditionAgreement':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe5cd('0x19')},'ratingType':{'type':Sequelize[_0xe5cd('0x8')](_0xe5cd('0x1a'),'thumb'),'defaultValue':_0xe5cd('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe5cd('0x11')],'defaultValue':function(){return JSON[_0xe5cd('0x1b')]({'items':[{'type':_0xe5cd('0x1c'),'variable':null,'config':{'placeholder':_0xe5cd('0x1d'),'type':_0xe5cd('0x1e'),'required':!![]},'props':{'title':_0xe5cd('0x1d'),'helpText':''}},{'type':_0xe5cd('0x1c'),'props':{'title':_0xe5cd('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xe5cd('0x3'),'type':_0xe5cd('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe5cd('0x1f')](_0xe5cd('0x20'))?JSON[_0xe5cd('0x21')](this[_0xe5cd('0x1f')](_0xe5cd('0x20'))):{};},'set':function(_0x125fe7){return this[_0xe5cd('0x22')](_0xe5cd('0x20'),JSON[_0xe5cd('0x1b')](_0x125fe7));}},'offlineForm':{'type':Sequelize[_0xe5cd('0x11')],'defaultValue':function(){return JSON[_0xe5cd('0x1b')]({'items':[{'type':_0xe5cd('0x1c'),'props':{'title':_0xe5cd('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xe5cd('0x3')},'variable':null},{'type':_0xe5cd('0x23'),'config':{'placeholder':_0xe5cd('0x24')},'props':{'title':_0xe5cd('0x24'),'helpText':_0xe5cd('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xe5cd('0x1f')]('offlineForm')?JSON[_0xe5cd('0x21')](this[_0xe5cd('0x1f')](_0xe5cd('0x26'))):{};},'set':function(_0x494e98){return this['setDataValue'](_0xe5cd('0x26'),JSON['stringify'](_0x494e98));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe5cd('0x27')]();}},'autoclose':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe5cd('0x1')]},'forwardOffline':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe5cd('0x1')]},'waitingTitle':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x28')},'offlineMessageSubject':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xe5cd('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x18')},'sendUnmanaged':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe5cd('0x1')]},'notificationTemplate':{'type':Sequelize[_0xe5cd('0x11')],'defaultValue':function(){return _0xe5cd('0x2b');}},'notificationSound':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xe5cd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x2d')},'defaultTitle':{'type':Sequelize[_0xe5cd('0x1')]},'customerAvatar':{'type':Sequelize[_0xe5cd('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe5cd('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe5cd('0x1')],'allowNull':![],'defaultValue':_0xe5cd('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe5cd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe5cd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe5cd('0x1')],'defaultValue':_0xe5cd('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe5cd('0xf')],'comment':_0xe5cd('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![],'comment':_0xe5cd('0x31'),'set':function(_0x5089e5){if(!_0x5089e5)this[_0xe5cd('0x22')](_0xe5cd('0x32'),null);this[_0xe5cd('0x22')](_0xe5cd('0x33'),_0x5089e5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe5cd('0x1')]},'vidaooTopic':{'type':Sequelize[_0xe5cd('0x1')],'allowNull':![],'defaultValue':_0xe5cd('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xe5cd('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xe5cd('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe5cd('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe5cd('0x11')]}};
\ No newline at end of file
+var _0xd78d=['Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','BOOLEAN','Feedback','star','thumb','stringify','input','text','getDataValue','parse','onlineForm','setDataValue','TEXT','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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}}','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','STRING','email','Agent','#011F6A','#ffffff','ENUM','squared','rounded','Chat','Send'];(function(_0xf4cf6f,_0x182f69){var _0x6d55f7=function(_0x57b6b1){while(--_0x57b6b1){_0xf4cf6f['push'](_0xf4cf6f['shift']());}};_0x6d55f7(++_0x182f69);}(_0xd78d,0x1d3));var _0xdd78=function(_0x2caaa3,_0xdd6bac){_0x2caaa3=_0x2caaa3-0x0;var _0x25148e=_0xd78d[_0x2caaa3];return _0x25148e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdd78('0x0'));module[_0xdd78('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdd78('0x2')},'description':{'type':Sequelize[_0xdd78('0x3')]},'mapKey':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xdd78('0x4')},'key':{'type':Sequelize[_0xdd78('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x5')},'customerAlias':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdd78('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdd78('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdd78('0x3')],'allowNull':![],'defaultValue':_0xdd78('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xdd78('0x8')]('rounded',_0xdd78('0x9')),'defaultValue':_0xdd78('0xa')},'header_online':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0xb')},'offline_chat_button':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0xc')},'header_offline':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdd78('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x12')},'noteTitle':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xdd78('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x15')},'ratingType':{'type':Sequelize[_0xdd78('0x8')](_0xdd78('0x16'),_0xdd78('0x17')),'defaultValue':_0xdd78('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xdd78('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdd78('0x18')]({'items':[{'type':_0xdd78('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xdd78('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xdd78('0x19'),'props':{'title':_0xdd78('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xdd78('0x4'),'type':_0xdd78('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdd78('0x1b')]('onlineForm')?JSON[_0xdd78('0x1c')](this[_0xdd78('0x1b')](_0xdd78('0x1d'))):{};},'set':function(_0x195ed1){return this[_0xdd78('0x1e')](_0xdd78('0x1d'),JSON['stringify'](_0x195ed1));}},'offlineForm':{'type':Sequelize[_0xdd78('0x1f')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xdd78('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xdd78('0x4'),'type':_0xdd78('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0xdd78('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xdd78('0x1b')](_0xdd78('0x21'))?JSON[_0xdd78('0x1c')](this[_0xdd78('0x1b')](_0xdd78('0x21'))):{};},'set':function(_0x4716a7){return this[_0xdd78('0x1e')]('offlineForm',JSON['stringify'](_0x4716a7));}},'token':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':function(){return rs[_0xdd78('0x22')]();}},'autoclose':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdd78('0x3')]},'forwardOffline':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdd78('0x3')]},'waitingTitle':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x23')},'waitingMessage':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x24')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x25')},'skipUnmanaged':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x13')},'sendUnmanaged':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdd78('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xdd78('0x26');}},'notificationSound':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xdd78('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xdd78('0xe')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xdd78('0x27')},'defaultTitle':{'type':Sequelize[_0xdd78('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdd78('0x3')],'allowNull':![],'defaultValue':_0xdd78('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdd78('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdd78('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xdd78('0x3')],'defaultValue':_0xdd78('0x29')},'systemAvatar':{'type':Sequelize[_0xdd78('0x1f')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xdd78('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![],'comment':_0xdd78('0x2b'),'set':function(_0x33f969){if(!_0x33f969)this[_0xdd78('0x1e')](_0xdd78('0x2c'),null);this[_0xdd78('0x1e')](_0xdd78('0x2d'),_0x33f969);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdd78('0x3')]},'vidaooTopic':{'type':Sequelize[_0xdd78('0x3')],'allowNull':![],'defaultValue':_0xdd78('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xdd78('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xdd78('0x1f')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xdd78('0x14')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index bf1937a..c731744 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 _0x5d01=['mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','ListId','contact','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','forcedOwnership','Start','startRouting','notify','offline','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','subjectOffline','mapValues','email','Chat','NotifyMailAccount','remove','addInteraction','omit','getInteractions','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','util','path','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','Pause','map','ChatWebsite','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','hasOwnProperty','nolimit','pick','options','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','filename','addAvatar','agentAvatar','file','customerAvatar','addSystemAvatar','getLogo','join','root','sitepic','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5d01,0x1c9));var _0x15d0=function(_0x427c91,_0x5b8eba){_0x427c91=_0x427c91-0x0;var _0x17380a=_0x5d01[_0x427c91];return _0x17380a;};'use strict';var emlformat=require(_0x15d0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x15d0('0x1'));var rp=require(_0x15d0('0x2'));var moment=require(_0x15d0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15d0('0x4'));var path=require(_0x15d0('0x5'));var sox=require('sox');var csv=require(_0x15d0('0x6'));var ejs=require(_0x15d0('0x7'));var fs=require('fs');var fs_extra=require(_0x15d0('0x8'));var _=require(_0x15d0('0x9'));var squel=require(_0x15d0('0xa'));var crypto=require('crypto');var jsforce=require(_0x15d0('0xb'));var deskjs=require(_0x15d0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x15d0('0xd'));var Papa=require(_0x15d0('0xe'));var Redis=require(_0x15d0('0xf'));var authService=require(_0x15d0('0x10'));var qs=require(_0x15d0('0x11'));var as=require(_0x15d0('0x12'));var hardwareService=require(_0x15d0('0x13'));var logger=require(_0x15d0('0x14'))('api');var utils=require(_0x15d0('0x15'));var config=require(_0x15d0('0x16'));var licenseUtil=require(_0x15d0('0x17'));var db=require('../../mysqldb')['db'];config[_0x15d0('0x18')]=_[_0x15d0('0x19')](config[_0x15d0('0x18')],{'host':_0x15d0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15d0('0x18')]));require(_0x15d0('0x1b'))[_0x15d0('0x1c')](socket);var jayson=require(_0x15d0('0x1d'));var client=jayson[_0x15d0('0x1e')][_0x15d0('0x1f')]({'port':0x232c});var client9002=jayson[_0x15d0('0x1e')]['http']({'port':0x232a});var client9003=jayson[_0x15d0('0x1e')][_0x15d0('0x1f')]({'port':0x232b});var client9001=jayson[_0x15d0('0x1e')][_0x15d0('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x565f57,_0x4aa1f4,_0x973c25,_0x11e195){return new BPromise(function(_0x18d14b,_0x41cad7){var _0x2f35a2=_0x11e195||client;return _0x2f35a2[_0x15d0('0x20')](_0x565f57,_0x973c25)[_0x15d0('0x21')](function(_0x1337b1){logger[_0x15d0('0x22')](_0x15d0('0x23'),_0x4aa1f4,_0x15d0('0x24'));logger['debug'](_0x15d0('0x25'),_0x4aa1f4,_0x15d0('0x24'),JSON[_0x15d0('0x26')](_0x1337b1));if(_0x1337b1[_0x15d0('0x27')]){if(_0x1337b1['error']['code']===0x1f4){logger[_0x15d0('0x27')](_0x15d0('0x23'),_0x4aa1f4,_0x1337b1[_0x15d0('0x27')]['message']);return _0x41cad7(_0x1337b1[_0x15d0('0x27')][_0x15d0('0x28')]);}logger[_0x15d0('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x4aa1f4,_0x1337b1[_0x15d0('0x27')][_0x15d0('0x28')]);return _0x18d14b(_0x1337b1[_0x15d0('0x27')][_0x15d0('0x28')]);}else{logger[_0x15d0('0x22')](_0x15d0('0x23'),_0x4aa1f4,_0x15d0('0x24'));_0x18d14b(_0x1337b1['result'][_0x15d0('0x28')]);}})['catch'](function(_0x220a36){logger[_0x15d0('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x4aa1f4,_0x220a36);_0x41cad7(_0x220a36);});});}function respondWithStatusCode(_0x24d5cc,_0x4a4027){_0x4a4027=_0x4a4027||0xcc;return function(_0x19fbbb){if(_0x19fbbb){return _0x24d5cc[_0x15d0('0x29')](_0x4a4027);}return _0x24d5cc['status'](_0x4a4027)[_0x15d0('0x2a')]();};}function respondWithResult(_0x3c7af6,_0x53da7a){_0x53da7a=_0x53da7a||0xc8;return function(_0x4309ce){if(_0x4309ce){return _0x3c7af6['status'](_0x53da7a)[_0x15d0('0x2b')](_0x4309ce);}};}function respondWithFilteredResult(_0x692159,_0x70dc82){return function(_0x5dd72f){if(_0x5dd72f){var _0x421cc5=typeof _0x70dc82[_0x15d0('0x2c')]===_0x15d0('0x2d')&&typeof _0x70dc82[_0x15d0('0x2e')]===_0x15d0('0x2d');var _0x177127=_0x5dd72f[_0x15d0('0x2f')];var _0x64ab77=_0x421cc5?0x0:_0x70dc82[_0x15d0('0x2c')];var _0xca49fc=_0x421cc5?_0x5dd72f[_0x15d0('0x2f')]:_0x70dc82[_0x15d0('0x2c')]+_0x70dc82['limit'];var _0x28585a;if(_0xca49fc>=_0x177127){_0xca49fc=_0x177127;_0x28585a=0xc8;}else{_0x28585a=0xce;}_0x692159[_0x15d0('0x30')](_0x28585a);return _0x692159[_0x15d0('0x31')](_0x15d0('0x32'),_0x64ab77+'-'+_0xca49fc+'/'+_0x177127)[_0x15d0('0x2b')](_0x5dd72f);}return null;};}function patchUpdates(_0x3cae45){return function(_0x3fc0bd){try{jsonpatch['apply'](_0x3fc0bd,_0x3cae45,!![]);}catch(_0x4d05f5){return BPromise[_0x15d0('0x33')](_0x4d05f5);}return _0x3fc0bd[_0x15d0('0x34')]();};}function saveUpdates(_0x32f015,_0xb54189){return function(_0x285f71){if(_0x285f71){return _0x285f71[_0x15d0('0x35')](_0x32f015)[_0x15d0('0x21')](function(_0xbd1259){return _0xbd1259;});}return null;};}function removeEntity(_0x5b5cdb,_0x558afd){return function(_0x441fda){if(_0x441fda){return _0x441fda['destroy']()[_0x15d0('0x21')](function(){var _0x53424e=_0x441fda[_0x15d0('0x36')]({'plain':!![]});var _0x45ad42=_0x15d0('0x37');return db[_0x15d0('0x38')][_0x15d0('0x39')]({'where':{'type':_0x45ad42,'resourceId':_0x53424e['id']}})['then'](function(){return _0x441fda;});})[_0x15d0('0x21')](function(){_0x5b5cdb[_0x15d0('0x30')](0xcc)[_0x15d0('0x2a')]();});}};}function handleEntityNotFound(_0x478cf6,_0x30b6ea){return function(_0x150171){if(!_0x150171){_0x478cf6[_0x15d0('0x29')](0x194);}return _0x150171;};}function handleError(_0x37b5a3,_0x33cb09){_0x33cb09=_0x33cb09||0x1f4;return function(_0x4e3667){logger['error'](_0x4e3667[_0x15d0('0x3a')]);if(_0x4e3667[_0x15d0('0x3b')]){delete _0x4e3667['name'];}_0x37b5a3[_0x15d0('0x30')](_0x33cb09)[_0x15d0('0x3c')](_0x4e3667);};}exports['index']=function(_0x337701,_0x442d68){var _0x5e9e8c={'include':[{'model':db[_0x15d0('0x3d')],'as':'mandatoryDispositionPause'}]},_0x165c61={},_0x1c5d98={'count':0x0,'rows':[]};var _0x246f60=_[_0x15d0('0x3e')](db[_0x15d0('0x3f')][_0x15d0('0x40')],function(_0xe4204){return{'name':_0xe4204['fieldName'],'type':_0xe4204[_0x15d0('0x41')]['key']};});_0x165c61[_0x15d0('0x42')]=_[_0x15d0('0x3e')](_0x246f60,_0x15d0('0x3b'));_0x165c61['query']=_[_0x15d0('0x43')](_0x337701[_0x15d0('0x44')]);_0x165c61[_0x15d0('0x45')]=_[_0x15d0('0x46')](_0x165c61[_0x15d0('0x42')],_0x165c61[_0x15d0('0x44')]);_0x5e9e8c[_0x15d0('0x47')]=_[_0x15d0('0x46')](_0x165c61[_0x15d0('0x42')],qs[_0x15d0('0x48')](_0x337701[_0x15d0('0x44')][_0x15d0('0x48')]));_0x5e9e8c[_0x15d0('0x47')]=_0x5e9e8c['attributes']['length']?_0x5e9e8c[_0x15d0('0x47')]:_0x165c61[_0x15d0('0x42')];if(!_0x337701[_0x15d0('0x44')]['hasOwnProperty']('nolimit')){_0x5e9e8c['limit']=qs[_0x15d0('0x2e')](_0x337701[_0x15d0('0x44')][_0x15d0('0x2e')]);_0x5e9e8c[_0x15d0('0x2c')]=qs['offset'](_0x337701['query']['offset']);}_0x5e9e8c[_0x15d0('0x49')]=qs[_0x15d0('0x4a')](_0x337701['query'][_0x15d0('0x4a')]);_0x5e9e8c[_0x15d0('0x4b')]=qs[_0x15d0('0x45')](_['pick'](_0x337701['query'],_0x165c61['filters']),_0x246f60);if(_0x337701[_0x15d0('0x44')][_0x15d0('0x4c')]){_0x5e9e8c['where']=_[_0x15d0('0x4d')](_0x5e9e8c[_0x15d0('0x4b')],{'$or':_[_0x15d0('0x3e')](_0x246f60,function(_0x5effd6){if(_0x5effd6[_0x15d0('0x41')]!==_0x15d0('0x4e')){var _0x3e123c={};_0x3e123c[_0x5effd6[_0x15d0('0x3b')]]={'$like':'%'+_0x337701[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x3e123c;}})});}_0x5e9e8c=_[_0x15d0('0x4d')]({},_0x5e9e8c,_0x337701['options']);var _0x66bd41={'where':_0x5e9e8c[_0x15d0('0x4b')]};return db['ChatWebsite'][_0x15d0('0x2f')](_0x66bd41)['then'](function(_0x5da588){_0x1c5d98[_0x15d0('0x2f')]=_0x5da588;if(_0x337701[_0x15d0('0x44')][_0x15d0('0x4f')]){_0x5e9e8c[_0x15d0('0x50')]=[{'all':!![]}];}return db['ChatWebsite'][_0x15d0('0x51')](_0x5e9e8c);})[_0x15d0('0x21')](function(_0x32150c){_0x1c5d98[_0x15d0('0x52')]=_0x32150c;return _0x1c5d98;})[_0x15d0('0x21')](respondWithFilteredResult(_0x442d68,_0x5e9e8c))[_0x15d0('0x53')](handleError(_0x442d68,null));};exports[_0x15d0('0x54')]=function(_0x2fee93,_0x56edd){var _0x441453={'raw':![],'where':{'id':_0x2fee93[_0x15d0('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x15d0('0x56')}]},_0x353700={};_0x353700[_0x15d0('0x42')]=_[_0x15d0('0x43')](db[_0x15d0('0x3f')][_0x15d0('0x40')]);_0x353700[_0x15d0('0x44')]=_['keys'](_0x2fee93[_0x15d0('0x44')]);_0x353700[_0x15d0('0x45')]=_['intersection'](_0x353700[_0x15d0('0x42')],_0x353700[_0x15d0('0x44')]);_0x441453[_0x15d0('0x47')]=_[_0x15d0('0x46')](_0x353700[_0x15d0('0x42')],qs['fields'](_0x2fee93[_0x15d0('0x44')][_0x15d0('0x48')]));_0x441453[_0x15d0('0x47')]=_0x441453[_0x15d0('0x47')][_0x15d0('0x57')]?_0x441453['attributes']:_0x353700[_0x15d0('0x42')];if(_0x2fee93[_0x15d0('0x44')][_0x15d0('0x4f')]){_0x441453[_0x15d0('0x50')]=[{'all':!![]}];}_0x441453=_['merge']({},_0x441453,_0x2fee93['options']);return db[_0x15d0('0x3f')]['find'](_0x441453)['then'](handleEntityNotFound(_0x56edd,null))[_0x15d0('0x21')](respondWithResult(_0x56edd,null))['catch'](handleError(_0x56edd,null));};exports['create']=function(_0x2bb609,_0x386b24){return db[_0x15d0('0x3f')][_0x15d0('0x58')](_0x2bb609[_0x15d0('0x59')],{})['then'](function(_0x3dd0e9){var _0x40aecb=_0x2bb609[_0x15d0('0x5a')][_0x15d0('0x36')]({'plain':!![]});if(!_0x40aecb)throw new Error(_0x15d0('0x5b'));if(_0x40aecb[_0x15d0('0x5c')]===_0x15d0('0x5a')){var _0x303061=_0x3dd0e9[_0x15d0('0x36')]({'plain':!![]});var _0x45503f='ChatWebsites';return db['UserProfileSection'][_0x15d0('0x5d')]({'where':{'name':_0x45503f,'userProfileId':_0x40aecb[_0x15d0('0x5e')]},'raw':!![]})[_0x15d0('0x21')](function(_0x2f26e1){if(_0x2f26e1&&_0x2f26e1[_0x15d0('0x5f')]===0x0){return db[_0x15d0('0x38')][_0x15d0('0x58')]({'name':_0x303061[_0x15d0('0x3b')],'resourceId':_0x303061['id'],'type':_0x2f26e1[_0x15d0('0x3b')],'sectionId':_0x2f26e1['id']},{})[_0x15d0('0x21')](function(){return _0x3dd0e9;});}else{return _0x3dd0e9;}})[_0x15d0('0x53')](function(_0x5247a5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5247a5);throw _0x5247a5;});}return _0x3dd0e9;})[_0x15d0('0x21')](respondWithResult(_0x386b24,0xc9))[_0x15d0('0x53')](handleError(_0x386b24,null));};exports[_0x15d0('0x35')]=function(_0x4015e4,_0x3b3be9){if(_0x4015e4[_0x15d0('0x59')]['id']){delete _0x4015e4['body']['id'];}return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x4015e4[_0x15d0('0x55')]['id']},'include':[{'model':db[_0x15d0('0x3d')],'as':_0x15d0('0x56')}]})[_0x15d0('0x21')](handleEntityNotFound(_0x3b3be9,null))['then'](saveUpdates(_0x4015e4['body'],null))[_0x15d0('0x21')](respondWithResult(_0x3b3be9,null))[_0x15d0('0x53')](handleError(_0x3b3be9,null));};exports[_0x15d0('0x39')]=function(_0x5059db,_0x4ec9b9){return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x5059db[_0x15d0('0x55')]['id']}})['then'](handleEntityNotFound(_0x4ec9b9,null))['then'](removeEntity(_0x4ec9b9,null))['catch'](handleError(_0x4ec9b9,null));};exports[_0x15d0('0x60')]=function(_0xd27127,_0x5cf543){return db[_0x15d0('0x3f')][_0x15d0('0x60')]()[_0x15d0('0x21')](respondWithResult(_0x5cf543,null))['catch'](handleError(_0x5cf543,null));};exports[_0x15d0('0x61')]=function(_0xab7dda,_0xc0bc73,_0x388b6e){if(_0xab7dda[_0x15d0('0x59')]['id']){delete _0xab7dda[_0x15d0('0x59')]['id'];}return db[_0x15d0('0x3f')]['find']({'where':{'id':_0xab7dda[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0xc0bc73,null))[_0x15d0('0x21')](function(_0x5d0671){if(_0x5d0671){_0xab7dda[_0x15d0('0x59')][_0x15d0('0x62')]=_0x5d0671['id'];return db[_0x15d0('0x63')][_0x15d0('0x58')](_0xab7dda[_0x15d0('0x59')]);}})[_0x15d0('0x21')](respondWithResult(_0xc0bc73,null))['catch'](handleError(_0xc0bc73,null));};exports[_0x15d0('0x64')]=function(_0x1c93cf,_0x1df92d,_0x18a977){var _0x238867={'raw':![],'where':{}};var _0x168496={};var _0x43853f={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1c93cf[_0x15d0('0x55')]['id']}})['then'](handleEntityNotFound(_0x1df92d,null))['then'](function(_0x26cf58){if(_0x26cf58){_0x168496[_0x15d0('0x42')]=_[_0x15d0('0x43')](db[_0x15d0('0x63')][_0x15d0('0x40')]);_0x168496[_0x15d0('0x44')]=_[_0x15d0('0x43')](_0x1c93cf[_0x15d0('0x44')]);_0x168496[_0x15d0('0x45')]=_[_0x15d0('0x46')](_0x168496['model'],_0x168496[_0x15d0('0x44')]);_0x238867[_0x15d0('0x47')]=_[_0x15d0('0x46')](_0x168496[_0x15d0('0x42')],qs[_0x15d0('0x48')](_0x1c93cf[_0x15d0('0x44')]['fields']));_0x238867[_0x15d0('0x47')]=_0x238867['attributes'][_0x15d0('0x57')]?_0x238867[_0x15d0('0x47')]:_0x168496['model'];if(!_0x1c93cf['query'][_0x15d0('0x65')](_0x15d0('0x66'))){_0x238867[_0x15d0('0x2e')]=qs['limit'](_0x1c93cf[_0x15d0('0x44')]['limit']);_0x238867[_0x15d0('0x2c')]=qs['offset'](_0x1c93cf[_0x15d0('0x44')][_0x15d0('0x2c')]);}_0x238867[_0x15d0('0x49')]=qs[_0x15d0('0x4a')](_0x1c93cf[_0x15d0('0x44')]['sort']);_0x238867[_0x15d0('0x4b')]=qs[_0x15d0('0x45')](_[_0x15d0('0x67')](_0x1c93cf['query'],_0x168496['filters']));_0x238867[_0x15d0('0x4b')][_0x15d0('0x62')]=_0x26cf58['id'];if(_0x1c93cf[_0x15d0('0x44')]['filter']){_0x238867['where']=_[_0x15d0('0x4d')](_0x238867[_0x15d0('0x4b')],{'$or':_[_0x15d0('0x3e')](_0x238867[_0x15d0('0x47')],function(_0x2c9a11){var _0x2b56a2={};_0x2b56a2[_0x2c9a11]={'$like':'%'+_0x1c93cf[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x2b56a2;})});}_0x238867=_[_0x15d0('0x4d')]({},_0x238867,_0x1c93cf[_0x15d0('0x68')]);return db[_0x15d0('0x63')][_0x15d0('0x2f')]({'where':_0x238867[_0x15d0('0x4b')]})['then'](function(_0x599450){_0x43853f[_0x15d0('0x2f')]=_0x599450;if(_0x1c93cf[_0x15d0('0x44')][_0x15d0('0x4f')]){_0x238867['include']=[{'all':!![]}];}return db[_0x15d0('0x63')][_0x15d0('0x51')](_0x238867);})['then'](function(_0xcf2739){_0x43853f[_0x15d0('0x52')]=_0xcf2739;return _0x43853f;});}})[_0x15d0('0x21')](respondWithFilteredResult(_0x1df92d,_0x238867))[_0x15d0('0x53')](handleError(_0x1df92d,null));};exports[_0x15d0('0x69')]=function(_0x38f03e,_0x1f8d4e,_0x2f55e0){return db['ChatWebsite'][_0x15d0('0x5d')]({'where':{'id':_0x38f03e[_0x15d0('0x55')]['id']}})['then'](handleEntityNotFound(_0x1f8d4e,null))[_0x15d0('0x21')](function(_0x3855c2){if(_0x3855c2){return _0x3855c2[_0x15d0('0x69')](_0x38f03e[_0x15d0('0x44')][_0x15d0('0x6a')]);}})['then'](respondWithStatusCode(_0x1f8d4e,null))[_0x15d0('0x53')](handleError(_0x1f8d4e,null));};exports['addAnswer']=function(_0x32cf10,_0x22fb2e,_0x1e7f71){if(_0x32cf10[_0x15d0('0x59')]['id']){delete _0x32cf10[_0x15d0('0x59')]['id'];}return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x32cf10['params']['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x22fb2e,null))[_0x15d0('0x21')](function(_0x272eba){if(_0x272eba){_0x32cf10[_0x15d0('0x59')][_0x15d0('0x62')]=_0x272eba['id'];return db[_0x15d0('0x6b')]['create'](_0x32cf10[_0x15d0('0x59')]);}})['then'](respondWithResult(_0x22fb2e,null))[_0x15d0('0x53')](handleError(_0x22fb2e,null));};exports['getAnswers']=function(_0x4db7ed,_0xe245e3,_0x31e723){var _0xf48074={'raw':![],'where':{}};var _0x472d9f={};var _0xb634e6={'count':0x0,'rows':[]};return db[_0x15d0('0x3f')][_0x15d0('0x6c')]({'where':{'id':_0x4db7ed[_0x15d0('0x55')]['id']}})['then'](handleEntityNotFound(_0xe245e3,null))[_0x15d0('0x21')](function(_0x378138){if(_0x378138){_0x472d9f[_0x15d0('0x42')]=_[_0x15d0('0x43')](db['CannedAnswer'][_0x15d0('0x40')]);_0x472d9f[_0x15d0('0x44')]=_[_0x15d0('0x43')](_0x4db7ed['query']);_0x472d9f[_0x15d0('0x45')]=_[_0x15d0('0x46')](_0x472d9f['model'],_0x472d9f[_0x15d0('0x44')]);_0xf48074['attributes']=_[_0x15d0('0x46')](_0x472d9f[_0x15d0('0x42')],qs['fields'](_0x4db7ed[_0x15d0('0x44')][_0x15d0('0x48')]));_0xf48074[_0x15d0('0x47')]=_0xf48074['attributes']['length']?_0xf48074['attributes']:_0x472d9f['model'];if(!_0x4db7ed[_0x15d0('0x44')][_0x15d0('0x65')](_0x15d0('0x66'))){_0xf48074['limit']=qs[_0x15d0('0x2e')](_0x4db7ed[_0x15d0('0x44')][_0x15d0('0x2e')]);_0xf48074[_0x15d0('0x2c')]=qs['offset'](_0x4db7ed[_0x15d0('0x44')]['offset']);}_0xf48074[_0x15d0('0x49')]=qs[_0x15d0('0x4a')](_0x4db7ed[_0x15d0('0x44')][_0x15d0('0x4a')]);_0xf48074[_0x15d0('0x4b')]=qs['filters'](_['pick'](_0x4db7ed['query'],_0x472d9f[_0x15d0('0x45')]));_0xf48074[_0x15d0('0x4b')][_0x15d0('0x62')]=_0x378138['id'];if(_0x4db7ed[_0x15d0('0x44')][_0x15d0('0x4c')]){_0xf48074[_0x15d0('0x4b')]=_['merge'](_0xf48074[_0x15d0('0x4b')],{'$or':_[_0x15d0('0x3e')](_0xf48074['attributes'],function(_0x6f5d27){var _0x388aa3={};_0x388aa3[_0x6f5d27]={'$like':'%'+_0x4db7ed[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x388aa3;})});}_0xf48074=_[_0x15d0('0x4d')]({},_0xf48074,_0x4db7ed[_0x15d0('0x68')]);return db[_0x15d0('0x6b')][_0x15d0('0x2f')]({'where':_0xf48074[_0x15d0('0x4b')]})['then'](function(_0x57aa71){_0xb634e6[_0x15d0('0x2f')]=_0x57aa71;if(_0x4db7ed['query'][_0x15d0('0x4f')]){_0xf48074['include']=[{'all':!![]}];}return db[_0x15d0('0x6b')][_0x15d0('0x51')](_0xf48074);})['then'](function(_0xefdc5b){_0xb634e6['rows']=_0xefdc5b;return _0xb634e6;});}})[_0x15d0('0x21')](respondWithFilteredResult(_0xe245e3,_0xf48074))['catch'](handleError(_0xe245e3,null));};exports[_0x15d0('0x6d')]=function(_0x11e88b,_0x20dcc6,_0x36fba2){return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x11e88b[_0x15d0('0x55')]['id']}})['then'](handleEntityNotFound(_0x20dcc6,null))[_0x15d0('0x21')](function(_0x41184b){if(_0x41184b){return _0x41184b[_0x15d0('0x6d')](_0x11e88b['query'][_0x15d0('0x6a')]);}})[_0x15d0('0x21')](respondWithStatusCode(_0x20dcc6,null))['catch'](handleError(_0x20dcc6,null));};exports['addLogo']=function(_0x5542e8,_0x2ed6e9,_0x57a394){_0x5542e8[_0x15d0('0x59')]['sitepic']=_0x5542e8['file'][_0x15d0('0x6e')];return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x5542e8[_0x15d0('0x55')]['id']}})['then'](handleEntityNotFound(_0x2ed6e9,null))[_0x15d0('0x21')](saveUpdates(_0x5542e8[_0x15d0('0x59')],null))['then'](respondWithResult(_0x2ed6e9,null))[_0x15d0('0x53')](handleError(_0x2ed6e9,null));};exports[_0x15d0('0x6f')]=function(_0x9bcf00,_0x1650a9,_0xd13368){_0x9bcf00['body'][_0x15d0('0x70')]=_0x9bcf00[_0x15d0('0x71')][_0x15d0('0x6e')];return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x9bcf00[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x1650a9,null))[_0x15d0('0x21')](saveUpdates(_0x9bcf00[_0x15d0('0x59')],null))['then'](respondWithResult(_0x1650a9,null))[_0x15d0('0x53')](handleError(_0x1650a9,null));};exports['addCustomerAvatar']=function(_0xfa283a,_0x58d968,_0x548949){_0xfa283a['body'][_0x15d0('0x72')]=_0xfa283a[_0x15d0('0x71')][_0x15d0('0x6e')];return db[_0x15d0('0x3f')]['find']({'where':{'id':_0xfa283a[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x58d968,null))[_0x15d0('0x21')](saveUpdates(_0xfa283a['body'],null))[_0x15d0('0x21')](respondWithResult(_0x58d968,null))[_0x15d0('0x53')](handleError(_0x58d968,null));};exports[_0x15d0('0x73')]=function(_0x10ea5b,_0x1ec7f5,_0x21d170){_0x10ea5b['body']['systemAvatar']=_0x10ea5b[_0x15d0('0x71')][_0x15d0('0x6e')];return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x10ea5b['params']['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x1ec7f5,null))[_0x15d0('0x21')](saveUpdates(_0x10ea5b[_0x15d0('0x59')],null))['then'](respondWithResult(_0x1ec7f5,null))[_0x15d0('0x53')](handleError(_0x1ec7f5,null));};exports[_0x15d0('0x74')]=function(_0x5b5950,_0x14839c,_0xa3e3ce){var _0x261c84=path[_0x15d0('0x75')](config[_0x15d0('0x76')],'server/files/images/logos/default_logo.svg');var _0xade6dc={'where':{'id':_0x5b5950['params']['id']},'attributes':['id',_0x15d0('0x77')],'raw':!![]};var _0x3bbead=![];return require('../../config/license/util')[_0x15d0('0x78')]()['then'](function(_0x4f0a6d){if(_0x4f0a6d){_0x3bbead=_0x4f0a6d[_0x15d0('0x79')];}})[_0x15d0('0x21')](function(){return db[_0x15d0('0x3f')]['find'](_0xade6dc);})[_0x15d0('0x21')](handleEntityNotFound(_0x14839c,null))[_0x15d0('0x21')](function(_0x196914){if(_0x196914){if(!_[_0x15d0('0x7a')](_0x196914[_0x15d0('0x77')])){if(fs[_0x15d0('0x7b')](path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x7c'),_0x196914[_0x15d0('0x77')]))&&_0x3bbead){_0x261c84=path['join'](config['root'],_0x15d0('0x7c'),_0x196914[_0x15d0('0x77')]);}}return _0x14839c[_0x15d0('0x7d')](_0x261c84);}})[_0x15d0('0x53')](handleError(_0x14839c,null));};exports[_0x15d0('0x7e')]=function(_0x5076a1,_0x50b463,_0x3c7b5d){var _0x3c33bd=path[_0x15d0('0x75')](config[_0x15d0('0x76')],'server/files/images/avatars/default_avatar.png');var _0x47882f={'where':{'id':_0x5076a1[_0x15d0('0x55')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x15d0('0x3f')][_0x15d0('0x5d')](_0x47882f)[_0x15d0('0x21')](handleEntityNotFound(_0x50b463,null))[_0x15d0('0x21')](function(_0x52a46f){if(_0x52a46f){if(!_[_0x15d0('0x7a')](_0x52a46f[_0x15d0('0x70')])){if(fs['existsSync'](path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x7f'),_0x52a46f[_0x15d0('0x70')]))){_0x3c33bd=path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x7f'),_0x52a46f['agentAvatar']);}}return _0x50b463['download'](_0x3c33bd);}})[_0x15d0('0x53')](handleError(_0x50b463,null));};exports['getCustomerAvatar']=function(_0x4cac2a,_0x3d9378,_0xf623a0){var _0x508445=path['join'](config[_0x15d0('0x76')],_0x15d0('0x80'));var _0x5f296d={'where':{'id':_0x4cac2a[_0x15d0('0x55')]['id']},'attributes':['id','customerAvatar',_0x15d0('0x81')],'raw':!![]};return db[_0x15d0('0x3f')][_0x15d0('0x5d')](_0x5f296d)[_0x15d0('0x21')](handleEntityNotFound(_0x3d9378,null))[_0x15d0('0x21')](function(_0x8c248c){if(_0x8c248c){if(!_[_0x15d0('0x7a')](_0x8c248c[_0x15d0('0x72')])){if(fs[_0x15d0('0x7b')](path[_0x15d0('0x75')](config[_0x15d0('0x76')],'server/files/images/avatars/',_0x8c248c[_0x15d0('0x72')]))&&_0x8c248c[_0x15d0('0x81')]){_0x508445=path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x7f'),_0x8c248c[_0x15d0('0x72')]);}}return _0x3d9378[_0x15d0('0x7d')](_0x508445);}})[_0x15d0('0x53')](handleError(_0x3d9378,null));};exports[_0x15d0('0x82')]=function(_0x27ca9d,_0x2684a1,_0x316dbc){var _0x59c517=path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x83'));var _0xb7bf54={'where':{'id':_0x27ca9d['params']['id']},'attributes':['id',_0x15d0('0x84')],'raw':!![]};return db[_0x15d0('0x3f')][_0x15d0('0x5d')](_0xb7bf54)['then'](handleEntityNotFound(_0x2684a1,null))[_0x15d0('0x21')](function(_0x3912e1){if(_0x3912e1){if(!_[_0x15d0('0x7a')](_0x3912e1['systemAvatar'])){if(fs[_0x15d0('0x7b')](path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x7f'),_0x3912e1[_0x15d0('0x84')]))){_0x59c517=path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x7f'),_0x3912e1['systemAvatar']);}}return _0x2684a1[_0x15d0('0x7d')](_0x59c517);}})[_0x15d0('0x53')](handleError(_0x2684a1,null));};exports['notify']=function(_0x50ab02,_0x32aa22,_0x11ba5c){var _0x441a33=require(_0x15d0('0x85'));var _0x533d74=new _0x441a33();var _0x3cb908=_0x533d74['setUA'](_0x50ab02[_0x15d0('0x86')][_0x15d0('0x87')])[_0x15d0('0x88')]();var _0x2ce51c={'body':_0x50ab02['body'],'channel':_0x15d0('0x89')};var _0x36a68f=[];var _0x12bb14=[];var _0x16971e={};var _0x20fd26=![];return db[_0x15d0('0x8a')][_0x15d0('0x60')]()[_0x15d0('0x21')](function(_0x5c1fe0){if(!_0x5c1fe0){throw new db['Sequelize'][(_0x15d0('0x8b'))](_0x15d0('0x8c'));}_0x36a68f=_[_0x15d0('0x8d')](_['keys'](_0x5c1fe0),['createdAt',_0x15d0('0x8e')]);_0x12bb14=_[_0x15d0('0x8d')](_[_0x15d0('0x43')](_0x5c1fe0),[_0x15d0('0x8f'),_0x15d0('0x8e'),_0x15d0('0x90'),'ListId']);if(_0x50ab02[_0x15d0('0x59')]['id']){delete _0x50ab02[_0x15d0('0x59')]['id'];}if(_[_0x15d0('0x7a')](_0x50ab02[_0x15d0('0x59')][_0x15d0('0x91')])){throw new db['Sequelize'][(_0x15d0('0x8b'))](_0x15d0('0x92'));}if(_[_0x15d0('0x7a')](_0x50ab02[_0x15d0('0x59')][_0x15d0('0x59')])||_0x50ab02['body'][_0x15d0('0x59')]===''){throw new db[(_0x15d0('0x93'))][(_0x15d0('0x8b'))](_0x15d0('0x94'));}if(_[_0x15d0('0x7a')](_0x50ab02['body'][_0x15d0('0x95')])){throw new db[(_0x15d0('0x93'))][(_0x15d0('0x8b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12bb14);}if(!_[_0x15d0('0x96')](_0x12bb14,_0x50ab02[_0x15d0('0x59')][_0x15d0('0x95')])){throw new db['Sequelize']['ValidationError'](_0x15d0('0x97')+_0x12bb14);}_0x16971e[_0x50ab02[_0x15d0('0x59')][_0x15d0('0x95')]]=_0x50ab02['body'][_0x15d0('0x91')];})[_0x15d0('0x21')](function(){return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x50ab02[_0x15d0('0x55')]['id']},'include':[{'model':db[_0x15d0('0x98')],'as':_0x15d0('0x99'),'include':[{'model':db['CmContact'],'as':_0x15d0('0x9a'),'where':_0x16971e,'limit':0x1,'order':[['updatedAt',_0x15d0('0x9b')]]}]},{'model':db[_0x15d0('0x9c')],'as':_0x15d0('0x9d')}]});})[_0x15d0('0x21')](handleEntityNotFound(_0x32aa22,null))[_0x15d0('0x21')](function(_0x2a3ff4){if(_0x2a3ff4&&_0x2a3ff4['List']){_0x2ce51c['account']=_0x2a3ff4;_0x2ce51c['applications']=_0x2a3ff4[_0x15d0('0x9d')];_0x2ce51c[_0x15d0('0x9e')]=_0x2a3ff4['List'];_0x2ce51c[_0x15d0('0x9f')]=_[_0x15d0('0xa0')](_0x2ce51c[_0x15d0('0x9f')],[_0x15d0('0xa1')],[_0x15d0('0xa2')]);if(_0x2ce51c[_0x15d0('0xa3')][_0x15d0('0x9d')]){delete _0x2ce51c['account'][_0x15d0('0x9d')];}if(_0x2ce51c[_0x15d0('0xa3')][_0x15d0('0x99')]&&_0x2ce51c[_0x15d0('0xa3')][_0x15d0('0x99')][_0x15d0('0x9a')][_0x15d0('0x57')]){return _0x2ce51c[_0x15d0('0xa3')][_0x15d0('0x99')][_0x15d0('0x9a')][0x0];}var _0x41eace=_[_0x15d0('0x19')](_0x50ab02['body'],{'firstName':_0x50ab02['body']['from'],'ListId':_0x2a3ff4[_0x15d0('0xa4')]});_0x41eace[_0x50ab02[_0x15d0('0x59')][_0x15d0('0x95')]]=_0x50ab02[_0x15d0('0x59')][_0x15d0('0x91')];return db[_0x15d0('0x8a')][_0x15d0('0x58')](_0x41eace,{'fields':_0x36a68f,'raw':!![]});}})[_0x15d0('0x21')](handleEntityNotFound(_0x32aa22,null))[_0x15d0('0x21')](function(_0x1660c3){_0x2ce51c[_0x15d0('0xa5')]=_0x1660c3;var _0x5d5450=_0x50ab02[_0x15d0('0x59')]['customerIp'];if(_0x50ab02[_0x15d0('0x86')][_0x15d0('0xa6')]){_0x5d5450=_0x50ab02['headers'][_0x15d0('0xa6')];}else if(_0x50ab02[_0x15d0('0x86')][_0x15d0('0xa7')]){_0x5d5450=_['first'](_0x50ab02[_0x15d0('0x86')][_0x15d0('0xa7')][_0x15d0('0xa8')](','));}if(_0x1660c3){var _0x27e597={'ContactId':_0x1660c3['id'],'ChatWebsiteId':_0x50ab02[_0x15d0('0x55')]['id'],'from':(_0x1660c3[_0x15d0('0xa9')]||'')+'\x20'+(_0x1660c3[_0x15d0('0xaa')]||''),'customerIp':_0x5d5450,'customerPort':_0x50ab02[_0x15d0('0x86')][_0x15d0('0xab')]?_0x50ab02[_0x15d0('0x86')]['x-real-port']:null,'referer':_0x50ab02[_0x15d0('0x59')][_0x15d0('0xac')],'browserName':_0x3cb908[_0x15d0('0xad')]['name']&&_0x3cb908[_0x15d0('0xad')][_0x15d0('0xae')]?util[_0x15d0('0xaf')](_0x15d0('0xb0'),_0x3cb908[_0x15d0('0xad')][_0x15d0('0x3b')],_0x3cb908[_0x15d0('0xad')]['version']):_0x15d0('0xb1'),'browserVersion':_0x3cb908[_0x15d0('0xad')][_0x15d0('0xae')]||_0x15d0('0xb1'),'osName':util[_0x15d0('0xaf')](_0x15d0('0xb0'),_0x3cb908['os'][_0x15d0('0x3b')],_0x3cb908['os'][_0x15d0('0xae')]),'osVersion':_0x3cb908['os']['version'],'deviceModel':_0x3cb908['device'][_0x15d0('0x42')]&&_0x3cb908['device'][_0x15d0('0xb2')]?util[_0x15d0('0xaf')](_0x15d0('0xb3'),_0x3cb908[_0x15d0('0xb4')]['model'],_0x3cb908[_0x15d0('0xb4')][_0x15d0('0xb2')],_0x3cb908[_0x15d0('0xb4')][_0x15d0('0x41')]):null,'deviceVendor':_0x3cb908[_0x15d0('0xb4')][_0x15d0('0xb2')],'deviceType':_0x3cb908[_0x15d0('0xb4')]['type'],'formData':JSON[_0x15d0('0x26')](_0x50ab02[_0x15d0('0x59')])};var _0x2fea08={'ChatWebsiteId':_0x50ab02[_0x15d0('0x55')]['id'],'closed':![]};if(_0x50ab02[_0x15d0('0x59')][_0x15d0('0xb5')]){_0x2fea08[_0x15d0('0xb5')]=_0x50ab02[_0x15d0('0x59')][_0x15d0('0xb5')];return db[_0x15d0('0xb6')][_0x15d0('0x5d')]({'where':_0x2fea08})[_0x15d0('0x21')](function(_0x287c51){if(_0x287c51){return[_0x287c51,![]];}_0x27e597['threadId']=_0x50ab02[_0x15d0('0x59')][_0x15d0('0xb5')];_0x27e597[_0x15d0('0xb7')]=_0x50ab02['body'][_0x15d0('0xb7')];return db[_0x15d0('0xb6')][_0x15d0('0x58')](_0x27e597)[_0x15d0('0x21')](function(_0x1e40a9){return[_0x1e40a9,!![]];});});}_0x2fea08[_0x15d0('0xb8')]=_0x1660c3['id'];if(_0x50ab02[_0x15d0('0x59')][_0x15d0('0xb9')]&&_0x50ab02[_0x15d0('0x59')][_0x15d0('0xb9')]['id']){_0x2fea08['id']=_0x50ab02['body']['interaction']['id'];return db[_0x15d0('0xb6')][_0x15d0('0x5d')]({'where':_0x2fea08})[_0x15d0('0x21')](function(_0x70b37b){if(_0x70b37b){return[_0x70b37b,![]];}return db[_0x15d0('0xb6')]['create'](_0x27e597)[_0x15d0('0x21')](function(_0x15183e){return[_0x15183e,!![]];});});}return db[_0x15d0('0xb6')][_0x15d0('0x58')](_0x27e597)[_0x15d0('0x21')](function(_0x30a0b1){return[_0x30a0b1,!![]];});}})[_0x15d0('0xba')](function(_0xb6880d,_0x308952){if(_0xb6880d){_0x20fd26=_0x308952;if(!_0x308952){var _0x5220bc={'from':(_0x2ce51c[_0x15d0('0xa5')][_0x15d0('0xa9')]||'')+'\x20'+(_0x2ce51c[_0x15d0('0xa5')][_0x15d0('0xaa')]||'')};if(_0x50ab02['body'][_0x15d0('0xb5')]&&_0x50ab02[_0x15d0('0x59')]['messageId']&&_0x50ab02['body'][_0x15d0('0xb5')]!=_0x50ab02['body'][_0x15d0('0xbb')]){_0x5220bc['threadId']=_0x50ab02['body'][_0x15d0('0xbb')];}return _0xb6880d[_0x15d0('0x35')](_0x5220bc);}else{return _0xb6880d;}}})['then'](function(_0x27e3ea){_0x2ce51c[_0x15d0('0xb9')]=_0x27e3ea[_0x15d0('0x36')]({'plain':!![]});_0x2ce51c['interaction']['created']=_0x20fd26;if(_0x2ce51c[_0x15d0('0xb9')][_0x15d0('0xbc')]){if(_0x2ce51c[_0x15d0('0xa3')][_0x15d0('0xbd')]){_0x2ce51c[_0x15d0('0x9f')][_0x15d0('0xbe')]({'id':0x0,'priority':_0x2ce51c[_0x15d0('0x9f')][_0x15d0('0x57')]+0x1,'app':'close','appdata':_0x15d0('0xbf'),'interval':_0x15d0('0xc0')});}}return db[_0x15d0('0xc1')][_0x15d0('0x58')]({'body':_0x50ab02[_0x15d0('0x59')][_0x15d0('0x59')],'ChatWebsiteId':_0x50ab02[_0x15d0('0x55')]['id'],'ChatInteractionId':_0x27e3ea['id'],'direction':'in','ContactId':_0x2ce51c[_0x15d0('0xa5')]['id'],'AttachmentId':_0x50ab02[_0x15d0('0x59')][_0x15d0('0xc2')]});})[_0x15d0('0x21')](function(_0xb33614){_0x2ce51c['message']=_0xb33614;if(_0x2ce51c[_0x15d0('0xb9')][_0x15d0('0xc3')]){return db[_0x15d0('0xc4')][_0x15d0('0x5d')]({'attributes':['id',_0x15d0('0x3b')],'where':{'id':_0x2ce51c[_0x15d0('0xb9')][_0x15d0('0xc3')]}})[_0x15d0('0x21')](function(_0x1736d3){if(_0x1736d3){_0x2ce51c[_0x15d0('0x9f')][_0x15d0('0xc5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1736d3[_0x15d0('0x3b')]+','+(_0x2ce51c[_0x15d0('0xa3')]['waitForTheAssignedAgent']||0xa),'interval':_0x15d0('0xc0')});_0x2ce51c[_0x15d0('0xc6')]=!![];}return respondWithRpcPromise(_0x15d0('0xc7'),_0x15d0('0xc8'),_0x2ce51c);});}return respondWithRpcPromise(_0x15d0('0xc7'),'startRouting',_0x2ce51c);})['then'](function(_0x30318b){respondWithRpcPromise('EventManager','EventManager',{'event':_0x15d0('0xc9'),'message':_0x30318b},client9002);return _0x30318b;})[_0x15d0('0x21')](respondWithResult(_0x32aa22,null))[_0x15d0('0x53')](handleError(_0x32aa22,null));};exports[_0x15d0('0xca')]=function(_0x349db5,_0x14f621,_0x535367){var _0x3331c2,_0x2ebc83,_0x4a9f6c;var _0x4045aa=[];var _0x4f83fe=[];var _0x5432c4={};var _0x109749=_0x349db5['files']||[];var _0x390376=[];var _0x32d17e;return db[_0x15d0('0x8a')][_0x15d0('0x60')]()[_0x15d0('0x21')](function(_0x10347a){if(!_0x10347a){throw new db[(_0x15d0('0x93'))][(_0x15d0('0x8b'))]('no\x20available\x20attributes');}_0x4f83fe=_[_0x15d0('0x8d')](_[_0x15d0('0x43')](_0x10347a),[_0x15d0('0x8f'),_0x15d0('0x8e')]);_0x4045aa=_[_0x15d0('0x8d')](_['keys'](_0x10347a),[_0x15d0('0x8f'),_0x15d0('0x8e'),_0x15d0('0x90'),'ListId']);if(_0x349db5[_0x15d0('0x59')]['id']){delete _0x349db5[_0x15d0('0x59')]['id'];}if(_[_0x15d0('0x7a')](_0x349db5[_0x15d0('0x59')]['from'])){throw _0x14f621[_0x15d0('0x30')](0x1f4)[_0x15d0('0x3c')](new db[(_0x15d0('0x93'))][(_0x15d0('0x8b'))](_0x15d0('0x92')));}if(_['isNil'](_0x349db5[_0x15d0('0x59')][_0x15d0('0x59')])||_0x349db5[_0x15d0('0x59')]['body']===''){throw _0x14f621['status'](0x1f4)['send'](new db[(_0x15d0('0x93'))][(_0x15d0('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x349db5[_0x15d0('0x59')]['mapKeyOffline'])){throw _0x14f621[_0x15d0('0x30')](0x1f4)[_0x15d0('0x3c')](new db[(_0x15d0('0x93'))][(_0x15d0('0x8b'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4045aa));}if(!_[_0x15d0('0x96')](_0x4045aa,_0x349db5[_0x15d0('0x59')][_0x15d0('0xcb')])){throw _0x14f621['status'](0x1f4)['send'](new db[(_0x15d0('0x93'))]['ValidationError'](_0x15d0('0xcc')+_0x4045aa));}_0x5432c4[_0x349db5['body']['mapKeyOffline']]=_0x349db5['body'][_0x15d0('0x91')];})['then'](function(){return db[_0x15d0('0x3f')]['find']({'where':{'id':_0x349db5[_0x15d0('0x55')]['id']},'include':[{'model':db[_0x15d0('0x98')],'as':_0x15d0('0x99')},{'model':db[_0x15d0('0xcd')],'as':_0x15d0('0xcd')}]});})['then'](handleEntityNotFound(_0x14f621,null))['then'](function(_0xac37b3){if(_0xac37b3&&_0xac37b3[_0x15d0('0x99')]){_0x2ebc83=_0xac37b3;var _0xd046f6=_[_0x15d0('0x19')](_0x349db5[_0x15d0('0x59')],{'firstName':_0x349db5[_0x15d0('0x59')]['from'],'phone':_0x349db5[_0x15d0('0x59')]['from'],'ListId':_0xac37b3[_0x15d0('0xa4')]});_0xd046f6[_0x349db5['body'][_0x15d0('0xcb')]]=_0x349db5[_0x15d0('0x59')][_0x15d0('0x91')];return db[_0x15d0('0x8a')][_0x15d0('0xce')]({'where':_0x5432c4,'defaults':_0xd046f6});}})[_0x15d0('0xba')](function(_0x4f6f9d){if(_0x4f6f9d){_0x4a9f6c=_0x4f6f9d;var _0x457159=fs[_0x15d0('0xcf')](path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0xd0')),_0x15d0('0xd1'));var _0x4f52d4=ejs[_0x15d0('0xd2')](_0x457159,{'body':_[_0x15d0('0xd3')](_0x349db5[_0x15d0('0x59')][_0x15d0('0x59')]),'bodyTitle':_0x2ebc83['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x4f52d4,'ContactId':_0x4f6f9d['id'],'ChatWebsiteId':_0x2ebc83['id']});}})[_0x15d0('0x21')](function(_0x11203d){_0x32d17e=_0x11203d;if(_0x109749[_0x15d0('0x57')]){var _0x1207af=_0x109749[_0x15d0('0x3e')](function(_0xc1ed45){return{'name':_0xc1ed45[_0x15d0('0xd4')],'basename':_0xc1ed45[_0x15d0('0x6e')],'type':_0xc1ed45[_0x15d0('0xd5')],'ChatOfflineMessageId':_0x11203d['id']};});_0x390376=_0x1207af[_0x15d0('0x3e')](_0xd33610=>{var _0x2792d3={'filename':_0xd33610[_0x15d0('0x3b')],'path':path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0xd6'),_0x15d0('0xd7'),_0x15d0('0xd8'),_0x15d0('0xd9'),_0xd33610[_0x15d0('0xda')])};return _0x2792d3;});if(!_0x2ebc83[_0x15d0('0xdb')]){return db[_0x15d0('0xdc')][_0x15d0('0xdd')](function(_0x34f369){return db[_0x15d0('0xde')][_0x15d0('0xdf')](_0x1207af,{'transaction':_0x34f369});});}}})[_0x15d0('0x21')](function(){if(_0x32d17e){_0x3331c2=_0x32d17e;return db[_0x15d0('0xcd')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x15d0('0xe0')],'as':_0x15d0('0xe1'),'raw':!![]}]});}})[_0x15d0('0x21')](function(_0x37817f){if(_0x37817f&&_0x37817f[_0x15d0('0xe1')]&&_0x2ebc83[_0x15d0('0xe2')]&&_0x2ebc83[_0x15d0('0xe3')]){var _0x698d81={'tls':{'rejectUnauthorized':![]}};if(_0x37817f[_0x15d0('0xe1')][_0x15d0('0xe4')]){_0x698d81[_0x15d0('0xe4')]=_0x37817f[_0x15d0('0xe1')]['service'];}else{_0x698d81[_0x15d0('0xe5')]=_0x37817f[_0x15d0('0xe1')][_0x15d0('0xe5')];_0x698d81['port']=_0x37817f[_0x15d0('0xe1')]['port'];_0x698d81[_0x15d0('0xe6')]=_0x37817f['Smtp'][_0x15d0('0xe6')];}if(_0x37817f['Smtp']['authentication']){_0x698d81[_0x15d0('0xe7')]={'user':_0x37817f[_0x15d0('0xe1')][_0x15d0('0x5a')],'pass':_0x37817f[_0x15d0('0xe1')][_0x15d0('0xe8')]};}return respondWithRpcPromise(_0x15d0('0xe9'),_0x15d0('0xea'),{'account':_0x698d81,'message':{'from':util[_0x15d0('0xaf')](_0x15d0('0xeb'),_0x37817f[_0x15d0('0x3b')],_0x37817f['email']||_0x37817f[_0x15d0('0xe1')][_0x15d0('0x5a')]),'to':_0x2ebc83['forwardOfflineAddress'],'subject':_0x2ebc83[_0x15d0('0xec')],'html':_0x3331c2[_0x15d0('0x59')],'attachments':_0x390376}},client9003)['then'](function(){return _0x3331c2;})[_0x15d0('0x53')](function(_0x3e2bae){console[_0x15d0('0x27')](_0x3e2bae);});}})['then'](function(){if(_0x2ebc83&&_0x2ebc83[_0x15d0('0xdb')]&&_0x2ebc83['MailAccountId']){var _0x4ff277=[];if(_0x109749[_0x15d0('0x57')]){_0x4ff277=_0x109749[_0x15d0('0x3e')](function(_0x18269e){return{'name':_0x18269e[_0x15d0('0xd4')],'basename':_0x18269e['filename'],'type':_0x18269e[_0x15d0('0xd5')],'ChatOfflineMessageId':_0x32d17e['id']};});}var _0x5cc7ba;if(!_[_0x15d0('0x7a')](_0x2ebc83[_0x15d0('0xed')])){var _0x28b8c2=_[_0x15d0('0x3e')](_0x349db5['body'],function(_0x41964c){return _0x41964c;});var _0x27449e=_['toPairsIn'](_0x28b8c2)[0x0];var _0x47e76b=_[_0x15d0('0xee')](_0x27449e,function(_0x27f013){return _0x27f013;});_0x5cc7ba=_0x47e76b[0x1][_0x2ebc83[_0x15d0('0xed')]];}var _0x72b30c={'from':_0x4a9f6c[_0x15d0('0xef')],'firstName':_0x4a9f6c['firstName'],'lastName':_0x4a9f6c[_0x15d0('0xaa')],'mapKey':'email','message':{'from':_0x4a9f6c[_0x15d0('0xef')],'to':_0x2ebc83[_0x15d0('0xcd')][_0x15d0('0xef')],'cc':'','subject':_[_0x15d0('0x7a')](_0x5cc7ba)?_0x2ebc83[_0x15d0('0xec')]:_0x5cc7ba,'messageId':'','sentAt':new Date(),'attach':_0x4ff277[_0x15d0('0x57')],'attachments':_0x4ff277,'originChannel':_0x15d0('0xf0'),'ChatWebsiteId':_0x2ebc83['id'],'ChatOfflineMessageId':_0x3331c2['id'],'originTo':_0x2ebc83[_0x15d0('0xcd')]['email']},'body':_0x3331c2[_0x15d0('0x59')]};var _0x4314c4={'account':{'id':_0x2ebc83['MailAccountId']},'body':_0x72b30c,'log':_0x15d0('0xf1')};return respondWithRpcPromise(_0x15d0('0xf1'),'notifyMail',_0x4314c4,client9001)[_0x15d0('0x21')](function(){return _0x3331c2;})[_0x15d0('0x53')](function(_0x371e8e){console[_0x15d0('0x27')](_0x371e8e);});}return;})[_0x15d0('0x21')](function(){if(_0x3331c2){return _0x3331c2;}})[_0x15d0('0x21')](respondWithResult(_0x14f621,null))[_0x15d0('0x53')](function(_0x47b8db){console[_0x15d0('0x27')](_0x15d0('0x53'),_0x47b8db);for(var _0x4a8f2d of _0x109749){var _0x4868fa=path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0xd6'),_0x15d0('0xd7'),_0x15d0('0xd8'),_0x15d0('0xd9'),_0x4a8f2d['filename']);fs_extra[_0x15d0('0xf2')](_0x4868fa)[_0x15d0('0x53')](function(_0x3b8d13){console[_0x15d0('0x27')]('Could\x20not\x20remove\x20attachment\x20file',_0x4868fa,_0x3b8d13);});}});};exports[_0x15d0('0xf3')]=function(_0x1a5052,_0x2335e3,_0x5830cc){return db[_0x15d0('0xb6')]['find']({'where':{'id':_0x1a5052[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x2335e3,null))[_0x15d0('0x21')](function(_0x4c38fd){if(_0x4c38fd){return _0x4c38fd[_0x15d0('0xf3')](_0x1a5052[_0x15d0('0x59')][_0x15d0('0x6a')],_[_0x15d0('0xf4')](_0x1a5052[_0x15d0('0x59')],[_0x15d0('0x6a'),'id'])||{});}})[_0x15d0('0x21')](respondWithResult(_0x2335e3,null))['catch'](handleError(_0x2335e3,null));};exports[_0x15d0('0xf5')]=function(_0x4463d4,_0x30657b,_0xde8992){var _0x1fb215={'raw':![],'where':{}};var _0x5035bd={};var _0x5f2d09={'count':0x0,'rows':[]};return db[_0x15d0('0x3f')][_0x15d0('0x6c')]({'where':{'id':_0x4463d4[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x30657b,null))[_0x15d0('0x21')](function(_0x5bbb5a){if(_0x5bbb5a){_0x5035bd[_0x15d0('0x42')]=_[_0x15d0('0x43')](db[_0x15d0('0xb6')]['rawAttributes']);_0x5035bd[_0x15d0('0x44')]=_[_0x15d0('0x43')](_0x4463d4[_0x15d0('0x44')]);_0x5035bd[_0x15d0('0x45')]=_[_0x15d0('0x46')](_0x5035bd[_0x15d0('0x42')],_0x5035bd[_0x15d0('0x44')]);_0x1fb215[_0x15d0('0x47')]=_['intersection'](_0x5035bd[_0x15d0('0x42')],qs['fields'](_0x4463d4[_0x15d0('0x44')][_0x15d0('0x48')]));_0x1fb215[_0x15d0('0x47')]=_0x1fb215[_0x15d0('0x47')]['length']?_0x1fb215['attributes']:_0x5035bd[_0x15d0('0x42')];if(!_0x4463d4[_0x15d0('0x44')][_0x15d0('0x65')](_0x15d0('0x66'))){_0x1fb215[_0x15d0('0x2e')]=qs[_0x15d0('0x2e')](_0x4463d4[_0x15d0('0x44')][_0x15d0('0x2e')]);_0x1fb215[_0x15d0('0x2c')]=qs[_0x15d0('0x2c')](_0x4463d4['query'][_0x15d0('0x2c')]);}_0x1fb215[_0x15d0('0x49')]=qs[_0x15d0('0x4a')](_0x4463d4[_0x15d0('0x44')][_0x15d0('0x4a')]);_0x1fb215[_0x15d0('0x4b')]=qs[_0x15d0('0x45')](_[_0x15d0('0x67')](_0x4463d4[_0x15d0('0x44')],_0x5035bd['filters']));_0x1fb215[_0x15d0('0x4b')][_0x15d0('0x62')]=_0x5bbb5a['id'];if(_0x4463d4[_0x15d0('0x44')][_0x15d0('0x4c')]){_0x1fb215[_0x15d0('0x4b')]=_[_0x15d0('0x4d')](_0x1fb215['where'],{'$or':_['map'](_0x1fb215['attributes'],function(_0x307603){var _0x3c7b7d={};_0x3c7b7d[_0x307603]={'$like':'%'+_0x4463d4[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x3c7b7d;})});}_0x1fb215=_[_0x15d0('0x4d')]({},_0x1fb215,_0x4463d4[_0x15d0('0x68')]);return db[_0x15d0('0xb6')][_0x15d0('0x2f')]({'where':_0x1fb215['where']})[_0x15d0('0x21')](function(_0x57b066){_0x5f2d09[_0x15d0('0x2f')]=_0x57b066;if(_0x4463d4['query'][_0x15d0('0x4f')]){_0x1fb215[_0x15d0('0x50')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x15d0('0xc4')],'as':'Owner','attributes':[_0x15d0('0x3b'),_0x15d0('0xf6'),_0x15d0('0xf7')],'required':![]},{'model':db[_0x15d0('0xf8')],'as':_0x15d0('0xf9'),'attributes':['id','name',_0x15d0('0xfa')],'where':_0x4463d4['query'][_0x15d0('0xfb')]?{'id':_0x4463d4['query'][_0x15d0('0xfb')]}:undefined,'required':_0x4463d4[_0x15d0('0x44')][_0x15d0('0xfb')]?!![]:![]}];}return db['ChatInteraction'][_0x15d0('0x51')](_0x1fb215);})[_0x15d0('0x21')](function(_0x2a2349){_0x5f2d09['rows']=_0x2a2349;return _0x5f2d09;});}})[_0x15d0('0x21')](respondWithFilteredResult(_0x30657b,_0x1fb215))[_0x15d0('0x53')](handleError(_0x30657b,null));};function iftimePromise(_0x5ddc52,_0x2188ee){return respondWithRpcPromise(_0x15d0('0xfc'),_0x15d0('0xfd'),{'command':_0x2188ee[_0x15d0('0xfe')]?util['format'](_0x15d0('0xff'),_0x5ddc52[_0x15d0('0x100')],_0x2188ee[_0x15d0('0xfe')]):util['format'](_0x15d0('0x101'),_0x5ddc52[_0x15d0('0x100')])},client9002)['then'](function(_0x47dbf9){var _0x4c63c5=_0x47dbf9&&_0x47dbf9[_0x15d0('0x102')](_0x15d0('0x103'))>=0x0?!![]:![];logger[_0x15d0('0x22')](_0x15d0('0x104'),_0x2188ee['id'],_0x5ddc52['id'],_0x5ddc52[_0x15d0('0x100')],_0x4c63c5?_0x15d0('0x105'):_0x15d0('0x106'),_0x2188ee[_0x15d0('0xfe')]?_0x2188ee[_0x15d0('0xfe')]:'No\x20timezone');return _0x4c63c5;})[_0x15d0('0x53')](function(_0x4037e6){logger[_0x15d0('0x27')](_0x15d0('0x104'),_0x2188ee['id'],_0x5ddc52['id'],_0x5ddc52['interval'],util['inspect'](_0x4037e6,{'showHidden':![],'depth':null}),_0x2188ee[_0x15d0('0xfe')]?_0x2188ee[_0x15d0('0xfe')]:_0x15d0('0x107'));return![];});}exports[_0x15d0('0xfd')]=function(_0x3178cc,_0x35379f,_0x309970){var _0x55415c=0x0;var _0x1cbdee=0x0;var _0x17e5c2=![];var _0x2f78bd;var _0x482976;return db[_0x15d0('0x3f')][_0x15d0('0x5d')]({'where':{'id':_0x3178cc['params']['id']},'include':[{'model':db[_0x15d0('0x108')],'as':_0x15d0('0x108'),'include':[{'model':db[_0x15d0('0x108')],'as':'Intervals','attributes':['id',_0x15d0('0x100')],'raw':!![]}]}]})[_0x15d0('0x21')](handleEntityNotFound(_0x35379f,null))[_0x15d0('0x21')](function(_0x5e0fef){if(_0x5e0fef){_0x2f78bd=_0x5e0fef;return _0x5e0fef[_0x15d0('0x109')]({'raw':!![]});}})['then'](function(_0x1e6416){if(_0x2f78bd){if(_0x1e6416){_0x482976=_0x1e6416;}}return require(_0x15d0('0x17'))['getLicense']();})[_0x15d0('0x21')](function(_0x467803){if(_0x467803){_0x1cbdee=_0x467803[_0x15d0('0x10a')];_0x17e5c2=_0x467803[_0x15d0('0x79')];}})[_0x15d0('0x21')](function(){return db[_0x15d0('0xb6')][_0x15d0('0x2f')]({'where':{'closed':![]}});})[_0x15d0('0x21')](function(_0x232ea7){_0x55415c=_0x232ea7;if(_0x1cbdee&&_0x232ea7>_0x1cbdee){return db[_0x15d0('0x10b')][_0x15d0('0x6c')]({'where':{'id':0x1}})[_0x15d0('0x21')](function(_0x5ebe21){if(_0x5ebe21){_0x5ebe21[_0x15d0('0x10c')](_0x15d0('0x10d'));}});}})[_0x15d0('0x21')](function(){if(_0x2f78bd[_0x15d0('0x108')]&&_0x2f78bd[_0x15d0('0x108')]['Intervals']){var _0x32843d=[];for(var _0xc8f1ab=0x0;_0xc8f1ab<_0x2f78bd[_0x15d0('0x108')]['Intervals'][_0x15d0('0x57')];_0xc8f1ab++){var _0x265c3f=_0x2f78bd['Interval'][_0x15d0('0x10e')][_0xc8f1ab][_0x15d0('0x36')]({'plain':!![]});_0x32843d[_0x15d0('0xbe')](iftimePromise(_0x265c3f,_0x2f78bd));}return BPromise[_0x15d0('0x10f')](_0x32843d)[_0x15d0('0x21')](function(_0x170347){return _[_0x15d0('0x110')](_0x170347);});}else{return!![];}})['then'](function(_0x30a499){var _0x5f636f=fs[_0x15d0('0xcf')](path[_0x15d0('0x75')](config[_0x15d0('0x76')],_0x15d0('0x111')),_0x15d0('0xd1'));var _0x3180cb={'remote':_0x2f78bd[_0x15d0('0x112')],'query':querystring['stringify'](_[_0x15d0('0x4d')](_0x2f78bd[_0x15d0('0x36')]({'plain':!![]}),{'customerIp':_0x3178cc['headers'][_0x15d0('0xa7')]||_0x3178cc['headers'][_0x15d0('0x113')]||_0x3178cc[_0x15d0('0x114')][_0x15d0('0x115')]||_0x3178cc['ip'],'referer':_0x3178cc['headers'][_0x15d0('0xac')],'openedInteractions':_0x55415c,'maxInteractions':_0x1cbdee,'virtual':_0x17e5c2[_0x15d0('0x10a')],'online':_0x30a499,'custom':_0x17e5c2}))['replace'](/'/g,'\x5c\x27')};_0x35379f['send'](ejs[_0x15d0('0xd2')](Mustache[_0x15d0('0xd2')](_0x5f636f,_0x3180cb),{'proactiveActions':_0x482976,'alignment':_0x2f78bd[_0x15d0('0x116')],'verticalAlignment':_0x2f78bd[_0x15d0('0x117')],'div_color':_0x2f78bd[_0x15d0('0xfa')],'text_color':_0x2f78bd['textColor'],'button_color':_0x2f78bd[_0x15d0('0x118')],'background_color':_0x2f78bd[_0x15d0('0x119')]}));})[_0x15d0('0x53')](handleError(_0x35379f,null));};exports[_0x15d0('0x11a')]=function(_0x37751b,_0x2ae257,_0xb53e12){return db[_0x15d0('0x3f')][_0x15d0('0x6c')]({'where':{'id':_0x37751b[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x2ae257,null))[_0x15d0('0x21')](function(_0xff4848){if(_0xff4848){return db['sequelize'][_0x15d0('0xdd')](function(_0x5eb2f0){return db[_0x15d0('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x37751b[_0x15d0('0x55')]['id']},'transaction':_0x5eb2f0})[_0x15d0('0x21')](function(_0x85046b){var _0x34157a=_[_0x15d0('0x3e')](_0x37751b[_0x15d0('0x59')],function(_0x2b6909){_0x2b6909['ChatWebsiteId']=_0x37751b[_0x15d0('0x55')]['id'];return _0x2b6909;});return db[_0x15d0('0x9c')][_0x15d0('0xdf')](_0x34157a,{'transaction':_0x5eb2f0});});})['then'](function(){return db[_0x15d0('0x9c')][_0x15d0('0x11b')]({'where':{'ChatWebsiteId':_0x37751b[_0x15d0('0x55')]['id']},'order':_0x15d0('0xa1')});});}})[_0x15d0('0x21')](respondWithResult(_0x2ae257,null))[_0x15d0('0x53')](handleError(_0x2ae257,null));};exports['getApplications']=function(_0x48d78e,_0x297541,_0x55bd99){var _0x7c8b66={};var _0x5ef14c={};var _0x16a8e4;var _0x221aa2;return db[_0x15d0('0x3f')][_0x15d0('0x6c')]({'where':{'id':_0x48d78e[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x297541,null))[_0x15d0('0x21')](function(_0x3eec07){if(_0x3eec07){_0x16a8e4=_0x3eec07;_0x5ef14c['model']=_[_0x15d0('0x43')](db[_0x15d0('0x9c')][_0x15d0('0x40')]);_0x5ef14c[_0x15d0('0x44')]=_[_0x15d0('0x43')](_0x48d78e['query']);_0x5ef14c[_0x15d0('0x45')]=_[_0x15d0('0x46')](_0x5ef14c[_0x15d0('0x42')],_0x5ef14c[_0x15d0('0x44')]);_0x7c8b66['attributes']=_[_0x15d0('0x46')](_0x5ef14c[_0x15d0('0x42')],qs[_0x15d0('0x48')](_0x48d78e[_0x15d0('0x44')]['fields']));_0x7c8b66[_0x15d0('0x47')]=_0x7c8b66[_0x15d0('0x47')][_0x15d0('0x57')]?_0x7c8b66['attributes']:_0x5ef14c['model'];_0x7c8b66[_0x15d0('0x49')]=qs[_0x15d0('0x4a')](_0x48d78e[_0x15d0('0x44')][_0x15d0('0x4a')]);_0x7c8b66[_0x15d0('0x4b')]=qs[_0x15d0('0x45')](_[_0x15d0('0x67')](_0x48d78e['query'],_0x5ef14c[_0x15d0('0x45')]));if(_0x48d78e[_0x15d0('0x44')]['filter']){_0x7c8b66['where']=_[_0x15d0('0x4d')](_0x7c8b66[_0x15d0('0x4b')],{'$or':_[_0x15d0('0x3e')](_0x7c8b66[_0x15d0('0x47')],function(_0x519b82){var _0x4ff612={};_0x4ff612[_0x519b82]={'$like':'%'+_0x48d78e[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x4ff612;})});}_0x7c8b66=_['merge']({},_0x7c8b66,_0x48d78e[_0x15d0('0x68')]);return _0x16a8e4[_0x15d0('0x11c')](_0x7c8b66);}})[_0x15d0('0x21')](function(_0x530454){if(_0x530454){_0x221aa2=_0x530454[_0x15d0('0x57')];if(!_0x48d78e[_0x15d0('0x44')][_0x15d0('0x65')](_0x15d0('0x66'))){_0x7c8b66[_0x15d0('0x2e')]=qs['limit'](_0x48d78e[_0x15d0('0x44')][_0x15d0('0x2e')]);_0x7c8b66[_0x15d0('0x2c')]=qs[_0x15d0('0x2c')](_0x48d78e[_0x15d0('0x44')][_0x15d0('0x2c')]);}return _0x16a8e4[_0x15d0('0x11c')](_0x7c8b66);}})['then'](function(_0x209425){if(_0x209425){return _0x209425?{'count':_0x221aa2,'rows':_0x209425}:null;}})[_0x15d0('0x21')](respondWithResult(_0x297541,null))['catch'](handleError(_0x297541,null));};exports[_0x15d0('0x11d')]=function(_0x389f19,_0x1cefd2,_0x4f0ee6){return db['chatProactiveAction'][_0x15d0('0x5d')]({'where':{'id':_0x389f19[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x1cefd2,null))[_0x15d0('0x21')](function(_0x4672e5){if(_0x4672e5){return _0x4672e5[_0x15d0('0x11d')](_0x389f19[_0x15d0('0x59')][_0x15d0('0x6a')],_['omit'](_0x389f19[_0x15d0('0x59')],['ids','id'])||{});}})[_0x15d0('0x21')](respondWithResult(_0x1cefd2,null))[_0x15d0('0x53')](handleError(_0x1cefd2,null));};exports[_0x15d0('0x109')]=function(_0x303e92,_0xf622a9,_0x4b5605){var _0x2baec5={};var _0x11fd17={};var _0xf21fb;var _0x56f859;return db[_0x15d0('0x3f')][_0x15d0('0x6c')]({'where':{'id':_0x303e92['params']['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0xf622a9,null))[_0x15d0('0x21')](function(_0x23a3c8){if(_0x23a3c8){_0xf21fb=_0x23a3c8;_0x11fd17[_0x15d0('0x42')]=_[_0x15d0('0x43')](db[_0x15d0('0x11e')][_0x15d0('0x40')]);_0x11fd17['query']=_['keys'](_0x303e92[_0x15d0('0x44')]);_0x11fd17['filters']=_[_0x15d0('0x46')](_0x11fd17[_0x15d0('0x42')],_0x11fd17['query']);_0x2baec5[_0x15d0('0x47')]=_[_0x15d0('0x46')](_0x11fd17[_0x15d0('0x42')],qs['fields'](_0x303e92[_0x15d0('0x44')][_0x15d0('0x48')]));_0x2baec5[_0x15d0('0x47')]=_0x2baec5['attributes'][_0x15d0('0x57')]?_0x2baec5[_0x15d0('0x47')]:_0x11fd17[_0x15d0('0x42')];_0x2baec5[_0x15d0('0x49')]=qs['sort'](_0x303e92[_0x15d0('0x44')][_0x15d0('0x4a')]);_0x2baec5['where']=qs[_0x15d0('0x45')](_[_0x15d0('0x67')](_0x303e92[_0x15d0('0x44')],_0x11fd17[_0x15d0('0x45')]));if(_0x303e92[_0x15d0('0x44')]['filter']){_0x2baec5[_0x15d0('0x4b')]=_[_0x15d0('0x4d')](_0x2baec5[_0x15d0('0x4b')],{'$or':_[_0x15d0('0x3e')](_0x2baec5[_0x15d0('0x47')],function(_0xdd1db3){var _0x12810b={};_0x12810b[_0xdd1db3]={'$like':'%'+_0x303e92[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x12810b;})});}_0x2baec5=_[_0x15d0('0x4d')]({},_0x2baec5,_0x303e92[_0x15d0('0x68')]);return _0xf21fb[_0x15d0('0x109')](_0x2baec5);}})[_0x15d0('0x21')](function(_0x11438f){if(_0x11438f){_0x56f859=_0x11438f[_0x15d0('0x57')];if(!_0x303e92[_0x15d0('0x44')][_0x15d0('0x65')](_0x15d0('0x66'))){_0x2baec5[_0x15d0('0x2e')]=qs[_0x15d0('0x2e')](_0x303e92[_0x15d0('0x44')][_0x15d0('0x2e')]);_0x2baec5['offset']=qs[_0x15d0('0x2c')](_0x303e92[_0x15d0('0x44')]['offset']);}return _0xf21fb[_0x15d0('0x109')](_0x2baec5);}})['then'](function(_0x366684){if(_0x366684){return _0x366684?{'count':_0x56f859,'rows':_0x366684}:null;}})[_0x15d0('0x21')](respondWithResult(_0xf622a9,null))[_0x15d0('0x53')](handleError(_0xf622a9,null));};exports[_0x15d0('0x11f')]=function(_0xe5df5c,_0x286ecc,_0x4e796c){var _0x2d8875=_0xe5df5c[_0x15d0('0x44')][_0x15d0('0x120')]==='false'?_0x15d0('0x121'):_0x15d0('0x122');return db['ChatWebsite'][_0x15d0('0x5d')]({'attributes':['id',_0x2d8875],'where':{'id':_0xe5df5c['params']['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x286ecc,null))['then'](function(_0x2564d7){if(_0x2564d7){var _0x4b4da3=_0x2564d7[_0x2d8875];var _0x20643f=_0x4b4da3&&_0x4b4da3[_0x15d0('0x123')]?_0x4b4da3['items']:[];_0x286ecc[_0x15d0('0x3c')]({'fromKey':_['isNil'](_0x4b4da3[_0x15d0('0x124')])?undefined:_0x4b4da3[_0x15d0('0x124')],'count':_0x20643f[_0x15d0('0x57')],'rows':_0x20643f});}})[_0x15d0('0x53')](handleError(_0x286ecc,null));};exports[_0x15d0('0x125')]=function(_0x2db774,_0x337a74,_0x11767a){var _0x392605={'raw':![],'where':{}};var _0x326c35={};var _0x2ab443={'count':0x0,'rows':[]};return db[_0x15d0('0x3f')][_0x15d0('0x6c')]({'where':{'id':_0x2db774[_0x15d0('0x55')]['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x337a74,null))[_0x15d0('0x21')](function(_0x19c1cd){if(_0x19c1cd){_0x326c35[_0x15d0('0x42')]=_[_0x15d0('0x43')](db[_0x15d0('0x126')][_0x15d0('0x40')]);_0x326c35[_0x15d0('0x44')]=_['keys'](_0x2db774['query']);_0x326c35['filters']=_[_0x15d0('0x46')](_0x326c35['model'],_0x326c35['query']);_0x392605[_0x15d0('0x47')]=_[_0x15d0('0x46')](_0x326c35[_0x15d0('0x42')],qs[_0x15d0('0x48')](_0x2db774[_0x15d0('0x44')][_0x15d0('0x48')]));_0x392605[_0x15d0('0x47')]=_0x392605[_0x15d0('0x47')]['length']?_0x392605[_0x15d0('0x47')]:_0x326c35[_0x15d0('0x42')];if(!_0x2db774[_0x15d0('0x44')][_0x15d0('0x65')](_0x15d0('0x66'))){_0x392605[_0x15d0('0x2e')]=qs[_0x15d0('0x2e')](_0x2db774['query'][_0x15d0('0x2e')]);_0x392605[_0x15d0('0x2c')]=qs[_0x15d0('0x2c')](_0x2db774[_0x15d0('0x44')][_0x15d0('0x2c')]);}_0x392605[_0x15d0('0x49')]=qs[_0x15d0('0x4a')](_0x2db774[_0x15d0('0x44')]['sort']);_0x392605[_0x15d0('0x4b')]=qs[_0x15d0('0x45')](_['pick'](_0x2db774[_0x15d0('0x44')],_0x326c35[_0x15d0('0x45')]));_0x392605[_0x15d0('0x4b')][_0x15d0('0x62')]=_0x19c1cd['id'];if(_0x2db774[_0x15d0('0x44')][_0x15d0('0x4c')]){_0x392605['where']=_[_0x15d0('0x4d')](_0x392605[_0x15d0('0x4b')],{'$or':_[_0x15d0('0x3e')](_0x392605[_0x15d0('0x47')],function(_0x4b2092){var _0x1303e8={};_0x1303e8[_0x4b2092]={'$like':'%'+_0x2db774[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x1303e8;})});}_0x392605=_[_0x15d0('0x4d')]({},_0x392605,_0x2db774['options']);return db['ChatOfflineMessage'][_0x15d0('0x2f')]({'where':_0x392605[_0x15d0('0x4b')]})[_0x15d0('0x21')](function(_0xe119e1){_0x2ab443[_0x15d0('0x2f')]=_0xe119e1;if(_0x2db774[_0x15d0('0x44')]['includeAll']){_0x392605[_0x15d0('0x50')]=[{'all':!![]}];}else{_0x392605[_0x15d0('0x50')]=[{'model':db[_0x15d0('0x8a')],'as':_0x15d0('0x127'),'required':![]},{'model':db[_0x15d0('0xde')],'as':_0x15d0('0x128'),'required':![]}];}return db['ChatOfflineMessage'][_0x15d0('0x51')](_0x392605);})[_0x15d0('0x21')](function(_0x556c98){_0x2ab443[_0x15d0('0x52')]=_0x556c98;return _0x2ab443;});}})[_0x15d0('0x21')](respondWithFilteredResult(_0x337a74,_0x392605))['catch'](handleError(_0x337a74,null));};exports['addAgents']=function(_0x5ac754,_0x5985e2,_0x4ed6e2){return db[_0x15d0('0x3f')]['find']({'where':{'id':_0x5ac754[_0x15d0('0x55')]['id']}})['then'](handleEntityNotFound(_0x5985e2,null))[_0x15d0('0x21')](function(_0x4ba6ec){if(_0x4ba6ec){return _0x4ba6ec[_0x15d0('0x129')](_0x5ac754[_0x15d0('0x59')]['ids'],_[_0x15d0('0xf4')](_0x5ac754[_0x15d0('0x59')],[_0x15d0('0x6a'),'id'])||{})[_0x15d0('0xba')](function(_0x58756e){for(var _0x8cb3d=0x0;_0x8cb3d<_0x5ac754[_0x15d0('0x59')][_0x15d0('0x6a')][_0x15d0('0x57')];_0x8cb3d+=0x1){socket[_0x15d0('0x12a')]('userChatWebsite:save',{'UserId':Number(_0x5ac754[_0x15d0('0x59')]['ids'][_0x8cb3d]),'ChatWebsiteId':Number(_0x5ac754[_0x15d0('0x55')]['id'])});}return _0x58756e;});}})[_0x15d0('0x21')](respondWithResult(_0x5985e2,null))[_0x15d0('0x53')](handleError(_0x5985e2,null));};exports[_0x15d0('0x12b')]=function(_0x4d2c3b,_0xf2260e,_0x2de0f7){return db[_0x15d0('0x3f')]['find']({'where':{'id':_0x4d2c3b['params']['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0xf2260e,null))['then'](function(_0xa533c4){if(_0xa533c4){return _0xa533c4['removeAgents'](_0x4d2c3b[_0x15d0('0x44')][_0x15d0('0x6a')])[_0x15d0('0x21')](function(){if(_[_0x15d0('0x12c')](_0x4d2c3b['query']['ids'])){for(var _0x49195f=0x0;_0x49195f<_0x4d2c3b[_0x15d0('0x44')]['ids'][_0x15d0('0x57')];_0x49195f+=0x1){socket[_0x15d0('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x4d2c3b[_0x15d0('0x44')][_0x15d0('0x6a')][_0x49195f]),'ChatWebsiteId':Number(_0x4d2c3b['params']['id'])});}}else{socket[_0x15d0('0x12a')](_0x15d0('0x12d'),{'UserId':Number(_0x4d2c3b['query']['ids']),'ChatWebsiteId':Number(_0x4d2c3b[_0x15d0('0x55')]['id'])});}});}})[_0x15d0('0x21')](respondWithStatusCode(_0xf2260e,null))[_0x15d0('0x53')](handleError(_0xf2260e,null));};exports[_0x15d0('0x12e')]=function(_0x53e72c,_0x3b222f,_0x46b1fe){var _0x480111={};var _0x423d7a={};var _0x187a7f;var _0x1e290b;return db[_0x15d0('0x3f')][_0x15d0('0x6c')]({'where':{'id':_0x53e72c['params']['id']}})[_0x15d0('0x21')](handleEntityNotFound(_0x3b222f,null))[_0x15d0('0x21')](function(_0x1c4930){if(_0x1c4930){_0x187a7f=_0x1c4930;_0x423d7a['model']=_['keys'](db[_0x15d0('0xc4')]['rawAttributes']);_0x423d7a[_0x15d0('0x44')]=_['keys'](_0x53e72c[_0x15d0('0x44')]);_0x423d7a[_0x15d0('0x45')]=_['intersection'](_0x423d7a['model'],_0x423d7a['query']);_0x480111[_0x15d0('0x47')]=_[_0x15d0('0x46')](_0x423d7a['model'],qs[_0x15d0('0x48')](_0x53e72c[_0x15d0('0x44')][_0x15d0('0x48')]));_0x480111[_0x15d0('0x47')]=_0x480111[_0x15d0('0x47')]['length']?_0x480111[_0x15d0('0x47')]:_0x423d7a[_0x15d0('0x42')];_0x480111[_0x15d0('0x49')]=qs[_0x15d0('0x4a')](_0x53e72c[_0x15d0('0x44')][_0x15d0('0x4a')]);_0x480111[_0x15d0('0x4b')]=qs['filters'](_[_0x15d0('0x67')](_0x53e72c[_0x15d0('0x44')],_0x423d7a[_0x15d0('0x45')]));if(_0x53e72c[_0x15d0('0x44')][_0x15d0('0x4c')]){_0x480111[_0x15d0('0x4b')]=_[_0x15d0('0x4d')](_0x480111[_0x15d0('0x4b')],{'$or':_[_0x15d0('0x3e')](_0x480111[_0x15d0('0x47')],function(_0x487626){var _0x2d05b1={};_0x2d05b1[_0x487626]={'$like':'%'+_0x53e72c[_0x15d0('0x44')][_0x15d0('0x4c')]+'%'};return _0x2d05b1;})});}_0x480111=_[_0x15d0('0x4d')]({},_0x480111,_0x53e72c[_0x15d0('0x68')]);return _0x187a7f[_0x15d0('0x12e')](_0x480111);}})[_0x15d0('0x21')](function(_0x208a95){if(_0x208a95){_0x1e290b=_0x208a95[_0x15d0('0x57')];if(!_0x53e72c[_0x15d0('0x44')][_0x15d0('0x65')](_0x15d0('0x66'))){_0x480111[_0x15d0('0x2e')]=qs['limit'](_0x53e72c[_0x15d0('0x44')][_0x15d0('0x2e')]);_0x480111[_0x15d0('0x2c')]=qs[_0x15d0('0x2c')](_0x53e72c[_0x15d0('0x44')]['offset']);}return _0x187a7f[_0x15d0('0x12e')](_0x480111);}})[_0x15d0('0x21')](function(_0x5434f0){if(_0x5434f0){return _0x5434f0?{'count':_0x1e290b,'rows':_0x5434f0}:null;}})['then'](respondWithResult(_0x3b222f,null))[_0x15d0('0x53')](handleError(_0x3b222f,null));};
\ No newline at end of file
+var _0xbf20=['from','CmList','List','DESC','ChatApplication','Applications','account','applications','orderBy','priority','Contacts','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','Smtp','forwardOffline','forwardOfflineAddress','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','toPairsIn','email','NotifyMailAccount','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','timezone','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','verticalAlignment','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','offset','undefined','count','limit','json','save','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','Pause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatWebsite','includeAll','findAll','params','mandatoryDispositionPause','length','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','download','customerAvatar','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey'];(function(_0x410afc,_0x5b751d){var _0x2a18b5=function(_0x1b350e){while(--_0x1b350e){_0x410afc['push'](_0x410afc['shift']());}};_0x2a18b5(++_0x5b751d);}(_0xbf20,0x90));var _0x0bf2=function(_0x3e6f49,_0x350a4f){_0x3e6f49=_0x3e6f49-0x0;var _0x5aac64=_0xbf20[_0x3e6f49];return _0x5aac64;};'use strict';var emlformat=require(_0x0bf2('0x0'));var rimraf=require(_0x0bf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bf2('0x2'));var rp=require(_0x0bf2('0x3'));var moment=require(_0x0bf2('0x4'));var BPromise=require(_0x0bf2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0bf2('0x6'));var csv=require(_0x0bf2('0x7'));var ejs=require(_0x0bf2('0x8'));var fs=require('fs');var fs_extra=require(_0x0bf2('0x9'));var _=require(_0x0bf2('0xa'));var squel=require(_0x0bf2('0xb'));var crypto=require(_0x0bf2('0xc'));var jsforce=require(_0x0bf2('0xd'));var deskjs=require(_0x0bf2('0xe'));var toCsv=require(_0x0bf2('0x7'));var querystring=require(_0x0bf2('0xf'));var Papa=require(_0x0bf2('0x10'));var Redis=require('ioredis');var authService=require(_0x0bf2('0x11'));var qs=require(_0x0bf2('0x12'));var as=require(_0x0bf2('0x13'));var hardwareService=require(_0x0bf2('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x0bf2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0bf2('0x16'))['db'];config[_0x0bf2('0x17')]=_['defaults'](config[_0x0bf2('0x17')],{'host':_0x0bf2('0x18'),'port':0x18eb});var socket=require(_0x0bf2('0x19'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0bf2('0x1a')](socket);var jayson=require(_0x0bf2('0x1b'));var client=jayson[_0x0bf2('0x1c')][_0x0bf2('0x1d')]({'port':0x232c});var client9002=jayson[_0x0bf2('0x1c')][_0x0bf2('0x1d')]({'port':0x232a});var client9003=jayson[_0x0bf2('0x1c')][_0x0bf2('0x1d')]({'port':0x232b});var client9001=jayson[_0x0bf2('0x1c')][_0x0bf2('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x3eb635,_0x4701ac,_0x31dd52,_0x57d2aa){return new BPromise(function(_0x30e8f1,_0x379b2e){var _0x1dfad0=_0x57d2aa||client;return _0x1dfad0[_0x0bf2('0x1e')](_0x3eb635,_0x31dd52)[_0x0bf2('0x1f')](function(_0x6e7c9c){logger['info'](_0x0bf2('0x20'),_0x4701ac,_0x0bf2('0x21'));logger[_0x0bf2('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4701ac,_0x0bf2('0x21'),JSON[_0x0bf2('0x23')](_0x6e7c9c));if(_0x6e7c9c[_0x0bf2('0x24')]){if(_0x6e7c9c[_0x0bf2('0x24')][_0x0bf2('0x25')]===0x1f4){logger[_0x0bf2('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x4701ac,_0x6e7c9c[_0x0bf2('0x24')][_0x0bf2('0x26')]);return _0x379b2e(_0x6e7c9c[_0x0bf2('0x24')][_0x0bf2('0x26')]);}logger[_0x0bf2('0x24')](_0x0bf2('0x20'),_0x4701ac,_0x6e7c9c[_0x0bf2('0x24')]['message']);return _0x30e8f1(_0x6e7c9c[_0x0bf2('0x24')]['message']);}else{logger[_0x0bf2('0x27')](_0x0bf2('0x20'),_0x4701ac,'request\x20sent');_0x30e8f1(_0x6e7c9c[_0x0bf2('0x28')][_0x0bf2('0x26')]);}})[_0x0bf2('0x29')](function(_0x18bd95){logger[_0x0bf2('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x4701ac,_0x18bd95);_0x379b2e(_0x18bd95);});});}function respondWithStatusCode(_0x558496,_0x358801){_0x358801=_0x358801||0xcc;return function(_0x3ea8bf){if(_0x3ea8bf){return _0x558496[_0x0bf2('0x2a')](_0x358801);}return _0x558496['status'](_0x358801)[_0x0bf2('0x2b')]();};}function respondWithResult(_0x48bb18,_0x394488){_0x394488=_0x394488||0xc8;return function(_0xcb39d1){if(_0xcb39d1){return _0x48bb18[_0x0bf2('0x2c')](_0x394488)['json'](_0xcb39d1);}};}function respondWithFilteredResult(_0x8ff2ec,_0x21f1b6){return function(_0xeb1478){if(_0xeb1478){var _0x5686e7=typeof _0x21f1b6[_0x0bf2('0x2d')]===_0x0bf2('0x2e')&&typeof _0x21f1b6['limit']===_0x0bf2('0x2e');var _0x22d62b=_0xeb1478['count'];var _0x429757=_0x5686e7?0x0:_0x21f1b6['offset'];var _0xbcf66e=_0x5686e7?_0xeb1478[_0x0bf2('0x2f')]:_0x21f1b6[_0x0bf2('0x2d')]+_0x21f1b6[_0x0bf2('0x30')];var _0x3825a6;if(_0xbcf66e>=_0x22d62b){_0xbcf66e=_0x22d62b;_0x3825a6=0xc8;}else{_0x3825a6=0xce;}_0x8ff2ec[_0x0bf2('0x2c')](_0x3825a6);return _0x8ff2ec['set']('Content-Range',_0x429757+'-'+_0xbcf66e+'/'+_0x22d62b)[_0x0bf2('0x31')](_0xeb1478);}return null;};}function patchUpdates(_0x1dbb09){return function(_0x21496f){try{jsonpatch['apply'](_0x21496f,_0x1dbb09,!![]);}catch(_0x8a9b39){return BPromise['reject'](_0x8a9b39);}return _0x21496f[_0x0bf2('0x32')]();};}function saveUpdates(_0x4b3b1e,_0x26cdf6){return function(_0x2f6332){if(_0x2f6332){return _0x2f6332['update'](_0x4b3b1e)[_0x0bf2('0x1f')](function(_0x550bfe){return _0x550bfe;});}return null;};}function removeEntity(_0x2cee48,_0x10c372){return function(_0x261017){if(_0x261017){return _0x261017['destroy']()[_0x0bf2('0x1f')](function(){var _0x5d9765=_0x261017[_0x0bf2('0x33')]({'plain':!![]});var _0x47d2a3=_0x0bf2('0x34');return db[_0x0bf2('0x35')][_0x0bf2('0x36')]({'where':{'type':_0x47d2a3,'resourceId':_0x5d9765['id']}})[_0x0bf2('0x1f')](function(){return _0x261017;});})[_0x0bf2('0x1f')](function(){_0x2cee48[_0x0bf2('0x2c')](0xcc)[_0x0bf2('0x2b')]();});}};}function handleEntityNotFound(_0x40f4b8,_0xdcbee9){return function(_0x480dba){if(!_0x480dba){_0x40f4b8[_0x0bf2('0x2a')](0x194);}return _0x480dba;};}function handleError(_0x98eb7,_0x40b7f0){_0x40b7f0=_0x40b7f0||0x1f4;return function(_0x17bad5){logger[_0x0bf2('0x24')](_0x17bad5[_0x0bf2('0x37')]);if(_0x17bad5[_0x0bf2('0x38')]){delete _0x17bad5[_0x0bf2('0x38')];}_0x98eb7['status'](_0x40b7f0)[_0x0bf2('0x39')](_0x17bad5);};}exports['index']=function(_0x305e8b,_0x4d0c76){var _0x362c0d={'include':[{'model':db[_0x0bf2('0x3a')],'as':'mandatoryDispositionPause'}]},_0x6a1902={},_0x2e2517={'count':0x0,'rows':[]};var _0x5ac1b1=_[_0x0bf2('0x3b')](db['ChatWebsite'][_0x0bf2('0x3c')],function(_0x565dac){return{'name':_0x565dac[_0x0bf2('0x3d')],'type':_0x565dac[_0x0bf2('0x3e')][_0x0bf2('0x3f')]};});_0x6a1902[_0x0bf2('0x40')]=_[_0x0bf2('0x3b')](_0x5ac1b1,'name');_0x6a1902['query']=_[_0x0bf2('0x41')](_0x305e8b[_0x0bf2('0x42')]);_0x6a1902[_0x0bf2('0x43')]=_[_0x0bf2('0x44')](_0x6a1902['model'],_0x6a1902[_0x0bf2('0x42')]);_0x362c0d[_0x0bf2('0x45')]=_[_0x0bf2('0x44')](_0x6a1902[_0x0bf2('0x40')],qs['fields'](_0x305e8b['query'][_0x0bf2('0x46')]));_0x362c0d[_0x0bf2('0x45')]=_0x362c0d[_0x0bf2('0x45')]['length']?_0x362c0d[_0x0bf2('0x45')]:_0x6a1902[_0x0bf2('0x40')];if(!_0x305e8b[_0x0bf2('0x42')][_0x0bf2('0x47')](_0x0bf2('0x48'))){_0x362c0d[_0x0bf2('0x30')]=qs[_0x0bf2('0x30')](_0x305e8b[_0x0bf2('0x42')][_0x0bf2('0x30')]);_0x362c0d['offset']=qs[_0x0bf2('0x2d')](_0x305e8b[_0x0bf2('0x42')][_0x0bf2('0x2d')]);}_0x362c0d[_0x0bf2('0x49')]=qs[_0x0bf2('0x4a')](_0x305e8b['query'][_0x0bf2('0x4a')]);_0x362c0d[_0x0bf2('0x4b')]=qs['filters'](_[_0x0bf2('0x4c')](_0x305e8b[_0x0bf2('0x42')],_0x6a1902['filters']),_0x5ac1b1);if(_0x305e8b[_0x0bf2('0x42')][_0x0bf2('0x4d')]){_0x362c0d[_0x0bf2('0x4b')]=_[_0x0bf2('0x4e')](_0x362c0d[_0x0bf2('0x4b')],{'$or':_[_0x0bf2('0x3b')](_0x5ac1b1,function(_0x471ec9){if(_0x471ec9['type']!=='VIRTUAL'){var _0x253b0c={};_0x253b0c[_0x471ec9['name']]={'$like':'%'+_0x305e8b[_0x0bf2('0x42')][_0x0bf2('0x4d')]+'%'};return _0x253b0c;}})});}_0x362c0d=_[_0x0bf2('0x4e')]({},_0x362c0d,_0x305e8b[_0x0bf2('0x4f')]);var _0x44b719={'where':_0x362c0d['where']};return db[_0x0bf2('0x50')]['count'](_0x44b719)['then'](function(_0x15d724){_0x2e2517[_0x0bf2('0x2f')]=_0x15d724;if(_0x305e8b['query'][_0x0bf2('0x51')]){_0x362c0d['include']=[{'all':!![]}];}return db[_0x0bf2('0x50')][_0x0bf2('0x52')](_0x362c0d);})[_0x0bf2('0x1f')](function(_0x2b2d2d){_0x2e2517['rows']=_0x2b2d2d;return _0x2e2517;})[_0x0bf2('0x1f')](respondWithFilteredResult(_0x4d0c76,_0x362c0d))[_0x0bf2('0x29')](handleError(_0x4d0c76,null));};exports['show']=function(_0x246b0b,_0x539241){var _0x2fb57d={'raw':![],'where':{'id':_0x246b0b[_0x0bf2('0x53')]['id']},'include':[{'model':db[_0x0bf2('0x3a')],'as':_0x0bf2('0x54')}]},_0x2591da={};_0x2591da['model']=_[_0x0bf2('0x41')](db[_0x0bf2('0x50')][_0x0bf2('0x3c')]);_0x2591da[_0x0bf2('0x42')]=_['keys'](_0x246b0b[_0x0bf2('0x42')]);_0x2591da[_0x0bf2('0x43')]=_[_0x0bf2('0x44')](_0x2591da[_0x0bf2('0x40')],_0x2591da['query']);_0x2fb57d[_0x0bf2('0x45')]=_[_0x0bf2('0x44')](_0x2591da['model'],qs[_0x0bf2('0x46')](_0x246b0b[_0x0bf2('0x42')][_0x0bf2('0x46')]));_0x2fb57d[_0x0bf2('0x45')]=_0x2fb57d[_0x0bf2('0x45')][_0x0bf2('0x55')]?_0x2fb57d[_0x0bf2('0x45')]:_0x2591da['model'];if(_0x246b0b[_0x0bf2('0x42')][_0x0bf2('0x51')]){_0x2fb57d[_0x0bf2('0x56')]=[{'all':!![]}];}_0x2fb57d=_[_0x0bf2('0x4e')]({},_0x2fb57d,_0x246b0b['options']);return db[_0x0bf2('0x50')][_0x0bf2('0x57')](_0x2fb57d)['then'](handleEntityNotFound(_0x539241,null))[_0x0bf2('0x1f')](respondWithResult(_0x539241,null))[_0x0bf2('0x29')](handleError(_0x539241,null));};exports[_0x0bf2('0x58')]=function(_0x5e1605,_0x2f8720){return db['ChatWebsite'][_0x0bf2('0x58')](_0x5e1605['body'],{})['then'](function(_0x2f0695){var _0x5d8d6d=_0x5e1605[_0x0bf2('0x59')][_0x0bf2('0x33')]({'plain':!![]});if(!_0x5d8d6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d8d6d[_0x0bf2('0x5a')]===_0x0bf2('0x59')){var _0x588855=_0x2f0695['get']({'plain':!![]});var _0x106aad='ChatWebsites';return db[_0x0bf2('0x5b')]['find']({'where':{'name':_0x106aad,'userProfileId':_0x5d8d6d[_0x0bf2('0x5c')]},'raw':!![]})[_0x0bf2('0x1f')](function(_0x517ef6){if(_0x517ef6&&_0x517ef6[_0x0bf2('0x5d')]===0x0){return db[_0x0bf2('0x35')][_0x0bf2('0x58')]({'name':_0x588855[_0x0bf2('0x38')],'resourceId':_0x588855['id'],'type':_0x517ef6[_0x0bf2('0x38')],'sectionId':_0x517ef6['id']},{})[_0x0bf2('0x1f')](function(){return _0x2f0695;});}else{return _0x2f0695;}})[_0x0bf2('0x29')](function(_0x5e61fc){logger[_0x0bf2('0x24')](_0x0bf2('0x5e'),_0x5e61fc);throw _0x5e61fc;});}return _0x2f0695;})[_0x0bf2('0x1f')](respondWithResult(_0x2f8720,0xc9))[_0x0bf2('0x29')](handleError(_0x2f8720,null));};exports[_0x0bf2('0x5f')]=function(_0x77cc3c,_0x1fea49){if(_0x77cc3c[_0x0bf2('0x60')]['id']){delete _0x77cc3c[_0x0bf2('0x60')]['id'];}return db[_0x0bf2('0x50')]['find']({'where':{'id':_0x77cc3c[_0x0bf2('0x53')]['id']},'include':[{'model':db[_0x0bf2('0x3a')],'as':'mandatoryDispositionPause'}]})[_0x0bf2('0x1f')](handleEntityNotFound(_0x1fea49,null))[_0x0bf2('0x1f')](saveUpdates(_0x77cc3c[_0x0bf2('0x60')],null))[_0x0bf2('0x1f')](respondWithResult(_0x1fea49,null))['catch'](handleError(_0x1fea49,null));};exports['destroy']=function(_0xb13b04,_0xa4d907){return db['ChatWebsite']['find']({'where':{'id':_0xb13b04[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0xa4d907,null))[_0x0bf2('0x1f')](removeEntity(_0xa4d907,null))[_0x0bf2('0x29')](handleError(_0xa4d907,null));};exports[_0x0bf2('0x61')]=function(_0x722b95,_0x30e43c){return db[_0x0bf2('0x50')][_0x0bf2('0x61')]()[_0x0bf2('0x1f')](respondWithResult(_0x30e43c,null))['catch'](handleError(_0x30e43c,null));};exports[_0x0bf2('0x62')]=function(_0x5ca89,_0x821c40,_0x86a048){if(_0x5ca89['body']['id']){delete _0x5ca89[_0x0bf2('0x60')]['id'];}return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'where':{'id':_0x5ca89[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x821c40,null))['then'](function(_0x281b73){if(_0x281b73){_0x5ca89[_0x0bf2('0x60')][_0x0bf2('0x63')]=_0x281b73['id'];return db[_0x0bf2('0x64')][_0x0bf2('0x58')](_0x5ca89['body']);}})['then'](respondWithResult(_0x821c40,null))[_0x0bf2('0x29')](handleError(_0x821c40,null));};exports[_0x0bf2('0x65')]=function(_0x3bf900,_0x798a58,_0xc73e8d){var _0x358f0f={'raw':![],'where':{}};var _0x435ef3={};var _0x4d7f17={'count':0x0,'rows':[]};return db[_0x0bf2('0x50')][_0x0bf2('0x66')]({'where':{'id':_0x3bf900[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x798a58,null))[_0x0bf2('0x1f')](function(_0x3cd5d1){if(_0x3cd5d1){_0x435ef3[_0x0bf2('0x40')]=_[_0x0bf2('0x41')](db[_0x0bf2('0x64')][_0x0bf2('0x3c')]);_0x435ef3[_0x0bf2('0x42')]=_[_0x0bf2('0x41')](_0x3bf900[_0x0bf2('0x42')]);_0x435ef3[_0x0bf2('0x43')]=_['intersection'](_0x435ef3[_0x0bf2('0x40')],_0x435ef3['query']);_0x358f0f[_0x0bf2('0x45')]=_['intersection'](_0x435ef3[_0x0bf2('0x40')],qs[_0x0bf2('0x46')](_0x3bf900[_0x0bf2('0x42')][_0x0bf2('0x46')]));_0x358f0f[_0x0bf2('0x45')]=_0x358f0f[_0x0bf2('0x45')][_0x0bf2('0x55')]?_0x358f0f[_0x0bf2('0x45')]:_0x435ef3[_0x0bf2('0x40')];if(!_0x3bf900[_0x0bf2('0x42')][_0x0bf2('0x47')]('nolimit')){_0x358f0f[_0x0bf2('0x30')]=qs['limit'](_0x3bf900[_0x0bf2('0x42')][_0x0bf2('0x30')]);_0x358f0f[_0x0bf2('0x2d')]=qs[_0x0bf2('0x2d')](_0x3bf900[_0x0bf2('0x42')]['offset']);}_0x358f0f[_0x0bf2('0x49')]=qs[_0x0bf2('0x4a')](_0x3bf900[_0x0bf2('0x42')]['sort']);_0x358f0f[_0x0bf2('0x4b')]=qs[_0x0bf2('0x43')](_[_0x0bf2('0x4c')](_0x3bf900['query'],_0x435ef3[_0x0bf2('0x43')]));_0x358f0f[_0x0bf2('0x4b')][_0x0bf2('0x63')]=_0x3cd5d1['id'];if(_0x3bf900[_0x0bf2('0x42')][_0x0bf2('0x4d')]){_0x358f0f[_0x0bf2('0x4b')]=_[_0x0bf2('0x4e')](_0x358f0f[_0x0bf2('0x4b')],{'$or':_[_0x0bf2('0x3b')](_0x358f0f[_0x0bf2('0x45')],function(_0x140cda){var _0x3bab46={};_0x3bab46[_0x140cda]={'$like':'%'+_0x3bf900[_0x0bf2('0x42')]['filter']+'%'};return _0x3bab46;})});}_0x358f0f=_[_0x0bf2('0x4e')]({},_0x358f0f,_0x3bf900[_0x0bf2('0x4f')]);return db['Disposition'][_0x0bf2('0x2f')]({'where':_0x358f0f[_0x0bf2('0x4b')]})[_0x0bf2('0x1f')](function(_0x41a745){_0x4d7f17[_0x0bf2('0x2f')]=_0x41a745;if(_0x3bf900[_0x0bf2('0x42')][_0x0bf2('0x51')]){_0x358f0f[_0x0bf2('0x56')]=[{'all':!![]}];}return db[_0x0bf2('0x64')][_0x0bf2('0x52')](_0x358f0f);})[_0x0bf2('0x1f')](function(_0x1d01fa){_0x4d7f17[_0x0bf2('0x67')]=_0x1d01fa;return _0x4d7f17;});}})[_0x0bf2('0x1f')](respondWithFilteredResult(_0x798a58,_0x358f0f))[_0x0bf2('0x29')](handleError(_0x798a58,null));};exports[_0x0bf2('0x68')]=function(_0x30fe63,_0x143aa0,_0x109dbb){return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'where':{'id':_0x30fe63[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x143aa0,null))[_0x0bf2('0x1f')](function(_0x2c3942){if(_0x2c3942){return _0x2c3942['removeDispositions'](_0x30fe63['query'][_0x0bf2('0x69')]);}})[_0x0bf2('0x1f')](respondWithStatusCode(_0x143aa0,null))[_0x0bf2('0x29')](handleError(_0x143aa0,null));};exports[_0x0bf2('0x6a')]=function(_0x26e0dc,_0x57bc8f,_0x2f5273){if(_0x26e0dc['body']['id']){delete _0x26e0dc[_0x0bf2('0x60')]['id'];}return db['ChatWebsite'][_0x0bf2('0x57')]({'where':{'id':_0x26e0dc[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x57bc8f,null))[_0x0bf2('0x1f')](function(_0x47bb22){if(_0x47bb22){_0x26e0dc[_0x0bf2('0x60')]['ChatWebsiteId']=_0x47bb22['id'];return db[_0x0bf2('0x6b')][_0x0bf2('0x58')](_0x26e0dc[_0x0bf2('0x60')]);}})['then'](respondWithResult(_0x57bc8f,null))[_0x0bf2('0x29')](handleError(_0x57bc8f,null));};exports[_0x0bf2('0x6c')]=function(_0x36957b,_0x47f24c,_0x32a950){var _0x588a32={'raw':![],'where':{}};var _0x42f269={};var _0x474b57={'count':0x0,'rows':[]};return db[_0x0bf2('0x50')][_0x0bf2('0x66')]({'where':{'id':_0x36957b[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x47f24c,null))[_0x0bf2('0x1f')](function(_0x27c937){if(_0x27c937){_0x42f269[_0x0bf2('0x40')]=_[_0x0bf2('0x41')](db['CannedAnswer'][_0x0bf2('0x3c')]);_0x42f269[_0x0bf2('0x42')]=_[_0x0bf2('0x41')](_0x36957b[_0x0bf2('0x42')]);_0x42f269[_0x0bf2('0x43')]=_[_0x0bf2('0x44')](_0x42f269[_0x0bf2('0x40')],_0x42f269[_0x0bf2('0x42')]);_0x588a32['attributes']=_[_0x0bf2('0x44')](_0x42f269[_0x0bf2('0x40')],qs[_0x0bf2('0x46')](_0x36957b[_0x0bf2('0x42')][_0x0bf2('0x46')]));_0x588a32[_0x0bf2('0x45')]=_0x588a32[_0x0bf2('0x45')]['length']?_0x588a32[_0x0bf2('0x45')]:_0x42f269['model'];if(!_0x36957b[_0x0bf2('0x42')][_0x0bf2('0x47')](_0x0bf2('0x48'))){_0x588a32[_0x0bf2('0x30')]=qs['limit'](_0x36957b[_0x0bf2('0x42')]['limit']);_0x588a32['offset']=qs[_0x0bf2('0x2d')](_0x36957b[_0x0bf2('0x42')][_0x0bf2('0x2d')]);}_0x588a32['order']=qs[_0x0bf2('0x4a')](_0x36957b[_0x0bf2('0x42')][_0x0bf2('0x4a')]);_0x588a32['where']=qs['filters'](_[_0x0bf2('0x4c')](_0x36957b[_0x0bf2('0x42')],_0x42f269['filters']));_0x588a32[_0x0bf2('0x4b')][_0x0bf2('0x63')]=_0x27c937['id'];if(_0x36957b['query']['filter']){_0x588a32[_0x0bf2('0x4b')]=_[_0x0bf2('0x4e')](_0x588a32[_0x0bf2('0x4b')],{'$or':_['map'](_0x588a32['attributes'],function(_0x559931){var _0x79e081={};_0x79e081[_0x559931]={'$like':'%'+_0x36957b[_0x0bf2('0x42')][_0x0bf2('0x4d')]+'%'};return _0x79e081;})});}_0x588a32=_[_0x0bf2('0x4e')]({},_0x588a32,_0x36957b[_0x0bf2('0x4f')]);return db[_0x0bf2('0x6b')][_0x0bf2('0x2f')]({'where':_0x588a32[_0x0bf2('0x4b')]})[_0x0bf2('0x1f')](function(_0x61b53d){_0x474b57[_0x0bf2('0x2f')]=_0x61b53d;if(_0x36957b['query'][_0x0bf2('0x51')]){_0x588a32[_0x0bf2('0x56')]=[{'all':!![]}];}return db[_0x0bf2('0x6b')]['findAll'](_0x588a32);})[_0x0bf2('0x1f')](function(_0x3e38e4){_0x474b57[_0x0bf2('0x67')]=_0x3e38e4;return _0x474b57;});}})[_0x0bf2('0x1f')](respondWithFilteredResult(_0x47f24c,_0x588a32))[_0x0bf2('0x29')](handleError(_0x47f24c,null));};exports[_0x0bf2('0x6d')]=function(_0x428d8a,_0x55b5d9,_0x3d6cd1){return db[_0x0bf2('0x50')]['find']({'where':{'id':_0x428d8a[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x55b5d9,null))[_0x0bf2('0x1f')](function(_0x5e5d0c){if(_0x5e5d0c){return _0x5e5d0c['removeAnswers'](_0x428d8a[_0x0bf2('0x42')][_0x0bf2('0x69')]);}})[_0x0bf2('0x1f')](respondWithStatusCode(_0x55b5d9,null))[_0x0bf2('0x29')](handleError(_0x55b5d9,null));};exports[_0x0bf2('0x6e')]=function(_0x2c3da3,_0x27f3c3,_0x27f57c){_0x2c3da3[_0x0bf2('0x60')][_0x0bf2('0x6f')]=_0x2c3da3[_0x0bf2('0x70')][_0x0bf2('0x71')];return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'where':{'id':_0x2c3da3[_0x0bf2('0x53')]['id']}})['then'](handleEntityNotFound(_0x27f3c3,null))[_0x0bf2('0x1f')](saveUpdates(_0x2c3da3[_0x0bf2('0x60')],null))[_0x0bf2('0x1f')](respondWithResult(_0x27f3c3,null))[_0x0bf2('0x29')](handleError(_0x27f3c3,null));};exports[_0x0bf2('0x72')]=function(_0x458633,_0x2ca2d0,_0x5d1c4e){_0x458633['body']['agentAvatar']=_0x458633['file'][_0x0bf2('0x71')];return db[_0x0bf2('0x50')]['find']({'where':{'id':_0x458633[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x2ca2d0,null))[_0x0bf2('0x1f')](saveUpdates(_0x458633['body'],null))['then'](respondWithResult(_0x2ca2d0,null))[_0x0bf2('0x29')](handleError(_0x2ca2d0,null));};exports['addCustomerAvatar']=function(_0x5035bd,_0x340479,_0x584726){_0x5035bd['body']['customerAvatar']=_0x5035bd[_0x0bf2('0x70')][_0x0bf2('0x71')];return db['ChatWebsite'][_0x0bf2('0x57')]({'where':{'id':_0x5035bd[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x340479,null))[_0x0bf2('0x1f')](saveUpdates(_0x5035bd[_0x0bf2('0x60')],null))[_0x0bf2('0x1f')](respondWithResult(_0x340479,null))[_0x0bf2('0x29')](handleError(_0x340479,null));};exports['addSystemAvatar']=function(_0x17c22a,_0x39d70e,_0x553d18){_0x17c22a[_0x0bf2('0x60')][_0x0bf2('0x73')]=_0x17c22a['file'][_0x0bf2('0x71')];return db['ChatWebsite']['find']({'where':{'id':_0x17c22a['params']['id']}})['then'](handleEntityNotFound(_0x39d70e,null))['then'](saveUpdates(_0x17c22a[_0x0bf2('0x60')],null))['then'](respondWithResult(_0x39d70e,null))['catch'](handleError(_0x39d70e,null));};exports[_0x0bf2('0x74')]=function(_0x11aabf,_0x22bdcb,_0x245b19){var _0xc4951e=path['join'](config[_0x0bf2('0x75')],_0x0bf2('0x76'));var _0x2f0258={'where':{'id':_0x11aabf[_0x0bf2('0x53')]['id']},'attributes':['id',_0x0bf2('0x6f')],'raw':!![]};var _0x165b5a=![];return require(_0x0bf2('0x77'))['getLicense']()[_0x0bf2('0x1f')](function(_0x1e6fa5){if(_0x1e6fa5){_0x165b5a=_0x1e6fa5[_0x0bf2('0x78')];}})['then'](function(){return db[_0x0bf2('0x50')][_0x0bf2('0x57')](_0x2f0258);})[_0x0bf2('0x1f')](handleEntityNotFound(_0x22bdcb,null))[_0x0bf2('0x1f')](function(_0x24eee4){if(_0x24eee4){if(!_['isNil'](_0x24eee4['sitepic'])){if(fs['existsSync'](path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0x7a'),_0x24eee4['sitepic']))&&_0x165b5a){_0xc4951e=path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0x7a'),_0x24eee4['sitepic']);}}return _0x22bdcb['download'](_0xc4951e);}})[_0x0bf2('0x29')](handleError(_0x22bdcb,null));};exports[_0x0bf2('0x7b')]=function(_0x4425ae,_0x4e7a38,_0x2d2558){var _0x4b51fa=path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0x7c'));var _0x4c362c={'where':{'id':_0x4425ae[_0x0bf2('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0bf2('0x50')][_0x0bf2('0x57')](_0x4c362c)[_0x0bf2('0x1f')](handleEntityNotFound(_0x4e7a38,null))[_0x0bf2('0x1f')](function(_0x2d8639){if(_0x2d8639){if(!_['isNil'](_0x2d8639[_0x0bf2('0x7d')])){if(fs[_0x0bf2('0x7e')](path['join'](config['root'],_0x0bf2('0x7f'),_0x2d8639[_0x0bf2('0x7d')]))){_0x4b51fa=path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],'server/files/images/avatars/',_0x2d8639['agentAvatar']);}}return _0x4e7a38[_0x0bf2('0x80')](_0x4b51fa);}})[_0x0bf2('0x29')](handleError(_0x4e7a38,null));};exports['getCustomerAvatar']=function(_0x1182c4,_0x17a812,_0x4649fc){var _0x5f2fbd=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x415f65={'where':{'id':_0x1182c4[_0x0bf2('0x53')]['id']},'attributes':['id',_0x0bf2('0x81'),_0x0bf2('0x82')],'raw':!![]};return db['ChatWebsite'][_0x0bf2('0x57')](_0x415f65)[_0x0bf2('0x1f')](handleEntityNotFound(_0x17a812,null))['then'](function(_0x4c6f7d){if(_0x4c6f7d){if(!_[_0x0bf2('0x83')](_0x4c6f7d['customerAvatar'])){if(fs['existsSync'](path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0x7f'),_0x4c6f7d[_0x0bf2('0x81')]))&&_0x4c6f7d[_0x0bf2('0x82')]){_0x5f2fbd=path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0x7f'),_0x4c6f7d[_0x0bf2('0x81')]);}}return _0x17a812[_0x0bf2('0x80')](_0x5f2fbd);}})[_0x0bf2('0x29')](handleError(_0x17a812,null));};exports[_0x0bf2('0x84')]=function(_0x5b37af,_0x52a022,_0x5f70ff){var _0x13e9f8=path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0x85'));var _0x58cfd3={'where':{'id':_0x5b37af[_0x0bf2('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x0bf2('0x50')][_0x0bf2('0x57')](_0x58cfd3)[_0x0bf2('0x1f')](handleEntityNotFound(_0x52a022,null))['then'](function(_0x1653f3){if(_0x1653f3){if(!_[_0x0bf2('0x83')](_0x1653f3['systemAvatar'])){if(fs[_0x0bf2('0x7e')](path[_0x0bf2('0x79')](config['root'],_0x0bf2('0x7f'),_0x1653f3[_0x0bf2('0x73')]))){_0x13e9f8=path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],'server/files/images/avatars/',_0x1653f3[_0x0bf2('0x73')]);}}return _0x52a022[_0x0bf2('0x80')](_0x13e9f8);}})[_0x0bf2('0x29')](handleError(_0x52a022,null));};exports[_0x0bf2('0x86')]=function(_0x2aa850,_0x342758,_0x3b958e){var _0x1d039a=require(_0x0bf2('0x87'));var _0x4cdf13=new _0x1d039a();var _0x27739c=_0x4cdf13[_0x0bf2('0x88')](_0x2aa850[_0x0bf2('0x89')][_0x0bf2('0x8a')])[_0x0bf2('0x8b')]();var _0x967df7={'body':_0x2aa850['body'],'channel':_0x0bf2('0x8c')};var _0xeef12d=[];var _0x8ea6da=[];var _0x157e73={};var _0x4d0ad7=![];return db[_0x0bf2('0x8d')][_0x0bf2('0x61')]()[_0x0bf2('0x1f')](function(_0x69accc){if(!_0x69accc){throw new db['Sequelize'][(_0x0bf2('0x8e'))](_0x0bf2('0x8f'));}_0xeef12d=_[_0x0bf2('0x90')](_['keys'](_0x69accc),['createdAt',_0x0bf2('0x91')]);_0x8ea6da=_[_0x0bf2('0x90')](_[_0x0bf2('0x41')](_0x69accc),[_0x0bf2('0x92'),_0x0bf2('0x91'),_0x0bf2('0x93'),_0x0bf2('0x94')]);if(_0x2aa850[_0x0bf2('0x60')]['id']){delete _0x2aa850[_0x0bf2('0x60')]['id'];}if(_[_0x0bf2('0x83')](_0x2aa850['body']['from'])){throw new db['Sequelize'][(_0x0bf2('0x8e'))](_0x0bf2('0x95'));}if(_[_0x0bf2('0x83')](_0x2aa850[_0x0bf2('0x60')]['body'])||_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0x60')]===''){throw new db[(_0x0bf2('0x96'))][(_0x0bf2('0x8e'))](_0x0bf2('0x97'));}if(_['isNil'](_0x2aa850[_0x0bf2('0x60')]['mapKey'])){throw new db['Sequelize'][(_0x0bf2('0x8e'))](_0x0bf2('0x98')+_0x8ea6da);}if(!_[_0x0bf2('0x99')](_0x8ea6da,_0x2aa850[_0x0bf2('0x60')]['mapKey'])){throw new db[(_0x0bf2('0x96'))][(_0x0bf2('0x8e'))](_0x0bf2('0x9a')+_0x8ea6da);}_0x157e73[_0x2aa850['body'][_0x0bf2('0x9b')]]=_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0x9c')];})[_0x0bf2('0x1f')](function(){return db['ChatWebsite'][_0x0bf2('0x57')]({'where':{'id':_0x2aa850[_0x0bf2('0x53')]['id']},'include':[{'model':db[_0x0bf2('0x9d')],'as':_0x0bf2('0x9e'),'include':[{'model':db[_0x0bf2('0x8d')],'as':'Contacts','where':_0x157e73,'limit':0x1,'order':[[_0x0bf2('0x91'),_0x0bf2('0x9f')]]}]},{'model':db[_0x0bf2('0xa0')],'as':_0x0bf2('0xa1')}]});})[_0x0bf2('0x1f')](handleEntityNotFound(_0x342758,null))[_0x0bf2('0x1f')](function(_0x143565){if(_0x143565&&_0x143565['List']){_0x967df7[_0x0bf2('0xa2')]=_0x143565;_0x967df7['applications']=_0x143565[_0x0bf2('0xa1')];_0x967df7['list']=_0x143565['List'];_0x967df7[_0x0bf2('0xa3')]=_[_0x0bf2('0xa4')](_0x967df7[_0x0bf2('0xa3')],[_0x0bf2('0xa5')],['asc']);if(_0x967df7['account'][_0x0bf2('0xa1')]){delete _0x967df7[_0x0bf2('0xa2')][_0x0bf2('0xa1')];}if(_0x967df7['account'][_0x0bf2('0x9e')]&&_0x967df7[_0x0bf2('0xa2')][_0x0bf2('0x9e')][_0x0bf2('0xa6')][_0x0bf2('0x55')]){return _0x967df7[_0x0bf2('0xa2')][_0x0bf2('0x9e')]['Contacts'][0x0];}var _0x53544f=_['defaults'](_0x2aa850['body'],{'firstName':_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0x9c')],'ListId':_0x143565[_0x0bf2('0x94')]});_0x53544f[_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0x9b')]]=_0x2aa850[_0x0bf2('0x60')]['from'];return db[_0x0bf2('0x8d')][_0x0bf2('0x58')](_0x53544f,{'fields':_0xeef12d,'raw':!![]});}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x342758,null))[_0x0bf2('0x1f')](function(_0xf68333){_0x967df7['contact']=_0xf68333;var _0x4efa64=_0x2aa850['body'][_0x0bf2('0xa7')];if(_0x2aa850[_0x0bf2('0x89')]['cf-connecting-ip']){_0x4efa64=_0x2aa850[_0x0bf2('0x89')][_0x0bf2('0xa8')];}else if(_0x2aa850[_0x0bf2('0x89')][_0x0bf2('0xa9')]){_0x4efa64=_[_0x0bf2('0xaa')](_0x2aa850['headers']['x-forwarded-for'][_0x0bf2('0xab')](','));}if(_0xf68333){var _0x1725af={'ContactId':_0xf68333['id'],'ChatWebsiteId':_0x2aa850['params']['id'],'from':(_0xf68333[_0x0bf2('0xac')]||'')+'\x20'+(_0xf68333[_0x0bf2('0xad')]||''),'customerIp':_0x4efa64,'customerPort':_0x2aa850['headers'][_0x0bf2('0xae')]?_0x2aa850[_0x0bf2('0x89')][_0x0bf2('0xae')]:null,'referer':_0x2aa850['body'][_0x0bf2('0xaf')],'browserName':_0x27739c[_0x0bf2('0xb0')]['name']&&_0x27739c[_0x0bf2('0xb0')][_0x0bf2('0xb1')]?util[_0x0bf2('0xb2')](_0x0bf2('0xb3'),_0x27739c[_0x0bf2('0xb0')][_0x0bf2('0x38')],_0x27739c['browser']['version']):_0x0bf2('0xb4'),'browserVersion':_0x27739c[_0x0bf2('0xb0')][_0x0bf2('0xb1')]||_0x0bf2('0xb4'),'osName':util['format'](_0x0bf2('0xb3'),_0x27739c['os']['name'],_0x27739c['os']['version']),'osVersion':_0x27739c['os'][_0x0bf2('0xb1')],'deviceModel':_0x27739c[_0x0bf2('0xb5')][_0x0bf2('0x40')]&&_0x27739c['device'][_0x0bf2('0xb6')]?util[_0x0bf2('0xb2')]('%s\x20%s\x20%s',_0x27739c[_0x0bf2('0xb5')][_0x0bf2('0x40')],_0x27739c[_0x0bf2('0xb5')][_0x0bf2('0xb6')],_0x27739c['device'][_0x0bf2('0x3e')]):null,'deviceVendor':_0x27739c['device']['vendor'],'deviceType':_0x27739c[_0x0bf2('0xb5')][_0x0bf2('0x3e')],'formData':JSON['stringify'](_0x2aa850['body'])};var _0x2b3d46={'ChatWebsiteId':_0x2aa850[_0x0bf2('0x53')]['id'],'closed':![]};if(_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xb7')]){_0x2b3d46[_0x0bf2('0xb7')]=_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xb7')];return db[_0x0bf2('0xb8')]['find']({'where':_0x2b3d46})[_0x0bf2('0x1f')](function(_0x2bc535){if(_0x2bc535){return[_0x2bc535,![]];}_0x1725af[_0x0bf2('0xb7')]=_0x2aa850[_0x0bf2('0x60')]['threadId'];_0x1725af['externalUrl']=_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xb9')];return db['ChatInteraction']['create'](_0x1725af)['then'](function(_0x4c435d){return[_0x4c435d,!![]];});});}_0x2b3d46['ContactId']=_0xf68333['id'];if(_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xba')]&&_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xba')]['id']){_0x2b3d46['id']=_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xba')]['id'];return db[_0x0bf2('0xb8')][_0x0bf2('0x57')]({'where':_0x2b3d46})[_0x0bf2('0x1f')](function(_0x5c8106){if(_0x5c8106){return[_0x5c8106,![]];}return db[_0x0bf2('0xb8')]['create'](_0x1725af)[_0x0bf2('0x1f')](function(_0x2ca33e){return[_0x2ca33e,!![]];});});}return db[_0x0bf2('0xb8')][_0x0bf2('0x58')](_0x1725af)[_0x0bf2('0x1f')](function(_0x227efd){return[_0x227efd,!![]];});}})[_0x0bf2('0xbb')](function(_0x2bb55d,_0x254ef3){if(_0x2bb55d){_0x4d0ad7=_0x254ef3;if(!_0x254ef3){var _0x3ce36f={'from':(_0x967df7[_0x0bf2('0xbc')][_0x0bf2('0xac')]||'')+'\x20'+(_0x967df7[_0x0bf2('0xbc')]['lastName']||'')};if(_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xb7')]&&_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xbd')]&&_0x2aa850['body']['threadId']!=_0x2aa850['body'][_0x0bf2('0xbd')]){_0x3ce36f[_0x0bf2('0xb7')]=_0x2aa850['body']['messageId'];}return _0x2bb55d[_0x0bf2('0x5f')](_0x3ce36f);}else{return _0x2bb55d;}}})[_0x0bf2('0x1f')](function(_0x5217a6){_0x967df7[_0x0bf2('0xba')]=_0x5217a6['get']({'plain':!![]});_0x967df7[_0x0bf2('0xba')][_0x0bf2('0xbe')]=_0x4d0ad7;if(_0x967df7[_0x0bf2('0xba')][_0x0bf2('0xbe')]){if(_0x967df7['account']['autoclose']){_0x967df7[_0x0bf2('0xa3')][_0x0bf2('0xbf')]({'id':0x0,'priority':_0x967df7[_0x0bf2('0xa3')][_0x0bf2('0x55')]+0x1,'app':'close','appdata':_0x0bf2('0xc0'),'interval':_0x0bf2('0xc1')});}}return db[_0x0bf2('0xc2')]['create']({'body':_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0x60')],'ChatWebsiteId':_0x2aa850[_0x0bf2('0x53')]['id'],'ChatInteractionId':_0x5217a6['id'],'direction':'in','ContactId':_0x967df7['contact']['id'],'AttachmentId':_0x2aa850[_0x0bf2('0x60')][_0x0bf2('0xc3')]});})[_0x0bf2('0x1f')](function(_0x3640e8){_0x967df7[_0x0bf2('0x26')]=_0x3640e8;if(_0x967df7['interaction'][_0x0bf2('0xc4')]){return db[_0x0bf2('0xc5')][_0x0bf2('0x57')]({'attributes':['id',_0x0bf2('0x38')],'where':{'id':_0x967df7[_0x0bf2('0xba')][_0x0bf2('0xc4')]}})[_0x0bf2('0x1f')](function(_0x49039d){if(_0x49039d){_0x967df7[_0x0bf2('0xa3')][_0x0bf2('0xc6')]({'id':0x0,'priority':0x0,'app':_0x0bf2('0xc7'),'appdata':_0x49039d[_0x0bf2('0x38')]+','+(_0x967df7[_0x0bf2('0xa2')][_0x0bf2('0xc8')]||0xa),'interval':'*,*,*,*'});_0x967df7[_0x0bf2('0xc9')]=!![];}return respondWithRpcPromise(_0x0bf2('0xca'),_0x0bf2('0xcb'),_0x967df7);});}return respondWithRpcPromise(_0x0bf2('0xca'),_0x0bf2('0xcb'),_0x967df7);})['then'](function(_0x3a7c04){respondWithRpcPromise(_0x0bf2('0xcc'),_0x0bf2('0xcc'),{'event':_0x0bf2('0x86'),'message':_0x3a7c04},client9002);return _0x3a7c04;})[_0x0bf2('0x1f')](respondWithResult(_0x342758,null))[_0x0bf2('0x29')](handleError(_0x342758,null));};exports[_0x0bf2('0xcd')]=function(_0x2848c9,_0x3fbc20,_0x516fa4){var _0x4894db,_0x5e5375,_0x132d15;var _0x1dfdbf=[];var _0x33a66c=[];var _0x2cfce6={};var _0x299ad1=_0x2848c9[_0x0bf2('0xce')]||[];var _0x3d6eb5=[];var _0x31f679;return db[_0x0bf2('0x8d')][_0x0bf2('0x61')]()[_0x0bf2('0x1f')](function(_0x43186a){if(!_0x43186a){throw new db['Sequelize'][(_0x0bf2('0x8e'))]('no\x20available\x20attributes');}_0x33a66c=_[_0x0bf2('0x90')](_[_0x0bf2('0x41')](_0x43186a),[_0x0bf2('0x92'),_0x0bf2('0x91')]);_0x1dfdbf=_[_0x0bf2('0x90')](_[_0x0bf2('0x41')](_0x43186a),['createdAt',_0x0bf2('0x91'),_0x0bf2('0x93'),_0x0bf2('0x94')]);if(_0x2848c9[_0x0bf2('0x60')]['id']){delete _0x2848c9[_0x0bf2('0x60')]['id'];}if(_[_0x0bf2('0x83')](_0x2848c9['body'][_0x0bf2('0x9c')])){throw _0x3fbc20['status'](0x1f4)[_0x0bf2('0x39')](new db[(_0x0bf2('0x96'))][(_0x0bf2('0x8e'))](_0x0bf2('0x95')));}if(_[_0x0bf2('0x83')](_0x2848c9[_0x0bf2('0x60')]['body'])||_0x2848c9[_0x0bf2('0x60')][_0x0bf2('0x60')]===''){throw _0x3fbc20[_0x0bf2('0x2c')](0x1f4)[_0x0bf2('0x39')](new db[(_0x0bf2('0x96'))][(_0x0bf2('0x8e'))](_0x0bf2('0x97')));}if(_[_0x0bf2('0x83')](_0x2848c9['body'][_0x0bf2('0xcf')])){throw _0x3fbc20['status'](0x1f4)[_0x0bf2('0x39')](new db['Sequelize'][(_0x0bf2('0x8e'))](_0x0bf2('0xd0')+_0x1dfdbf));}if(!_[_0x0bf2('0x99')](_0x1dfdbf,_0x2848c9[_0x0bf2('0x60')]['mapKeyOffline'])){throw _0x3fbc20[_0x0bf2('0x2c')](0x1f4)[_0x0bf2('0x39')](new db['Sequelize']['ValidationError'](_0x0bf2('0xd1')+_0x1dfdbf));}_0x2cfce6[_0x2848c9[_0x0bf2('0x60')][_0x0bf2('0xcf')]]=_0x2848c9[_0x0bf2('0x60')][_0x0bf2('0x9c')];})[_0x0bf2('0x1f')](function(){return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'where':{'id':_0x2848c9[_0x0bf2('0x53')]['id']},'include':[{'model':db[_0x0bf2('0x9d')],'as':_0x0bf2('0x9e')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x0bf2('0x1f')](handleEntityNotFound(_0x3fbc20,null))[_0x0bf2('0x1f')](function(_0x3c9863){if(_0x3c9863&&_0x3c9863['List']){_0x5e5375=_0x3c9863;var _0x439a78=_['defaults'](_0x2848c9['body'],{'firstName':_0x2848c9[_0x0bf2('0x60')]['from'],'phone':_0x2848c9[_0x0bf2('0x60')][_0x0bf2('0x9c')],'ListId':_0x3c9863['ListId']});_0x439a78[_0x2848c9[_0x0bf2('0x60')]['mapKeyOffline']]=_0x2848c9[_0x0bf2('0x60')]['from'];return db[_0x0bf2('0x8d')][_0x0bf2('0xd2')]({'where':_0x2cfce6,'defaults':_0x439a78});}})['spread'](function(_0x224d51){if(_0x224d51){_0x132d15=_0x224d51;var _0xbed889=fs[_0x0bf2('0xd3')](path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],'server/files/templates/chatOfflineMessage.ejs'),_0x0bf2('0xd4'));var _0x26228b=ejs[_0x0bf2('0xd5')](_0xbed889,{'body':_[_0x0bf2('0xd6')](_0x2848c9['body'][_0x0bf2('0x60')]),'bodyTitle':_0x5e5375[_0x0bf2('0xd7')]});return db['ChatOfflineMessage'][_0x0bf2('0x58')]({'body':_0x26228b,'ContactId':_0x224d51['id'],'ChatWebsiteId':_0x5e5375['id']});}})[_0x0bf2('0x1f')](function(_0x1677f){_0x31f679=_0x1677f;if(_0x299ad1[_0x0bf2('0x55')]){var _0x22cdca=_0x299ad1[_0x0bf2('0x3b')](function(_0x374947){return{'name':_0x374947[_0x0bf2('0xd8')],'basename':_0x374947[_0x0bf2('0x71')],'type':_0x374947[_0x0bf2('0xd9')],'ChatOfflineMessageId':_0x1677f['id']};});_0x3d6eb5=_0x22cdca[_0x0bf2('0x3b')](_0x5a98ce=>{var _0x57ad22={'filename':_0x5a98ce[_0x0bf2('0x38')],'path':path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],'server','files','attachments','offline-chat',_0x5a98ce[_0x0bf2('0xda')])};return _0x57ad22;});if(!_0x5e5375[_0x0bf2('0xdb')]){return db[_0x0bf2('0xdc')][_0x0bf2('0xdd')](function(_0x26de74){return db[_0x0bf2('0xde')][_0x0bf2('0xdf')](_0x22cdca,{'transaction':_0x26de74});});}}})[_0x0bf2('0x1f')](function(){if(_0x31f679){_0x4894db=_0x31f679;return db[_0x0bf2('0xe0')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x0bf2('0x1f')](function(_0xe97fbd){if(_0xe97fbd&&_0xe97fbd[_0x0bf2('0xe1')]&&_0x5e5375[_0x0bf2('0xe2')]&&_0x5e5375[_0x0bf2('0xe3')]){var _0x41bc29={'tls':{'rejectUnauthorized':![]}};if(_0xe97fbd[_0x0bf2('0xe1')]['service']){_0x41bc29['service']=_0xe97fbd['Smtp']['service'];}else{_0x41bc29[_0x0bf2('0xe4')]=_0xe97fbd[_0x0bf2('0xe1')][_0x0bf2('0xe4')];_0x41bc29[_0x0bf2('0xe5')]=_0xe97fbd[_0x0bf2('0xe1')]['port'];_0x41bc29[_0x0bf2('0xe6')]=_0xe97fbd[_0x0bf2('0xe1')][_0x0bf2('0xe6')];}if(_0xe97fbd[_0x0bf2('0xe1')][_0x0bf2('0xe7')]){_0x41bc29['auth']={'user':_0xe97fbd[_0x0bf2('0xe1')][_0x0bf2('0x59')],'pass':_0xe97fbd[_0x0bf2('0xe1')]['pass']};}return respondWithRpcPromise(_0x0bf2('0xe8'),_0x0bf2('0xe9'),{'account':_0x41bc29,'message':{'from':util[_0x0bf2('0xb2')](_0x0bf2('0xea'),_0xe97fbd[_0x0bf2('0x38')],_0xe97fbd['email']||_0xe97fbd['Smtp'][_0x0bf2('0x59')]),'to':_0x5e5375[_0x0bf2('0xe3')],'subject':_0x5e5375[_0x0bf2('0xeb')],'html':_0x4894db[_0x0bf2('0x60')],'attachments':_0x3d6eb5}},client9003)[_0x0bf2('0x1f')](function(){return _0x4894db;})[_0x0bf2('0x29')](function(_0x1db9e9){console[_0x0bf2('0x24')](_0x1db9e9);});}})[_0x0bf2('0x1f')](function(){if(_0x5e5375&&_0x5e5375[_0x0bf2('0xdb')]&&_0x5e5375[_0x0bf2('0xec')]){var _0x1a3720=[];if(_0x299ad1[_0x0bf2('0x55')]){_0x1a3720=_0x299ad1[_0x0bf2('0x3b')](function(_0x2740ae){return{'name':_0x2740ae[_0x0bf2('0xd8')],'basename':_0x2740ae[_0x0bf2('0x71')],'type':_0x2740ae[_0x0bf2('0xd9')],'ChatOfflineMessageId':_0x31f679['id']};});}var _0x11e5ce;if(!_[_0x0bf2('0x83')](_0x5e5375['subjectOffline'])){var _0x2a2664=_[_0x0bf2('0x3b')](_0x2848c9['body'],function(_0x57af53){return _0x57af53;});var _0x3f1aef=_[_0x0bf2('0xed')](_0x2a2664)[0x0];var _0x5cc0a4=_['mapValues'](_0x3f1aef,function(_0x1cfebb){return _0x1cfebb;});_0x11e5ce=_0x5cc0a4[0x1][_0x5e5375['subjectOffline']];}var _0xa9337f={'from':_0x132d15[_0x0bf2('0xee')],'firstName':_0x132d15['firstName'],'lastName':_0x132d15[_0x0bf2('0xad')],'mapKey':'email','message':{'from':_0x132d15['email'],'to':_0x5e5375[_0x0bf2('0xe0')]['email'],'cc':'','subject':_[_0x0bf2('0x83')](_0x11e5ce)?_0x5e5375[_0x0bf2('0xeb')]:_0x11e5ce,'messageId':'','sentAt':new Date(),'attach':_0x1a3720[_0x0bf2('0x55')],'attachments':_0x1a3720,'originChannel':'Chat','ChatWebsiteId':_0x5e5375['id'],'ChatOfflineMessageId':_0x4894db['id'],'originTo':_0x5e5375[_0x0bf2('0xe0')][_0x0bf2('0xee')]},'body':_0x4894db[_0x0bf2('0x60')]};var _0x36a55c={'account':{'id':_0x5e5375[_0x0bf2('0xec')]},'body':_0xa9337f,'log':_0x0bf2('0xef')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x36a55c,client9001)[_0x0bf2('0x1f')](function(){return _0x4894db;})[_0x0bf2('0x29')](function(_0xc197c){console[_0x0bf2('0x24')](_0xc197c);});}return;})[_0x0bf2('0x1f')](function(){if(_0x4894db){return _0x4894db;}})[_0x0bf2('0x1f')](respondWithResult(_0x3fbc20,null))[_0x0bf2('0x29')](function(_0x56daab){console[_0x0bf2('0x24')](_0x0bf2('0x29'),_0x56daab);for(var _0x371548 of _0x299ad1){var _0x58cf4c=path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0xf0'),'files',_0x0bf2('0xf1'),'offline-chat',_0x371548[_0x0bf2('0x71')]);fs_extra[_0x0bf2('0xf2')](_0x58cf4c)['catch'](function(_0x24e191){console['error'](_0x0bf2('0xf3'),_0x58cf4c,_0x24e191);});}});};exports[_0x0bf2('0xf4')]=function(_0x3e880c,_0x5e4ddb,_0x2e637a){return db['ChatInteraction']['find']({'where':{'id':_0x3e880c[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x5e4ddb,null))[_0x0bf2('0x1f')](function(_0x2b9585){if(_0x2b9585){return _0x2b9585['addInteraction'](_0x3e880c[_0x0bf2('0x60')]['ids'],_[_0x0bf2('0xf5')](_0x3e880c[_0x0bf2('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0x5e4ddb,null))['catch'](handleError(_0x5e4ddb,null));};exports[_0x0bf2('0xf6')]=function(_0x2458a7,_0x1a5ed2,_0x5eff50){var _0x53952b={'raw':![],'where':{}};var _0x2d13d9={};var _0x3290c5={'count':0x0,'rows':[]};return db[_0x0bf2('0x50')][_0x0bf2('0x66')]({'where':{'id':_0x2458a7[_0x0bf2('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a5ed2,null))[_0x0bf2('0x1f')](function(_0x58a662){if(_0x58a662){_0x2d13d9[_0x0bf2('0x40')]=_[_0x0bf2('0x41')](db['ChatInteraction'][_0x0bf2('0x3c')]);_0x2d13d9[_0x0bf2('0x42')]=_[_0x0bf2('0x41')](_0x2458a7[_0x0bf2('0x42')]);_0x2d13d9['filters']=_[_0x0bf2('0x44')](_0x2d13d9['model'],_0x2d13d9[_0x0bf2('0x42')]);_0x53952b['attributes']=_[_0x0bf2('0x44')](_0x2d13d9[_0x0bf2('0x40')],qs[_0x0bf2('0x46')](_0x2458a7['query'][_0x0bf2('0x46')]));_0x53952b[_0x0bf2('0x45')]=_0x53952b['attributes']['length']?_0x53952b[_0x0bf2('0x45')]:_0x2d13d9[_0x0bf2('0x40')];if(!_0x2458a7[_0x0bf2('0x42')][_0x0bf2('0x47')](_0x0bf2('0x48'))){_0x53952b[_0x0bf2('0x30')]=qs['limit'](_0x2458a7['query'][_0x0bf2('0x30')]);_0x53952b[_0x0bf2('0x2d')]=qs[_0x0bf2('0x2d')](_0x2458a7[_0x0bf2('0x42')][_0x0bf2('0x2d')]);}_0x53952b[_0x0bf2('0x49')]=qs[_0x0bf2('0x4a')](_0x2458a7['query'][_0x0bf2('0x4a')]);_0x53952b['where']=qs['filters'](_['pick'](_0x2458a7[_0x0bf2('0x42')],_0x2d13d9[_0x0bf2('0x43')]));_0x53952b[_0x0bf2('0x4b')]['ChatWebsiteId']=_0x58a662['id'];if(_0x2458a7['query'][_0x0bf2('0x4d')]){_0x53952b[_0x0bf2('0x4b')]=_[_0x0bf2('0x4e')](_0x53952b['where'],{'$or':_[_0x0bf2('0x3b')](_0x53952b['attributes'],function(_0x4b44e8){var _0x39bc5d={};_0x39bc5d[_0x4b44e8]={'$like':'%'+_0x2458a7['query'][_0x0bf2('0x4d')]+'%'};return _0x39bc5d;})});}_0x53952b=_[_0x0bf2('0x4e')]({},_0x53952b,_0x2458a7[_0x0bf2('0x4f')]);return db[_0x0bf2('0xb8')][_0x0bf2('0x2f')]({'where':_0x53952b[_0x0bf2('0x4b')]})['then'](function(_0x25c6d7){_0x3290c5[_0x0bf2('0x2f')]=_0x25c6d7;if(_0x2458a7[_0x0bf2('0x42')]['includeAll']){_0x53952b[_0x0bf2('0x56')]=[{'model':db[_0x0bf2('0x8d')],'as':_0x0bf2('0xf7'),'required':![]},{'model':db['User'],'as':_0x0bf2('0xf8'),'attributes':[_0x0bf2('0x38'),_0x0bf2('0xf9'),_0x0bf2('0xfa')],'required':![]},{'model':db[_0x0bf2('0xfb')],'as':'Tags','attributes':['id',_0x0bf2('0x38'),_0x0bf2('0xfc')],'where':_0x2458a7[_0x0bf2('0x42')][_0x0bf2('0xfd')]?{'id':_0x2458a7[_0x0bf2('0x42')]['tag']}:undefined,'required':_0x2458a7[_0x0bf2('0x42')][_0x0bf2('0xfd')]?!![]:![]}];}return db[_0x0bf2('0xb8')][_0x0bf2('0x52')](_0x53952b);})['then'](function(_0x5e273d){_0x3290c5['rows']=_0x5e273d;return _0x3290c5;});}})[_0x0bf2('0x1f')](respondWithFilteredResult(_0x1a5ed2,_0x53952b))[_0x0bf2('0x29')](handleError(_0x1a5ed2,null));};function iftimePromise(_0x56d010,_0x48cc86){return respondWithRpcPromise(_0x0bf2('0xfe'),_0x0bf2('0xff'),{'command':_0x48cc86['timezone']?util[_0x0bf2('0xb2')](_0x0bf2('0x100'),_0x56d010['interval'],_0x48cc86[_0x0bf2('0x101')]):util[_0x0bf2('0xb2')]('iftime\x20%s',_0x56d010[_0x0bf2('0x102')])},client9002)[_0x0bf2('0x1f')](function(_0x3f12bd){var _0x2aed61=_0x3f12bd&&_0x3f12bd[_0x0bf2('0x103')](_0x0bf2('0x104'))>=0x0?!![]:![];logger[_0x0bf2('0x27')](_0x0bf2('0x105'),_0x48cc86['id'],_0x56d010['id'],_0x56d010[_0x0bf2('0x102')],_0x2aed61?_0x0bf2('0x106'):'OFFLINE',_0x48cc86['timezone']?_0x48cc86[_0x0bf2('0x101')]:'No\x20timezone');return _0x2aed61;})['catch'](function(_0x3b11be){logger[_0x0bf2('0x24')](_0x0bf2('0x105'),_0x48cc86['id'],_0x56d010['id'],_0x56d010[_0x0bf2('0x102')],util['inspect'](_0x3b11be,{'showHidden':![],'depth':null}),_0x48cc86[_0x0bf2('0x101')]?_0x48cc86[_0x0bf2('0x101')]:_0x0bf2('0x107'));return![];});}exports[_0x0bf2('0xff')]=function(_0x319c1b,_0x552558,_0x43c8e9){var _0x5bea47=0x0;var _0x4175d7=0x0;var _0x15981e=![];var _0x43f381;var _0x260525;return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'where':{'id':_0x319c1b[_0x0bf2('0x53')]['id']},'include':[{'model':db[_0x0bf2('0x108')],'as':_0x0bf2('0x108'),'include':[{'model':db[_0x0bf2('0x108')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x0bf2('0x1f')](handleEntityNotFound(_0x552558,null))['then'](function(_0x8a9d52){if(_0x8a9d52){_0x43f381=_0x8a9d52;return _0x8a9d52[_0x0bf2('0x109')]({'raw':!![]});}})[_0x0bf2('0x1f')](function(_0x4c4351){if(_0x43f381){if(_0x4c4351){_0x260525=_0x4c4351;}}return require(_0x0bf2('0x77'))['getLicense']();})['then'](function(_0x29fea8){if(_0x29fea8){_0x4175d7=_0x29fea8[_0x0bf2('0x10a')];_0x15981e=_0x29fea8[_0x0bf2('0x78')];}})[_0x0bf2('0x1f')](function(){return db[_0x0bf2('0xb8')][_0x0bf2('0x2f')]({'where':{'closed':![]}});})[_0x0bf2('0x1f')](function(_0x51caf8){_0x5bea47=_0x51caf8;if(_0x4175d7&&_0x51caf8>_0x4175d7){return db[_0x0bf2('0x10b')]['findOne']({'where':{'id':0x1}})[_0x0bf2('0x1f')](function(_0x4dae06){if(_0x4dae06){_0x4dae06['increment'](_0x0bf2('0x10c'));}});}})[_0x0bf2('0x1f')](function(){if(_0x43f381[_0x0bf2('0x108')]&&_0x43f381['Interval'][_0x0bf2('0x10d')]){var _0x6df579=[];for(var _0x3df50f=0x0;_0x3df50f<_0x43f381[_0x0bf2('0x108')][_0x0bf2('0x10d')]['length'];_0x3df50f++){var _0x5c7344=_0x43f381[_0x0bf2('0x108')]['Intervals'][_0x3df50f][_0x0bf2('0x33')]({'plain':!![]});_0x6df579[_0x0bf2('0xbf')](iftimePromise(_0x5c7344,_0x43f381));}return BPromise[_0x0bf2('0x10e')](_0x6df579)[_0x0bf2('0x1f')](function(_0x31817b){return _[_0x0bf2('0x10f')](_0x31817b);});}else{return!![];}})[_0x0bf2('0x1f')](function(_0x219413){var _0x399fe1=fs[_0x0bf2('0xd3')](path[_0x0bf2('0x79')](config[_0x0bf2('0x75')],_0x0bf2('0x110')),_0x0bf2('0xd4'));var _0x49123f={'remote':_0x43f381[_0x0bf2('0x111')],'query':querystring[_0x0bf2('0x23')](_[_0x0bf2('0x4e')](_0x43f381[_0x0bf2('0x33')]({'plain':!![]}),{'customerIp':_0x319c1b[_0x0bf2('0x89')]['x-forwarded-for']||_0x319c1b[_0x0bf2('0x89')][_0x0bf2('0x112')]||_0x319c1b['connection'][_0x0bf2('0x113')]||_0x319c1b['ip'],'referer':_0x319c1b[_0x0bf2('0x89')][_0x0bf2('0xaf')],'openedInteractions':_0x5bea47,'maxInteractions':_0x4175d7,'virtual':_0x15981e['virtual'],'online':_0x219413,'custom':_0x15981e}))[_0x0bf2('0x114')](/'/g,'\x5c\x27')};_0x552558['send'](ejs[_0x0bf2('0xd5')](Mustache[_0x0bf2('0xd5')](_0x399fe1,_0x49123f),{'proactiveActions':_0x260525,'alignment':_0x43f381['alignment'],'verticalAlignment':_0x43f381[_0x0bf2('0x115')],'div_color':_0x43f381[_0x0bf2('0xfc')],'text_color':_0x43f381['textColor'],'button_color':_0x43f381[_0x0bf2('0x116')],'background_color':_0x43f381[_0x0bf2('0x117')]}));})[_0x0bf2('0x29')](handleError(_0x552558,null));};exports[_0x0bf2('0x118')]=function(_0x5accc5,_0x158f26,_0x35dea0){return db[_0x0bf2('0x50')]['findOne']({'where':{'id':_0x5accc5['params']['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x158f26,null))[_0x0bf2('0x1f')](function(_0x292253){if(_0x292253){return db[_0x0bf2('0xdc')][_0x0bf2('0xdd')](function(_0x1ce837){return db['ChatApplication'][_0x0bf2('0x36')]({'where':{'ChatWebsiteId':_0x5accc5['params']['id']},'transaction':_0x1ce837})[_0x0bf2('0x1f')](function(_0x23f4a5){var _0x454c50=_[_0x0bf2('0x3b')](_0x5accc5[_0x0bf2('0x60')],function(_0x2e5bac){_0x2e5bac[_0x0bf2('0x63')]=_0x5accc5[_0x0bf2('0x53')]['id'];return _0x2e5bac;});return db[_0x0bf2('0xa0')][_0x0bf2('0xdf')](_0x454c50,{'transaction':_0x1ce837});});})[_0x0bf2('0x1f')](function(){return db['ChatApplication'][_0x0bf2('0x119')]({'where':{'ChatWebsiteId':_0x5accc5[_0x0bf2('0x53')]['id']},'order':'priority'});});}})[_0x0bf2('0x1f')](respondWithResult(_0x158f26,null))[_0x0bf2('0x29')](handleError(_0x158f26,null));};exports[_0x0bf2('0x11a')]=function(_0x1e1017,_0x456d5d,_0x41e590){var _0x1e583a={};var _0x17c4f3={};var _0x5b25e3;var _0x531f27;return db[_0x0bf2('0x50')][_0x0bf2('0x66')]({'where':{'id':_0x1e1017['params']['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x456d5d,null))[_0x0bf2('0x1f')](function(_0x28033f){if(_0x28033f){_0x5b25e3=_0x28033f;_0x17c4f3['model']=_['keys'](db[_0x0bf2('0xa0')][_0x0bf2('0x3c')]);_0x17c4f3['query']=_[_0x0bf2('0x41')](_0x1e1017[_0x0bf2('0x42')]);_0x17c4f3[_0x0bf2('0x43')]=_[_0x0bf2('0x44')](_0x17c4f3[_0x0bf2('0x40')],_0x17c4f3[_0x0bf2('0x42')]);_0x1e583a[_0x0bf2('0x45')]=_[_0x0bf2('0x44')](_0x17c4f3['model'],qs[_0x0bf2('0x46')](_0x1e1017[_0x0bf2('0x42')][_0x0bf2('0x46')]));_0x1e583a['attributes']=_0x1e583a['attributes'][_0x0bf2('0x55')]?_0x1e583a[_0x0bf2('0x45')]:_0x17c4f3[_0x0bf2('0x40')];_0x1e583a[_0x0bf2('0x49')]=qs[_0x0bf2('0x4a')](_0x1e1017['query'][_0x0bf2('0x4a')]);_0x1e583a['where']=qs[_0x0bf2('0x43')](_[_0x0bf2('0x4c')](_0x1e1017[_0x0bf2('0x42')],_0x17c4f3['filters']));if(_0x1e1017[_0x0bf2('0x42')][_0x0bf2('0x4d')]){_0x1e583a['where']=_[_0x0bf2('0x4e')](_0x1e583a[_0x0bf2('0x4b')],{'$or':_['map'](_0x1e583a[_0x0bf2('0x45')],function(_0xb67f95){var _0x26d63f={};_0x26d63f[_0xb67f95]={'$like':'%'+_0x1e1017[_0x0bf2('0x42')][_0x0bf2('0x4d')]+'%'};return _0x26d63f;})});}_0x1e583a=_['merge']({},_0x1e583a,_0x1e1017[_0x0bf2('0x4f')]);return _0x5b25e3['getApplications'](_0x1e583a);}})['then'](function(_0x2511d9){if(_0x2511d9){_0x531f27=_0x2511d9['length'];if(!_0x1e1017[_0x0bf2('0x42')][_0x0bf2('0x47')]('nolimit')){_0x1e583a[_0x0bf2('0x30')]=qs[_0x0bf2('0x30')](_0x1e1017['query'][_0x0bf2('0x30')]);_0x1e583a[_0x0bf2('0x2d')]=qs[_0x0bf2('0x2d')](_0x1e1017['query'][_0x0bf2('0x2d')]);}return _0x5b25e3[_0x0bf2('0x11a')](_0x1e583a);}})[_0x0bf2('0x1f')](function(_0x19f14a){if(_0x19f14a){return _0x19f14a?{'count':_0x531f27,'rows':_0x19f14a}:null;}})[_0x0bf2('0x1f')](respondWithResult(_0x456d5d,null))[_0x0bf2('0x29')](handleError(_0x456d5d,null));};exports[_0x0bf2('0x11b')]=function(_0x46254c,_0x36214c,_0x47b51b){return db[_0x0bf2('0x11c')][_0x0bf2('0x57')]({'where':{'id':_0x46254c[_0x0bf2('0x53')]['id']}})['then'](handleEntityNotFound(_0x36214c,null))[_0x0bf2('0x1f')](function(_0x330c4b){if(_0x330c4b){return _0x330c4b[_0x0bf2('0x11b')](_0x46254c[_0x0bf2('0x60')][_0x0bf2('0x69')],_[_0x0bf2('0xf5')](_0x46254c[_0x0bf2('0x60')],[_0x0bf2('0x69'),'id'])||{});}})[_0x0bf2('0x1f')](respondWithResult(_0x36214c,null))[_0x0bf2('0x29')](handleError(_0x36214c,null));};exports[_0x0bf2('0x109')]=function(_0x5e2583,_0x3bbefd,_0xffeb8a){var _0x2d888b={};var _0xc0e839={};var _0x3c8ba1;var _0x1b2e1c;return db['ChatWebsite'][_0x0bf2('0x66')]({'where':{'id':_0x5e2583[_0x0bf2('0x53')]['id']}})['then'](handleEntityNotFound(_0x3bbefd,null))[_0x0bf2('0x1f')](function(_0x56096b){if(_0x56096b){_0x3c8ba1=_0x56096b;_0xc0e839['model']=_[_0x0bf2('0x41')](db[_0x0bf2('0x11d')][_0x0bf2('0x3c')]);_0xc0e839[_0x0bf2('0x42')]=_[_0x0bf2('0x41')](_0x5e2583[_0x0bf2('0x42')]);_0xc0e839[_0x0bf2('0x43')]=_[_0x0bf2('0x44')](_0xc0e839['model'],_0xc0e839[_0x0bf2('0x42')]);_0x2d888b[_0x0bf2('0x45')]=_[_0x0bf2('0x44')](_0xc0e839['model'],qs[_0x0bf2('0x46')](_0x5e2583[_0x0bf2('0x42')][_0x0bf2('0x46')]));_0x2d888b[_0x0bf2('0x45')]=_0x2d888b['attributes'][_0x0bf2('0x55')]?_0x2d888b[_0x0bf2('0x45')]:_0xc0e839['model'];_0x2d888b[_0x0bf2('0x49')]=qs[_0x0bf2('0x4a')](_0x5e2583[_0x0bf2('0x42')][_0x0bf2('0x4a')]);_0x2d888b['where']=qs[_0x0bf2('0x43')](_[_0x0bf2('0x4c')](_0x5e2583['query'],_0xc0e839['filters']));if(_0x5e2583[_0x0bf2('0x42')]['filter']){_0x2d888b[_0x0bf2('0x4b')]=_[_0x0bf2('0x4e')](_0x2d888b[_0x0bf2('0x4b')],{'$or':_[_0x0bf2('0x3b')](_0x2d888b[_0x0bf2('0x45')],function(_0xfcba63){var _0x564592={};_0x564592[_0xfcba63]={'$like':'%'+_0x5e2583['query'][_0x0bf2('0x4d')]+'%'};return _0x564592;})});}_0x2d888b=_[_0x0bf2('0x4e')]({},_0x2d888b,_0x5e2583[_0x0bf2('0x4f')]);return _0x3c8ba1[_0x0bf2('0x109')](_0x2d888b);}})[_0x0bf2('0x1f')](function(_0x498dbe){if(_0x498dbe){_0x1b2e1c=_0x498dbe[_0x0bf2('0x55')];if(!_0x5e2583[_0x0bf2('0x42')][_0x0bf2('0x47')]('nolimit')){_0x2d888b[_0x0bf2('0x30')]=qs[_0x0bf2('0x30')](_0x5e2583[_0x0bf2('0x42')]['limit']);_0x2d888b[_0x0bf2('0x2d')]=qs[_0x0bf2('0x2d')](_0x5e2583['query'][_0x0bf2('0x2d')]);}return _0x3c8ba1[_0x0bf2('0x109')](_0x2d888b);}})[_0x0bf2('0x1f')](function(_0x14d5a3){if(_0x14d5a3){return _0x14d5a3?{'count':_0x1b2e1c,'rows':_0x14d5a3}:null;}})[_0x0bf2('0x1f')](respondWithResult(_0x3bbefd,null))[_0x0bf2('0x29')](handleError(_0x3bbefd,null));};exports[_0x0bf2('0x11e')]=function(_0x2f3b55,_0x560b26,_0x4707ee){var _0x57edc9=_0x2f3b55['query']['online']==='false'?_0x0bf2('0x11f'):'onlineForm';return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'attributes':['id',_0x57edc9],'where':{'id':_0x2f3b55[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x560b26,null))[_0x0bf2('0x1f')](function(_0xc19d04){if(_0xc19d04){var _0x37aa58=_0xc19d04[_0x57edc9];var _0x2234ab=_0x37aa58&&_0x37aa58[_0x0bf2('0x120')]?_0x37aa58[_0x0bf2('0x120')]:[];_0x560b26[_0x0bf2('0x39')]({'fromKey':_[_0x0bf2('0x83')](_0x37aa58[_0x0bf2('0x121')])?undefined:_0x37aa58['fromKey'],'count':_0x2234ab[_0x0bf2('0x55')],'rows':_0x2234ab});}})[_0x0bf2('0x29')](handleError(_0x560b26,null));};exports[_0x0bf2('0x122')]=function(_0x397d06,_0x52a21b,_0x3cbe2e){var _0x1e3331={'raw':![],'where':{}};var _0xffd1ad={};var _0x27cfce={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0bf2('0x66')]({'where':{'id':_0x397d06[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x52a21b,null))[_0x0bf2('0x1f')](function(_0x1a1e69){if(_0x1a1e69){_0xffd1ad[_0x0bf2('0x40')]=_[_0x0bf2('0x41')](db[_0x0bf2('0x123')]['rawAttributes']);_0xffd1ad[_0x0bf2('0x42')]=_[_0x0bf2('0x41')](_0x397d06['query']);_0xffd1ad[_0x0bf2('0x43')]=_['intersection'](_0xffd1ad[_0x0bf2('0x40')],_0xffd1ad[_0x0bf2('0x42')]);_0x1e3331[_0x0bf2('0x45')]=_[_0x0bf2('0x44')](_0xffd1ad[_0x0bf2('0x40')],qs[_0x0bf2('0x46')](_0x397d06['query'][_0x0bf2('0x46')]));_0x1e3331['attributes']=_0x1e3331[_0x0bf2('0x45')][_0x0bf2('0x55')]?_0x1e3331[_0x0bf2('0x45')]:_0xffd1ad[_0x0bf2('0x40')];if(!_0x397d06['query'][_0x0bf2('0x47')](_0x0bf2('0x48'))){_0x1e3331[_0x0bf2('0x30')]=qs[_0x0bf2('0x30')](_0x397d06['query'][_0x0bf2('0x30')]);_0x1e3331['offset']=qs['offset'](_0x397d06[_0x0bf2('0x42')][_0x0bf2('0x2d')]);}_0x1e3331[_0x0bf2('0x49')]=qs[_0x0bf2('0x4a')](_0x397d06[_0x0bf2('0x42')][_0x0bf2('0x4a')]);_0x1e3331['where']=qs['filters'](_['pick'](_0x397d06[_0x0bf2('0x42')],_0xffd1ad[_0x0bf2('0x43')]));_0x1e3331[_0x0bf2('0x4b')]['ChatWebsiteId']=_0x1a1e69['id'];if(_0x397d06['query'][_0x0bf2('0x4d')]){_0x1e3331[_0x0bf2('0x4b')]=_[_0x0bf2('0x4e')](_0x1e3331[_0x0bf2('0x4b')],{'$or':_['map'](_0x1e3331[_0x0bf2('0x45')],function(_0x47e521){var _0x2f7358={};_0x2f7358[_0x47e521]={'$like':'%'+_0x397d06[_0x0bf2('0x42')]['filter']+'%'};return _0x2f7358;})});}_0x1e3331=_[_0x0bf2('0x4e')]({},_0x1e3331,_0x397d06['options']);return db[_0x0bf2('0x123')][_0x0bf2('0x2f')]({'where':_0x1e3331[_0x0bf2('0x4b')]})[_0x0bf2('0x1f')](function(_0x3273d9){_0x27cfce['count']=_0x3273d9;if(_0x397d06[_0x0bf2('0x42')][_0x0bf2('0x51')]){_0x1e3331[_0x0bf2('0x56')]=[{'all':!![]}];}else{_0x1e3331[_0x0bf2('0x56')]=[{'model':db[_0x0bf2('0x8d')],'as':'Contact','required':![]},{'model':db[_0x0bf2('0xde')],'as':_0x0bf2('0x124'),'required':![]}];}return db[_0x0bf2('0x123')][_0x0bf2('0x52')](_0x1e3331);})[_0x0bf2('0x1f')](function(_0x4dd4f7){_0x27cfce[_0x0bf2('0x67')]=_0x4dd4f7;return _0x27cfce;});}})['then'](respondWithFilteredResult(_0x52a21b,_0x1e3331))[_0x0bf2('0x29')](handleError(_0x52a21b,null));};exports[_0x0bf2('0x125')]=function(_0x2687eb,_0x5d0c67,_0x2438bc){return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'where':{'id':_0x2687eb[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x5d0c67,null))[_0x0bf2('0x1f')](function(_0x5a1ad0){if(_0x5a1ad0){return _0x5a1ad0[_0x0bf2('0x125')](_0x2687eb[_0x0bf2('0x60')]['ids'],_[_0x0bf2('0xf5')](_0x2687eb[_0x0bf2('0x60')],[_0x0bf2('0x69'),'id'])||{})['spread'](function(_0x5ef1c0){for(var _0x4e2648=0x0;_0x4e2648<_0x2687eb[_0x0bf2('0x60')]['ids'][_0x0bf2('0x55')];_0x4e2648+=0x1){socket[_0x0bf2('0x126')](_0x0bf2('0x127'),{'UserId':Number(_0x2687eb[_0x0bf2('0x60')][_0x0bf2('0x69')][_0x4e2648]),'ChatWebsiteId':Number(_0x2687eb['params']['id'])});}return _0x5ef1c0;});}})[_0x0bf2('0x1f')](respondWithResult(_0x5d0c67,null))[_0x0bf2('0x29')](handleError(_0x5d0c67,null));};exports[_0x0bf2('0x128')]=function(_0x35b745,_0x482949,_0x5e818b){return db[_0x0bf2('0x50')][_0x0bf2('0x57')]({'where':{'id':_0x35b745[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x482949,null))[_0x0bf2('0x1f')](function(_0x288456){if(_0x288456){return _0x288456[_0x0bf2('0x128')](_0x35b745['query'][_0x0bf2('0x69')])[_0x0bf2('0x1f')](function(){if(_[_0x0bf2('0x129')](_0x35b745[_0x0bf2('0x42')][_0x0bf2('0x69')])){for(var _0xa38633=0x0;_0xa38633<_0x35b745['query'][_0x0bf2('0x69')][_0x0bf2('0x55')];_0xa38633+=0x1){socket['emit'](_0x0bf2('0x12a'),{'UserId':Number(_0x35b745[_0x0bf2('0x42')][_0x0bf2('0x69')][_0xa38633]),'ChatWebsiteId':Number(_0x35b745[_0x0bf2('0x53')]['id'])});}}else{socket[_0x0bf2('0x126')](_0x0bf2('0x12a'),{'UserId':Number(_0x35b745['query']['ids']),'ChatWebsiteId':Number(_0x35b745[_0x0bf2('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x482949,null))[_0x0bf2('0x29')](handleError(_0x482949,null));};exports[_0x0bf2('0x12b')]=function(_0x42dcf0,_0x5798f8,_0x4ad0cb){var _0x44cb5d={};var _0x5ee078={};var _0x347633;var _0x2bb45e;return db[_0x0bf2('0x50')][_0x0bf2('0x66')]({'where':{'id':_0x42dcf0[_0x0bf2('0x53')]['id']}})[_0x0bf2('0x1f')](handleEntityNotFound(_0x5798f8,null))[_0x0bf2('0x1f')](function(_0x3c9749){if(_0x3c9749){_0x347633=_0x3c9749;_0x5ee078[_0x0bf2('0x40')]=_[_0x0bf2('0x41')](db[_0x0bf2('0xc5')][_0x0bf2('0x3c')]);_0x5ee078['query']=_[_0x0bf2('0x41')](_0x42dcf0[_0x0bf2('0x42')]);_0x5ee078[_0x0bf2('0x43')]=_['intersection'](_0x5ee078[_0x0bf2('0x40')],_0x5ee078[_0x0bf2('0x42')]);_0x44cb5d[_0x0bf2('0x45')]=_[_0x0bf2('0x44')](_0x5ee078[_0x0bf2('0x40')],qs[_0x0bf2('0x46')](_0x42dcf0[_0x0bf2('0x42')][_0x0bf2('0x46')]));_0x44cb5d['attributes']=_0x44cb5d['attributes'][_0x0bf2('0x55')]?_0x44cb5d[_0x0bf2('0x45')]:_0x5ee078[_0x0bf2('0x40')];_0x44cb5d[_0x0bf2('0x49')]=qs[_0x0bf2('0x4a')](_0x42dcf0[_0x0bf2('0x42')][_0x0bf2('0x4a')]);_0x44cb5d['where']=qs[_0x0bf2('0x43')](_[_0x0bf2('0x4c')](_0x42dcf0[_0x0bf2('0x42')],_0x5ee078[_0x0bf2('0x43')]));if(_0x42dcf0['query']['filter']){_0x44cb5d['where']=_['merge'](_0x44cb5d[_0x0bf2('0x4b')],{'$or':_['map'](_0x44cb5d[_0x0bf2('0x45')],function(_0x27c0e3){var _0x17e7f9={};_0x17e7f9[_0x27c0e3]={'$like':'%'+_0x42dcf0[_0x0bf2('0x42')][_0x0bf2('0x4d')]+'%'};return _0x17e7f9;})});}_0x44cb5d=_['merge']({},_0x44cb5d,_0x42dcf0[_0x0bf2('0x4f')]);return _0x347633['getAgents'](_0x44cb5d);}})[_0x0bf2('0x1f')](function(_0x5ea9cb){if(_0x5ea9cb){_0x2bb45e=_0x5ea9cb[_0x0bf2('0x55')];if(!_0x42dcf0['query']['hasOwnProperty'](_0x0bf2('0x48'))){_0x44cb5d[_0x0bf2('0x30')]=qs[_0x0bf2('0x30')](_0x42dcf0[_0x0bf2('0x42')][_0x0bf2('0x30')]);_0x44cb5d[_0x0bf2('0x2d')]=qs[_0x0bf2('0x2d')](_0x42dcf0[_0x0bf2('0x42')][_0x0bf2('0x2d')]);}return _0x347633[_0x0bf2('0x12b')](_0x44cb5d);}})[_0x0bf2('0x1f')](function(_0x35b482){if(_0x35b482){return _0x35b482?{'count':_0x2bb45e,'rows':_0x35b482}:null;}})[_0x0bf2('0x1f')](respondWithResult(_0x5798f8,null))[_0x0bf2('0x29')](handleError(_0x5798f8,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 6e51d6d..952a01d 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 _0xb1a3=['ChatWebsite','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4647c6,_0x49366b){var _0x3c40ad=function(_0x547fbe){while(--_0x547fbe){_0x4647c6['push'](_0x4647c6['shift']());}};_0x3c40ad(++_0x49366b);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0xb1a3[_0x3a0c4f];return _0x247049;};'use strict';var EventEmitter=require(_0x3b1a('0x0'));var ChatWebsite=require(_0x3b1a('0x1'))['db'][_0x3b1a('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3b1a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x41fe6c){return function(_0x77489e,_0xd2c9e1,_0x3fcfd5){ChatWebsiteEvents[_0x3b1a('0x4')](_0x41fe6c+':'+_0x77489e['id'],_0x77489e);ChatWebsiteEvents[_0x3b1a('0x4')](_0x41fe6c,_0x77489e);_0x3fcfd5(null);};}for(var e in events){if(events[_0x3b1a('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x3b1a('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x3261db,_0x5ca0a){var _0x8c0bf3=function(_0x523f98){while(--_0x523f98){_0x3261db['push'](_0x3261db['shift']());}};_0x8c0bf3(++_0x5ca0a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x7995('0x0'));var ChatWebsite=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){ChatWebsiteEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);ChatWebsiteEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];ChatWebsite[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('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 864f630..b1a1fe1 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 _0xf353=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','api','moment','bluebird','path','rimraf'];(function(_0x5eba1d,_0x36f115){var _0x2ea36c=function(_0x21f50d){while(--_0x21f50d){_0x5eba1d['push'](_0x5eba1d['shift']());}};_0x2ea36c(++_0x36f115);}(_0xf353,0xea));var _0x3f35=function(_0x34f930,_0x597cb0){_0x34f930=_0x34f930-0x0;var _0x55b287=_0xf353[_0x34f930];return _0x55b287;};'use strict';var _=require(_0x3f35('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3f35('0x1'));var moment=require(_0x3f35('0x2'));var BPromise=require(_0x3f35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f35('0x4'));var rimraf=require(_0x3f35('0x5'));var config=require(_0x3f35('0x6'));var attributes=require(_0x3f35('0x7'));module[_0x3f35('0x8')]=function(_0xae62b2,_0x17c6e5){return _0xae62b2[_0x3f35('0x9')](_0x3f35('0xa'),attributes,{'tableName':_0x3f35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ac7=['util','../../config/logger','moment','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x2974f5,_0xd6967c){var _0x4583bf=function(_0x4b9dc3){while(--_0x4b9dc3){_0x2974f5['push'](_0x2974f5['shift']());}};_0x4583bf(++_0xd6967c);}(_0x5ac7,0x83));var _0x75ac=function(_0x303083,_0x41dc54){_0x303083=_0x303083-0x0;var _0x1c5f83=_0x5ac7[_0x303083];return _0x1c5f83;};'use strict';var _=require(_0x75ac('0x0'));var util=require(_0x75ac('0x1'));var logger=require(_0x75ac('0x2'))('api');var moment=require(_0x75ac('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75ac('0x4'));var rimraf=require('rimraf');var config=require(_0x75ac('0x5'));var attributes=require(_0x75ac('0x6'));module[_0x75ac('0x7')]=function(_0x48de1e,_0x15e72f){return _0x48de1e[_0x75ac('0x8')](_0x75ac('0x9'),attributes,{'tableName':_0x75ac('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 2a52dc5..9ffa290 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 _0x9981=['../../config/logger','rpc','jayson/promise','client','http','redis','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x19313e,_0x2f81fe){var _0x3c699c=function(_0x245499){while(--_0x245499){_0x19313e['push'](_0x19313e['shift']());}};_0x3c699c(++_0x2f81fe);}(_0x9981,0x1b8));var _0x1998=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x9981[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0x1998('0x0'));var util=require(_0x1998('0x1'));var moment=require(_0x1998('0x2'));var BPromise=require(_0x1998('0x3'));var rs=require(_0x1998('0x4'));var fs=require('fs');var Redis=require(_0x1998('0x5'));var db=require(_0x1998('0x6'))['db'];var utils=require(_0x1998('0x7'));var logger=require(_0x1998('0x8'))(_0x1998('0x9'));var config=require('../../config/environment');var jayson=require(_0x1998('0xa'));var client=jayson[_0x1998('0xb')][_0x1998('0xc')]({'port':0x232a});config[_0x1998('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1998('0xd')]));require('./chatWebsite.socket')[_0x1998('0xe')](socket);function respondWithRpcPromise(_0x4d3c56,_0x4ff2c8,_0x42c233){return new BPromise(function(_0x1c46ab,_0x3a797c){return client[_0x1998('0xf')](_0x4d3c56,_0x42c233)[_0x1998('0x10')](function(_0x1bf054){logger[_0x1998('0x11')](_0x1998('0x12'),_0x4ff2c8,_0x1998('0x13'));logger[_0x1998('0x14')](_0x1998('0x15'),_0x4ff2c8,'request\x20sent',JSON[_0x1998('0x16')](_0x1bf054));if(_0x1bf054[_0x1998('0x17')]){if(_0x1bf054[_0x1998('0x17')][_0x1998('0x18')]===0x1f4){logger[_0x1998('0x17')](_0x1998('0x12'),_0x4ff2c8,_0x1bf054['error'][_0x1998('0x19')]);return _0x3a797c(_0x1bf054[_0x1998('0x17')][_0x1998('0x19')]);}logger[_0x1998('0x17')](_0x1998('0x12'),_0x4ff2c8,_0x1bf054['error'][_0x1998('0x19')]);return _0x1c46ab(_0x1bf054['error'][_0x1998('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4ff2c8,_0x1998('0x13'));_0x1c46ab(_0x1bf054[_0x1998('0x1a')]['message']);}})[_0x1998('0x1b')](function(_0x5ea4b4){logger[_0x1998('0x17')](_0x1998('0x12'),_0x4ff2c8,_0x5ea4b4);_0x3a797c(_0x5ea4b4);});});}
\ No newline at end of file
+var _0x0783=['lodash','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x5a4fce,_0x5a3521){var _0x563ab3=function(_0x1f7fdc){while(--_0x1f7fdc){_0x5a4fce['push'](_0x5a4fce['shift']());}};_0x563ab3(++_0x5a3521);}(_0x0783,0xd8));var _0x3078=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0783[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3078('0x0'));var util=require(_0x3078('0x1'));var moment=require(_0x3078('0x2'));var BPromise=require('bluebird');var rs=require(_0x3078('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3078('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3078('0x5'));var jayson=require(_0x3078('0x6'));var client=jayson[_0x3078('0x7')][_0x3078('0x8')]({'port':0x232a});config[_0x3078('0x9')]=_[_0x3078('0xa')](config[_0x3078('0x9')],{'host':_0x3078('0xb'),'port':0x18eb});var socket=require(_0x3078('0xc'))(new Redis(config['redis']));require(_0x3078('0xd'))['register'](socket);function respondWithRpcPromise(_0x171ea3,_0x2adc32,_0x216b85){return new BPromise(function(_0x148db8,_0x4cdfe5){return client[_0x3078('0xe')](_0x171ea3,_0x216b85)['then'](function(_0x22165){logger[_0x3078('0xf')](_0x3078('0x10'),_0x2adc32,_0x3078('0x11'));logger[_0x3078('0x12')](_0x3078('0x13'),_0x2adc32,'request\x20sent',JSON['stringify'](_0x22165));if(_0x22165[_0x3078('0x14')]){if(_0x22165[_0x3078('0x14')][_0x3078('0x15')]===0x1f4){logger[_0x3078('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2adc32,_0x22165[_0x3078('0x14')][_0x3078('0x16')]);return _0x4cdfe5(_0x22165[_0x3078('0x14')]['message']);}logger[_0x3078('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2adc32,_0x22165[_0x3078('0x14')][_0x3078('0x16')]);return _0x148db8(_0x22165[_0x3078('0x14')][_0x3078('0x16')]);}else{logger[_0x3078('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x2adc32,_0x3078('0x11'));_0x148db8(_0x22165['result']['message']);}})[_0x3078('0x17')](function(_0x1ed2cf){logger[_0x3078('0x14')](_0x3078('0x10'),_0x2adc32,_0x1ed2cf);_0x4cdfe5(_0x1ed2cf);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index aee4047..1c2fcb7 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 _0x88c8=['./chatWebsite.events','save','remove','update','emit','removeListener','register','chatWebsite:'];(function(_0x17e423,_0x3146b2){var _0x24b2a7=function(_0x49212a){while(--_0x49212a){_0x17e423['push'](_0x17e423['shift']());}};_0x24b2a7(++_0x3146b2);}(_0x88c8,0x1d8));var _0x888c=function(_0xa7ca56,_0x1f2781){_0xa7ca56=_0xa7ca56-0x0;var _0x123b80=_0x88c8[_0xa7ca56];return _0x123b80;};'use strict';var ChatWebsiteEvents=require(_0x888c('0x0'));var events=[_0x888c('0x1'),_0x888c('0x2'),_0x888c('0x3')];function createListener(_0x3b9b56,_0x55cdfd){return function(_0x425384){_0x55cdfd[_0x888c('0x4')](_0x3b9b56,_0x425384);};}function removeListener(_0x94f106,_0x31d63f){return function(){ChatWebsiteEvents[_0x888c('0x5')](_0x94f106,_0x31d63f);};}exports[_0x888c('0x6')]=function(_0x58bc37){for(var _0x16733e=0x0,_0x30cf97=events['length'];_0x16733e<_0x30cf97;_0x16733e++){var _0x540fd3=events[_0x16733e];var _0x83a019=createListener(_0x888c('0x7')+_0x540fd3,_0x58bc37);ChatWebsiteEvents['on'](_0x540fd3,_0x83a019);}};
\ No newline at end of file
+var _0x5efe=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x5efe,0x112));var _0xe5ef=function(_0x2b4cdd,_0x56e9aa){_0x2b4cdd=_0x2b4cdd-0x0;var _0x4553f5=_0x5efe[_0x2b4cdd];return _0x4553f5;};'use strict';var ChatWebsiteEvents=require(_0xe5ef('0x0'));var events=[_0xe5ef('0x1'),_0xe5ef('0x2'),'update'];function createListener(_0x11d231,_0xf0975e){return function(_0x5245ec){_0xf0975e[_0xe5ef('0x3')](_0x11d231,_0x5245ec);};}function removeListener(_0x101d9c,_0x4ed335){return function(){ChatWebsiteEvents[_0xe5ef('0x4')](_0x101d9c,_0x4ed335);};}exports[_0xe5ef('0x5')]=function(_0x28c327){for(var _0x555f76=0x0,_0x4c010d=events['length'];_0x555f76<_0x4c010d;_0x555f76++){var _0x4ac7e2=events[_0x555f76];var _0x4a2c6b=createListener(_0xe5ef('0x6')+_0x4ac7e2,_0x28c327);ChatWebsiteEvents['on'](_0x4ac7e2,_0x4a2c6b);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7aafb4c..70e73ce 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 _0xe799=['join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','server/files/images/avatars/','now','addAvatar','addCustomerAvatar','single','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage'];(function(_0x12ba85,_0x51e159){var _0x55bb6d=function(_0x297dbf){while(--_0x297dbf){_0x12ba85['push'](_0x12ba85['shift']());}};_0x55bb6d(++_0x51e159);}(_0xe799,0xb0));var _0x9e79=function(_0x5f4b2c,_0x55e7dc){_0x5f4b2c=_0x5f4b2c-0x0;var _0x32bb14=_0xe799[_0x5f4b2c];return _0x32bb14;};'use strict';var multer=require(_0x9e79('0x0'));var util=require(_0x9e79('0x1'));var path=require(_0x9e79('0x2'));var timeout=require(_0x9e79('0x3'));var express=require(_0x9e79('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e79('0x5'));var interaction=require(_0x9e79('0x6'));var config=require(_0x9e79('0x7'));var controller=require('./chatWebsite.controller');router[_0x9e79('0x8')]('/',auth[_0x9e79('0x9')](),controller[_0x9e79('0xa')]);router['get'](_0x9e79('0xb'),auth[_0x9e79('0x9')](),controller[_0x9e79('0xc')]);router['get'](_0x9e79('0xd'),auth[_0x9e79('0x9')](),controller[_0x9e79('0xe')]);router[_0x9e79('0x8')](_0x9e79('0xf'),auth[_0x9e79('0x9')](),controller[_0x9e79('0x10')]);router[_0x9e79('0x8')](_0x9e79('0x11'),auth[_0x9e79('0x9')](),controller[_0x9e79('0x12')]);router[_0x9e79('0x8')](_0x9e79('0x13'),controller[_0x9e79('0x14')]);router[_0x9e79('0x8')](_0x9e79('0x15'),controller['getAvatar']);router[_0x9e79('0x8')](_0x9e79('0x16'),controller['getCustomerAvatar']);router[_0x9e79('0x8')](_0x9e79('0x17'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x9e79('0x9')](),controller[_0x9e79('0x18')]);router[_0x9e79('0x8')](_0x9e79('0x19'),controller[_0x9e79('0x1a')]);router['get'](_0x9e79('0x1b'),auth[_0x9e79('0x9')](),controller[_0x9e79('0x1c')]);router['get'](_0x9e79('0x1d'),auth[_0x9e79('0x9')](),controller[_0x9e79('0x1e')]);router[_0x9e79('0x8')](_0x9e79('0x1f'),controller[_0x9e79('0x20')]);router[_0x9e79('0x8')]('/:id/offline_messages',auth[_0x9e79('0x9')](),controller[_0x9e79('0x21')]);router[_0x9e79('0x8')](_0x9e79('0x22'),auth[_0x9e79('0x9')](),controller[_0x9e79('0x23')]);router[_0x9e79('0x24')]('/',auth['isAuthenticated'](),controller[_0x9e79('0x25')]);router[_0x9e79('0x24')](_0x9e79('0xf'),auth['isAuthenticated'](),controller[_0x9e79('0x26')]);router[_0x9e79('0x24')](_0x9e79('0x11'),auth[_0x9e79('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x9e79('0x27')]({'destination':function(_0x575d18,_0x2d6f07,_0x599ea8){_0x599ea8(null,path[_0x9e79('0x28')](config[_0x9e79('0x29')],_0x9e79('0x2a')));},'filename':function(_0x1a002b,_0x44529b,_0x5b487c){_0x5b487c(null,util[_0x9e79('0x2b')](_0x9e79('0x2c'),Date['now'](),_0x44529b[_0x9e79('0x2d')]));}})});router[_0x9e79('0x24')](_0x9e79('0x13'),upload['single'](_0x9e79('0x2e')),controller[_0x9e79('0x2f')]);var upload=multer({'storage':multer[_0x9e79('0x27')]({'destination':function(_0x4586e8,_0x356bdd,_0x64cca2){_0x64cca2(null,path[_0x9e79('0x28')](config[_0x9e79('0x29')],_0x9e79('0x30')));},'filename':function(_0x5644a7,_0x1c6d09,_0x1a67e9){_0x1a67e9(null,util[_0x9e79('0x2b')]('%s-%s',Date[_0x9e79('0x31')](),_0x1c6d09[_0x9e79('0x2d')]));}})});router[_0x9e79('0x24')](_0x9e79('0x15'),upload['single'](_0x9e79('0x2e')),controller[_0x9e79('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34a71a,_0x20095d,_0x5796f1){_0x5796f1(null,path[_0x9e79('0x28')](config[_0x9e79('0x29')],_0x9e79('0x30')));},'filename':function(_0x3bde19,_0x3f1161,_0x1af7f6){_0x1af7f6(null,util['format'](_0x9e79('0x2c'),Date[_0x9e79('0x31')](),_0x3f1161['originalname']));}})});router['post'](_0x9e79('0x16'),upload['single'](_0x9e79('0x2e')),controller[_0x9e79('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2cdc41,_0x28a634,_0x28c103){_0x28c103(null,path[_0x9e79('0x28')](config['root'],_0x9e79('0x30')));},'filename':function(_0x3c4835,_0x50d091,_0x4c067a){_0x4c067a(null,util[_0x9e79('0x2b')]('%s-%s',Date[_0x9e79('0x31')](),_0x50d091['originalname']));}})});router['post'](_0x9e79('0x17'),upload[_0x9e79('0x34')]('file'),controller[_0x9e79('0x35')]);router[_0x9e79('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x9e79('0x27')]({'destination':function(_0x45da77,_0x32928a,_0x2636b9){const _0x4e5ea2=path[_0x9e79('0x28')](config['root'],_0x9e79('0x36'),_0x9e79('0x37'),_0x9e79('0x38'));fs_extra[_0x9e79('0x39')](_0x4e5ea2,function(){_0x2636b9(null,_0x4e5ea2);});},'filename':function(_0x46fdf0,_0x13bbfc,_0x497e6e){const _0x54486e=_0x13bbfc[_0x9e79('0x2d')][_0x9e79('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4be577=path['extname'](_0x54486e);const _0x55539d=Date[_0x9e79('0x31')]()+'-'+_0x54486e[_0x9e79('0x3a')](_0x4be577,'')+_0x4be577;_0x497e6e(null,_0x55539d);}})});router[_0x9e79('0x24')](_0x9e79('0x3b'),offlineUploadMulter[_0x9e79('0x3c')](),controller[_0x9e79('0x3d')]);router['post']('/:id/interactions',auth[_0x9e79('0x9')](),controller[_0x9e79('0x3e')]);router[_0x9e79('0x24')](_0x9e79('0x1b'),auth['isAuthenticated'](),controller[_0x9e79('0x3f')]);router[_0x9e79('0x24')](_0x9e79('0x1d'),auth[_0x9e79('0x9')](),controller['addProactiveActions']);router[_0x9e79('0x24')](_0x9e79('0x22'),auth['isAuthenticated'](),controller[_0x9e79('0x40')]);router[_0x9e79('0x41')](_0x9e79('0xd'),auth[_0x9e79('0x9')](),controller[_0x9e79('0x42')]);router[_0x9e79('0x43')](_0x9e79('0xd'),auth[_0x9e79('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x9e79('0x9')](),controller[_0x9e79('0x44')]);router[_0x9e79('0x43')](_0x9e79('0x11'),auth[_0x9e79('0x9')](),controller[_0x9e79('0x45')]);router[_0x9e79('0x43')](_0x9e79('0x22'),auth['isAuthenticated'](),controller[_0x9e79('0x46')]);module[_0x9e79('0x47')]=router;
\ No newline at end of file
+var _0xf18c=['/:id/users','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','any','/:id/interactions'];(function(_0x4eed89,_0x108efd){var _0x1d6ded=function(_0x18a0bd){while(--_0x18a0bd){_0x4eed89['push'](_0x4eed89['shift']());}};_0x1d6ded(++_0x108efd);}(_0xf18c,0x1ad));var _0xcf18=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xf18c[_0x4fde08];return _0x12e725;};'use strict';var multer=require(_0xcf18('0x0'));var util=require(_0xcf18('0x1'));var path=require(_0xcf18('0x2'));var timeout=require(_0xcf18('0x3'));var express=require(_0xcf18('0x4'));var router=express[_0xcf18('0x5')]();var fs_extra=require(_0xcf18('0x6'));var auth=require(_0xcf18('0x7'));var interaction=require(_0xcf18('0x8'));var config=require(_0xcf18('0x9'));var controller=require('./chatWebsite.controller');router[_0xcf18('0xa')]('/',auth[_0xcf18('0xb')](),controller[_0xcf18('0xc')]);router[_0xcf18('0xa')](_0xcf18('0xd'),auth[_0xcf18('0xb')](),controller[_0xcf18('0xe')]);router[_0xcf18('0xa')](_0xcf18('0xf'),auth[_0xcf18('0xb')](),controller['show']);router['get'](_0xcf18('0x10'),auth[_0xcf18('0xb')](),controller[_0xcf18('0x11')]);router[_0xcf18('0xa')](_0xcf18('0x12'),auth[_0xcf18('0xb')](),controller['getAnswers']);router[_0xcf18('0xa')](_0xcf18('0x13'),controller[_0xcf18('0x14')]);router[_0xcf18('0xa')](_0xcf18('0x15'),controller[_0xcf18('0x16')]);router[_0xcf18('0xa')](_0xcf18('0x17'),controller[_0xcf18('0x18')]);router[_0xcf18('0xa')](_0xcf18('0x19'),controller[_0xcf18('0x1a')]);router['get']('/:id/interactions',auth[_0xcf18('0xb')](),controller[_0xcf18('0x1b')]);router['get']('/:id/snippet',controller[_0xcf18('0x1c')]);router['get'](_0xcf18('0x1d'),auth[_0xcf18('0xb')](),controller['getApplications']);router['get'](_0xcf18('0x1e'),auth['isAuthenticated'](),controller[_0xcf18('0x1f')]);router[_0xcf18('0xa')]('/:id/fields',controller[_0xcf18('0x20')]);router[_0xcf18('0xa')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xcf18('0x21')]);router[_0xcf18('0xa')]('/:id/users',auth[_0xcf18('0xb')](),controller['getAgents']);router[_0xcf18('0x22')]('/',auth['isAuthenticated'](),controller[_0xcf18('0x23')]);router[_0xcf18('0x22')](_0xcf18('0x10'),auth[_0xcf18('0xb')](),controller[_0xcf18('0x24')]);router['post'](_0xcf18('0x12'),auth[_0xcf18('0xb')](),controller[_0xcf18('0x25')]);var upload=multer({'storage':multer[_0xcf18('0x26')]({'destination':function(_0x244449,_0x4287bc,_0x42dac3){_0x42dac3(null,path[_0xcf18('0x27')](config[_0xcf18('0x28')],_0xcf18('0x29')));},'filename':function(_0x3652d9,_0x868a85,_0x2faae8){_0x2faae8(null,util[_0xcf18('0x2a')](_0xcf18('0x2b'),Date[_0xcf18('0x2c')](),_0x868a85[_0xcf18('0x2d')]));}})});router[_0xcf18('0x22')](_0xcf18('0x13'),upload[_0xcf18('0x2e')]('file'),controller[_0xcf18('0x2f')]);var upload=multer({'storage':multer[_0xcf18('0x26')]({'destination':function(_0x56d56b,_0x546fce,_0x50fd1d){_0x50fd1d(null,path[_0xcf18('0x27')](config[_0xcf18('0x28')],_0xcf18('0x30')));},'filename':function(_0x3cf20f,_0x3c12af,_0x2e196c){_0x2e196c(null,util['format'](_0xcf18('0x2b'),Date[_0xcf18('0x2c')](),_0x3c12af['originalname']));}})});router['post'](_0xcf18('0x15'),upload[_0xcf18('0x2e')](_0xcf18('0x31')),controller[_0xcf18('0x32')]);var upload=multer({'storage':multer[_0xcf18('0x26')]({'destination':function(_0x130af1,_0x4dff8e,_0x52efc2){_0x52efc2(null,path['join'](config['root'],_0xcf18('0x30')));},'filename':function(_0x5624bc,_0xb4681,_0x40d51d){_0x40d51d(null,util[_0xcf18('0x2a')]('%s-%s',Date['now'](),_0xb4681[_0xcf18('0x2d')]));}})});router[_0xcf18('0x22')](_0xcf18('0x17'),upload[_0xcf18('0x2e')](_0xcf18('0x31')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xcf18('0x26')]({'destination':function(_0x18b68c,_0x20d368,_0xde8dfb){_0xde8dfb(null,path[_0xcf18('0x27')](config[_0xcf18('0x28')],_0xcf18('0x30')));},'filename':function(_0x46c7d9,_0x39a8ec,_0x433bfd){_0x433bfd(null,util[_0xcf18('0x2a')]('%s-%s',Date[_0xcf18('0x2c')](),_0x39a8ec[_0xcf18('0x2d')]));}})});router['post'](_0xcf18('0x19'),upload[_0xcf18('0x2e')](_0xcf18('0x31')),controller[_0xcf18('0x33')]);router[_0xcf18('0x22')](_0xcf18('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x14fbd1,_0x41a63a,_0x2c6c67){const _0x3edda0=path[_0xcf18('0x27')](config[_0xcf18('0x28')],_0xcf18('0x35'),_0xcf18('0x36'),_0xcf18('0x37'));fs_extra[_0xcf18('0x38')](_0x3edda0,function(){_0x2c6c67(null,_0x3edda0);});},'filename':function(_0x56ee0b,_0x24e799,_0x861a61){const _0x2cbc89=_0x24e799['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3e6fa8=path[_0xcf18('0x39')](_0x2cbc89);const _0xdff487=Date['now']()+'-'+_0x2cbc89['replace'](_0x3e6fa8,'')+_0x3e6fa8;_0x861a61(null,_0xdff487);}})});router[_0xcf18('0x22')](_0xcf18('0x3a'),offlineUploadMulter[_0xcf18('0x3b')](),controller['offline']);router[_0xcf18('0x22')](_0xcf18('0x3c'),auth[_0xcf18('0xb')](),controller['addInteraction']);router[_0xcf18('0x22')](_0xcf18('0x1d'),auth['isAuthenticated'](),controller['addApplications']);router[_0xcf18('0x22')](_0xcf18('0x1e'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xcf18('0x22')](_0xcf18('0x3d'),auth[_0xcf18('0xb')](),controller[_0xcf18('0x3e')]);router[_0xcf18('0x3f')]('/:id',auth[_0xcf18('0xb')](),controller[_0xcf18('0x40')]);router[_0xcf18('0x41')](_0xcf18('0xf'),auth[_0xcf18('0xb')](),controller[_0xcf18('0x42')]);router['delete'](_0xcf18('0x10'),auth[_0xcf18('0xb')](),controller['removeDispositions']);router[_0xcf18('0x41')](_0xcf18('0x12'),auth['isAuthenticated'](),controller[_0xcf18('0x43')]);router[_0xcf18('0x41')](_0xcf18('0x3d'),auth[_0xcf18('0xb')](),controller[_0xcf18('0x44')]);module[_0xcf18('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index fa8ee85..7642e83 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 _0xa899=['Google','sequelize','exports','STRING','AmazonAWS'];(function(_0x39d481,_0x468019){var _0x510b49=function(_0x3f57d9){while(--_0x3f57d9){_0x39d481['push'](_0x39d481['shift']());}};_0x510b49(++_0x468019);}(_0xa899,0x155));var _0x9a89=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0xa899[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require(_0x9a89('0x0'));module[_0x9a89('0x1')]={'name':{'type':Sequelize[_0x9a89('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x9a89('0x3'),_0x9a89('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9a89('0x2')]},'data2':{'type':Sequelize[_0x9a89('0x2')]}};
\ No newline at end of file
+var _0x022a=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x022a,0x1f0));var _0xa022=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x022a[_0x13594e];return _0x1a4f42;};'use strict';var Sequelize=require(_0xa022('0x0'));module[_0xa022('0x1')]={'name':{'type':Sequelize[_0xa022('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa022('0x3')](_0xa022('0x4'),_0xa022('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa022('0x2')]},'data2':{'type':Sequelize[_0xa022('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index a1b1df8..8251bad 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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x36a0fd,_0x397ff4){var _0x53de2a=function(_0x3dc646){while(--_0x3dc646){_0x36a0fd['push'](_0x36a0fd['shift']());}};_0x53de2a(++_0x397ff4);}(_0xdb28,0x106));var _0x8db2=function(_0x48e8ec,_0x1ddeb6){_0x48e8ec=_0x48e8ec-0x0;var _0x589de1=_0xdb28[_0x48e8ec];return _0x589de1;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
+var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x2361bc,_0xe667fa){var _0x14df19=function(_0x2ecd47){while(--_0x2ecd47){_0x2361bc['push'](_0x2361bc['shift']());}};_0x14df19(++_0xe667fa);}(_0x2032,0xd9));var _0x2203=function(_0x1572f3,_0x523dba){_0x1572f3=_0x1572f3-0x0;var _0x3104a6=_0x2032[_0x1572f3];return _0x3104a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index ce2c411..7651c89 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 _0x4bec=['rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x4bec,0x124));var _0xc4be=function(_0x11fdbc,_0x39596b){_0x11fdbc=_0x11fdbc-0x0;var _0x4d2e0a=_0x4bec[_0x11fdbc];return _0x4d2e0a;};'use strict';var _=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var logger=require(_0xc4be('0x2'))(_0xc4be('0x3'));var moment=require('moment');var BPromise=require(_0xc4be('0x4'));var rp=require(_0xc4be('0x5'));var fs=require('fs');var path=require(_0xc4be('0x6'));var rimraf=require(_0xc4be('0x7'));var config=require(_0xc4be('0x8'));var attributes=require(_0xc4be('0x9'));module['exports']=function(_0x495a5c,_0x300a60){return _0x495a5c[_0xc4be('0xa')](_0xc4be('0xb'),attributes,{'tableName':_0xc4be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa4e2=['moment','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0xa4e2,0xe0));var _0x2a4e=function(_0xdf485c,_0x4e1eb4){_0xdf485c=_0xdf485c-0x0;var _0x27aad1=_0xa4e2[_0xdf485c];return _0x27aad1;};'use strict';var _=require(_0x2a4e('0x0'));var util=require(_0x2a4e('0x1'));var logger=require(_0x2a4e('0x2'))(_0x2a4e('0x3'));var moment=require(_0x2a4e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a4e('0x5'));var rimraf=require(_0x2a4e('0x6'));var config=require(_0x2a4e('0x7'));var attributes=require(_0x2a4e('0x8'));module[_0x2a4e('0x9')]=function(_0x5e2a1f,_0x15f436){return _0x5e2a1f['define'](_0x2a4e('0xa'),attributes,{'tableName':_0x2a4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 8b29be5..2cb60b0 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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36b3ed,_0x1d9ce6){var _0x41ff06=function(_0x4fcf44){while(--_0x4fcf44){_0x36b3ed['push'](_0x36b3ed['shift']());}};_0x41ff06(++_0x1d9ce6);}(_0x7880,0x1f4));var _0x0788=function(_0x15fdff,_0x40d5b2){_0x15fdff=_0x15fdff-0x0;var _0x5450ed=_0x7880[_0x15fdff];return _0x5450ed;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});}
\ No newline at end of file
+var _0x0b0e=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x0b0e[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b5640ba..149fc8d 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 _0xfefc=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','create','put','/:id','update'];(function(_0x324f55,_0x2e6ca4){var _0x284952=function(_0x36ceae){while(--_0x36ceae){_0x324f55['push'](_0x324f55['shift']());}};_0x284952(++_0x2e6ca4);}(_0xfefc,0xfa));var _0xcfef=function(_0x5e501a,_0x33a574){_0x5e501a=_0x5e501a-0x0;var _0x43d2e9=_0xfefc[_0x5e501a];return _0x43d2e9;};'use strict';var multer=require(_0xcfef('0x0'));var util=require(_0xcfef('0x1'));var path=require(_0xcfef('0x2'));var timeout=require(_0xcfef('0x3'));var express=require(_0xcfef('0x4'));var router=express['Router']();var fs_extra=require(_0xcfef('0x5'));var auth=require(_0xcfef('0x6'));var interaction=require(_0xcfef('0x7'));var config=require(_0xcfef('0x8'));var controller=require('./cloudProvider.controller');router[_0xcfef('0x9')]('/',auth['isAuthenticated'](),controller[_0xcfef('0xa')]);router[_0xcfef('0x9')]('/:id',auth[_0xcfef('0xb')](),controller['show']);router['post']('/',auth[_0xcfef('0xb')](),controller[_0xcfef('0xc')]);router[_0xcfef('0xd')](_0xcfef('0xe'),auth[_0xcfef('0xb')](),controller[_0xcfef('0xf')]);router[_0xcfef('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xcfef('0x11')]);module[_0xcfef('0x12')]=router;
\ No newline at end of file
+var _0xe2ab=['post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','show'];(function(_0x166b02,_0x3bedb3){var _0xa70dab=function(_0x12e92a){while(--_0x12e92a){_0x166b02['push'](_0x166b02['shift']());}};_0xa70dab(++_0x3bedb3);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x38ca12,_0x2cbbec){_0x38ca12=_0x38ca12-0x0;var _0x2f6936=_0xe2ab[_0x38ca12];return _0x2f6936;};'use strict';var multer=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var path=require(_0xbe2a('0x2'));var timeout=require(_0xbe2a('0x3'));var express=require(_0xbe2a('0x4'));var router=express[_0xbe2a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbe2a('0x6'));var interaction=require(_0xbe2a('0x7'));var config=require(_0xbe2a('0x8'));var controller=require(_0xbe2a('0x9'));router['get']('/',auth[_0xbe2a('0xa')](),controller['index']);router[_0xbe2a('0xb')]('/:id',auth[_0xbe2a('0xa')](),controller[_0xbe2a('0xc')]);router[_0xbe2a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbe2a('0xe')](_0xbe2a('0xf'),auth['isAuthenticated'](),controller[_0xbe2a('0x10')]);router[_0xbe2a('0x11')](_0xbe2a('0xf'),auth[_0xbe2a('0xa')](),controller[_0xbe2a('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8ff905a..e42a11d 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 _0xf9ec=['sequelize','exports','STRING','name'];(function(_0x56b2d5,_0x1d3dd5){var _0x54b7fe=function(_0x25aa59){while(--_0x25aa59){_0x56b2d5['push'](_0x56b2d5['shift']());}};_0x54b7fe(++_0x1d3dd5);}(_0xf9ec,0x128));var _0xcf9e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf9ec[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xcf9e('0x0'));module[_0xcf9e('0x1')]={'name':{'type':Sequelize[_0xcf9e('0x2')],'unique':_0xcf9e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcf9e('0x2')]},'companyId':{'type':Sequelize[_0xcf9e('0x2')]},'website':{'type':Sequelize[_0xcf9e('0x2')]},'phone':{'type':Sequelize[_0xcf9e('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcf9e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xcf9e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xcf9e('0x2')]},'email':{'type':Sequelize[_0xcf9e('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xcf9e('0x2')]},'sStreet':{'type':Sequelize[_0xcf9e('0x2')]},'sPostalCode':{'type':Sequelize[_0xcf9e('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xcf9e('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x253b=['exports','name','STRING','sequelize'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x253b,0xfb));var _0xb253=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x253b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb253('0x0'));module[_0xb253('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb253('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb253('0x3')]},'companyId':{'type':Sequelize[_0xb253('0x3')]},'website':{'type':Sequelize[_0xb253('0x3')]},'phone':{'type':Sequelize[_0xb253('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb253('0x3')]},'street':{'type':Sequelize[_0xb253('0x3')]},'postalCode':{'type':Sequelize[_0xb253('0x3')]},'city':{'type':Sequelize[_0xb253('0x3')]},'country':{'type':Sequelize[_0xb253('0x3')]},'email':{'type':Sequelize[_0xb253('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb253('0x3')]},'sStreet':{'type':Sequelize[_0xb253('0x3')]},'sPostalCode':{'type':Sequelize[_0xb253('0x3')]},'sCity':{'type':Sequelize[_0xb253('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb253('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 775b580..52df501 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 _0x8b55=['role','Companies','UserProfileSection','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','options','includeAll','include','rows','catch','params','rawAttributes','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8b55,0xc0));var _0x58b5=function(_0x28ad73,_0xae98cf){_0x28ad73=_0x28ad73-0x0;var _0x363f16=_0x8b55[_0x28ad73];return _0x363f16;};'use strict';var emlformat=require(_0x58b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58b5('0x1'));var jsonpatch=require(_0x58b5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x58b5('0x3'));var Mustache=require(_0x58b5('0x4'));var util=require(_0x58b5('0x5'));var path=require(_0x58b5('0x6'));var sox=require(_0x58b5('0x7'));var csv=require(_0x58b5('0x8'));var ejs=require(_0x58b5('0x9'));var fs=require('fs');var fs_extra=require(_0x58b5('0xa'));var _=require(_0x58b5('0xb'));var squel=require(_0x58b5('0xc'));var crypto=require(_0x58b5('0xd'));var jsforce=require(_0x58b5('0xe'));var deskjs=require(_0x58b5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x58b5('0x10'));var Redis=require(_0x58b5('0x11'));var authService=require(_0x58b5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x58b5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58b5('0x14'))(_0x58b5('0x15'));var utils=require(_0x58b5('0x16'));var config=require(_0x58b5('0x17'));var licenseUtil=require(_0x58b5('0x18'));var db=require(_0x58b5('0x19'))['db'];function respondWithStatusCode(_0x5a5fdf,_0x280bb4){_0x280bb4=_0x280bb4||0xcc;return function(_0x2abd3f){if(_0x2abd3f){return _0x5a5fdf[_0x58b5('0x1a')](_0x280bb4);}return _0x5a5fdf['status'](_0x280bb4)[_0x58b5('0x1b')]();};}function respondWithResult(_0x248742,_0x52481f){_0x52481f=_0x52481f||0xc8;return function(_0x4e6ac3){if(_0x4e6ac3){return _0x248742[_0x58b5('0x1c')](_0x52481f)[_0x58b5('0x1d')](_0x4e6ac3);}};}function respondWithFilteredResult(_0x915c6a,_0x27c1fa){return function(_0x21b3a4){if(_0x21b3a4){var _0x1c6815=typeof _0x27c1fa['offset']===_0x58b5('0x1e')&&typeof _0x27c1fa['limit']===_0x58b5('0x1e');var _0x1deb59=_0x21b3a4[_0x58b5('0x1f')];var _0x594dcb=_0x1c6815?0x0:_0x27c1fa['offset'];var _0x3d7f68=_0x1c6815?_0x21b3a4[_0x58b5('0x1f')]:_0x27c1fa[_0x58b5('0x20')]+_0x27c1fa[_0x58b5('0x21')];var _0x16ddb5;if(_0x3d7f68>=_0x1deb59){_0x3d7f68=_0x1deb59;_0x16ddb5=0xc8;}else{_0x16ddb5=0xce;}_0x915c6a[_0x58b5('0x1c')](_0x16ddb5);return _0x915c6a[_0x58b5('0x22')](_0x58b5('0x23'),_0x594dcb+'-'+_0x3d7f68+'/'+_0x1deb59)['json'](_0x21b3a4);}return null;};}function patchUpdates(_0x48b139){return function(_0x4e4630){try{jsonpatch[_0x58b5('0x24')](_0x4e4630,_0x48b139,!![]);}catch(_0x2401e2){return BPromise[_0x58b5('0x25')](_0x2401e2);}return _0x4e4630[_0x58b5('0x26')]();};}function saveUpdates(_0x1ca921,_0x2a191a){return function(_0x101514){if(_0x101514){return _0x101514[_0x58b5('0x27')](_0x1ca921)[_0x58b5('0x28')](function(_0x2382dc){return _0x2382dc;});}return null;};}function removeEntity(_0x4b7064,_0x10de29){return function(_0x9558e6){if(_0x9558e6){return _0x9558e6[_0x58b5('0x29')]()['then'](function(){var _0xaf66c8=_0x9558e6['get']({'plain':!![]});var _0x4ab02c='Companies';return db['UserProfileResource'][_0x58b5('0x29')]({'where':{'type':_0x4ab02c,'resourceId':_0xaf66c8['id']}})[_0x58b5('0x28')](function(){return _0x9558e6;});})[_0x58b5('0x28')](function(){_0x4b7064[_0x58b5('0x1c')](0xcc)[_0x58b5('0x1b')]();});}};}function handleEntityNotFound(_0x3957d9,_0x5d2ee7){return function(_0x4ebd1e){if(!_0x4ebd1e){_0x3957d9[_0x58b5('0x1a')](0x194);}return _0x4ebd1e;};}function handleError(_0x416598,_0xc3daf2){_0xc3daf2=_0xc3daf2||0x1f4;return function(_0x2a7f39){logger['error'](_0x2a7f39[_0x58b5('0x2a')]);if(_0x2a7f39[_0x58b5('0x2b')]){delete _0x2a7f39[_0x58b5('0x2b')];}_0x416598[_0x58b5('0x1c')](_0xc3daf2)[_0x58b5('0x2c')](_0x2a7f39);};}exports['index']=function(_0x1108ee,_0x5814af){var _0x45e27e={},_0x73c21e={},_0x41cebb={'count':0x0,'rows':[]};return db[_0x58b5('0x2d')][_0x58b5('0x2e')]()[_0x58b5('0x28')](function(_0x49ef2b){_0x73c21e[_0x58b5('0x2f')]=_[_0x58b5('0x30')](_0x49ef2b);_0x73c21e['query']=_[_0x58b5('0x30')](_0x1108ee[_0x58b5('0x31')]);_0x73c21e[_0x58b5('0x32')]=_[_0x58b5('0x33')](_0x73c21e[_0x58b5('0x2f')],_0x73c21e['query']);_0x45e27e['attributes']=_[_0x58b5('0x33')](_0x73c21e['model'],qs['fields'](_0x1108ee[_0x58b5('0x31')][_0x58b5('0x34')]));_0x45e27e[_0x58b5('0x35')]=_0x45e27e[_0x58b5('0x35')][_0x58b5('0x36')]?_0x45e27e[_0x58b5('0x35')]:_0x73c21e[_0x58b5('0x2f')];if(!_0x1108ee['query'][_0x58b5('0x37')](_0x58b5('0x38'))){_0x45e27e[_0x58b5('0x21')]=qs['limit'](_0x1108ee[_0x58b5('0x31')]['limit']);_0x45e27e[_0x58b5('0x20')]=qs['offset'](_0x1108ee['query']['offset']);}_0x45e27e['order']=qs[_0x58b5('0x39')](_0x1108ee[_0x58b5('0x31')]['sort']);_0x45e27e[_0x58b5('0x3a')]=qs[_0x58b5('0x32')](_[_0x58b5('0x3b')](_0x1108ee[_0x58b5('0x31')],_0x73c21e[_0x58b5('0x32')]),_0x49ef2b);if(_0x1108ee['query']['filter']){_0x45e27e[_0x58b5('0x3a')]=_[_0x58b5('0x3c')](_0x45e27e['where'],{'$or':_[_0x58b5('0x3d')](_0x45e27e[_0x58b5('0x35')],function(_0x1ec094){var _0x47d74a={};_0x47d74a[_0x1ec094]={'$like':'%'+_0x1108ee[_0x58b5('0x31')][_0x58b5('0x3e')]+'%'};return _0x47d74a;})});}_0x45e27e=_[_0x58b5('0x3c')]({},_0x45e27e,_0x1108ee[_0x58b5('0x3f')]);var _0x1b2d67={'where':_0x45e27e[_0x58b5('0x3a')]};return db[_0x58b5('0x2d')][_0x58b5('0x1f')](_0x1b2d67)[_0x58b5('0x28')](function(_0x24d5e5){_0x41cebb[_0x58b5('0x1f')]=_0x24d5e5;if(_0x1108ee[_0x58b5('0x31')][_0x58b5('0x40')]){_0x45e27e[_0x58b5('0x41')]=[{'all':!![]}];}return db[_0x58b5('0x2d')]['findAll'](_0x45e27e);})[_0x58b5('0x28')](function(_0x55b0b2){_0x41cebb[_0x58b5('0x42')]=_0x55b0b2;return _0x41cebb;})['then'](respondWithFilteredResult(_0x5814af,_0x45e27e))['catch'](handleError(_0x5814af,null));})[_0x58b5('0x43')](handleError(_0x5814af,null));};exports['show']=function(_0x5907e8,_0xa59262){var _0x18d0cd={'raw':![],'where':{'id':_0x5907e8[_0x58b5('0x44')]['id']}},_0x3f1836={};_0x3f1836[_0x58b5('0x2f')]=_['keys'](db['CmCompany'][_0x58b5('0x45')]);_0x3f1836['query']=_[_0x58b5('0x30')](_0x5907e8[_0x58b5('0x31')]);_0x3f1836['filters']=_[_0x58b5('0x33')](_0x3f1836[_0x58b5('0x2f')],_0x3f1836[_0x58b5('0x31')]);_0x18d0cd[_0x58b5('0x35')]=_[_0x58b5('0x33')](_0x3f1836['model'],qs[_0x58b5('0x34')](_0x5907e8[_0x58b5('0x31')][_0x58b5('0x34')]));_0x18d0cd[_0x58b5('0x35')]=_0x18d0cd[_0x58b5('0x35')][_0x58b5('0x36')]?_0x18d0cd['attributes']:_0x3f1836['model'];if(_0x5907e8[_0x58b5('0x31')]['includeAll']){_0x18d0cd[_0x58b5('0x41')]=[{'all':!![]}];}_0x18d0cd=_[_0x58b5('0x3c')]({},_0x18d0cd,_0x5907e8[_0x58b5('0x3f')]);return db[_0x58b5('0x2d')][_0x58b5('0x46')](_0x18d0cd)[_0x58b5('0x28')](handleEntityNotFound(_0xa59262,null))[_0x58b5('0x28')](respondWithResult(_0xa59262,null))[_0x58b5('0x43')](handleError(_0xa59262,null));};exports['create']=function(_0x4c9f7c,_0xf16e38){return db[_0x58b5('0x2d')]['create'](_0x4c9f7c[_0x58b5('0x47')],{})[_0x58b5('0x28')](function(_0x32cbb9){var _0xcea5e2=_0x4c9f7c[_0x58b5('0x48')][_0x58b5('0x49')]({'plain':!![]});if(!_0xcea5e2)throw new Error(_0x58b5('0x4a'));if(_0xcea5e2[_0x58b5('0x4b')]===_0x58b5('0x48')){var _0x5796c5=_0x32cbb9[_0x58b5('0x49')]({'plain':!![]});var _0x2841be=_0x58b5('0x4c');return db[_0x58b5('0x4d')]['find']({'where':{'name':_0x2841be,'userProfileId':_0xcea5e2['userProfileId']},'raw':!![]})['then'](function(_0x5dfc87){if(_0x5dfc87&&_0x5dfc87[_0x58b5('0x4e')]===0x0){return db[_0x58b5('0x4f')][_0x58b5('0x50')]({'name':_0x5796c5[_0x58b5('0x2b')],'resourceId':_0x5796c5['id'],'type':_0x5dfc87[_0x58b5('0x2b')],'sectionId':_0x5dfc87['id']},{})['then'](function(){return _0x32cbb9;});}else{return _0x32cbb9;}})[_0x58b5('0x43')](function(_0x22587b){logger[_0x58b5('0x51')](_0x58b5('0x52'),_0x22587b);throw _0x22587b;});}return _0x32cbb9;})[_0x58b5('0x28')](respondWithResult(_0xf16e38,0xc9))['catch'](handleError(_0xf16e38,null));};exports['update']=function(_0x3ce07a,_0x24caa4){if(_0x3ce07a[_0x58b5('0x47')]['id']){delete _0x3ce07a[_0x58b5('0x47')]['id'];}return db['CmCompany'][_0x58b5('0x46')]({'where':{'id':_0x3ce07a[_0x58b5('0x44')]['id']}})['then'](handleEntityNotFound(_0x24caa4,null))['then'](saveUpdates(_0x3ce07a[_0x58b5('0x47')],null))[_0x58b5('0x28')](respondWithResult(_0x24caa4,null))[_0x58b5('0x43')](handleError(_0x24caa4,null));};exports[_0x58b5('0x29')]=function(_0x33ac1b,_0x1bc276){return db['CmCompany'][_0x58b5('0x46')]({'where':{'id':_0x33ac1b[_0x58b5('0x44')]['id']}})[_0x58b5('0x28')](handleEntityNotFound(_0x1bc276,null))['then'](removeEntity(_0x1bc276,null))[_0x58b5('0x43')](handleError(_0x1bc276,null));};exports[_0x58b5('0x2e')]=function(_0x23ce0b,_0x2b2ae7){return db['CmCompany'][_0x58b5('0x2e')]()[_0x58b5('0x28')](respondWithResult(_0x2b2ae7,null))[_0x58b5('0x43')](handleError(_0x2b2ae7,null));};exports['addContacts']=function(_0x2c942a,_0x205030,_0x5dcb64){return db[_0x58b5('0x53')][_0x58b5('0x46')]({'where':{'id':_0x2c942a[_0x58b5('0x44')]['id']}})[_0x58b5('0x28')](handleEntityNotFound(_0x205030,null))[_0x58b5('0x28')](function(_0x250e9e){if(_0x250e9e){return _0x250e9e[_0x58b5('0x54')](_0x2c942a['body'][_0x58b5('0x55')],_[_0x58b5('0x56')](_0x2c942a[_0x58b5('0x47')],[_0x58b5('0x55'),'id'])||{});}})[_0x58b5('0x28')](respondWithResult(_0x205030,null))[_0x58b5('0x43')](handleError(_0x205030,null));};exports[_0x58b5('0x57')]=function(_0xb162cd,_0x394ba6,_0x1030b1){var _0x3d0898={};var _0x2764e1={};var _0x29c7af;var _0x5eeb1d;return db['CmCompany'][_0x58b5('0x58')]({'where':{'id':_0xb162cd[_0x58b5('0x44')]['id']}})[_0x58b5('0x28')](handleEntityNotFound(_0x394ba6,null))[_0x58b5('0x28')](function(_0x5455bb){if(_0x5455bb){_0x29c7af=_0x5455bb;_0x2764e1[_0x58b5('0x2f')]=_[_0x58b5('0x30')](db['CmContact'][_0x58b5('0x45')]);_0x2764e1[_0x58b5('0x31')]=_[_0x58b5('0x30')](_0xb162cd[_0x58b5('0x31')]);_0x2764e1[_0x58b5('0x32')]=_[_0x58b5('0x33')](_0x2764e1[_0x58b5('0x2f')],_0x2764e1[_0x58b5('0x31')]);_0x3d0898[_0x58b5('0x35')]=_[_0x58b5('0x33')](_0x2764e1[_0x58b5('0x2f')],qs[_0x58b5('0x34')](_0xb162cd[_0x58b5('0x31')][_0x58b5('0x34')]));_0x3d0898['attributes']=_0x3d0898[_0x58b5('0x35')][_0x58b5('0x36')]?_0x3d0898[_0x58b5('0x35')]:_0x2764e1['model'];_0x3d0898['order']=qs['sort'](_0xb162cd[_0x58b5('0x31')]['sort']);_0x3d0898[_0x58b5('0x3a')]=qs['filters'](_['pick'](_0xb162cd[_0x58b5('0x31')],_0x2764e1['filters']));if(_0xb162cd[_0x58b5('0x31')][_0x58b5('0x3e')]){_0x3d0898[_0x58b5('0x3a')]=_[_0x58b5('0x3c')](_0x3d0898['where'],{'$or':_[_0x58b5('0x3d')](_0x3d0898['attributes'],function(_0x7b09cf){var _0x47e9d0={};_0x47e9d0[_0x7b09cf]={'$like':'%'+_0xb162cd[_0x58b5('0x31')][_0x58b5('0x3e')]+'%'};return _0x47e9d0;})});}_0x3d0898=_[_0x58b5('0x3c')]({},_0x3d0898,_0xb162cd[_0x58b5('0x3f')]);return _0x29c7af[_0x58b5('0x57')](_0x3d0898);}})[_0x58b5('0x28')](function(_0x2ac028){if(_0x2ac028){_0x5eeb1d=_0x2ac028[_0x58b5('0x36')];if(!_0xb162cd[_0x58b5('0x31')][_0x58b5('0x37')](_0x58b5('0x38'))){_0x3d0898['limit']=qs[_0x58b5('0x21')](_0xb162cd[_0x58b5('0x31')]['limit']);_0x3d0898[_0x58b5('0x20')]=qs[_0x58b5('0x20')](_0xb162cd[_0x58b5('0x31')]['offset']);}return _0x29c7af[_0x58b5('0x57')](_0x3d0898);}})['then'](function(_0x2e37a1){if(_0x2e37a1){return _0x2e37a1?{'count':_0x5eeb1d,'rows':_0x2e37a1}:null;}})['then'](respondWithResult(_0x394ba6,null))[_0x58b5('0x43')](handleError(_0x394ba6,null));};
\ No newline at end of file
+var _0x7f87=['include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Companies','userProfileId','autoAssociation','error','addContacts','ids','getContacts','findOne','CmContact','order','sort','hasOwnProperty','nolimit','rimraf','request-promise','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','where','pick','filter','merge','map','options','includeAll'];(function(_0x392f67,_0x773cc4){var _0x5810d6=function(_0x1da556){while(--_0x1da556){_0x392f67['push'](_0x392f67['shift']());}};_0x5810d6(++_0x773cc4);}(_0x7f87,0x1f3));var _0x77f8=function(_0x4504e3,_0x5ad201){_0x4504e3=_0x4504e3-0x0;var _0x14ff39=_0x7f87[_0x4504e3];return _0x14ff39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x77f8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77f8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x77f8('0x2'));var path=require(_0x77f8('0x3'));var sox=require('sox');var csv=require(_0x77f8('0x4'));var ejs=require(_0x77f8('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77f8('0x6'));var squel=require('squel');var crypto=require(_0x77f8('0x7'));var jsforce=require(_0x77f8('0x8'));var deskjs=require(_0x77f8('0x9'));var toCsv=require(_0x77f8('0x4'));var querystring=require(_0x77f8('0xa'));var Papa=require(_0x77f8('0xb'));var Redis=require('ioredis');var authService=require(_0x77f8('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x77f8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77f8('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x77f8('0xf'));var licenseUtil=require(_0x77f8('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f6e76,_0x226aba){_0x226aba=_0x226aba||0xcc;return function(_0x1177a1){if(_0x1177a1){return _0x1f6e76[_0x77f8('0x11')](_0x226aba);}return _0x1f6e76['status'](_0x226aba)[_0x77f8('0x12')]();};}function respondWithResult(_0x4af0cb,_0x5ee51e){_0x5ee51e=_0x5ee51e||0xc8;return function(_0x523275){if(_0x523275){return _0x4af0cb['status'](_0x5ee51e)[_0x77f8('0x13')](_0x523275);}};}function respondWithFilteredResult(_0x459250,_0xbb7ab1){return function(_0x505e62){if(_0x505e62){var _0x4078de=typeof _0xbb7ab1['offset']===_0x77f8('0x14')&&typeof _0xbb7ab1[_0x77f8('0x15')]===_0x77f8('0x14');var _0xdb21a5=_0x505e62[_0x77f8('0x16')];var _0x5b9978=_0x4078de?0x0:_0xbb7ab1[_0x77f8('0x17')];var _0x41d888=_0x4078de?_0x505e62['count']:_0xbb7ab1['offset']+_0xbb7ab1[_0x77f8('0x15')];var _0x2e3e6d;if(_0x41d888>=_0xdb21a5){_0x41d888=_0xdb21a5;_0x2e3e6d=0xc8;}else{_0x2e3e6d=0xce;}_0x459250[_0x77f8('0x18')](_0x2e3e6d);return _0x459250[_0x77f8('0x19')](_0x77f8('0x1a'),_0x5b9978+'-'+_0x41d888+'/'+_0xdb21a5)[_0x77f8('0x13')](_0x505e62);}return null;};}function patchUpdates(_0x3430bf){return function(_0x4863c){try{jsonpatch[_0x77f8('0x1b')](_0x4863c,_0x3430bf,!![]);}catch(_0x3da338){return BPromise[_0x77f8('0x1c')](_0x3da338);}return _0x4863c[_0x77f8('0x1d')]();};}function saveUpdates(_0xa85a6d,_0x20dacf){return function(_0x35c7ca){if(_0x35c7ca){return _0x35c7ca[_0x77f8('0x1e')](_0xa85a6d)[_0x77f8('0x1f')](function(_0x318747){return _0x318747;});}return null;};}function removeEntity(_0x4e01d5,_0x17e8ed){return function(_0x23d56b){if(_0x23d56b){return _0x23d56b[_0x77f8('0x20')]()[_0x77f8('0x1f')](function(){var _0xbde72e=_0x23d56b['get']({'plain':!![]});var _0x22ce6f='Companies';return db[_0x77f8('0x21')][_0x77f8('0x20')]({'where':{'type':_0x22ce6f,'resourceId':_0xbde72e['id']}})['then'](function(){return _0x23d56b;});})[_0x77f8('0x1f')](function(){_0x4e01d5[_0x77f8('0x18')](0xcc)[_0x77f8('0x12')]();});}};}function handleEntityNotFound(_0x317692,_0x508bef){return function(_0x1f2ad2){if(!_0x1f2ad2){_0x317692['sendStatus'](0x194);}return _0x1f2ad2;};}function handleError(_0x5270a2,_0x5a5821){_0x5a5821=_0x5a5821||0x1f4;return function(_0x4fd59f){logger['error'](_0x4fd59f[_0x77f8('0x22')]);if(_0x4fd59f[_0x77f8('0x23')]){delete _0x4fd59f[_0x77f8('0x23')];}_0x5270a2[_0x77f8('0x18')](_0x5a5821)['send'](_0x4fd59f);};}exports[_0x77f8('0x24')]=function(_0x8ba89d,_0x4f15cc){var _0x5da118={},_0x1f1dcb={},_0x2c9ae7={'count':0x0,'rows':[]};return db[_0x77f8('0x25')][_0x77f8('0x26')]()[_0x77f8('0x1f')](function(_0x44d9c8){_0x1f1dcb[_0x77f8('0x27')]=_[_0x77f8('0x28')](_0x44d9c8);_0x1f1dcb[_0x77f8('0x29')]=_[_0x77f8('0x28')](_0x8ba89d[_0x77f8('0x29')]);_0x1f1dcb[_0x77f8('0x2a')]=_[_0x77f8('0x2b')](_0x1f1dcb['model'],_0x1f1dcb[_0x77f8('0x29')]);_0x5da118[_0x77f8('0x2c')]=_[_0x77f8('0x2b')](_0x1f1dcb['model'],qs[_0x77f8('0x2d')](_0x8ba89d[_0x77f8('0x29')][_0x77f8('0x2d')]));_0x5da118[_0x77f8('0x2c')]=_0x5da118[_0x77f8('0x2c')][_0x77f8('0x2e')]?_0x5da118['attributes']:_0x1f1dcb[_0x77f8('0x27')];if(!_0x8ba89d[_0x77f8('0x29')]['hasOwnProperty']('nolimit')){_0x5da118[_0x77f8('0x15')]=qs[_0x77f8('0x15')](_0x8ba89d[_0x77f8('0x29')][_0x77f8('0x15')]);_0x5da118[_0x77f8('0x17')]=qs[_0x77f8('0x17')](_0x8ba89d[_0x77f8('0x29')][_0x77f8('0x17')]);}_0x5da118['order']=qs['sort'](_0x8ba89d[_0x77f8('0x29')]['sort']);_0x5da118[_0x77f8('0x2f')]=qs[_0x77f8('0x2a')](_[_0x77f8('0x30')](_0x8ba89d[_0x77f8('0x29')],_0x1f1dcb[_0x77f8('0x2a')]),_0x44d9c8);if(_0x8ba89d[_0x77f8('0x29')][_0x77f8('0x31')]){_0x5da118[_0x77f8('0x2f')]=_[_0x77f8('0x32')](_0x5da118[_0x77f8('0x2f')],{'$or':_[_0x77f8('0x33')](_0x5da118[_0x77f8('0x2c')],function(_0x3a12fd){var _0x55c93a={};_0x55c93a[_0x3a12fd]={'$like':'%'+_0x8ba89d[_0x77f8('0x29')][_0x77f8('0x31')]+'%'};return _0x55c93a;})});}_0x5da118=_['merge']({},_0x5da118,_0x8ba89d[_0x77f8('0x34')]);var _0x5933b0={'where':_0x5da118[_0x77f8('0x2f')]};return db['CmCompany'][_0x77f8('0x16')](_0x5933b0)[_0x77f8('0x1f')](function(_0x53c66a){_0x2c9ae7[_0x77f8('0x16')]=_0x53c66a;if(_0x8ba89d[_0x77f8('0x29')][_0x77f8('0x35')]){_0x5da118[_0x77f8('0x36')]=[{'all':!![]}];}return db[_0x77f8('0x25')][_0x77f8('0x37')](_0x5da118);})[_0x77f8('0x1f')](function(_0x39869f){_0x2c9ae7[_0x77f8('0x38')]=_0x39869f;return _0x2c9ae7;})['then'](respondWithFilteredResult(_0x4f15cc,_0x5da118))[_0x77f8('0x39')](handleError(_0x4f15cc,null));})[_0x77f8('0x39')](handleError(_0x4f15cc,null));};exports[_0x77f8('0x3a')]=function(_0x65546b,_0x30de1f){var _0x98a4fd={'raw':![],'where':{'id':_0x65546b[_0x77f8('0x3b')]['id']}},_0x1d5076={};_0x1d5076[_0x77f8('0x27')]=_[_0x77f8('0x28')](db[_0x77f8('0x25')][_0x77f8('0x3c')]);_0x1d5076['query']=_[_0x77f8('0x28')](_0x65546b[_0x77f8('0x29')]);_0x1d5076[_0x77f8('0x2a')]=_['intersection'](_0x1d5076[_0x77f8('0x27')],_0x1d5076['query']);_0x98a4fd[_0x77f8('0x2c')]=_[_0x77f8('0x2b')](_0x1d5076[_0x77f8('0x27')],qs['fields'](_0x65546b[_0x77f8('0x29')][_0x77f8('0x2d')]));_0x98a4fd[_0x77f8('0x2c')]=_0x98a4fd[_0x77f8('0x2c')]['length']?_0x98a4fd[_0x77f8('0x2c')]:_0x1d5076[_0x77f8('0x27')];if(_0x65546b['query']['includeAll']){_0x98a4fd[_0x77f8('0x36')]=[{'all':!![]}];}_0x98a4fd=_[_0x77f8('0x32')]({},_0x98a4fd,_0x65546b['options']);return db['CmCompany'][_0x77f8('0x3d')](_0x98a4fd)[_0x77f8('0x1f')](handleEntityNotFound(_0x30de1f,null))['then'](respondWithResult(_0x30de1f,null))[_0x77f8('0x39')](handleError(_0x30de1f,null));};exports[_0x77f8('0x3e')]=function(_0xb84599,_0x14146a){return db['CmCompany']['create'](_0xb84599[_0x77f8('0x3f')],{})[_0x77f8('0x1f')](function(_0x6387fe){var _0x317e1a=_0xb84599[_0x77f8('0x40')][_0x77f8('0x41')]({'plain':!![]});if(!_0x317e1a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x317e1a['role']===_0x77f8('0x40')){var _0x3e5bba=_0x6387fe[_0x77f8('0x41')]({'plain':!![]});var _0x5ef171=_0x77f8('0x42');return db['UserProfileSection']['find']({'where':{'name':_0x5ef171,'userProfileId':_0x317e1a[_0x77f8('0x43')]},'raw':!![]})['then'](function(_0x2b63c2){if(_0x2b63c2&&_0x2b63c2[_0x77f8('0x44')]===0x0){return db[_0x77f8('0x21')][_0x77f8('0x3e')]({'name':_0x3e5bba['name'],'resourceId':_0x3e5bba['id'],'type':_0x2b63c2[_0x77f8('0x23')],'sectionId':_0x2b63c2['id']},{})[_0x77f8('0x1f')](function(){return _0x6387fe;});}else{return _0x6387fe;}})[_0x77f8('0x39')](function(_0x25a6a9){logger[_0x77f8('0x45')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25a6a9);throw _0x25a6a9;});}return _0x6387fe;})['then'](respondWithResult(_0x14146a,0xc9))[_0x77f8('0x39')](handleError(_0x14146a,null));};exports['update']=function(_0x2f1f52,_0x3ad6cb){if(_0x2f1f52[_0x77f8('0x3f')]['id']){delete _0x2f1f52[_0x77f8('0x3f')]['id'];}return db['CmCompany'][_0x77f8('0x3d')]({'where':{'id':_0x2f1f52[_0x77f8('0x3b')]['id']}})[_0x77f8('0x1f')](handleEntityNotFound(_0x3ad6cb,null))['then'](saveUpdates(_0x2f1f52['body'],null))[_0x77f8('0x1f')](respondWithResult(_0x3ad6cb,null))[_0x77f8('0x39')](handleError(_0x3ad6cb,null));};exports[_0x77f8('0x20')]=function(_0x3fcdc0,_0x529af1){return db[_0x77f8('0x25')][_0x77f8('0x3d')]({'where':{'id':_0x3fcdc0[_0x77f8('0x3b')]['id']}})[_0x77f8('0x1f')](handleEntityNotFound(_0x529af1,null))[_0x77f8('0x1f')](removeEntity(_0x529af1,null))[_0x77f8('0x39')](handleError(_0x529af1,null));};exports[_0x77f8('0x26')]=function(_0x8166ce,_0x12c0d0){return db[_0x77f8('0x25')][_0x77f8('0x26')]()['then'](respondWithResult(_0x12c0d0,null))[_0x77f8('0x39')](handleError(_0x12c0d0,null));};exports[_0x77f8('0x46')]=function(_0x56c31f,_0xc9559,_0x1a2e12){return db['CmContact']['find']({'where':{'id':_0x56c31f['params']['id']}})[_0x77f8('0x1f')](handleEntityNotFound(_0xc9559,null))[_0x77f8('0x1f')](function(_0x416030){if(_0x416030){return _0x416030['addContacts'](_0x56c31f[_0x77f8('0x3f')][_0x77f8('0x47')],_['omit'](_0x56c31f[_0x77f8('0x3f')],[_0x77f8('0x47'),'id'])||{});}})[_0x77f8('0x1f')](respondWithResult(_0xc9559,null))[_0x77f8('0x39')](handleError(_0xc9559,null));};exports[_0x77f8('0x48')]=function(_0x2db575,_0x32fb34,_0x58e6ba){var _0x22a455={};var _0x464cb5={};var _0x556ea3;var _0x2f1299;return db[_0x77f8('0x25')][_0x77f8('0x49')]({'where':{'id':_0x2db575[_0x77f8('0x3b')]['id']}})[_0x77f8('0x1f')](handleEntityNotFound(_0x32fb34,null))[_0x77f8('0x1f')](function(_0x48736f){if(_0x48736f){_0x556ea3=_0x48736f;_0x464cb5[_0x77f8('0x27')]=_[_0x77f8('0x28')](db[_0x77f8('0x4a')][_0x77f8('0x3c')]);_0x464cb5[_0x77f8('0x29')]=_[_0x77f8('0x28')](_0x2db575[_0x77f8('0x29')]);_0x464cb5[_0x77f8('0x2a')]=_['intersection'](_0x464cb5['model'],_0x464cb5['query']);_0x22a455[_0x77f8('0x2c')]=_[_0x77f8('0x2b')](_0x464cb5[_0x77f8('0x27')],qs['fields'](_0x2db575[_0x77f8('0x29')][_0x77f8('0x2d')]));_0x22a455[_0x77f8('0x2c')]=_0x22a455['attributes'][_0x77f8('0x2e')]?_0x22a455[_0x77f8('0x2c')]:_0x464cb5[_0x77f8('0x27')];_0x22a455[_0x77f8('0x4b')]=qs[_0x77f8('0x4c')](_0x2db575[_0x77f8('0x29')]['sort']);_0x22a455[_0x77f8('0x2f')]=qs[_0x77f8('0x2a')](_[_0x77f8('0x30')](_0x2db575[_0x77f8('0x29')],_0x464cb5['filters']));if(_0x2db575['query'][_0x77f8('0x31')]){_0x22a455['where']=_[_0x77f8('0x32')](_0x22a455[_0x77f8('0x2f')],{'$or':_['map'](_0x22a455[_0x77f8('0x2c')],function(_0x5ede8e){var _0x4ce8c2={};_0x4ce8c2[_0x5ede8e]={'$like':'%'+_0x2db575[_0x77f8('0x29')][_0x77f8('0x31')]+'%'};return _0x4ce8c2;})});}_0x22a455=_['merge']({},_0x22a455,_0x2db575['options']);return _0x556ea3[_0x77f8('0x48')](_0x22a455);}})[_0x77f8('0x1f')](function(_0x4733a2){if(_0x4733a2){_0x2f1299=_0x4733a2[_0x77f8('0x2e')];if(!_0x2db575['query'][_0x77f8('0x4d')](_0x77f8('0x4e'))){_0x22a455[_0x77f8('0x15')]=qs[_0x77f8('0x15')](_0x2db575[_0x77f8('0x29')][_0x77f8('0x15')]);_0x22a455['offset']=qs[_0x77f8('0x17')](_0x2db575[_0x77f8('0x29')]['offset']);}return _0x556ea3[_0x77f8('0x48')](_0x22a455);}})[_0x77f8('0x1f')](function(_0x4fbd7e){if(_0x4fbd7e){return _0x4fbd7e?{'count':_0x2f1299,'rows':_0x4fbd7e}:null;}})[_0x77f8('0x1f')](respondWithResult(_0x32fb34,null))['catch'](handleError(_0x32fb34,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 82cc662..b764309 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 _0x5d7c=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x5d7c,0x1a1));var _0xc5d7=function(_0x7f971b,_0x32f797){_0x7f971b=_0x7f971b-0x0;var _0x16405f=_0x5d7c[_0x7f971b];return _0x16405f;};'use strict';var _=require(_0xc5d7('0x0'));var util=require(_0xc5d7('0x1'));var logger=require(_0xc5d7('0x2'))(_0xc5d7('0x3'));var moment=require('moment');var BPromise=require(_0xc5d7('0x4'));var rp=require(_0xc5d7('0x5'));var fs=require('fs');var path=require(_0xc5d7('0x6'));var rimraf=require(_0xc5d7('0x7'));var config=require(_0xc5d7('0x8'));var attributes=require('./cmCompany.attributes');module[_0xc5d7('0x9')]=function(_0xb5ca62,_0x2c14a6){return _0xb5ca62['define'](_0xc5d7('0xa'),attributes,{'tableName':_0xc5d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb37=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash'];(function(_0x41dccc,_0x26f668){var _0xf1c161=function(_0xf36089){while(--_0xf36089){_0x41dccc['push'](_0x41dccc['shift']());}};_0xf1c161(++_0x26f668);}(_0xbb37,0xe6));var _0x7bb3=function(_0x29ed63,_0x3255c5){_0x29ed63=_0x29ed63-0x0;var _0x5e86c6=_0xbb37[_0x29ed63];return _0x5e86c6;};'use strict';var _=require(_0x7bb3('0x0'));var util=require('util');var logger=require(_0x7bb3('0x1'))('api');var moment=require(_0x7bb3('0x2'));var BPromise=require(_0x7bb3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7bb3('0x4'));var rimraf=require(_0x7bb3('0x5'));var config=require(_0x7bb3('0x6'));var attributes=require(_0x7bb3('0x7'));module[_0x7bb3('0x8')]=function(_0x9f3353,_0x494b98){return _0x9f3353[_0x7bb3('0x9')](_0x7bb3('0xa'),attributes,{'tableName':'cm_companies','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 771fd56..e91b391 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 _0x2dc4=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x2dc4,0xb2));var _0x42dc=function(_0x238738,_0xeae3b6){_0x238738=_0x238738-0x0;var _0x46d76f=_0x2dc4[_0x238738];return _0x46d76f;};'use strict';var _=require(_0x42dc('0x0'));var util=require(_0x42dc('0x1'));var moment=require(_0x42dc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42dc('0x3'));var db=require(_0x42dc('0x4'))['db'];var utils=require(_0x42dc('0x5'));var logger=require(_0x42dc('0x6'))(_0x42dc('0x7'));var config=require('../../config/environment');var jayson=require(_0x42dc('0x8'));var client=jayson[_0x42dc('0x9')][_0x42dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38207b,_0x1e944b,_0xc5e862){return new BPromise(function(_0x229a4f,_0x5b1572){return client[_0x42dc('0xb')](_0x38207b,_0xc5e862)['then'](function(_0x200581){logger['info'](_0x42dc('0xc'),_0x1e944b,_0x42dc('0xd'));logger[_0x42dc('0xe')](_0x42dc('0xf'),_0x1e944b,'request\x20sent',JSON['stringify'](_0x200581));if(_0x200581[_0x42dc('0x10')]){if(_0x200581[_0x42dc('0x10')][_0x42dc('0x11')]===0x1f4){logger[_0x42dc('0x10')](_0x42dc('0xc'),_0x1e944b,_0x200581[_0x42dc('0x10')][_0x42dc('0x12')]);return _0x5b1572(_0x200581['error'][_0x42dc('0x12')]);}logger[_0x42dc('0x10')]('CmCompany,\x20%s,\x20%s',_0x1e944b,_0x200581[_0x42dc('0x10')][_0x42dc('0x12')]);return _0x229a4f(_0x200581[_0x42dc('0x10')][_0x42dc('0x12')]);}else{logger[_0x42dc('0x13')](_0x42dc('0xc'),_0x1e944b,_0x42dc('0xd'));_0x229a4f(_0x200581[_0x42dc('0x14')][_0x42dc('0x12')]);}})[_0x42dc('0x15')](function(_0x7f1a61){logger[_0x42dc('0x10')](_0x42dc('0xc'),_0x1e944b,_0x7f1a61);_0x5b1572(_0x7f1a61);});});}
\ No newline at end of file
+var _0x1c8c=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1c8c,0x100));var _0xc1c8=function(_0x16ceb5,_0x24dbf0){_0x16ceb5=_0x16ceb5-0x0;var _0x2ecd40=_0x1c8c[_0x16ceb5];return _0x2ecd40;};'use strict';var _=require(_0xc1c8('0x0'));var util=require(_0xc1c8('0x1'));var moment=require(_0xc1c8('0x2'));var BPromise=require(_0xc1c8('0x3'));var rs=require(_0xc1c8('0x4'));var fs=require('fs');var Redis=require(_0xc1c8('0x5'));var db=require(_0xc1c8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1c8('0x7'))(_0xc1c8('0x8'));var config=require('../../config/environment');var jayson=require(_0xc1c8('0x9'));var client=jayson[_0xc1c8('0xa')][_0xc1c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1638c3,_0x18fdb8,_0x4291c3){return new BPromise(function(_0x29fe48,_0x32ec57){return client[_0xc1c8('0xc')](_0x1638c3,_0x4291c3)[_0xc1c8('0xd')](function(_0x243dc9){logger['info'](_0xc1c8('0xe'),_0x18fdb8,_0xc1c8('0xf'));logger[_0xc1c8('0x10')](_0xc1c8('0x11'),_0x18fdb8,_0xc1c8('0xf'),JSON[_0xc1c8('0x12')](_0x243dc9));if(_0x243dc9[_0xc1c8('0x13')]){if(_0x243dc9[_0xc1c8('0x13')][_0xc1c8('0x14')]===0x1f4){logger['error'](_0xc1c8('0xe'),_0x18fdb8,_0x243dc9['error']['message']);return _0x32ec57(_0x243dc9[_0xc1c8('0x13')][_0xc1c8('0x15')]);}logger[_0xc1c8('0x13')]('CmCompany,\x20%s,\x20%s',_0x18fdb8,_0x243dc9[_0xc1c8('0x13')][_0xc1c8('0x15')]);return _0x29fe48(_0x243dc9[_0xc1c8('0x13')][_0xc1c8('0x15')]);}else{logger[_0xc1c8('0x16')](_0xc1c8('0xe'),_0x18fdb8,_0xc1c8('0xf'));_0x29fe48(_0x243dc9[_0xc1c8('0x17')][_0xc1c8('0x15')]);}})[_0xc1c8('0x18')](function(_0xa8e10a){logger[_0xc1c8('0x13')](_0xc1c8('0xe'),_0x18fdb8,_0xa8e10a);_0x32ec57(_0xa8e10a);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 757d428..48f21fa 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 _0xcd6f=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xcd6f,0x1be));var _0xfcd6=function(_0x103316,_0x4b7261){_0x103316=_0x103316-0x0;var _0x55eaf3=_0xcd6f[_0x103316];return _0x55eaf3;};'use strict';var multer=require(_0xfcd6('0x0'));var util=require(_0xfcd6('0x1'));var path=require(_0xfcd6('0x2'));var timeout=require(_0xfcd6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfcd6('0x4'));var interaction=require(_0xfcd6('0x5'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0xfcd6('0x6')]('/',auth[_0xfcd6('0x7')](),controller[_0xfcd6('0x8')]);router[_0xfcd6('0x6')](_0xfcd6('0x9'),auth['isAuthenticated'](),controller[_0xfcd6('0xa')]);router[_0xfcd6('0x6')](_0xfcd6('0xb'),auth['isAuthenticated'](),controller[_0xfcd6('0xc')]);router[_0xfcd6('0x6')](_0xfcd6('0xd'),auth[_0xfcd6('0x7')](),controller[_0xfcd6('0xe')]);router[_0xfcd6('0xf')]('/',auth['isAuthenticated'](),controller[_0xfcd6('0x10')]);router[_0xfcd6('0xf')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0xfcd6('0x11')](_0xfcd6('0xb'),auth[_0xfcd6('0x7')](),controller[_0xfcd6('0x12')]);router[_0xfcd6('0x13')](_0xfcd6('0xb'),auth[_0xfcd6('0x7')](),controller[_0xfcd6('0x14')]);module[_0xfcd6('0x15')]=router;
\ No newline at end of file
+var _0xd4ee=['describe','show','/:id/contacts','getContacts','create','addContacts','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe'];(function(_0x80935e,_0x95043b){var _0x21693e=function(_0x168c05){while(--_0x168c05){_0x80935e['push'](_0x80935e['shift']());}};_0x21693e(++_0x95043b);}(_0xd4ee,0x1e6));var _0xed4e=function(_0x4434d7,_0x20ac5a){_0x4434d7=_0x4434d7-0x0;var _0x3bd620=_0xd4ee[_0x4434d7];return _0x3bd620;};'use strict';var multer=require(_0xed4e('0x0'));var util=require(_0xed4e('0x1'));var path=require(_0xed4e('0x2'));var timeout=require(_0xed4e('0x3'));var express=require(_0xed4e('0x4'));var router=express[_0xed4e('0x5')]();var fs_extra=require(_0xed4e('0x6'));var auth=require(_0xed4e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xed4e('0x8'));var controller=require(_0xed4e('0x9'));router[_0xed4e('0xa')]('/',auth[_0xed4e('0xb')](),controller[_0xed4e('0xc')]);router['get'](_0xed4e('0xd'),auth[_0xed4e('0xb')](),controller[_0xed4e('0xe')]);router['get']('/:id',auth[_0xed4e('0xb')](),controller[_0xed4e('0xf')]);router[_0xed4e('0xa')](_0xed4e('0x10'),auth['isAuthenticated'](),controller[_0xed4e('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xed4e('0x12')]);router['post'](_0xed4e('0x10'),auth[_0xed4e('0xb')](),controller[_0xed4e('0x13')]);router[_0xed4e('0x14')](_0xed4e('0x15'),auth[_0xed4e('0xb')](),controller['update']);router[_0xed4e('0x16')](_0xed4e('0x15'),auth[_0xed4e('0xb')](),controller[_0xed4e('0x17')]);module[_0xed4e('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 50705a4..05ffaed 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 _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x757a,0xde));var _0xa757=function(_0x3319d6,_0x115301){_0x3319d6=_0x3319d6-0x0;var _0x586e19=_0x757a[_0x3319d6];return _0x586e19;};'use strict';var _=require('lodash');var Sequelize=require(_0xa757('0x0'));module[_0xa757('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa757('0x2')]},'city':{'type':Sequelize[_0xa757('0x2')]},'country':{'type':Sequelize[_0xa757('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa757('0x2')]},'description':{'type':Sequelize[_0xa757('0x3')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa757('0x2')]},'email':{'type':Sequelize[_0xa757('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa757('0x2')]},'fb_data':{'type':Sequelize[_0xa757('0x2')]},'twitter':{'type':Sequelize[_0xa757('0x2')]},'skype':{'type':Sequelize[_0xa757('0x2')]},'teams':{'type':Sequelize[_0xa757('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa757('0x2')]},'wechat':{'type':Sequelize[_0xa757('0x2')]},'telegram':{'type':Sequelize[_0xa757('0x2')]},'UserId':{'type':Sequelize[_0xa757('0x4')]},'priority':{'type':Sequelize[_0xa757('0x4')](0x2)[_0xa757('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa757('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4ab871,_0x19eb0a){var _0x27d796=function(_0x20119b){while(--_0x20119b){_0x4ab871['push'](_0x4ab871['shift']());}};_0x27d796(++_0x19eb0a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 9504cf9..50794ce 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 _0x4e2f=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','push','CmCustomField','trimStart','all','length','fieldType','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','type','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','agent','some','c.ListId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','c.firstName','c.mobile','c.fax','c.email','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','tags','findAll','columnName','displayName','alias','custom','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','timezones','utcOffset','each','duplicates','findOrCreate','spread','error','show','params','$and','omit','format','dialTimezone','pickBy','cf_%d','table','id\x20=\x20?','toParam','values','phone','CmHopper','getTags','findOne','rawAttributes','filters','setTags','ids','getHoppers','ContactId','options','includeAll','include','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','createReadStream','file','parse','meta','import','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','getJourney','mail','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','findAndCountAll','fullname','chat','Account','note','thirdDisposition','Owner','customerPort','deviceModel','osName','ratingType','ratingValue','referer','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x59543b,_0x364e20){var _0x32ec92=function(_0x287728){while(--_0x287728){_0x59543b['push'](_0x59543b['shift']());}};_0x32ec92(++_0x364e20);}(_0x4e2f,0x11f));var _0xf4e2=function(_0x5b24b9,_0x11e150){_0x5b24b9=_0x5b24b9-0x0;var _0x4f4e4f=_0x4e2f[_0x5b24b9];return _0x4f4e4f;};'use strict';var emlformat=require(_0xf4e2('0x0'));var rimraf=require(_0xf4e2('0x1'));var zipdir=require(_0xf4e2('0x2'));var jsonpatch=require(_0xf4e2('0x3'));var rp=require(_0xf4e2('0x4'));var moment=require(_0xf4e2('0x5'));var BPromise=require(_0xf4e2('0x6'));var Mustache=require(_0xf4e2('0x7'));var util=require(_0xf4e2('0x8'));var path=require(_0xf4e2('0x9'));var sox=require(_0xf4e2('0xa'));var csv=require(_0xf4e2('0xb'));var ejs=require(_0xf4e2('0xc'));var fs=require('fs');var fs_extra=require(_0xf4e2('0xd'));var _=require(_0xf4e2('0xe'));var squel=require(_0xf4e2('0xf'));var crypto=require('crypto');var jsforce=require(_0xf4e2('0x10'));var deskjs=require(_0xf4e2('0x11'));var toCsv=require(_0xf4e2('0xb'));var querystring=require(_0xf4e2('0x12'));var Papa=require(_0xf4e2('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf4e2('0x14'));var as=require(_0xf4e2('0x15'));var hardwareService=require(_0xf4e2('0x16'));var logger=require(_0xf4e2('0x17'))('api');var utils=require(_0xf4e2('0x18'));var config=require(_0xf4e2('0x19'));var shared=require(_0xf4e2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf4e2('0x1b'))['db'];config[_0xf4e2('0x1c')]=_[_0xf4e2('0x1d')](config[_0xf4e2('0x1c')],{'host':_0xf4e2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')[_0xf4e2('0x1f')](socket);function respondWithStatusCode(_0x1b782d,_0x50ae55){_0x50ae55=_0x50ae55||0xcc;return function(_0x31dba7){if(_0x31dba7){return _0x1b782d[_0xf4e2('0x20')](_0x50ae55);}return _0x1b782d[_0xf4e2('0x21')](_0x50ae55)[_0xf4e2('0x22')]();};}function respondWithResult(_0x168ac4,_0xf8b2e0){_0xf8b2e0=_0xf8b2e0||0xc8;return function(_0x488196){if(_0x488196){return _0x168ac4[_0xf4e2('0x21')](_0xf8b2e0)[_0xf4e2('0x23')](_0x488196);}};}function respondWithFilteredResult(_0x2f4a89,_0x10d4f3){return function(_0x2f172c){if(_0x2f172c){var _0x2a065f=typeof _0x10d4f3[_0xf4e2('0x24')]==='undefined'&&typeof _0x10d4f3['limit']===_0xf4e2('0x25');var _0x187a1e=_0x2f172c['count'];var _0x244ca5=_0x2a065f?0x0:_0x10d4f3['offset'];var _0x121e5d=_0x2a065f?_0x2f172c[_0xf4e2('0x26')]:_0x10d4f3[_0xf4e2('0x24')]+_0x10d4f3[_0xf4e2('0x27')];var _0x1f4dd0;if(_0x121e5d>=_0x187a1e){_0x121e5d=_0x187a1e;_0x1f4dd0=0xc8;}else{_0x1f4dd0=0xce;}_0x2f4a89[_0xf4e2('0x21')](_0x1f4dd0);return _0x2f4a89[_0xf4e2('0x28')](_0xf4e2('0x29'),_0x244ca5+'-'+_0x121e5d+'/'+_0x187a1e)[_0xf4e2('0x23')](_0x2f172c);}return null;};}function patchUpdates(_0x4eb870){return function(_0x20ccb5){try{jsonpatch['apply'](_0x20ccb5,_0x4eb870,!![]);}catch(_0x4414fb){return BPromise[_0xf4e2('0x2a')](_0x4414fb);}return _0x20ccb5[_0xf4e2('0x2b')]();};}function saveUpdates(_0xeee80e,_0x58f667){return function(_0x4184af){if(_0x4184af){return _0x4184af[_0xf4e2('0x2c')](_0xeee80e)[_0xf4e2('0x2d')](function(_0x3aef86){return _0x3aef86;});}return null;};}function removeEntity(_0x387c2d,_0x3443c1){return function(_0x3c5ae1){if(_0x3c5ae1){return _0x3c5ae1[_0xf4e2('0x2e')]()['then'](function(){_0x387c2d[_0xf4e2('0x21')](0xcc)[_0xf4e2('0x22')]();});}};}function handleEntityNotFound(_0x4c89a3,_0x34de55){return function(_0x22af92){if(!_0x22af92){_0x4c89a3[_0xf4e2('0x20')](0x194);}return _0x22af92;};}function handleError(_0x325999,_0x38d4de){_0x38d4de=_0x38d4de||0x1f4;return function(_0x5a1298){logger['error'](_0x5a1298[_0xf4e2('0x2f')]);if(_0x5a1298[_0xf4e2('0x30')]){delete _0x5a1298['name'];}_0x325999[_0xf4e2('0x21')](_0x38d4de)[_0xf4e2('0x31')](_0x5a1298);};}exports[_0xf4e2('0x32')]=function(_0x40dcb4,_0x5b4863){var _0x6f7825={},_0x113376={},_0x16ea63={'count':0x0,'rows':[]};return db[_0xf4e2('0x33')][_0xf4e2('0x34')]()[_0xf4e2('0x2d')](function(_0x231ae0){var _0x307984=[];for(var _0x3573b9=0x0;_0x3573b9
','Attachments','Title','Data','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment'];(function(_0x1b9d83,_0x27518f){var _0xf8008d=function(_0x49815c){while(--_0x49815c){_0x1b9d83['push'](_0x1b9d83['shift']());}};_0xf8008d(++_0x27518f);}(_0x4329,0x13b));var _0x9432=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4329[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x9432('0x0'));var moment=require(_0x9432('0x1'));var random=require(_0x9432('0x2'));var fs=require('fs');var path=require(_0x9432('0x3'));var util=require(_0x9432('0x4'));var tnef=require(_0x9432('0x5'));var logger=require(_0x9432('0x6'))(_0x9432('0x7'));var config=require(_0x9432('0x8'));function getAddress(_0x5796ef){var _0x13add2=_[_0x9432('0x9')](_0x5796ef[_0x9432('0xa')]);return _0x13add2&&_0x13add2[_0x9432('0xb')]?_0x13add2['address']:_0x9432('0xc')+random['generate'](0x6)+_0x9432('0xd');}function getFirstName(_0x4563c4){var _0x4eba63=_[_0x9432('0x9')](_0x4563c4[_0x9432('0xa')]);if(_0x4eba63&&_0x4eba63[_0x9432('0xe')]){if(_0x4eba63[_0x9432('0xe')]==_0x4eba63[_0x9432('0xb')]){return _0x4eba63['name'][_0x9432('0xf')](0x0,_0x4eba63[_0x9432('0xe')]['indexOf']('@'));}var _0x502e36=_0x4eba63[_0x9432('0xe')][_0x9432('0x10')](/\s+/);return _0x502e36[_0x9432('0x11')]>0x1?_0x502e36[_0x9432('0x12')](0x0,-0x1)['join']('\x20'):_0x4eba63[_0x9432('0xe')];}return _0x9432('0x13');}function getLastName(_0x3e3f0f){var _0x2210d2=_[_0x9432('0x9')](_0x3e3f0f['value']);if(_0x2210d2&&_0x2210d2[_0x9432('0xe')]){var _0x27781c=_0x2210d2['name'][_0x9432('0x10')](/\s+/);return _0x27781c[_0x9432('0x11')]>0x1?_0x27781c['pop']():'';}return'';}function getMails(_0x2b8d4b,_0x23ca2d){var _0x5334fe='';for(var _0x5c4360=0x0;_0x5c4360<_0x23ca2d['value']['length'];_0x5c4360+=0x1){if(_0x23ca2d['value'][_0x5c4360][_0x9432('0xb')]!==_0x2b8d4b){if(!_[_0x9432('0x14')](_0x5334fe)){_0x5334fe+=',';}_0x5334fe+=_0x23ca2d[_0x9432('0xa')][_0x5c4360]['name']||_0x23ca2d[_0x9432('0xa')][_0x5c4360]['address']||'';_0x5334fe+='\x20<';_0x5334fe+=_0x23ca2d[_0x9432('0xa')][_0x5c4360][_0x9432('0xb')]?_0x23ca2d[_0x9432('0xa')][_0x5c4360]['address']:_0x9432('0xc')+random[_0x9432('0x15')](0x6)+_0x9432('0xd');_0x5334fe+='>';}}return _0x5334fe;}function parseEmail(_0x321e28,_0xf62a59,_0x240c23){if(_0xf62a59[_0x9432('0x16')]){var _0x57721f=/