Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / campaign / campaign.controller.js
index afb6d59..0bf9453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7136=['pick','where','merge','type','options','includeAll','include','rows','params','find','catch','create','body','user','get','autoAssociation','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','order','CampaignId','filter','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_contacts','sequelize','all','removeLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','destroy','IvrCampaigns','then','error','stack','name','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x7136,0x1c0));var _0x6713=function(_0x5b9a8b,_0x2a047a){_0x5b9a8b=_0x5b9a8b-0x0;var _0x146d8b=_0x7136[_0x5b9a8b];return _0x146d8b;};'use strict';var pdf=require(_0x6713('0x0'));var emlformat=require(_0x6713('0x1'));var rimraf=require(_0x6713('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6713('0x3'));var rp=require(_0x6713('0x4'));var moment=require(_0x6713('0x5'));var BPromise=require(_0x6713('0x6'));var Mustache=require('mustache');var util=require(_0x6713('0x7'));var path=require(_0x6713('0x8'));var sox=require(_0x6713('0x9'));var csv=require(_0x6713('0xa'));var ejs=require(_0x6713('0xb'));var fs=require('fs');var _=require(_0x6713('0xc'));var squel=require(_0x6713('0xd'));var crypto=require(_0x6713('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6713('0xf'));var toCsv=require(_0x6713('0xa'));var querystring=require(_0x6713('0x10'));var Papa=require(_0x6713('0x11'));var Redis=require('ioredis');var authService=require(_0x6713('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6713('0x13'));var logger=require('../../config/logger')(_0x6713('0x14'));var utils=require('../../config/utils');var config=require(_0x6713('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6713('0x16'))['db'];function respondWithStatusCode(_0x4564a6,_0xe0ce69){_0xe0ce69=_0xe0ce69||0xcc;return function(_0x19cedd){if(_0x19cedd){return _0x4564a6[_0x6713('0x17')](_0xe0ce69);}return _0x4564a6[_0x6713('0x18')](_0xe0ce69)[_0x6713('0x19')]();};}function respondWithResult(_0x278532,_0x548e88){_0x548e88=_0x548e88||0xc8;return function(_0xe520c7){if(_0xe520c7){return _0x278532[_0x6713('0x18')](_0x548e88)['json'](_0xe520c7);}};}function respondWithFilteredResult(_0x1c3970,_0x43d616){return function(_0x1620ce){if(_0x1620ce){var _0x579a79=_0x1620ce[_0x6713('0x1a')],_0x153bab=_0x43d616[_0x6713('0x1b')],_0x1e3df1=_0x43d616[_0x6713('0x1b')]+_0x43d616[_0x6713('0x1c')],_0x3e8c5b;if(_0x1e3df1>=_0x579a79){_0x1e3df1=_0x579a79;_0x3e8c5b=0xc8;}else{_0x3e8c5b=0xce;}_0x1c3970[_0x6713('0x18')](_0x3e8c5b);return _0x1c3970[_0x6713('0x1d')](_0x6713('0x1e'),_0x153bab+'-'+_0x1e3df1+'/'+_0x579a79)['json'](_0x1620ce);}return null;};}function patchUpdates(_0xa26c63){return function(_0x4498d8){try{jsonpatch[_0x6713('0x1f')](_0x4498d8,_0xa26c63,!![]);}catch(_0x1a7d46){return BPromise[_0x6713('0x20')](_0x1a7d46);}return _0x4498d8['save']();};}function saveUpdates(_0x13ac93,_0xf00b84){return function(_0x1472f8){if(_0x1472f8){return _0x1472f8[_0x6713('0x21')](_0x13ac93)['then'](function(_0x2e2aae){return _0x2e2aae;});}return null;};}function removeEntity(_0x13a635,_0x19bcc1){return function(_0x4ca20c){if(_0x4ca20c){return _0x4ca20c[_0x6713('0x22')]()['then'](function(){var _0x308bee=_0x4ca20c['get']({'plain':!![]});var _0x238dfa=_0x6713('0x23');return db['UserProfileResource'][_0x6713('0x22')]({'where':{'type':_0x238dfa,'resourceId':_0x308bee['id']}})[_0x6713('0x24')](function(){return _0x4ca20c;});})[_0x6713('0x24')](function(){_0x13a635[_0x6713('0x18')](0xcc)[_0x6713('0x19')]();});}};}function handleEntityNotFound(_0x4121eb,_0x748844){return function(_0x3ad7e0){if(!_0x3ad7e0){_0x4121eb[_0x6713('0x17')](0x194);}return _0x3ad7e0;};}function handleError(_0x275c20,_0x63c75d){_0x63c75d=_0x63c75d||0x1f4;return function(_0x54d3de){logger[_0x6713('0x25')](_0x54d3de[_0x6713('0x26')]);if(_0x54d3de[_0x6713('0x27')]){delete _0x54d3de[_0x6713('0x27')];}_0x275c20[_0x6713('0x18')](_0x63c75d)['send'](_0x54d3de);};}exports['index']=function(_0x4d5edc,_0x425fdb){var _0x2ce0a8={},_0x558d64={},_0x583c87={'count':0x0,'rows':[]};var _0x29229b=_[_0x6713('0x28')](db[_0x6713('0x29')][_0x6713('0x2a')],function(_0x401c68){return{'name':_0x401c68[_0x6713('0x2b')],'type':_0x401c68['type'][_0x6713('0x2c')]};});_0x558d64[_0x6713('0x2d')]=_['map'](_0x29229b,_0x6713('0x27'));_0x558d64[_0x6713('0x2e')]=_[_0x6713('0x2f')](_0x4d5edc[_0x6713('0x2e')]);_0x558d64[_0x6713('0x30')]=_['intersection'](_0x558d64[_0x6713('0x2d')],_0x558d64[_0x6713('0x2e')]);_0x2ce0a8[_0x6713('0x31')]=_[_0x6713('0x32')](_0x558d64['model'],qs[_0x6713('0x33')](_0x4d5edc[_0x6713('0x2e')][_0x6713('0x33')]));_0x2ce0a8[_0x6713('0x31')]=_0x2ce0a8[_0x6713('0x31')][_0x6713('0x34')]?_0x2ce0a8[_0x6713('0x31')]:_0x558d64['model'];if(!_0x4d5edc[_0x6713('0x2e')][_0x6713('0x35')](_0x6713('0x36'))){_0x2ce0a8[_0x6713('0x1c')]=qs[_0x6713('0x1c')](_0x4d5edc['query'][_0x6713('0x1c')]);_0x2ce0a8[_0x6713('0x1b')]=qs[_0x6713('0x1b')](_0x4d5edc[_0x6713('0x2e')][_0x6713('0x1b')]);}_0x2ce0a8['order']=qs[_0x6713('0x37')](_0x4d5edc[_0x6713('0x2e')][_0x6713('0x37')]);_0x2ce0a8['where']=qs['filters'](_[_0x6713('0x38')](_0x4d5edc[_0x6713('0x2e')],_0x558d64[_0x6713('0x30')]),_0x29229b);if(_0x4d5edc[_0x6713('0x2e')]['filter']){_0x2ce0a8[_0x6713('0x39')]=_[_0x6713('0x3a')](_0x2ce0a8[_0x6713('0x39')],{'$or':_[_0x6713('0x28')](_0x29229b,function(_0x97c131){if(_0x97c131[_0x6713('0x3b')]!=='VIRTUAL'){var _0x1a8205={};_0x1a8205[_0x97c131['name']]={'$like':'%'+_0x4d5edc[_0x6713('0x2e')]['filter']+'%'};return _0x1a8205;}})});}_0x2ce0a8=_['merge']({},_0x2ce0a8,_0x4d5edc[_0x6713('0x3c')]);var _0x274e66={'where':_0x2ce0a8[_0x6713('0x39')]};return db[_0x6713('0x29')][_0x6713('0x1a')](_0x274e66)[_0x6713('0x24')](function(_0x9cbe83){_0x583c87['count']=_0x9cbe83;if(_0x4d5edc[_0x6713('0x2e')][_0x6713('0x3d')]){_0x2ce0a8[_0x6713('0x3e')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x2ce0a8);})[_0x6713('0x24')](function(_0x47b40c){_0x583c87[_0x6713('0x3f')]=_0x47b40c;return _0x583c87;})[_0x6713('0x24')](respondWithFilteredResult(_0x425fdb,_0x2ce0a8))['catch'](handleError(_0x425fdb,null));};exports['show']=function(_0x22e25c,_0x82f650){var _0x19d0f4={'raw':![],'where':{'id':_0x22e25c[_0x6713('0x40')]['id']}},_0x4900e7={};_0x4900e7[_0x6713('0x2d')]=_[_0x6713('0x2f')](db[_0x6713('0x29')]['rawAttributes']);_0x4900e7['query']=_['keys'](_0x22e25c[_0x6713('0x2e')]);_0x4900e7['filters']=_['intersection'](_0x4900e7['model'],_0x4900e7[_0x6713('0x2e')]);_0x19d0f4[_0x6713('0x31')]=_[_0x6713('0x32')](_0x4900e7[_0x6713('0x2d')],qs[_0x6713('0x33')](_0x22e25c[_0x6713('0x2e')]['fields']));_0x19d0f4['attributes']=_0x19d0f4['attributes']['length']?_0x19d0f4[_0x6713('0x31')]:_0x4900e7[_0x6713('0x2d')];if(_0x22e25c[_0x6713('0x2e')][_0x6713('0x3d')]){_0x19d0f4[_0x6713('0x3e')]=[{'all':!![]}];}_0x19d0f4=_[_0x6713('0x3a')]({},_0x19d0f4,_0x22e25c[_0x6713('0x3c')]);return db[_0x6713('0x29')][_0x6713('0x41')](_0x19d0f4)[_0x6713('0x24')](handleEntityNotFound(_0x82f650,null))['then'](respondWithResult(_0x82f650,null))[_0x6713('0x42')](handleError(_0x82f650,null));};exports[_0x6713('0x43')]=function(_0x38b809,_0x22a669){return db['Campaign']['create'](_0x38b809[_0x6713('0x44')],{})[_0x6713('0x24')](function(_0x218058){var _0x16e78e=_0x38b809[_0x6713('0x45')][_0x6713('0x46')]({'plain':!![]});if(!_0x16e78e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16e78e['role']===_0x6713('0x45')){var _0x2b5a63=_0x218058[_0x6713('0x46')]({'plain':!![]});var _0x581694=_0x6713('0x23');return db['UserProfileSection'][_0x6713('0x41')]({'where':{'name':_0x581694,'userProfileId':_0x16e78e['userProfileId']},'raw':!![]})[_0x6713('0x24')](function(_0x315491){if(_0x315491&&_0x315491[_0x6713('0x47')]===0x0){return db['UserProfileResource'][_0x6713('0x43')]({'name':_0x2b5a63[_0x6713('0x27')],'resourceId':_0x2b5a63['id'],'type':_0x315491[_0x6713('0x27')],'sectionId':_0x315491['id']},{})[_0x6713('0x24')](function(){return _0x218058;});}else{return _0x218058;}})[_0x6713('0x42')](function(_0x3be388){logger[_0x6713('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3be388);throw _0x3be388;});}return _0x218058;})['then'](respondWithResult(_0x22a669,0xc9))[_0x6713('0x42')](handleError(_0x22a669,null));};exports['clone']=function(_0x2d3393,_0x16df89){var _0x370419={'where':{'id':_0x2d3393[_0x6713('0x40')]['id']}},_0x3e3821={};_0x3e3821[_0x6713('0x2d')]=_[_0x6713('0x2f')](db[_0x6713('0x29')][_0x6713('0x2a')]);_0x370419[_0x6713('0x31')]=_[_0x6713('0x32')](_0x3e3821[_0x6713('0x2d')],qs[_0x6713('0x33')](_0x2d3393[_0x6713('0x2e')]['fields']));_0x370419['attributes']=_0x370419[_0x6713('0x31')][_0x6713('0x34')]?_0x370419[_0x6713('0x31')]:_0x3e3821[_0x6713('0x2d')];if(_0x2d3393['query'][_0x6713('0x3d')]){_0x370419['include']=[{'all':!![]}];}_0x370419=_[_0x6713('0x3a')]({},_0x370419,_0x2d3393[_0x6713('0x3c')]);return db[_0x6713('0x29')][_0x6713('0x41')](_0x370419)[_0x6713('0x24')](handleEntityNotFound(_0x16df89,null))[_0x6713('0x24')](function(_0x3438b5){if(_0x3438b5){var _0x2d823d=_0x3438b5['get']({'plain':!![]});_0x2d823d=qs[_0x6713('0x48')](_0x2d823d,['id','createdAt',_0x6713('0x49')]);_0x2d3393[_0x6713('0x44')]=_[_0x6713('0x48')](_0x2d3393[_0x6713('0x44')],['id',_0x6713('0x4a'),_0x6713('0x49')]);return db['Campaign']['create'](_[_0x6713('0x3a')](_0x2d823d,_0x2d3393[_0x6713('0x44')]),{'include':_0x2d3393[_0x6713('0x2e')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3820d7){var _0x39cd1d=_0x2d3393['user'][_0x6713('0x46')]({'plain':!![]});if(!_0x39cd1d)throw new Error(_0x6713('0x4b'));if(_0x39cd1d[_0x6713('0x4c')]==='user'){var _0x3626eb=_0x3820d7[_0x6713('0x46')]({'plain':!![]});var _0x505b52=_0x6713('0x23');return db['UserProfileSection'][_0x6713('0x41')]({'where':{'name':_0x505b52,'userProfileId':_0x39cd1d['userProfileId']},'raw':!![]})['then'](function(_0x2b9826){if(_0x2b9826&&_0x2b9826[_0x6713('0x47')]===0x0){return db[_0x6713('0x4d')][_0x6713('0x43')]({'name':_0x3626eb['name'],'resourceId':_0x3626eb['id'],'type':_0x2b9826['name'],'sectionId':_0x2b9826['id']},{})[_0x6713('0x24')](function(){return _0x3820d7;});}else{return _0x3820d7;}})['catch'](function(_0x4d1ec1){logger[_0x6713('0x25')](_0x6713('0x4e'),_0x4d1ec1);throw _0x4d1ec1;});}return _0x3820d7;});}})[_0x6713('0x24')](respondWithResult(_0x16df89,0xc9))[_0x6713('0x42')](handleError(_0x16df89,null));};exports[_0x6713('0x21')]=function(_0x64fc9,_0x103c1b){if(_0x64fc9['body']['id']){delete _0x64fc9[_0x6713('0x44')]['id'];}return db[_0x6713('0x29')]['find']({'where':{'id':_0x64fc9['params']['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x103c1b,null))[_0x6713('0x24')](saveUpdates(_0x64fc9[_0x6713('0x44')],null))[_0x6713('0x24')](respondWithResult(_0x103c1b,null))['catch'](handleError(_0x103c1b,null));};exports[_0x6713('0x22')]=function(_0x4edc17,_0x4fe498){return db[_0x6713('0x29')][_0x6713('0x41')]({'where':{'id':_0x4edc17[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x4fe498,null))[_0x6713('0x24')](removeEntity(_0x4fe498,null))[_0x6713('0x42')](handleError(_0x4fe498,null));};exports[_0x6713('0x4f')]=function(_0x4537d4,_0x33eb0c,_0x985236){var _0x3cff2c={'raw':!![],'where':{}};var _0x5836a2={};var _0x820f81={'count':0x0,'rows':[]};return db[_0x6713('0x29')][_0x6713('0x50')]({'where':{'id':_0x4537d4[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x33eb0c,null))[_0x6713('0x24')](function(_0x4d723e){if(_0x4d723e){_0x5836a2[_0x6713('0x2d')]=_['keys'](db[_0x6713('0x51')]['rawAttributes']);_0x5836a2[_0x6713('0x2e')]=_[_0x6713('0x2f')](_0x4537d4[_0x6713('0x2e')]);_0x5836a2[_0x6713('0x30')]=_['intersection'](_0x5836a2[_0x6713('0x2d')],_0x5836a2[_0x6713('0x2e')]);_0x3cff2c[_0x6713('0x31')]=_[_0x6713('0x32')](_0x5836a2[_0x6713('0x2d')],qs[_0x6713('0x33')](_0x4537d4['query'][_0x6713('0x33')]));_0x3cff2c['attributes']=_0x3cff2c[_0x6713('0x31')][_0x6713('0x34')]?_0x3cff2c[_0x6713('0x31')]:_0x5836a2[_0x6713('0x2d')];if(!_0x4537d4[_0x6713('0x2e')]['hasOwnProperty'](_0x6713('0x36'))){_0x3cff2c[_0x6713('0x1c')]=qs[_0x6713('0x1c')](_0x4537d4[_0x6713('0x2e')][_0x6713('0x1c')]);_0x3cff2c[_0x6713('0x1b')]=qs[_0x6713('0x1b')](_0x4537d4[_0x6713('0x2e')][_0x6713('0x1b')]);}_0x3cff2c[_0x6713('0x52')]=qs['sort'](_0x4537d4[_0x6713('0x2e')][_0x6713('0x37')]);_0x3cff2c[_0x6713('0x39')]=qs[_0x6713('0x30')](_['pick'](_0x4537d4[_0x6713('0x2e')],_0x5836a2['filters']));_0x3cff2c[_0x6713('0x39')][_0x6713('0x53')]=_0x4d723e['id'];if(_0x4537d4[_0x6713('0x2e')][_0x6713('0x54')]){_0x3cff2c['where']=_[_0x6713('0x3a')](_0x3cff2c[_0x6713('0x39')],{'$or':_['map'](_0x3cff2c[_0x6713('0x31')],function(_0x4d0411){var _0x392cc4={};_0x392cc4[_0x4d0411]={'$like':'%'+_0x4537d4['query'][_0x6713('0x54')]+'%'};return _0x392cc4;})});}_0x3cff2c=_[_0x6713('0x3a')]({},_0x3cff2c,_0x4537d4[_0x6713('0x3c')]);return db[_0x6713('0x51')][_0x6713('0x1a')]({'where':_0x3cff2c[_0x6713('0x39')]})[_0x6713('0x24')](function(_0x417d23){_0x820f81['count']=_0x417d23;if(_0x4537d4[_0x6713('0x2e')][_0x6713('0x3d')]){_0x3cff2c['include']=[{'all':!![]}];}return db[_0x6713('0x51')]['findAll'](_0x3cff2c);})['then'](function(_0xe6aaf5){_0x820f81['rows']=_0xe6aaf5;return _0x820f81;});}})[_0x6713('0x24')](respondWithFilteredResult(_0x33eb0c,_0x3cff2c))['catch'](handleError(_0x33eb0c,null));};exports['getHopperHistories']=function(_0x8e66e9,_0x286fa8,_0xe94ecb){var _0x53c2d3={'raw':!![],'where':{}};var _0x2d48ff={};var _0x3a039a={'count':0x0,'rows':[]};return db[_0x6713('0x29')]['findOne']({'where':{'id':_0x8e66e9[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x286fa8,null))[_0x6713('0x24')](function(_0x3b7fe1){if(_0x3b7fe1){_0x2d48ff[_0x6713('0x2d')]=_['keys'](db[_0x6713('0x55')][_0x6713('0x2a')]);_0x2d48ff[_0x6713('0x2e')]=_[_0x6713('0x2f')](_0x8e66e9[_0x6713('0x2e')]);_0x2d48ff[_0x6713('0x30')]=_[_0x6713('0x32')](_0x2d48ff[_0x6713('0x2d')],_0x2d48ff['query']);_0x53c2d3[_0x6713('0x31')]=_['intersection'](_0x2d48ff[_0x6713('0x2d')],qs['fields'](_0x8e66e9[_0x6713('0x2e')][_0x6713('0x33')]));_0x53c2d3['attributes']=_0x53c2d3['attributes'][_0x6713('0x34')]?_0x53c2d3['attributes']:_0x2d48ff[_0x6713('0x2d')];if(!_0x8e66e9['query'][_0x6713('0x35')](_0x6713('0x36'))){_0x53c2d3[_0x6713('0x1c')]=qs[_0x6713('0x1c')](_0x8e66e9['query'][_0x6713('0x1c')]);_0x53c2d3[_0x6713('0x1b')]=qs[_0x6713('0x1b')](_0x8e66e9[_0x6713('0x2e')][_0x6713('0x1b')]);}_0x53c2d3['order']=qs['sort'](_0x8e66e9[_0x6713('0x2e')][_0x6713('0x37')]);_0x53c2d3['where']=qs[_0x6713('0x30')](_[_0x6713('0x38')](_0x8e66e9['query'],_0x2d48ff[_0x6713('0x30')]));_0x53c2d3[_0x6713('0x39')][_0x6713('0x53')]=_0x3b7fe1['id'];if(_0x8e66e9[_0x6713('0x2e')][_0x6713('0x54')]){_0x53c2d3[_0x6713('0x39')]=_['merge'](_0x53c2d3[_0x6713('0x39')],{'$or':_['map'](_0x53c2d3[_0x6713('0x31')],function(_0x21a209){var _0x31d189={};_0x31d189[_0x21a209]={'$like':'%'+_0x8e66e9[_0x6713('0x2e')][_0x6713('0x54')]+'%'};return _0x31d189;})});}_0x53c2d3=_[_0x6713('0x3a')]({},_0x53c2d3,_0x8e66e9[_0x6713('0x3c')]);return db[_0x6713('0x55')][_0x6713('0x1a')]({'where':_0x53c2d3['where']})[_0x6713('0x24')](function(_0x368733){_0x3a039a[_0x6713('0x1a')]=_0x368733;if(_0x8e66e9[_0x6713('0x2e')][_0x6713('0x3d')]){_0x53c2d3[_0x6713('0x3e')]=[{'all':!![]}];}return db[_0x6713('0x55')][_0x6713('0x56')](_0x53c2d3);})[_0x6713('0x24')](function(_0x567ffd){_0x3a039a[_0x6713('0x3f')]=_0x567ffd;return _0x3a039a;});}})['then'](respondWithFilteredResult(_0x286fa8,_0x53c2d3))['catch'](handleError(_0x286fa8,null));};exports[_0x6713('0x57')]=function(_0x4a0021,_0x2ed152,_0x189272){var _0x255e56={'raw':!![],'where':{}};var _0x16f8d3={};var _0xb36104={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4a0021[_0x6713('0x40')]['id']}})['then'](handleEntityNotFound(_0x2ed152,null))[_0x6713('0x24')](function(_0x5e3892){if(_0x5e3892){_0x16f8d3[_0x6713('0x2d')]=_[_0x6713('0x2f')](db[_0x6713('0x58')]['rawAttributes']);_0x16f8d3[_0x6713('0x2e')]=_[_0x6713('0x2f')](_0x4a0021[_0x6713('0x2e')]);_0x16f8d3[_0x6713('0x30')]=_[_0x6713('0x32')](_0x16f8d3[_0x6713('0x2d')],_0x16f8d3[_0x6713('0x2e')]);_0x255e56['attributes']=_[_0x6713('0x32')](_0x16f8d3[_0x6713('0x2d')],qs[_0x6713('0x33')](_0x4a0021['query'][_0x6713('0x33')]));_0x255e56[_0x6713('0x31')]=_0x255e56['attributes'][_0x6713('0x34')]?_0x255e56[_0x6713('0x31')]:_0x16f8d3['model'];if(!_0x4a0021[_0x6713('0x2e')][_0x6713('0x35')](_0x6713('0x36'))){_0x255e56[_0x6713('0x1c')]=qs['limit'](_0x4a0021[_0x6713('0x2e')]['limit']);_0x255e56['offset']=qs[_0x6713('0x1b')](_0x4a0021[_0x6713('0x2e')][_0x6713('0x1b')]);}_0x255e56[_0x6713('0x52')]=qs[_0x6713('0x37')](_0x4a0021['query'][_0x6713('0x37')]);_0x255e56[_0x6713('0x39')]=qs['filters'](_[_0x6713('0x38')](_0x4a0021[_0x6713('0x2e')],_0x16f8d3[_0x6713('0x30')]));_0x255e56[_0x6713('0x39')][_0x6713('0x53')]=_0x5e3892['id'];if(_0x4a0021['query'][_0x6713('0x54')]){_0x255e56[_0x6713('0x39')]=_['merge'](_0x255e56['where'],{'$or':_[_0x6713('0x28')](_0x255e56[_0x6713('0x31')],function(_0x52885a){var _0x3783c3={};_0x3783c3[_0x52885a]={'$like':'%'+_0x4a0021[_0x6713('0x2e')]['filter']+'%'};return _0x3783c3;})});}_0x255e56=_[_0x6713('0x3a')]({},_0x255e56,_0x4a0021[_0x6713('0x3c')]);return db[_0x6713('0x58')][_0x6713('0x1a')]({'where':_0x255e56['where']})[_0x6713('0x24')](function(_0x2f401e){_0xb36104['count']=_0x2f401e;if(_0x4a0021['query'][_0x6713('0x3d')]){_0x255e56[_0x6713('0x3e')]=[{'all':!![]}];}return db[_0x6713('0x58')]['findAll'](_0x255e56);})[_0x6713('0x24')](function(_0x4bfdb5){_0xb36104[_0x6713('0x3f')]=_0x4bfdb5;return _0xb36104;});}})['then'](respondWithFilteredResult(_0x2ed152,_0x255e56))[_0x6713('0x42')](handleError(_0x2ed152,null));};exports[_0x6713('0x59')]=function(_0x5396b8,_0x6ae16,_0x5a737f){var _0x28c8bd={'raw':!![],'where':{}};var _0x5af6d7={};var _0x19dfe6={'count':0x0,'rows':[]};return db[_0x6713('0x29')][_0x6713('0x50')]({'where':{'id':_0x5396b8[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x6ae16,null))[_0x6713('0x24')](function(_0x539be6){if(_0x539be6){_0x5af6d7[_0x6713('0x2d')]=_[_0x6713('0x2f')](db[_0x6713('0x5a')]['rawAttributes']);_0x5af6d7['query']=_['keys'](_0x5396b8[_0x6713('0x2e')]);_0x5af6d7[_0x6713('0x30')]=_[_0x6713('0x32')](_0x5af6d7[_0x6713('0x2d')],_0x5af6d7[_0x6713('0x2e')]);_0x28c8bd[_0x6713('0x31')]=_[_0x6713('0x32')](_0x5af6d7[_0x6713('0x2d')],qs['fields'](_0x5396b8['query'][_0x6713('0x33')]));_0x28c8bd[_0x6713('0x31')]=_0x28c8bd[_0x6713('0x31')][_0x6713('0x34')]?_0x28c8bd[_0x6713('0x31')]:_0x5af6d7[_0x6713('0x2d')];if(!_0x5396b8['query'][_0x6713('0x35')](_0x6713('0x36'))){_0x28c8bd[_0x6713('0x1c')]=qs[_0x6713('0x1c')](_0x5396b8[_0x6713('0x2e')][_0x6713('0x1c')]);_0x28c8bd[_0x6713('0x1b')]=qs[_0x6713('0x1b')](_0x5396b8[_0x6713('0x2e')][_0x6713('0x1b')]);}_0x28c8bd['order']=qs[_0x6713('0x37')](_0x5396b8[_0x6713('0x2e')][_0x6713('0x37')]);_0x28c8bd[_0x6713('0x39')]=qs[_0x6713('0x30')](_[_0x6713('0x38')](_0x5396b8[_0x6713('0x2e')],_0x5af6d7[_0x6713('0x30')]));_0x28c8bd[_0x6713('0x39')]['CampaignId']=_0x539be6['id'];if(_0x5396b8[_0x6713('0x2e')][_0x6713('0x54')]){_0x28c8bd[_0x6713('0x39')]=_[_0x6713('0x3a')](_0x28c8bd[_0x6713('0x39')],{'$or':_[_0x6713('0x28')](_0x28c8bd['attributes'],function(_0x17398f){var _0x4e7d0c={};_0x4e7d0c[_0x17398f]={'$like':'%'+_0x5396b8['query'][_0x6713('0x54')]+'%'};return _0x4e7d0c;})});}_0x28c8bd=_[_0x6713('0x3a')]({},_0x28c8bd,_0x5396b8[_0x6713('0x3c')]);return db[_0x6713('0x5a')]['count']({'where':_0x28c8bd[_0x6713('0x39')]})[_0x6713('0x24')](function(_0x4e2a16){_0x19dfe6[_0x6713('0x1a')]=_0x4e2a16;if(_0x5396b8[_0x6713('0x2e')][_0x6713('0x3d')]){_0x28c8bd[_0x6713('0x3e')]=[{'all':!![]}];}return db[_0x6713('0x5a')][_0x6713('0x56')](_0x28c8bd);})[_0x6713('0x24')](function(_0x42f50c){_0x19dfe6[_0x6713('0x3f')]=_0x42f50c;return _0x19dfe6;});}})[_0x6713('0x24')](respondWithFilteredResult(_0x6ae16,_0x28c8bd))[_0x6713('0x42')](handleError(_0x6ae16,null));};exports[_0x6713('0x5b')]=function(_0x5b158f,_0x404167,_0x20c059){var _0xcead04={};var _0x5c2f41={};var _0x9344d;var _0x2d9c78;return db[_0x6713('0x29')][_0x6713('0x50')]({'where':{'id':_0x5b158f[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x404167,null))['then'](function(_0x5a6bbc){if(_0x5a6bbc){_0x9344d=_0x5a6bbc;_0x5c2f41[_0x6713('0x2d')]=_['keys'](db[_0x6713('0x5c')]['rawAttributes']);_0x5c2f41[_0x6713('0x2e')]=_['keys'](_0x5b158f[_0x6713('0x2e')]);_0x5c2f41[_0x6713('0x30')]=_['intersection'](_0x5c2f41[_0x6713('0x2d')],_0x5c2f41[_0x6713('0x2e')]);_0xcead04[_0x6713('0x31')]=_[_0x6713('0x32')](_0x5c2f41[_0x6713('0x2d')],qs[_0x6713('0x33')](_0x5b158f[_0x6713('0x2e')][_0x6713('0x33')]));_0xcead04['attributes']=_0xcead04[_0x6713('0x31')]['length']?_0xcead04[_0x6713('0x31')]:_0x5c2f41[_0x6713('0x2d')];_0xcead04['order']=qs[_0x6713('0x37')](_0x5b158f[_0x6713('0x2e')][_0x6713('0x37')]);_0xcead04[_0x6713('0x39')]=qs['filters'](_[_0x6713('0x38')](_0x5b158f[_0x6713('0x2e')],_0x5c2f41[_0x6713('0x30')]));if(_0x5b158f[_0x6713('0x2e')][_0x6713('0x54')]){_0xcead04[_0x6713('0x39')]=_['merge'](_0xcead04[_0x6713('0x39')],{'$or':_['map'](_0xcead04[_0x6713('0x31')],function(_0x344c94){var _0x38a559={};_0x38a559[_0x344c94]={'$like':'%'+_0x5b158f['query'][_0x6713('0x54')]+'%'};return _0x38a559;})});}_0xcead04=_['merge']({},_0xcead04,_0x5b158f['options']);return _0x9344d[_0x6713('0x5b')](_0xcead04);}})[_0x6713('0x24')](function(_0x5c3e1a){if(_0x5c3e1a){_0x2d9c78=_0x5c3e1a[_0x6713('0x34')];if(!_0x5b158f[_0x6713('0x2e')][_0x6713('0x35')]('nolimit')){_0xcead04[_0x6713('0x1c')]=qs[_0x6713('0x1c')](_0x5b158f[_0x6713('0x2e')]['limit']);_0xcead04[_0x6713('0x1b')]=qs[_0x6713('0x1b')](_0x5b158f[_0x6713('0x2e')][_0x6713('0x1b')]);}return _0x9344d[_0x6713('0x5b')](_0xcead04);}})[_0x6713('0x24')](function(_0x27ca3c){if(_0x27ca3c){return _0x27ca3c?{'count':_0x2d9c78,'rows':_0x27ca3c}:null;}})[_0x6713('0x24')](respondWithResult(_0x404167,null))[_0x6713('0x42')](handleError(_0x404167,null));};exports[_0x6713('0x5d')]=function(_0x410c3e,_0x2e0d91,_0x38055c){var _0x4e6214,_0x1282e8;return db['Campaign'][_0x6713('0x41')]({'where':{'id':_0x410c3e[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x2e0d91,null))[_0x6713('0x24')](function(_0x2be5ce){if(_0x2be5ce){_0x1282e8=_0x2be5ce;return _0x2be5ce[_0x6713('0x5d')](_0x410c3e['body'][_0x6713('0x5e')],_[_0x6713('0x48')](_0x410c3e[_0x6713('0x44')],[_0x6713('0x5e'),'id'])||{});}return null;})['spread'](function(_0x2a2c62){var _0x1ee6e3;_0x4e6214=_0x2a2c62||[];var _0x56a96a=[];if(_0x2a2c62){for(var _0x233c16=0x0;_0x233c16<_0x2a2c62[_0x6713('0x34')];_0x233c16+=0x1){var _0x4ade58=_0x2a2c62[_0x233c16][_0x6713('0x46')]({'plain':!![]});_0x1282e8[_0x6713('0x5f')]=_0x410c3e[_0x6713('0x44')][_0x6713('0x5f')]?_0x410c3e['body'][_0x6713('0x5f')]:_0x1282e8['dialCheckDuplicateType'];switch(_0x1282e8['dialCheckDuplicateType']){case _0x6713('0x60'):_0x1ee6e3=squel['insert']()[_0x6713('0x61')](_0x6713('0x62'))[_0x6713('0x63')](['phone',_0x6713('0x64'),_0x6713('0x65'),_0x6713('0x66'),_0x6713('0x53'),_0x6713('0x4a'),_0x6713('0x49')],squel[_0x6713('0x67')]()[_0x6713('0x68')](_0x6713('0x69'),_0x6713('0x69'))['field'](_0x6713('0x6a'),_0x6713('0x64'))['field']('id',_0x6713('0x65'))[_0x6713('0x68')](_0x4ade58['CmListId'][_0x6713('0x6b')](),_0x6713('0x66'))['field'](_0x410c3e[_0x6713('0x40')]['id']['toString'](),'CampaignId')[_0x6713('0x68')](_0x6713('0x6a'),_0x6713('0x4a'))[_0x6713('0x68')](_0x6713('0x6a'),_0x6713('0x49'))[_0x6713('0x6c')]('cm_contacts')[_0x6713('0x39')](_0x6713('0x6d'))[_0x6713('0x39')](_0x6713('0x6e'),_0x4ade58[_0x6713('0x6f')][_0x6713('0x6b')]())[_0x6713('0x39')](_0x6713('0x70'))[_0x6713('0x39')](_0x6713('0x71'),squel['select']()[_0x6713('0x68')](_0x6713('0x72'))[_0x6713('0x6c')]('cm_hopper_final')['where'](_0x6713('0x73'),_0x410c3e[_0x6713('0x40')]['id'][_0x6713('0x6b')]()))[_0x6713('0x39')](_0x6713('0x71'),squel[_0x6713('0x67')]()[_0x6713('0x68')](_0x6713('0x74'))[_0x6713('0x6c')](_0x6713('0x62'))['where'](_0x6713('0x73'),_0x410c3e['params']['id'][_0x6713('0x6b')]())))[_0x6713('0x6b')]();break;case _0x6713('0x75'):_0x1ee6e3=squel[_0x6713('0x76')]()['into']('cm_hopper')[_0x6713('0x63')](['phone',_0x6713('0x64'),'ContactId','ListId','CampaignId',_0x6713('0x4a'),_0x6713('0x49')],squel[_0x6713('0x67')]()[_0x6713('0x68')](_0x6713('0x69'),'phone')[_0x6713('0x68')]('NOW()',_0x6713('0x64'))[_0x6713('0x68')]('id',_0x6713('0x65'))[_0x6713('0x68')](_0x4ade58[_0x6713('0x6f')][_0x6713('0x6b')](),_0x6713('0x66'))['field'](_0x410c3e[_0x6713('0x40')]['id'][_0x6713('0x6b')](),'CampaignId')[_0x6713('0x68')](_0x6713('0x6a'),'createdAt')[_0x6713('0x68')](_0x6713('0x6a'),_0x6713('0x49'))[_0x6713('0x6c')](_0x6713('0x77'))[_0x6713('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0x6713('0x6e'),_0x4ade58[_0x6713('0x6f')][_0x6713('0x6b')]())['where'](_0x6713('0x70'))[_0x6713('0x39')](_0x6713('0x71'),squel[_0x6713('0x67')]()[_0x6713('0x68')](_0x6713('0x74'))[_0x6713('0x6c')](_0x6713('0x62'))[_0x6713('0x39')](_0x6713('0x73'),_0x410c3e['params']['id']['toString']())))[_0x6713('0x6b')]();break;default:_0x1ee6e3=squel['insert']()['into'](_0x6713('0x62'))['fromQuery'](['phone','scheduledAt',_0x6713('0x65'),_0x6713('0x66'),_0x6713('0x53'),_0x6713('0x4a'),'updatedAt'],squel[_0x6713('0x67')]()[_0x6713('0x68')](_0x6713('0x69'),_0x6713('0x69'))['field']('NOW()','scheduledAt')[_0x6713('0x68')]('id','ContactId')['field'](_0x4ade58[_0x6713('0x6f')][_0x6713('0x6b')](),'ListId')[_0x6713('0x68')](_0x410c3e[_0x6713('0x40')]['id'][_0x6713('0x6b')](),'CampaignId')[_0x6713('0x68')](_0x6713('0x6a'),_0x6713('0x4a'))[_0x6713('0x68')]('NOW()',_0x6713('0x49'))[_0x6713('0x6c')]('cm_contacts')[_0x6713('0x39')](_0x6713('0x6d'))[_0x6713('0x39')](_0x6713('0x6e'),_0x4ade58['CmListId'][_0x6713('0x6b')]())[_0x6713('0x39')](_0x6713('0x70')))[_0x6713('0x6b')]();}_0x56a96a['push'](db[_0x6713('0x78')][_0x6713('0x2e')](_0x1ee6e3));}return BPromise[_0x6713('0x79')](_0x56a96a);}})[_0x6713('0x24')](function(){return _0x4e6214;})[_0x6713('0x24')](respondWithResult(_0x2e0d91,null))[_0x6713('0x42')](handleError(_0x2e0d91,null));};exports[_0x6713('0x7a')]=function(_0x45f634,_0x52cfff,_0xc2a203){return db[_0x6713('0x29')][_0x6713('0x41')]({'where':{'id':_0x45f634[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x52cfff,null))[_0x6713('0x24')](function(_0x252ac5){if(_0x252ac5){return _0x252ac5[_0x6713('0x7a')](_0x45f634[_0x6713('0x2e')][_0x6713('0x5e')]);}})[_0x6713('0x24')](function(_0x16f94b){if(_0x16f94b){return db[_0x6713('0x51')][_0x6713('0x22')]({'where':{'ListId':_0x45f634[_0x6713('0x2e')]['ids'],'CampaignId':_0x45f634[_0x6713('0x40')]['id']}})[_0x6713('0x24')](function(){return _0x16f94b;});}})[_0x6713('0x24')](respondWithStatusCode(_0x52cfff,null))[_0x6713('0x42')](handleError(_0x52cfff,null));};exports['getBlackLists']=function(_0x102983,_0x306bce,_0x433c7e){var _0x7725c8={};var _0x4184d7={};var _0x43c4f9;var _0x9ba80a;return db['Campaign'][_0x6713('0x50')]({'where':{'id':_0x102983[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x306bce,null))[_0x6713('0x24')](function(_0x5b2bbb){if(_0x5b2bbb){_0x43c4f9=_0x5b2bbb;_0x4184d7[_0x6713('0x2d')]=_[_0x6713('0x2f')](db['CmList'][_0x6713('0x2a')]);_0x4184d7[_0x6713('0x2e')]=_['keys'](_0x102983[_0x6713('0x2e')]);_0x4184d7[_0x6713('0x30')]=_[_0x6713('0x32')](_0x4184d7[_0x6713('0x2d')],_0x4184d7[_0x6713('0x2e')]);_0x7725c8[_0x6713('0x31')]=_['intersection'](_0x4184d7[_0x6713('0x2d')],qs[_0x6713('0x33')](_0x102983['query'][_0x6713('0x33')]));_0x7725c8['attributes']=_0x7725c8[_0x6713('0x31')]['length']?_0x7725c8[_0x6713('0x31')]:_0x4184d7[_0x6713('0x2d')];_0x7725c8[_0x6713('0x52')]=qs['sort'](_0x102983['query'][_0x6713('0x37')]);_0x7725c8[_0x6713('0x39')]=qs[_0x6713('0x30')](_[_0x6713('0x38')](_0x102983[_0x6713('0x2e')],_0x4184d7[_0x6713('0x30')]));if(_0x102983[_0x6713('0x2e')][_0x6713('0x54')]){_0x7725c8[_0x6713('0x39')]=_['merge'](_0x7725c8[_0x6713('0x39')],{'$or':_[_0x6713('0x28')](_0x7725c8[_0x6713('0x31')],function(_0x42bf66){var _0x105fd0={};_0x105fd0[_0x42bf66]={'$like':'%'+_0x102983[_0x6713('0x2e')][_0x6713('0x54')]+'%'};return _0x105fd0;})});}_0x7725c8=_['merge']({},_0x7725c8,_0x102983[_0x6713('0x3c')]);return _0x43c4f9['getBlackLists'](_0x7725c8);}})[_0x6713('0x24')](function(_0x41c9e7){if(_0x41c9e7){_0x9ba80a=_0x41c9e7['length'];if(!_0x102983['query'][_0x6713('0x35')](_0x6713('0x36'))){_0x7725c8[_0x6713('0x1c')]=qs[_0x6713('0x1c')](_0x102983[_0x6713('0x2e')][_0x6713('0x1c')]);_0x7725c8[_0x6713('0x1b')]=qs[_0x6713('0x1b')](_0x102983[_0x6713('0x2e')]['offset']);}return _0x43c4f9['getBlackLists'](_0x7725c8);}})[_0x6713('0x24')](function(_0x4563ca){if(_0x4563ca){return _0x4563ca?{'count':_0x9ba80a,'rows':_0x4563ca}:null;}})[_0x6713('0x24')](respondWithResult(_0x306bce,null))[_0x6713('0x42')](handleError(_0x306bce,null));};exports[_0x6713('0x7b')]=function(_0x4f0278,_0x23a8af,_0x518a31){var _0x277ce8,_0x3caadc;return db[_0x6713('0x29')]['find']({'where':{'id':_0x4f0278[_0x6713('0x40')]['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x23a8af,null))['then'](function(_0x44ed9d){if(_0x44ed9d){_0x3caadc=_0x44ed9d;return _0x44ed9d[_0x6713('0x7b')](_0x4f0278[_0x6713('0x44')]['ids'],_[_0x6713('0x48')](_0x4f0278['body'],[_0x6713('0x5e'),'id'])||{});}return null;})['spread'](function(_0x4a214c){var _0x4ec440;_0x277ce8=_0x4a214c||[];var _0x13cf08=[];if(_0x4a214c){for(var _0x49bdf6=0x0;_0x49bdf6<_0x4a214c[_0x6713('0x34')];_0x49bdf6+=0x1){var _0x4c99ae=_0x4a214c[_0x49bdf6][_0x6713('0x46')]({'plain':!![]});_0x4ec440=squel[_0x6713('0x76')]()[_0x6713('0x61')](_0x6713('0x7c'))[_0x6713('0x63')]([_0x6713('0x69'),_0x6713('0x65'),'ListId','CampaignId',_0x6713('0x4a'),_0x6713('0x49')],squel[_0x6713('0x67')]()['field']('phone',_0x6713('0x69'))[_0x6713('0x68')]('id',_0x6713('0x65'))['field'](_0x4c99ae[_0x6713('0x6f')][_0x6713('0x6b')](),_0x6713('0x66'))[_0x6713('0x68')](_0x4f0278[_0x6713('0x40')]['id'][_0x6713('0x6b')](),_0x6713('0x53'))[_0x6713('0x68')](_0x6713('0x6a'),_0x6713('0x4a'))[_0x6713('0x68')](_0x6713('0x6a'),_0x6713('0x49'))[_0x6713('0x6c')]('cm_contacts')[_0x6713('0x39')](_0x6713('0x6d'))['where'](_0x6713('0x6e'),_0x4c99ae['CmListId'][_0x6713('0x6b')]())['where'](_0x6713('0x70')))['toString']();_0x13cf08['push'](db[_0x6713('0x78')][_0x6713('0x2e')](_0x4ec440));}return BPromise[_0x6713('0x79')](_0x13cf08);}})[_0x6713('0x24')](function(){return _0x277ce8;})[_0x6713('0x24')](respondWithResult(_0x23a8af,null))[_0x6713('0x42')](handleError(_0x23a8af,null));};exports[_0x6713('0x7d')]=function(_0xd983c9,_0x45223c,_0x4ebb69){return db[_0x6713('0x29')][_0x6713('0x41')]({'where':{'id':_0xd983c9['params']['id']}})[_0x6713('0x24')](handleEntityNotFound(_0x45223c,null))[_0x6713('0x24')](function(_0x323516){if(_0x323516){return _0x323516[_0x6713('0x7d')](_0xd983c9[_0x6713('0x2e')][_0x6713('0x5e')]);}})[_0x6713('0x24')](function(_0x4c06b0){if(_0x4c06b0){return db[_0x6713('0x5a')][_0x6713('0x22')]({'where':{'ListId':_0xd983c9[_0x6713('0x2e')][_0x6713('0x5e')],'CampaignId':_0xd983c9[_0x6713('0x40')]['id']}})['then'](function(){return _0x4c06b0;});}})[_0x6713('0x24')](respondWithStatusCode(_0x45223c,null))[_0x6713('0x42')](handleError(_0x45223c,null));};
\ No newline at end of file
+var _0x21dd=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','clone','rawAttributes','omit','createdAt','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','ListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','all','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys'];(function(_0x4278cb,_0x5b0fec){var _0x1c2984=function(_0x205764){while(--_0x205764){_0x4278cb['push'](_0x4278cb['shift']());}};_0x1c2984(++_0x5b0fec);}(_0x21dd,0xdb));var _0xd21d=function(_0x39a73c,_0x30b1b8){_0x39a73c=_0x39a73c-0x0;var _0x56c10a=_0x21dd[_0x39a73c];return _0x56c10a;};'use strict';var pdf=require(_0xd21d('0x0'));var emlformat=require(_0xd21d('0x1'));var rimraf=require(_0xd21d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd21d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd21d('0x4'));var util=require(_0xd21d('0x5'));var path=require(_0xd21d('0x6'));var sox=require(_0xd21d('0x7'));var csv=require('to-csv');var ejs=require(_0xd21d('0x8'));var fs=require('fs');var _=require(_0xd21d('0x9'));var squel=require(_0xd21d('0xa'));var crypto=require(_0xd21d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd21d('0xc'));var toCsv=require(_0xd21d('0xd'));var querystring=require(_0xd21d('0xe'));var Papa=require(_0xd21d('0xf'));var Redis=require(_0xd21d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd21d('0x11'));var as=require(_0xd21d('0x12'));var hardwareService=require(_0xd21d('0x13'));var logger=require(_0xd21d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd21d('0x15'));var licenseUtil=require(_0xd21d('0x16'));var db=require(_0xd21d('0x17'))['db'];function respondWithStatusCode(_0x312c27,_0x38ec9a){_0x38ec9a=_0x38ec9a||0xcc;return function(_0x4b2d5c){if(_0x4b2d5c){return _0x312c27[_0xd21d('0x18')](_0x38ec9a);}return _0x312c27[_0xd21d('0x19')](_0x38ec9a)[_0xd21d('0x1a')]();};}function respondWithResult(_0x4c4b24,_0x14db85){_0x14db85=_0x14db85||0xc8;return function(_0x5cf2e6){if(_0x5cf2e6){return _0x4c4b24['status'](_0x14db85)[_0xd21d('0x1b')](_0x5cf2e6);}};}function respondWithFilteredResult(_0x3eeb86,_0x2b449f){return function(_0x3477e0){if(_0x3477e0){var _0x3bd432=_0x3477e0[_0xd21d('0x1c')],_0x4cf1d5=_0x2b449f['offset'],_0x5249c0=_0x2b449f[_0xd21d('0x1d')]+_0x2b449f[_0xd21d('0x1e')],_0x4417d3;if(_0x5249c0>=_0x3bd432){_0x5249c0=_0x3bd432;_0x4417d3=0xc8;}else{_0x4417d3=0xce;}_0x3eeb86[_0xd21d('0x19')](_0x4417d3);return _0x3eeb86['set'](_0xd21d('0x1f'),_0x4cf1d5+'-'+_0x5249c0+'/'+_0x3bd432)[_0xd21d('0x1b')](_0x3477e0);}return null;};}function patchUpdates(_0x271a55){return function(_0x59827b){try{jsonpatch[_0xd21d('0x20')](_0x59827b,_0x271a55,!![]);}catch(_0x45f9fd){return BPromise[_0xd21d('0x21')](_0x45f9fd);}return _0x59827b[_0xd21d('0x22')]();};}function saveUpdates(_0x19aedb,_0x563710){return function(_0x4db0e3){if(_0x4db0e3){return _0x4db0e3[_0xd21d('0x23')](_0x19aedb)[_0xd21d('0x24')](function(_0x5af3a2){return _0x5af3a2;});}return null;};}function removeEntity(_0x9557e1,_0x25667f){return function(_0x3c66c4){if(_0x3c66c4){return _0x3c66c4[_0xd21d('0x25')]()[_0xd21d('0x24')](function(){var _0x18ccfa=_0x3c66c4[_0xd21d('0x26')]({'plain':!![]});var _0x49bb45=_0xd21d('0x27');return db[_0xd21d('0x28')][_0xd21d('0x25')]({'where':{'type':_0x49bb45,'resourceId':_0x18ccfa['id']}})[_0xd21d('0x24')](function(){return _0x3c66c4;});})[_0xd21d('0x24')](function(){_0x9557e1[_0xd21d('0x19')](0xcc)[_0xd21d('0x1a')]();});}};}function handleEntityNotFound(_0xd7cda4,_0x5d720d){return function(_0x591690){if(!_0x591690){_0xd7cda4[_0xd21d('0x18')](0x194);}return _0x591690;};}function handleError(_0x1813cb,_0x555a9d){_0x555a9d=_0x555a9d||0x1f4;return function(_0x22f6b4){logger[_0xd21d('0x29')](_0x22f6b4[_0xd21d('0x2a')]);if(_0x22f6b4['name']){delete _0x22f6b4[_0xd21d('0x2b')];}_0x1813cb['status'](_0x555a9d)[_0xd21d('0x2c')](_0x22f6b4);};}exports[_0xd21d('0x2d')]=function(_0x236fd7,_0x3c5613){var _0x30966f={},_0x8a7a3e={},_0x5c11b8={'count':0x0,'rows':[]};var _0x23b193=_[_0xd21d('0x2e')](db[_0xd21d('0x2f')]['rawAttributes'],function(_0x293f9f){return{'name':_0x293f9f[_0xd21d('0x30')],'type':_0x293f9f[_0xd21d('0x31')]['key']};});_0x8a7a3e[_0xd21d('0x32')]=_[_0xd21d('0x2e')](_0x23b193,_0xd21d('0x2b'));_0x8a7a3e[_0xd21d('0x33')]=_[_0xd21d('0x34')](_0x236fd7['query']);_0x8a7a3e[_0xd21d('0x35')]=_['intersection'](_0x8a7a3e[_0xd21d('0x32')],_0x8a7a3e[_0xd21d('0x33')]);_0x30966f[_0xd21d('0x36')]=_[_0xd21d('0x37')](_0x8a7a3e[_0xd21d('0x32')],qs[_0xd21d('0x38')](_0x236fd7[_0xd21d('0x33')]['fields']));_0x30966f[_0xd21d('0x36')]=_0x30966f['attributes'][_0xd21d('0x39')]?_0x30966f[_0xd21d('0x36')]:_0x8a7a3e[_0xd21d('0x32')];if(!_0x236fd7[_0xd21d('0x33')][_0xd21d('0x3a')](_0xd21d('0x3b'))){_0x30966f['limit']=qs['limit'](_0x236fd7[_0xd21d('0x33')][_0xd21d('0x1e')]);_0x30966f[_0xd21d('0x1d')]=qs[_0xd21d('0x1d')](_0x236fd7['query'][_0xd21d('0x1d')]);}_0x30966f[_0xd21d('0x3c')]=qs[_0xd21d('0x3d')](_0x236fd7['query'][_0xd21d('0x3d')]);_0x30966f['where']=qs[_0xd21d('0x35')](_[_0xd21d('0x3e')](_0x236fd7[_0xd21d('0x33')],_0x8a7a3e[_0xd21d('0x35')]),_0x23b193);if(_0x236fd7[_0xd21d('0x33')][_0xd21d('0x3f')]){_0x30966f[_0xd21d('0x40')]=_[_0xd21d('0x41')](_0x30966f[_0xd21d('0x40')],{'$or':_[_0xd21d('0x2e')](_0x23b193,function(_0x5a51d8){if(_0x5a51d8[_0xd21d('0x31')]!=='VIRTUAL'){var _0x320c1d={};_0x320c1d[_0x5a51d8[_0xd21d('0x2b')]]={'$like':'%'+_0x236fd7[_0xd21d('0x33')]['filter']+'%'};return _0x320c1d;}})});}_0x30966f=_[_0xd21d('0x41')]({},_0x30966f,_0x236fd7[_0xd21d('0x42')]);var _0x4e8afa={'where':_0x30966f[_0xd21d('0x40')]};return db[_0xd21d('0x2f')][_0xd21d('0x1c')](_0x4e8afa)['then'](function(_0x3908cc){_0x5c11b8[_0xd21d('0x1c')]=_0x3908cc;if(_0x236fd7['query'][_0xd21d('0x43')]){_0x30966f['include']=[{'all':!![]}];}return db['Campaign'][_0xd21d('0x44')](_0x30966f);})[_0xd21d('0x24')](function(_0xfb93cc){_0x5c11b8[_0xd21d('0x45')]=_0xfb93cc;return _0x5c11b8;})[_0xd21d('0x24')](respondWithFilteredResult(_0x3c5613,_0x30966f))[_0xd21d('0x46')](handleError(_0x3c5613,null));};exports['show']=function(_0x4a0831,_0x26b56b){var _0x50e070={'raw':![],'where':{'id':_0x4a0831[_0xd21d('0x47')]['id']}},_0x4e391c={};_0x4e391c[_0xd21d('0x32')]=_['keys'](db['Campaign']['rawAttributes']);_0x4e391c[_0xd21d('0x33')]=_[_0xd21d('0x34')](_0x4a0831[_0xd21d('0x33')]);_0x4e391c[_0xd21d('0x35')]=_[_0xd21d('0x37')](_0x4e391c[_0xd21d('0x32')],_0x4e391c[_0xd21d('0x33')]);_0x50e070[_0xd21d('0x36')]=_[_0xd21d('0x37')](_0x4e391c['model'],qs[_0xd21d('0x38')](_0x4a0831[_0xd21d('0x33')][_0xd21d('0x38')]));_0x50e070[_0xd21d('0x36')]=_0x50e070['attributes']['length']?_0x50e070[_0xd21d('0x36')]:_0x4e391c['model'];if(_0x4a0831[_0xd21d('0x33')]['includeAll']){_0x50e070[_0xd21d('0x48')]=[{'all':!![]}];}_0x50e070=_[_0xd21d('0x41')]({},_0x50e070,_0x4a0831['options']);return db[_0xd21d('0x2f')][_0xd21d('0x49')](_0x50e070)[_0xd21d('0x24')](handleEntityNotFound(_0x26b56b,null))[_0xd21d('0x24')](respondWithResult(_0x26b56b,null))[_0xd21d('0x46')](handleError(_0x26b56b,null));};exports[_0xd21d('0x4a')]=function(_0x3713c9,_0x3e1304){return db[_0xd21d('0x2f')][_0xd21d('0x4a')](_0x3713c9['body'],{})[_0xd21d('0x24')](function(_0x4a54fe){var _0x2246c3=_0x3713c9['user'][_0xd21d('0x26')]({'plain':!![]});if(!_0x2246c3)throw new Error(_0xd21d('0x4b'));if(_0x2246c3[_0xd21d('0x4c')]===_0xd21d('0x4d')){var _0x1d153c=_0x4a54fe[_0xd21d('0x26')]({'plain':!![]});var _0x189ea2=_0xd21d('0x27');return db[_0xd21d('0x4e')][_0xd21d('0x49')]({'where':{'name':_0x189ea2,'userProfileId':_0x2246c3[_0xd21d('0x4f')]},'raw':!![]})[_0xd21d('0x24')](function(_0x48f030){if(_0x48f030&&_0x48f030['autoAssociation']===0x0){return db[_0xd21d('0x28')][_0xd21d('0x4a')]({'name':_0x1d153c[_0xd21d('0x2b')],'resourceId':_0x1d153c['id'],'type':_0x48f030[_0xd21d('0x2b')],'sectionId':_0x48f030['id']},{})[_0xd21d('0x24')](function(){return _0x4a54fe;});}else{return _0x4a54fe;}})[_0xd21d('0x46')](function(_0x2ace24){logger[_0xd21d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ace24);throw _0x2ace24;});}return _0x4a54fe;})[_0xd21d('0x24')](respondWithResult(_0x3e1304,0xc9))[_0xd21d('0x46')](handleError(_0x3e1304,null));};exports[_0xd21d('0x50')]=function(_0x522bf8,_0x40c59c){var _0x38e8f4={'where':{'id':_0x522bf8[_0xd21d('0x47')]['id']}},_0x4134ce={};_0x4134ce[_0xd21d('0x32')]=_['keys'](db[_0xd21d('0x2f')][_0xd21d('0x51')]);_0x38e8f4['attributes']=_[_0xd21d('0x37')](_0x4134ce[_0xd21d('0x32')],qs[_0xd21d('0x38')](_0x522bf8[_0xd21d('0x33')][_0xd21d('0x38')]));_0x38e8f4[_0xd21d('0x36')]=_0x38e8f4[_0xd21d('0x36')][_0xd21d('0x39')]?_0x38e8f4[_0xd21d('0x36')]:_0x4134ce[_0xd21d('0x32')];if(_0x522bf8['query'][_0xd21d('0x43')]){_0x38e8f4[_0xd21d('0x48')]=[{'all':!![]}];}_0x38e8f4=_[_0xd21d('0x41')]({},_0x38e8f4,_0x522bf8[_0xd21d('0x42')]);return db[_0xd21d('0x2f')][_0xd21d('0x49')](_0x38e8f4)['then'](handleEntityNotFound(_0x40c59c,null))[_0xd21d('0x24')](function(_0x2c67b0){if(_0x2c67b0){var _0x5040cb=_0x2c67b0[_0xd21d('0x26')]({'plain':!![]});_0x5040cb=qs[_0xd21d('0x52')](_0x5040cb,['id',_0xd21d('0x53'),_0xd21d('0x54')]);_0x522bf8['body']=_[_0xd21d('0x52')](_0x522bf8[_0xd21d('0x55')],['id',_0xd21d('0x53'),'updatedAt']);return db[_0xd21d('0x2f')][_0xd21d('0x4a')](_[_0xd21d('0x41')](_0x5040cb,_0x522bf8['body']),{'include':_0x522bf8[_0xd21d('0x33')][_0xd21d('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x34cd4f){var _0x4ec554=_0x522bf8[_0xd21d('0x4d')][_0xd21d('0x26')]({'plain':!![]});if(!_0x4ec554)throw new Error(_0xd21d('0x4b'));if(_0x4ec554[_0xd21d('0x4c')]===_0xd21d('0x4d')){var _0x3df4b5=_0x34cd4f[_0xd21d('0x26')]({'plain':!![]});var _0x235472=_0xd21d('0x27');return db[_0xd21d('0x4e')][_0xd21d('0x49')]({'where':{'name':_0x235472,'userProfileId':_0x4ec554[_0xd21d('0x4f')]},'raw':!![]})[_0xd21d('0x24')](function(_0x15bfcb){if(_0x15bfcb&&_0x15bfcb[_0xd21d('0x56')]===0x0){return db[_0xd21d('0x28')]['create']({'name':_0x3df4b5['name'],'resourceId':_0x3df4b5['id'],'type':_0x15bfcb[_0xd21d('0x2b')],'sectionId':_0x15bfcb['id']},{})[_0xd21d('0x24')](function(){return _0x34cd4f;});}else{return _0x34cd4f;}})[_0xd21d('0x46')](function(_0x37e3b5){logger[_0xd21d('0x29')](_0xd21d('0x57'),_0x37e3b5);throw _0x37e3b5;});}return _0x34cd4f;});}})[_0xd21d('0x24')](respondWithResult(_0x40c59c,0xc9))[_0xd21d('0x46')](handleError(_0x40c59c,null));};exports['update']=function(_0x2b8692,_0x1a92d8){if(_0x2b8692[_0xd21d('0x55')]['id']){delete _0x2b8692[_0xd21d('0x55')]['id'];}return db[_0xd21d('0x2f')]['find']({'where':{'id':_0x2b8692[_0xd21d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a92d8,null))[_0xd21d('0x24')](saveUpdates(_0x2b8692[_0xd21d('0x55')],null))[_0xd21d('0x24')](respondWithResult(_0x1a92d8,null))[_0xd21d('0x46')](handleError(_0x1a92d8,null));};exports['destroy']=function(_0x51da1e,_0x3b0344){return db[_0xd21d('0x2f')][_0xd21d('0x49')]({'where':{'id':_0x51da1e['params']['id']}})[_0xd21d('0x24')](handleEntityNotFound(_0x3b0344,null))[_0xd21d('0x24')](removeEntity(_0x3b0344,null))[_0xd21d('0x46')](handleError(_0x3b0344,null));};exports[_0xd21d('0x58')]=function(_0x1ebb5e,_0x533ad9,_0x5336d5){var _0x174fd1={'raw':!![],'where':{}};var _0x1ce2c7={};var _0x2a3cd7={'count':0x0,'rows':[]};return db['Campaign'][_0xd21d('0x59')]({'where':{'id':_0x1ebb5e[_0xd21d('0x47')]['id']}})[_0xd21d('0x24')](handleEntityNotFound(_0x533ad9,null))[_0xd21d('0x24')](function(_0x1b32e4){if(_0x1b32e4){_0x1ce2c7[_0xd21d('0x32')]=_[_0xd21d('0x34')](db[_0xd21d('0x5a')][_0xd21d('0x51')]);_0x1ce2c7[_0xd21d('0x33')]=_[_0xd21d('0x34')](_0x1ebb5e[_0xd21d('0x33')]);_0x1ce2c7[_0xd21d('0x35')]=_[_0xd21d('0x37')](_0x1ce2c7[_0xd21d('0x32')],_0x1ce2c7[_0xd21d('0x33')]);_0x174fd1[_0xd21d('0x36')]=_[_0xd21d('0x37')](_0x1ce2c7[_0xd21d('0x32')],qs[_0xd21d('0x38')](_0x1ebb5e[_0xd21d('0x33')][_0xd21d('0x38')]));_0x174fd1[_0xd21d('0x36')]=_0x174fd1['attributes'][_0xd21d('0x39')]?_0x174fd1[_0xd21d('0x36')]:_0x1ce2c7['model'];if(!_0x1ebb5e['query'][_0xd21d('0x3a')](_0xd21d('0x3b'))){_0x174fd1[_0xd21d('0x1e')]=qs[_0xd21d('0x1e')](_0x1ebb5e['query']['limit']);_0x174fd1[_0xd21d('0x1d')]=qs[_0xd21d('0x1d')](_0x1ebb5e['query']['offset']);}_0x174fd1[_0xd21d('0x3c')]=qs['sort'](_0x1ebb5e['query'][_0xd21d('0x3d')]);_0x174fd1[_0xd21d('0x40')]=qs[_0xd21d('0x35')](_[_0xd21d('0x3e')](_0x1ebb5e[_0xd21d('0x33')],_0x1ce2c7[_0xd21d('0x35')]));_0x174fd1['where'][_0xd21d('0x5b')]=_0x1b32e4['id'];if(_0x1ebb5e[_0xd21d('0x33')][_0xd21d('0x3f')]){_0x174fd1[_0xd21d('0x40')]=_[_0xd21d('0x41')](_0x174fd1['where'],{'$or':_[_0xd21d('0x2e')](_0x174fd1[_0xd21d('0x36')],function(_0x49b324){var _0x22fef0={};_0x22fef0[_0x49b324]={'$like':'%'+_0x1ebb5e[_0xd21d('0x33')][_0xd21d('0x3f')]+'%'};return _0x22fef0;})});}_0x174fd1=_[_0xd21d('0x41')]({},_0x174fd1,_0x1ebb5e['options']);return db[_0xd21d('0x5a')][_0xd21d('0x1c')]({'where':_0x174fd1[_0xd21d('0x40')]})[_0xd21d('0x24')](function(_0x17115d){_0x2a3cd7['count']=_0x17115d;if(_0x1ebb5e[_0xd21d('0x33')][_0xd21d('0x43')]){_0x174fd1[_0xd21d('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0xd21d('0x44')](_0x174fd1);})[_0xd21d('0x24')](function(_0x59fc2d){_0x2a3cd7['rows']=_0x59fc2d;return _0x2a3cd7;});}})[_0xd21d('0x24')](respondWithFilteredResult(_0x533ad9,_0x174fd1))['catch'](handleError(_0x533ad9,null));};exports[_0xd21d('0x5c')]=function(_0x14f917,_0x2e2f3a,_0x366e62){var _0x31c143={'raw':!![],'where':{}};var _0x132315={};var _0x49937b={'count':0x0,'rows':[]};return db[_0xd21d('0x2f')][_0xd21d('0x59')]({'where':{'id':_0x14f917['params']['id']}})['then'](handleEntityNotFound(_0x2e2f3a,null))[_0xd21d('0x24')](function(_0x3c3e8a){if(_0x3c3e8a){_0x132315[_0xd21d('0x32')]=_[_0xd21d('0x34')](db[_0xd21d('0x5d')]['rawAttributes']);_0x132315[_0xd21d('0x33')]=_[_0xd21d('0x34')](_0x14f917[_0xd21d('0x33')]);_0x132315[_0xd21d('0x35')]=_['intersection'](_0x132315[_0xd21d('0x32')],_0x132315[_0xd21d('0x33')]);_0x31c143[_0xd21d('0x36')]=_[_0xd21d('0x37')](_0x132315['model'],qs[_0xd21d('0x38')](_0x14f917[_0xd21d('0x33')]['fields']));_0x31c143[_0xd21d('0x36')]=_0x31c143[_0xd21d('0x36')][_0xd21d('0x39')]?_0x31c143['attributes']:_0x132315[_0xd21d('0x32')];if(!_0x14f917[_0xd21d('0x33')]['hasOwnProperty']('nolimit')){_0x31c143['limit']=qs[_0xd21d('0x1e')](_0x14f917[_0xd21d('0x33')]['limit']);_0x31c143[_0xd21d('0x1d')]=qs[_0xd21d('0x1d')](_0x14f917[_0xd21d('0x33')][_0xd21d('0x1d')]);}_0x31c143[_0xd21d('0x3c')]=qs[_0xd21d('0x3d')](_0x14f917[_0xd21d('0x33')]['sort']);_0x31c143[_0xd21d('0x40')]=qs[_0xd21d('0x35')](_[_0xd21d('0x3e')](_0x14f917[_0xd21d('0x33')],_0x132315['filters']));_0x31c143[_0xd21d('0x40')][_0xd21d('0x5b')]=_0x3c3e8a['id'];if(_0x14f917[_0xd21d('0x33')][_0xd21d('0x3f')]){_0x31c143['where']=_[_0xd21d('0x41')](_0x31c143[_0xd21d('0x40')],{'$or':_[_0xd21d('0x2e')](_0x31c143[_0xd21d('0x36')],function(_0x5c07a1){var _0x4f7939={};_0x4f7939[_0x5c07a1]={'$like':'%'+_0x14f917['query'][_0xd21d('0x3f')]+'%'};return _0x4f7939;})});}_0x31c143=_[_0xd21d('0x41')]({},_0x31c143,_0x14f917[_0xd21d('0x42')]);return db[_0xd21d('0x5d')][_0xd21d('0x1c')]({'where':_0x31c143[_0xd21d('0x40')]})[_0xd21d('0x24')](function(_0x3553f2){_0x49937b[_0xd21d('0x1c')]=_0x3553f2;if(_0x14f917[_0xd21d('0x33')][_0xd21d('0x43')]){_0x31c143['include']=[{'all':!![]}];}return db[_0xd21d('0x5d')][_0xd21d('0x44')](_0x31c143);})['then'](function(_0x3bd010){_0x49937b['rows']=_0x3bd010;return _0x49937b;});}})[_0xd21d('0x24')](respondWithFilteredResult(_0x2e2f3a,_0x31c143))[_0xd21d('0x46')](handleError(_0x2e2f3a,null));};exports[_0xd21d('0x5e')]=function(_0x28a917,_0x3343ca,_0x451e09){var _0x36de08={'raw':!![],'where':{}};var _0x20df7a={};var _0xf4082d={'count':0x0,'rows':[]};return db[_0xd21d('0x2f')][_0xd21d('0x59')]({'where':{'id':_0x28a917[_0xd21d('0x47')]['id']}})[_0xd21d('0x24')](handleEntityNotFound(_0x3343ca,null))[_0xd21d('0x24')](function(_0x17ddc8){if(_0x17ddc8){_0x20df7a[_0xd21d('0x32')]=_['keys'](db[_0xd21d('0x5f')][_0xd21d('0x51')]);_0x20df7a[_0xd21d('0x33')]=_[_0xd21d('0x34')](_0x28a917[_0xd21d('0x33')]);_0x20df7a['filters']=_[_0xd21d('0x37')](_0x20df7a[_0xd21d('0x32')],_0x20df7a[_0xd21d('0x33')]);_0x36de08['attributes']=_['intersection'](_0x20df7a[_0xd21d('0x32')],qs[_0xd21d('0x38')](_0x28a917[_0xd21d('0x33')]['fields']));_0x36de08[_0xd21d('0x36')]=_0x36de08[_0xd21d('0x36')][_0xd21d('0x39')]?_0x36de08['attributes']:_0x20df7a[_0xd21d('0x32')];if(!_0x28a917[_0xd21d('0x33')][_0xd21d('0x3a')]('nolimit')){_0x36de08[_0xd21d('0x1e')]=qs['limit'](_0x28a917[_0xd21d('0x33')][_0xd21d('0x1e')]);_0x36de08[_0xd21d('0x1d')]=qs[_0xd21d('0x1d')](_0x28a917[_0xd21d('0x33')][_0xd21d('0x1d')]);}_0x36de08['order']=qs[_0xd21d('0x3d')](_0x28a917['query'][_0xd21d('0x3d')]);_0x36de08[_0xd21d('0x40')]=qs[_0xd21d('0x35')](_[_0xd21d('0x3e')](_0x28a917[_0xd21d('0x33')],_0x20df7a[_0xd21d('0x35')]));_0x36de08[_0xd21d('0x40')][_0xd21d('0x5b')]=_0x17ddc8['id'];if(_0x28a917[_0xd21d('0x33')][_0xd21d('0x3f')]){_0x36de08['where']=_[_0xd21d('0x41')](_0x36de08[_0xd21d('0x40')],{'$or':_['map'](_0x36de08[_0xd21d('0x36')],function(_0x50f140){var _0x27e012={};_0x27e012[_0x50f140]={'$like':'%'+_0x28a917['query'][_0xd21d('0x3f')]+'%'};return _0x27e012;})});}_0x36de08=_['merge']({},_0x36de08,_0x28a917[_0xd21d('0x42')]);return db[_0xd21d('0x5f')][_0xd21d('0x1c')]({'where':_0x36de08[_0xd21d('0x40')]})[_0xd21d('0x24')](function(_0x1d23d4){_0xf4082d['count']=_0x1d23d4;if(_0x28a917[_0xd21d('0x33')][_0xd21d('0x43')]){_0x36de08[_0xd21d('0x48')]=[{'all':!![]}];}return db[_0xd21d('0x5f')][_0xd21d('0x44')](_0x36de08);})[_0xd21d('0x24')](function(_0x5b47d6){_0xf4082d['rows']=_0x5b47d6;return _0xf4082d;});}})['then'](respondWithFilteredResult(_0x3343ca,_0x36de08))[_0xd21d('0x46')](handleError(_0x3343ca,null));};exports[_0xd21d('0x60')]=function(_0x1957c4,_0x2c6ca9,_0x4c4892){var _0x1f51ce={'raw':!![],'where':{}};var _0x1ca8f0={};var _0xda3fb8={'count':0x0,'rows':[]};return db[_0xd21d('0x2f')]['findOne']({'where':{'id':_0x1957c4[_0xd21d('0x47')]['id']}})[_0xd21d('0x24')](handleEntityNotFound(_0x2c6ca9,null))[_0xd21d('0x24')](function(_0x39afa0){if(_0x39afa0){_0x1ca8f0['model']=_[_0xd21d('0x34')](db['CmHopperBlack']['rawAttributes']);_0x1ca8f0['query']=_[_0xd21d('0x34')](_0x1957c4[_0xd21d('0x33')]);_0x1ca8f0[_0xd21d('0x35')]=_['intersection'](_0x1ca8f0[_0xd21d('0x32')],_0x1ca8f0['query']);_0x1f51ce[_0xd21d('0x36')]=_[_0xd21d('0x37')](_0x1ca8f0[_0xd21d('0x32')],qs[_0xd21d('0x38')](_0x1957c4[_0xd21d('0x33')][_0xd21d('0x38')]));_0x1f51ce[_0xd21d('0x36')]=_0x1f51ce[_0xd21d('0x36')][_0xd21d('0x39')]?_0x1f51ce[_0xd21d('0x36')]:_0x1ca8f0['model'];if(!_0x1957c4['query'][_0xd21d('0x3a')](_0xd21d('0x3b'))){_0x1f51ce['limit']=qs[_0xd21d('0x1e')](_0x1957c4[_0xd21d('0x33')][_0xd21d('0x1e')]);_0x1f51ce['offset']=qs[_0xd21d('0x1d')](_0x1957c4['query'][_0xd21d('0x1d')]);}_0x1f51ce['order']=qs[_0xd21d('0x3d')](_0x1957c4[_0xd21d('0x33')]['sort']);_0x1f51ce['where']=qs['filters'](_[_0xd21d('0x3e')](_0x1957c4['query'],_0x1ca8f0[_0xd21d('0x35')]));_0x1f51ce[_0xd21d('0x40')][_0xd21d('0x5b')]=_0x39afa0['id'];if(_0x1957c4[_0xd21d('0x33')][_0xd21d('0x3f')]){_0x1f51ce[_0xd21d('0x40')]=_[_0xd21d('0x41')](_0x1f51ce[_0xd21d('0x40')],{'$or':_['map'](_0x1f51ce[_0xd21d('0x36')],function(_0x6a6271){var _0x4bcb92={};_0x4bcb92[_0x6a6271]={'$like':'%'+_0x1957c4[_0xd21d('0x33')][_0xd21d('0x3f')]+'%'};return _0x4bcb92;})});}_0x1f51ce=_[_0xd21d('0x41')]({},_0x1f51ce,_0x1957c4[_0xd21d('0x42')]);return db['CmHopperBlack']['count']({'where':_0x1f51ce[_0xd21d('0x40')]})[_0xd21d('0x24')](function(_0x19756f){_0xda3fb8['count']=_0x19756f;if(_0x1957c4[_0xd21d('0x33')]['includeAll']){_0x1f51ce['include']=[{'all':!![]}];}return db[_0xd21d('0x61')][_0xd21d('0x44')](_0x1f51ce);})[_0xd21d('0x24')](function(_0x4ca6ec){_0xda3fb8[_0xd21d('0x45')]=_0x4ca6ec;return _0xda3fb8;});}})[_0xd21d('0x24')](respondWithFilteredResult(_0x2c6ca9,_0x1f51ce))[_0xd21d('0x46')](handleError(_0x2c6ca9,null));};exports[_0xd21d('0x62')]=function(_0x286e13,_0x70b1ae,_0x42e241){var _0x5f4b20={};var _0x32d08c={};var _0x5362a1;var _0x50ec8a;return db['Campaign'][_0xd21d('0x59')]({'where':{'id':_0x286e13[_0xd21d('0x47')]['id']}})[_0xd21d('0x24')](handleEntityNotFound(_0x70b1ae,null))[_0xd21d('0x24')](function(_0x58c9b8){if(_0x58c9b8){_0x5362a1=_0x58c9b8;_0x32d08c[_0xd21d('0x32')]=_['keys'](db[_0xd21d('0x63')][_0xd21d('0x51')]);_0x32d08c[_0xd21d('0x33')]=_['keys'](_0x286e13[_0xd21d('0x33')]);_0x32d08c[_0xd21d('0x35')]=_[_0xd21d('0x37')](_0x32d08c['model'],_0x32d08c[_0xd21d('0x33')]);_0x5f4b20['attributes']=_[_0xd21d('0x37')](_0x32d08c['model'],qs[_0xd21d('0x38')](_0x286e13[_0xd21d('0x33')][_0xd21d('0x38')]));_0x5f4b20[_0xd21d('0x36')]=_0x5f4b20['attributes'][_0xd21d('0x39')]?_0x5f4b20[_0xd21d('0x36')]:_0x32d08c[_0xd21d('0x32')];_0x5f4b20[_0xd21d('0x3c')]=qs[_0xd21d('0x3d')](_0x286e13[_0xd21d('0x33')][_0xd21d('0x3d')]);_0x5f4b20[_0xd21d('0x40')]=qs[_0xd21d('0x35')](_[_0xd21d('0x3e')](_0x286e13[_0xd21d('0x33')],_0x32d08c['filters']));if(_0x286e13[_0xd21d('0x33')]['filter']){_0x5f4b20[_0xd21d('0x40')]=_[_0xd21d('0x41')](_0x5f4b20[_0xd21d('0x40')],{'$or':_['map'](_0x5f4b20[_0xd21d('0x36')],function(_0x53c1e3){var _0x545488={};_0x545488[_0x53c1e3]={'$like':'%'+_0x286e13[_0xd21d('0x33')][_0xd21d('0x3f')]+'%'};return _0x545488;})});}_0x5f4b20=_[_0xd21d('0x41')]({},_0x5f4b20,_0x286e13[_0xd21d('0x42')]);return _0x5362a1[_0xd21d('0x62')](_0x5f4b20);}})[_0xd21d('0x24')](function(_0x1c779b){if(_0x1c779b){_0x50ec8a=_0x1c779b[_0xd21d('0x39')];if(!_0x286e13[_0xd21d('0x33')][_0xd21d('0x3a')](_0xd21d('0x3b'))){_0x5f4b20[_0xd21d('0x1e')]=qs[_0xd21d('0x1e')](_0x286e13['query'][_0xd21d('0x1e')]);_0x5f4b20['offset']=qs['offset'](_0x286e13['query'][_0xd21d('0x1d')]);}return _0x5362a1[_0xd21d('0x62')](_0x5f4b20);}})[_0xd21d('0x24')](function(_0x247ccb){if(_0x247ccb){return _0x247ccb?{'count':_0x50ec8a,'rows':_0x247ccb}:null;}})['then'](respondWithResult(_0x70b1ae,null))[_0xd21d('0x46')](handleError(_0x70b1ae,null));};exports[_0xd21d('0x64')]=function(_0x21b749,_0xaaf427,_0x58c25d){var _0x532f9,_0x405301;return db[_0xd21d('0x2f')][_0xd21d('0x49')]({'where':{'id':_0x21b749[_0xd21d('0x47')]['id']}})[_0xd21d('0x24')](handleEntityNotFound(_0xaaf427,null))[_0xd21d('0x24')](function(_0x35c10e){if(_0x35c10e){_0x405301=_0x35c10e;return _0x35c10e[_0xd21d('0x64')](_0x21b749[_0xd21d('0x55')][_0xd21d('0x65')],_[_0xd21d('0x52')](_0x21b749[_0xd21d('0x55')],[_0xd21d('0x65'),'id'])||{});}return null;})['spread'](function(_0x14d9c8){var _0x31a5fa;_0x532f9=_0x14d9c8||[];var _0x3465b4=[];if(_0x14d9c8){for(var _0x30fd7a=0x0;_0x30fd7a<_0x14d9c8[_0xd21d('0x39')];_0x30fd7a+=0x1){var _0x5306ad=_0x14d9c8[_0x30fd7a][_0xd21d('0x26')]({'plain':!![]});_0x405301[_0xd21d('0x66')]=_0x21b749[_0xd21d('0x55')][_0xd21d('0x66')]?_0x21b749[_0xd21d('0x55')]['dialCheckDuplicateType']:_0x405301[_0xd21d('0x66')];switch(_0x405301[_0xd21d('0x66')]){case _0xd21d('0x67'):_0x31a5fa=squel[_0xd21d('0x68')]()[_0xd21d('0x69')](_0xd21d('0x6a'))[_0xd21d('0x6b')](['phone',_0xd21d('0x6c'),_0xd21d('0x6d'),'ListId',_0xd21d('0x5b'),'createdAt','updatedAt'],squel[_0xd21d('0x6e')]()[_0xd21d('0x6f')](_0xd21d('0x70'),_0xd21d('0x70'))[_0xd21d('0x6f')](_0xd21d('0x71'),'scheduledAt')[_0xd21d('0x6f')]('id',_0xd21d('0x6d'))['field'](_0x5306ad[_0xd21d('0x72')]['toString'](),_0xd21d('0x73'))[_0xd21d('0x6f')](_0x21b749[_0xd21d('0x47')]['id'][_0xd21d('0x74')](),_0xd21d('0x5b'))[_0xd21d('0x6f')](_0xd21d('0x71'),'createdAt')[_0xd21d('0x6f')](_0xd21d('0x71'),_0xd21d('0x54'))[_0xd21d('0x75')](_0xd21d('0x76'))[_0xd21d('0x40')]('deletedAt\x20IS\x20NULL')[_0xd21d('0x40')](_0xd21d('0x77'),_0x5306ad[_0xd21d('0x72')][_0xd21d('0x74')]())[_0xd21d('0x40')](_0xd21d('0x78'))['where'](_0xd21d('0x79'),squel[_0xd21d('0x6e')]()[_0xd21d('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0xd21d('0x75')](_0xd21d('0x7a'))[_0xd21d('0x40')](_0xd21d('0x7b'),_0x21b749[_0xd21d('0x47')]['id'][_0xd21d('0x74')]()))[_0xd21d('0x40')](_0xd21d('0x79'),squel[_0xd21d('0x6e')]()[_0xd21d('0x6f')](_0xd21d('0x7c'))[_0xd21d('0x75')](_0xd21d('0x6a'))['where'](_0xd21d('0x7b'),_0x21b749[_0xd21d('0x47')]['id'][_0xd21d('0x74')]())))[_0xd21d('0x74')]();break;case _0xd21d('0x7d'):_0x31a5fa=squel[_0xd21d('0x68')]()['into']('cm_hopper')[_0xd21d('0x6b')]([_0xd21d('0x70'),_0xd21d('0x6c'),_0xd21d('0x6d'),_0xd21d('0x73'),'CampaignId',_0xd21d('0x53'),_0xd21d('0x54')],squel[_0xd21d('0x6e')]()['field'](_0xd21d('0x70'),_0xd21d('0x70'))[_0xd21d('0x6f')]('NOW()',_0xd21d('0x6c'))[_0xd21d('0x6f')]('id',_0xd21d('0x6d'))[_0xd21d('0x6f')](_0x5306ad[_0xd21d('0x72')][_0xd21d('0x74')](),_0xd21d('0x73'))[_0xd21d('0x6f')](_0x21b749[_0xd21d('0x47')]['id'][_0xd21d('0x74')](),_0xd21d('0x5b'))[_0xd21d('0x6f')](_0xd21d('0x71'),_0xd21d('0x53'))[_0xd21d('0x6f')](_0xd21d('0x71'),_0xd21d('0x54'))['from']('cm_contacts')[_0xd21d('0x40')](_0xd21d('0x7e'))[_0xd21d('0x40')](_0xd21d('0x77'),_0x5306ad[_0xd21d('0x72')][_0xd21d('0x74')]())[_0xd21d('0x40')](_0xd21d('0x78'))['where'](_0xd21d('0x79'),squel[_0xd21d('0x6e')]()[_0xd21d('0x6f')]('COALESCE(phone,\x27\x27)')[_0xd21d('0x75')](_0xd21d('0x6a'))[_0xd21d('0x40')](_0xd21d('0x7b'),_0x21b749['params']['id'][_0xd21d('0x74')]())))['toString']();break;default:_0x31a5fa=squel[_0xd21d('0x68')]()[_0xd21d('0x69')](_0xd21d('0x6a'))['fromQuery']([_0xd21d('0x70'),_0xd21d('0x6c'),_0xd21d('0x6d'),_0xd21d('0x73'),'CampaignId',_0xd21d('0x53'),_0xd21d('0x54')],squel[_0xd21d('0x6e')]()[_0xd21d('0x6f')](_0xd21d('0x70'),_0xd21d('0x70'))[_0xd21d('0x6f')]('NOW()',_0xd21d('0x6c'))[_0xd21d('0x6f')]('id',_0xd21d('0x6d'))['field'](_0x5306ad[_0xd21d('0x72')][_0xd21d('0x74')](),_0xd21d('0x73'))[_0xd21d('0x6f')](_0x21b749[_0xd21d('0x47')]['id'][_0xd21d('0x74')](),_0xd21d('0x5b'))['field'](_0xd21d('0x71'),'createdAt')[_0xd21d('0x6f')]('NOW()',_0xd21d('0x54'))[_0xd21d('0x75')](_0xd21d('0x76'))[_0xd21d('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x5306ad[_0xd21d('0x72')][_0xd21d('0x74')]())[_0xd21d('0x40')](_0xd21d('0x78')))[_0xd21d('0x74')]();}_0x3465b4[_0xd21d('0x7f')](db[_0xd21d('0x80')]['query'](_0x31a5fa));}return BPromise['all'](_0x3465b4);}})[_0xd21d('0x24')](function(){return _0x532f9;})['then'](respondWithResult(_0xaaf427,null))['catch'](handleError(_0xaaf427,null));};exports['removeLists']=function(_0xbb91af,_0x211149,_0x33f538){return db[_0xd21d('0x2f')]['find']({'where':{'id':_0xbb91af[_0xd21d('0x47')]['id']}})['then'](handleEntityNotFound(_0x211149,null))[_0xd21d('0x24')](function(_0x100f14){if(_0x100f14){return _0x100f14[_0xd21d('0x81')](_0xbb91af[_0xd21d('0x33')][_0xd21d('0x65')]);}})[_0xd21d('0x24')](function(_0x586a14){if(_0x586a14){return db[_0xd21d('0x5a')][_0xd21d('0x25')]({'where':{'ListId':_0xbb91af['query']['ids'],'CampaignId':_0xbb91af['params']['id']}})[_0xd21d('0x24')](function(){return _0x586a14;});}})[_0xd21d('0x24')](respondWithStatusCode(_0x211149,null))['catch'](handleError(_0x211149,null));};exports['getBlackLists']=function(_0x4360a7,_0x4948c9,_0x23b746){var _0x18bcc7={};var _0x2c5ad4={};var _0x24e278;var _0x3e5fc0;return db[_0xd21d('0x2f')][_0xd21d('0x59')]({'where':{'id':_0x4360a7[_0xd21d('0x47')]['id']}})['then'](handleEntityNotFound(_0x4948c9,null))[_0xd21d('0x24')](function(_0x9d1d1c){if(_0x9d1d1c){_0x24e278=_0x9d1d1c;_0x2c5ad4[_0xd21d('0x32')]=_[_0xd21d('0x34')](db[_0xd21d('0x63')]['rawAttributes']);_0x2c5ad4[_0xd21d('0x33')]=_[_0xd21d('0x34')](_0x4360a7['query']);_0x2c5ad4['filters']=_[_0xd21d('0x37')](_0x2c5ad4[_0xd21d('0x32')],_0x2c5ad4[_0xd21d('0x33')]);_0x18bcc7[_0xd21d('0x36')]=_[_0xd21d('0x37')](_0x2c5ad4['model'],qs['fields'](_0x4360a7['query'][_0xd21d('0x38')]));_0x18bcc7[_0xd21d('0x36')]=_0x18bcc7[_0xd21d('0x36')][_0xd21d('0x39')]?_0x18bcc7['attributes']:_0x2c5ad4[_0xd21d('0x32')];_0x18bcc7[_0xd21d('0x3c')]=qs['sort'](_0x4360a7[_0xd21d('0x33')][_0xd21d('0x3d')]);_0x18bcc7[_0xd21d('0x40')]=qs[_0xd21d('0x35')](_[_0xd21d('0x3e')](_0x4360a7[_0xd21d('0x33')],_0x2c5ad4['filters']));if(_0x4360a7[_0xd21d('0x33')]['filter']){_0x18bcc7['where']=_[_0xd21d('0x41')](_0x18bcc7['where'],{'$or':_[_0xd21d('0x2e')](_0x18bcc7['attributes'],function(_0x5a7799){var _0x4416b2={};_0x4416b2[_0x5a7799]={'$like':'%'+_0x4360a7[_0xd21d('0x33')][_0xd21d('0x3f')]+'%'};return _0x4416b2;})});}_0x18bcc7=_[_0xd21d('0x41')]({},_0x18bcc7,_0x4360a7[_0xd21d('0x42')]);return _0x24e278[_0xd21d('0x82')](_0x18bcc7);}})[_0xd21d('0x24')](function(_0x422311){if(_0x422311){_0x3e5fc0=_0x422311[_0xd21d('0x39')];if(!_0x4360a7['query']['hasOwnProperty'](_0xd21d('0x3b'))){_0x18bcc7[_0xd21d('0x1e')]=qs[_0xd21d('0x1e')](_0x4360a7[_0xd21d('0x33')]['limit']);_0x18bcc7[_0xd21d('0x1d')]=qs[_0xd21d('0x1d')](_0x4360a7[_0xd21d('0x33')][_0xd21d('0x1d')]);}return _0x24e278[_0xd21d('0x82')](_0x18bcc7);}})[_0xd21d('0x24')](function(_0x4d161e){if(_0x4d161e){return _0x4d161e?{'count':_0x3e5fc0,'rows':_0x4d161e}:null;}})[_0xd21d('0x24')](respondWithResult(_0x4948c9,null))['catch'](handleError(_0x4948c9,null));};exports[_0xd21d('0x83')]=function(_0x3baaa9,_0x3a7493,_0x3568e5){var _0x109828,_0x35e0fa;return db['Campaign'][_0xd21d('0x49')]({'where':{'id':_0x3baaa9[_0xd21d('0x47')]['id']}})[_0xd21d('0x24')](handleEntityNotFound(_0x3a7493,null))['then'](function(_0x28dfe9){if(_0x28dfe9){_0x35e0fa=_0x28dfe9;return _0x28dfe9[_0xd21d('0x83')](_0x3baaa9['body'][_0xd21d('0x65')],_[_0xd21d('0x52')](_0x3baaa9[_0xd21d('0x55')],['ids','id'])||{});}return null;})[_0xd21d('0x84')](function(_0x3368e2){var _0x2d583b;_0x109828=_0x3368e2||[];var _0x40e714=[];if(_0x3368e2){for(var _0x3b6042=0x0;_0x3b6042<_0x3368e2['length'];_0x3b6042+=0x1){var _0x96a496=_0x3368e2[_0x3b6042][_0xd21d('0x26')]({'plain':!![]});_0x2d583b=squel[_0xd21d('0x68')]()[_0xd21d('0x69')](_0xd21d('0x85'))['fromQuery']([_0xd21d('0x70'),_0xd21d('0x6d'),_0xd21d('0x73'),_0xd21d('0x5b'),_0xd21d('0x53'),_0xd21d('0x54')],squel[_0xd21d('0x6e')]()[_0xd21d('0x6f')](_0xd21d('0x70'),'phone')[_0xd21d('0x6f')]('id','ContactId')[_0xd21d('0x6f')](_0x96a496[_0xd21d('0x72')][_0xd21d('0x74')](),_0xd21d('0x73'))[_0xd21d('0x6f')](_0x3baaa9[_0xd21d('0x47')]['id'][_0xd21d('0x74')](),_0xd21d('0x5b'))[_0xd21d('0x6f')](_0xd21d('0x71'),_0xd21d('0x53'))[_0xd21d('0x6f')](_0xd21d('0x71'),'updatedAt')['from'](_0xd21d('0x76'))[_0xd21d('0x40')](_0xd21d('0x7e'))['where']('ListId\x20=\x20?',_0x96a496[_0xd21d('0x72')][_0xd21d('0x74')]())[_0xd21d('0x40')](_0xd21d('0x78')))[_0xd21d('0x74')]();_0x40e714[_0xd21d('0x7f')](db[_0xd21d('0x80')][_0xd21d('0x33')](_0x2d583b));}return BPromise[_0xd21d('0x86')](_0x40e714);}})['then'](function(){return _0x109828;})[_0xd21d('0x24')](respondWithResult(_0x3a7493,null))[_0xd21d('0x46')](handleError(_0x3a7493,null));};exports[_0xd21d('0x87')]=function(_0xe7c295,_0x1f2114,_0x12c582){return db[_0xd21d('0x2f')][_0xd21d('0x49')]({'where':{'id':_0xe7c295[_0xd21d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f2114,null))[_0xd21d('0x24')](function(_0x240ae3){if(_0x240ae3){return _0x240ae3[_0xd21d('0x87')](_0xe7c295['query']['ids']);}})[_0xd21d('0x24')](function(_0x4f30c6){if(_0x4f30c6){return db['CmHopperBlack'][_0xd21d('0x25')]({'where':{'ListId':_0xe7c295[_0xd21d('0x33')]['ids'],'CampaignId':_0xe7c295[_0xd21d('0x47')]['id']}})['then'](function(){return _0x4f30c6;});}})[_0xd21d('0x24')](respondWithStatusCode(_0x1f2114,null))[_0xd21d('0x46')](handleError(_0x1f2114,null));};
\ No newline at end of file