Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / api / userProfile / userProfile.model.js
index 73ae134..845bb49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf291=['push','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','Tags','tag','ThroughTags','Agents','openTabs','chat','dataValues','fax','openchannel','whatsapp','../../components/parsers/qs','squel','exports','models','filter','field','findAll','associatedResources','value','model','then','catch','resolve','UserProfileResource','map','AnalyticExtractedReport','resourceId','type','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','contacts','CmContact','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','whatsappaccounts','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','Disposition','customdashboards','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','params','all','isEmpty','union','ignore'];(function(_0x3d0e12,_0x41e165){var _0x22da51=function(_0x274763){while(--_0x274763){_0x3d0e12['push'](_0x3d0e12['shift']());}};_0x22da51(++_0x41e165);}(_0xf291,0xec));var _0x1f29=function(_0xf3075c,_0x522a46){_0xf3075c=_0xf3075c-0x0;var _0x360f0b=_0xf291[_0xf3075c];return _0x360f0b;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require(_0x1f29('0x0'));var squel=require(_0x1f29('0x1'));module[_0x1f29('0x2')]=function(_0x1e4296){var _0x2debd7=_0x1e4296[_0x1f29('0x3')];function _0x5b43cb(_0x35ba89,_0x31eed4){return new Promise(function(_0x203cd7,_0x2b7a28){if(!_0x31eed4)return _0x203cd7(null);var _0x5065ae=_0x31eed4['filter']?{[_0x31eed4[_0x1f29('0x4')][_0x1f29('0x5')]]:_0x31eed4[_0x1f29('0x4')]['value']}:undefined;return _0x2debd7[_0x35ba89][_0x1f29('0x6')]({'where':_0x5065ae,'raw':!![]})['then'](function(_0x2fbfef){_0x31eed4[_0x1f29('0x7')]=_['map'](_0x2fbfef,'id');_0x203cd7(_0x31eed4);})['catch'](function(_0x3169f7){_0x2b7a28(_0x3169f7);});});}function _0x89c5e7(_0x9cbf8f,_0x4efc19){return new Promise(function(_0x58fdb9,_0x3e3d95){var _0x317923=_0x9cbf8f[_0x1f29('0x4')]?{[_0x9cbf8f[_0x1f29('0x4')][_0x1f29('0x5')]]:_0x9cbf8f[_0x1f29('0x4')][_0x1f29('0x8')]}:undefined;return _0x2debd7[_0x9cbf8f[_0x1f29('0x9')]][_0x1f29('0x6')]({'where':_0x317923,'raw':!![]})[_0x1f29('0xa')](function(_0x557ca2){_0x4efc19[_0x1f29('0x7')]=_['map'](_0x557ca2,function(_0x101eb7){return _0x101eb7['name'];});_0x58fdb9(_0x4efc19);})[_0x1f29('0xb')](function(_0x1ed563){_0x3e3d95(_0x1ed563);});});}function _0x336b27(_0x2d5120,_0x646e3e,_0x2467ff){if(!_0x646e3e)return Promise[_0x1f29('0xc')](null);return new Promise(function(_0x6b23c4,_0x261f10){return _0x2debd7[_0x1f29('0xd')][_0x1f29('0x6')]({'where':{'sectionId':_0x646e3e['id']},'raw':!![]})[_0x1f29('0xa')](function(_0x8455ed){if(_0x2d5120[_0x1f29('0x5')]&&_0x2d5120[_0x1f29('0x5')]!=='id'){_0x646e3e['associatedResources']=_[_0x1f29('0xe')](_0x8455ed,function(_0x2950c0){return _0x2950c0[_0x2d5120[_0x1f29('0x5')]];});}else{if(_0x2467ff===_0x1f29('0xf')){_0x646e3e[_0x1f29('0x7')]=_[_0x1f29('0xe')](_0x8455ed,function(_0xde3030){return{'id':_0xde3030[_0x1f29('0x10')],'type':_0xde3030[_0x1f29('0x11')]};});}else{_0x646e3e[_0x1f29('0x7')]=_[_0x1f29('0xe')](_0x8455ed,function(_0x161bc1){return _0x161bc1['resourceId'];});}}_0x6b23c4(_0x646e3e);})[_0x1f29('0xb')](function(_0xc9c5c5){_0x261f10(_0xc9c5c5);});});}function _0x177cd3(_0x24de95,_0x265e1f){var _0x464eee={'parentSections':[]};switch(_0x24de95['toLowerCase']()){case _0x1f29('0x12'):_0x464eee['childModel']=_0x1f29('0x13');break;case _0x1f29('0x14'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x16');break;case _0x1f29('0x17'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x18');_0x464eee[_0x1f29('0x19')]=[{'name':_0x1f29('0x1a'),'field':_0x1f29('0x1b'),'foreignKey':_0x1f29('0x1c')}];break;case _0x1f29('0x1d'):_0x464eee[_0x1f29('0x15')]='JscriptyProject';break;case _0x1f29('0x1e'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x1f');_0x464eee[_0x1f29('0x19')]=[{'name':_0x1f29('0x20'),'field':'id','foreignKey':_0x1f29('0x21')}];break;case _0x1f29('0x22'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x23');break;case'companies':_0x464eee['childModel']='CmCompany';break;case _0x1f29('0x24'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x25');break;case _0x1f29('0x26'):_0x464eee[_0x1f29('0x15')]='ChatQueue';break;case _0x1f29('0x27'):_0x464eee[_0x1f29('0x15')]='ChatWebsite';break;case _0x1f29('0x28'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x29');break;case _0x1f29('0x2a'):_0x464eee['childModel']=_0x1f29('0x2b');break;case _0x1f29('0x2c'):case'internalroutes':case _0x1f29('0x2d'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x2e');break;case _0x1f29('0x2f'):_0x464eee[_0x1f29('0x15')]='VoiceContext';break;case _0x1f29('0x30'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x31');break;case _0x1f29('0x32'):_0x464eee['childModel']=_0x1f29('0x33');_0x464eee['parentSections']=[{'name':'Agents','field':_0x1f29('0x1b'),'foreignKey':'membername','model':_0x1f29('0x34'),'filter':{'field':_0x1f29('0x35'),'value':[_0x1f29('0x36')]}},{'name':_0x1f29('0x37'),'field':_0x1f29('0x1b'),'foreignKey':'membername','model':_0x1f29('0x34'),'filter':{'field':_0x1f29('0x35'),'value':[_0x1f29('0x38')]}},{'name':_0x1f29('0x39'),'field':'name','foreignKey':_0x1f29('0x3a'),'model':_0x1f29('0x3b'),'filter':{'field':_0x1f29('0x11'),'value':[_0x1f29('0x3c')]}},{'name':_0x1f29('0x3d'),'field':_0x1f29('0x1b'),'foreignKey':_0x1f29('0x3a'),'model':_0x1f29('0x3b'),'filter':{'field':_0x1f29('0x11'),'value':[_0x1f29('0x3e')]}}];break;case _0x1f29('0x3f'):_0x464eee['childModel']=_0x1f29('0x40');break;case _0x1f29('0x41'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x42');break;case'voiceprefixes':_0x464eee[_0x1f29('0x15')]=_0x1f29('0x43');break;case _0x1f29('0x44'):_0x464eee['childModel']=_0x1f29('0x45');break;case _0x1f29('0x46'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x47');break;case _0x1f29('0x48'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x49');break;case _0x1f29('0x4a'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x4b');break;case'openchannelqueues':_0x464eee[_0x1f29('0x15')]=_0x1f29('0x4c');break;case'openchannelaccounts':_0x464eee['childModel']='OpenchannelAccount';break;case _0x1f29('0x4d'):_0x464eee['childModel']=_0x1f29('0x4e');break;case _0x1f29('0x4f'):_0x464eee[_0x1f29('0x15')]='SmsAccount';break;case'whatsappqueues':_0x464eee[_0x1f29('0x15')]='WhatsappQueue';break;case _0x1f29('0x50'):_0x464eee[_0x1f29('0x15')]='WhatsappAccount';break;case _0x1f29('0x51'):_0x464eee[_0x1f29('0x15')]='Team';break;case _0x1f29('0x52'):case _0x1f29('0x53'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x3b');if(_0x265e1f){_0x464eee['parentSections']=[{'name':'VoiceQueues'},{'name':_0x1f29('0x3d')}];}break;case _0x1f29('0x54'):case _0x1f29('0x55'):case _0x1f29('0x56'):_0x464eee['childModel']=_0x1f29('0x34');if(_0x265e1f){_0x464eee[_0x1f29('0x19')]=[{'name':_0x1f29('0x57'),'filter':{'field':_0x1f29('0x35'),'value':[_0x1f29('0x58'),_0x1f29('0x59')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x464eee[_0x1f29('0x15')]=_0x1f29('0x5a');break;case'salesforceaccounts':_0x464eee[_0x1f29('0x15')]=_0x1f29('0x5b');break;case _0x1f29('0x5c'):_0x464eee['childModel']=_0x1f29('0x5d');break;case _0x1f29('0x5e'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x5f');break;case _0x1f29('0x60'):_0x464eee[_0x1f29('0x15')]='DeskAccount';break;case _0x1f29('0x61'):_0x464eee[_0x1f29('0x15')]='ZohoAccount';break;case _0x1f29('0x62'):_0x464eee['childModel']=_0x1f29('0x34');break;case _0x1f29('0x63'):_0x464eee[_0x1f29('0x15')]='CannedAnswer';break;case'dispositions':_0x464eee[_0x1f29('0x15')]=_0x1f29('0x64');break;case _0x1f29('0x65'):_0x464eee[_0x1f29('0x15')]='Dashboard';break;case _0x1f29('0x66'):_0x464eee['childModel']=_0x1f29('0x67');break;case _0x1f29('0x68'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x69');break;case'scheduler':_0x464eee[_0x1f29('0x15')]=_0x1f29('0x6a');break;case _0x1f29('0x6b'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x6c');break;case _0x1f29('0x6d'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x6e');break;case _0x1f29('0x6f'):_0x464eee[_0x1f29('0x15')]='Template';break;case _0x1f29('0x70'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x71');break;case'trunks':_0x464eee[_0x1f29('0x15')]=_0x1f29('0x72');break;case _0x1f29('0x73'):_0x464eee['childModel']=_0x1f29('0x74');break;case _0x1f29('0x75'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0x76');break;case _0x1f29('0x77'):_0x464eee[_0x1f29('0x15')]=_0x1f29('0xf');_0x464eee[_0x1f29('0x19')]=[{'name':_0x1f29('0x78'),'field':'id','foreignKey':_0x1f29('0x79')}];break;case _0x1f29('0x7a'):_0x464eee[_0x1f29('0x15')]='AnalyticMetric';break;}return _0x464eee;}function _0x367f88(_0x3b1189,_0x34ebbf){var _0x2571a8=_0x3b1189[_0x1f29('0x7b')](0x0)[_0x1f29('0x7c')]()+_0x3b1189[_0x1f29('0x7d')](0x1);var _0x2479d8={'type':_0x2debd7[_0x1f29('0x7e')][_0x1f29('0x7f')][_0x1f29('0x80')],'raw':!![]};return new Promise(function(_0x5f37fc,_0x3299e7){var _0x5ee797=squel[_0x1f29('0x81')]()[_0x1f29('0x5')](_0x1f29('0x82')+_0x2571a8+_0x1f29('0x83'),'id')[_0x1f29('0x5')]('ui.createdAt')[_0x1f29('0x84')](_0x1f29('0x85')+_0x3b1189+_0x1f29('0x86'),'ui')[_0x1f29('0x87')](_0x1f29('0x88'),_0x34ebbf['id']);return _0x2debd7[_0x1f29('0x89')][_0x1f29('0x8a')](_0x5ee797['toString'](),_0x2479d8)['then'](function(_0x5b1b1f){_0x34ebbf[_0x2571a8+_0x1f29('0x8b')]=_0x5b1b1f;_0x5f37fc(_0x5b1b1f);})[_0x1f29('0xb')](function(_0x4494bc){_0x3299e7(_0x4494bc);});});}return _0x1e4296['define'](_0x1f29('0x8c'),attributes,{'tableName':_0x1f29('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1546be){var _0x55cf58={'raw':_0x1546be[_0x1f29('0x8a')][_0x1f29('0x8e')],'where':{}};var _0x4c185c={};var _0x46a6f2={'count':0x0,'rows':[]};var _0x58ca64=_0x1546be[_0x1f29('0x8a')][_0x1f29('0x8f')];var _0x3aabdb=_0x1546be['query'][_0x1f29('0x90')]||![];var _0x52586f=_0x177cd3(_0x58ca64,_0x3aabdb);if(!_0x52586f[_0x1f29('0x15')])throw new Error(_0x1f29('0x91')+_0x58ca64+'\x27');var _0x467846=[{'name':_0x58ca64}];if(!_['isEmpty'](_0x52586f[_0x1f29('0x19')]))_0x467846=_0x52586f['parentSections'];var _0x34ae89=[];for(var _0x16af0d=0x0;_0x16af0d<_0x467846[_0x1f29('0x92')];_0x16af0d++){_0x34ae89['push'](_0x2debd7[_0x1f29('0x93')][_0x1f29('0x94')]({'where':{'userProfileId':_0x1546be[_0x1f29('0x95')]['id'],'name':_0x467846[_0x16af0d]['name']},'raw':!![]}));}return Promise[_0x1f29('0x96')](_0x34ae89)[_0x1f29('0xa')](function(_0x3967c8){var _0x37c0c6=_[_0x1f29('0x4')](_0x3967c8,function(_0x1e0395){return _0x1e0395?_0x1e0395:undefined;});var _0x37c2d0=_['filter'](_0x467846,['ignore',!![]]);var _0x43e394=_[_0x1f29('0x97')](_0x37c0c6)&&_['isEmpty'](_0x37c2d0)?null:_[_0x1f29('0x98')](_0x37c2d0,_0x37c0c6);if(!_0x43e394)return null;var _0x3abcee=[];for(var _0x4bb7b3=0x0;_0x4bb7b3<_0x43e394[_0x1f29('0x92')];_0x4bb7b3++){var _0x27f715=_[_0x1f29('0x94')](_0x467846,function(_0x2dfe50){return _0x43e394[_0x4bb7b3]?_0x2dfe50['name']===_0x43e394[_0x4bb7b3][_0x1f29('0x1b')]:null;});if(_0x27f715){if(_0x43e394[_0x4bb7b3][_0x1f29('0x99')]){_0x3abcee[_0x1f29('0x9a')](_0x5b43cb(_0x52586f['childModel'],_0x43e394[_0x4bb7b3]));}else{if(!_0x43e394[_0x4bb7b3][_0x1f29('0x9b')]){_0x3abcee[_0x1f29('0x9a')](_0x336b27(_0x27f715,_0x43e394[_0x4bb7b3],_0x52586f[_0x1f29('0x15')]));}else{if(_0x27f715[_0x1f29('0x9')]){_0x3abcee[_0x1f29('0x9a')](_0x89c5e7(_0x27f715,_0x43e394[_0x4bb7b3]));}}}}}return Promise['all'](_0x3abcee);})[_0x1f29('0xa')](function(_0x3d8fee){var _0x4b350c=_0x3d8fee;var _0x37e089=null;if(_0x4b350c){_0x37e089=_0x4b350c[_0x1f29('0x92')]===0x1?_0x4b350c[0x0]:null;}if(!_0x37e089&&!_0x4b350c)return _0x46a6f2;var _0x11c622=_0x2debd7[_0x52586f[_0x1f29('0x15')]][_0x1f29('0x9c')];_0x4c185c[_0x1f29('0x9')]=_[_0x1f29('0x9d')](_0x11c622);_0x4c185c[_0x1f29('0x8a')]=_[_0x1f29('0x9d')](_0x1546be['query']);_0x4c185c[_0x1f29('0x9e')]=_[_0x1f29('0x9f')](_0x4c185c[_0x1f29('0x9')],_0x4c185c[_0x1f29('0x8a')]);_0x55cf58['attributes']=_[_0x1f29('0x9f')](_0x4c185c[_0x1f29('0x9')],qs[_0x1f29('0xa0')](_0x1546be[_0x1f29('0x8a')][_0x1f29('0xa0')]));_0x55cf58['attributes']=_0x55cf58['attributes'][_0x1f29('0x92')]?_0x55cf58[_0x1f29('0xa1')]:_0x4c185c[_0x1f29('0x9')];if(!_0x1546be[_0x1f29('0x8a')][_0x1f29('0xa2')]('nolimit')){_0x55cf58['limit']=qs['limit'](_0x1546be['query']['limit']);_0x55cf58['offset']=qs[_0x1f29('0xa3')](_0x1546be[_0x1f29('0x8a')][_0x1f29('0xa3')]);}_0x55cf58['order']=qs[_0x1f29('0xa4')](_0x1546be[_0x1f29('0x8a')]['sort']);_0x55cf58[_0x1f29('0x87')]=qs[_0x1f29('0x9e')](_[_0x1f29('0xa5')](_0x1546be[_0x1f29('0x8a')],_0x4c185c['filters']));if(_0x1546be[_0x1f29('0x8a')][_0x1f29('0x4')]){_0x55cf58[_0x1f29('0x87')]=_[_0x1f29('0xa6')](_0x55cf58['where'],{'$or':_[_0x1f29('0xe')](_0x11c622,function(_0x3ef700){if(_0x3ef700['type'][_0x1f29('0xa7')]!==_0x1f29('0xa8')){var _0x1656c3={};_0x1656c3[_0x3ef700['field']]={'$like':'%'+_0x1546be[_0x1f29('0x8a')][_0x1f29('0x4')]+'%'};return _0x1656c3;}})});}var _0xab3bdd=[];var _0x17301e=null;var _0x24c659={};if(_0x37e089){_0x17301e=_[_0x1f29('0x94')](_0x467846,['name',_0x37e089[_0x1f29('0x1b')]]);if(_0x17301e[_0x1f29('0x5')]){_0x24c659={};if(_0x52586f[_0x1f29('0x15')]===_0x1f29('0xf')){_0x24c659[_0x17301e[_0x1f29('0xa9')]]=_['map'](_0x37e089[_0x1f29('0x7')],'id');}else{_0x24c659[_0x17301e[_0x1f29('0xa9')]]=_0x37e089[_0x1f29('0x7')];}_0xab3bdd['push'](_0x24c659);}else{_0x55cf58[_0x1f29('0x87')]['id']=_0x37e089[_0x1f29('0x7')];}}else{for(var _0x18a85b=0x0;_0x18a85b<_0x4b350c[_0x1f29('0x92')];_0x18a85b++){_0x17301e=_[_0x1f29('0x94')](_0x467846,[_0x1f29('0x1b'),_0x4b350c[_0x18a85b]['name']]);if(_0x17301e[_0x1f29('0x5')]){_0x24c659={};_0x24c659[_0x17301e[_0x1f29('0xa9')]]=_0x4b350c[_0x18a85b][_0x1f29('0x7')];_0xab3bdd[_0x1f29('0x9a')](_0x24c659);}else{if(!_0x55cf58[_0x1f29('0x87')]['id'])_0x55cf58[_0x1f29('0x87')]['id']=[];_0x4b350c[_0x18a85b][_0x1f29('0x7')][_0x1f29('0xaa')](function(_0x49dc7a){_0x55cf58[_0x1f29('0x87')]['id'][_0x1f29('0x9a')](_0x49dc7a);});}}}if(!_['isEmpty'](_0xab3bdd)){_0x55cf58[_0x1f29('0x87')]=_[_0x1f29('0xa6')](_0x55cf58[_0x1f29('0x87')],{'$and':{'$or':_0xab3bdd}});}_0x55cf58=_[_0x1f29('0xa6')]({},_0x55cf58,_0x1546be[_0x1f29('0xab')]);if(_0x37e089&&!_0x37e089[_0x1f29('0x9b')]&&_0x52586f['childModel']===_0x1f29('0xf')){if(_0x1546be[_0x1f29('0x8a')][_0x1f29('0xac')]){_0x55cf58[_0x1f29('0xad')]=[{'all':!![]}];}return _0x2debd7[_0x52586f[_0x1f29('0x15')]]['findAll'](_0x55cf58)[_0x1f29('0xa')](function(_0x3ce937){var _0x4bfd52=[];_0x3ce937[_0x1f29('0xaa')](function(_0x1af23b){var _0x37e242;switch(_0x1af23b[_0x1f29('0xae')]){case _0x1f29('0xaf'):_0x37e242=_['find'](_0x37e089[_0x1f29('0x7')],function(_0x56b5c0){return _0x56b5c0['id']===_0x1af23b[_0x1f29('0x79')]&&_0x56b5c0[_0x1f29('0x11')]===_0x1f29('0xb0');});break;case _0x1f29('0xb1'):_0x37e242=_['find'](_0x37e089['associatedResources'],function(_0x33854f){return _0x33854f['id']===_0x1af23b[_0x1f29('0x79')]&&_0x33854f[_0x1f29('0x11')]===_0x1f29('0xb2');});break;}if(_0x37e242)_0x4bfd52[_0x1f29('0x9a')](_0x1af23b);});_0x46a6f2[_0x1f29('0xb3')]=_0x4bfd52[_0x1f29('0x92')];_0x46a6f2[_0x1f29('0xb4')]=_0x4bfd52;return _0x46a6f2;});}else{if(!_[_0x1f29('0x97')](_0x1546be[_0x1f29('0x8a')]['ids'])){_0x55cf58[_0x1f29('0x87')]['id']=_0x55cf58[_0x1f29('0x87')]['id']?_[_0x1f29('0x9f')](_0x55cf58[_0x1f29('0x87')]['id'],_0x1546be[_0x1f29('0x8a')][_0x1f29('0xb5')]):_0x1546be[_0x1f29('0x8a')]['ids'];if(_0x1546be[_0x1f29('0x8a')][_0x1f29('0xb6')]){_0x55cf58[_0x1f29('0xb7')]=_0x1546be[_0x1f29('0x8a')][_0x1f29('0xb6')];}}if(_0x1546be[_0x1f29('0x8a')]['extraQueryConditions']){_0x55cf58[_0x1f29('0x87')]=_[_0x1f29('0xa6')](_0x55cf58[_0x1f29('0x87')],{'$and':_0x1546be[_0x1f29('0x8a')][_0x1f29('0xb8')]});}return _0x2debd7[_0x52586f[_0x1f29('0x15')]]['count']({'where':_0x55cf58[_0x1f29('0x87')]})[_0x1f29('0xa')](function(_0x4ad36e){_0x46a6f2[_0x1f29('0xb3')]=_0x4ad36e;if(_0x1546be[_0x1f29('0x8a')][_0x1f29('0xac')]){if(_0x52586f[_0x1f29('0x15')]===_0x1f29('0x1f')){_0x55cf58[_0x1f29('0xad')]=[{'model':_0x2debd7['Tag'],'as':_0x1f29('0xb9'),'attributes':['id',_0x1f29('0x1b'),'color'],'required':_0x1546be[_0x1f29('0x8a')][_0x1f29('0xba')]?!![]:![]},{'model':_0x2debd7[_0x1f29('0x6e')],'as':_0x1f29('0xbb'),'attributes':['id',_0x1f29('0x1b'),'color'],'through':_0x1546be[_0x1f29('0x8a')][_0x1f29('0xba')]?{'attributes':[],'where':{'TagId':_0x1546be['query'][_0x1f29('0xba')]||undefined}}:{},'required':_0x1546be[_0x1f29('0x8a')][_0x1f29('0xba')]?!![]:![]}];}else{_0x55cf58['include']=[{'all':!![]}];}}return _0x2debd7[_0x52586f[_0x1f29('0x15')]]['findAll'](_0x55cf58);})[_0x1f29('0xa')](function(_0x3142e7){_0x46a6f2[_0x1f29('0xb4')]=_0x3142e7;if(_0x58ca64===_0x1f29('0xbc')&&_0x1546be[_0x1f29('0x8a')][_0x1f29('0xbd')]==='true'){var _0x231412=[];for(var _0x325672=0x0;_0x325672<_0x46a6f2[_0x1f29('0xb4')][_0x1f29('0x92')];_0x325672++){_0x231412['push'](_0x367f88(_0x1f29('0xbe'),_0x46a6f2[_0x1f29('0xb4')][_0x325672][_0x1f29('0xbf')]));_0x231412['push'](_0x367f88('sms',_0x46a6f2[_0x1f29('0xb4')][_0x325672][_0x1f29('0xbf')]));_0x231412[_0x1f29('0x9a')](_0x367f88(_0x1f29('0xc0'),_0x46a6f2[_0x1f29('0xb4')][_0x325672][_0x1f29('0xbf')]));_0x231412[_0x1f29('0x9a')](_0x367f88('mail',_0x46a6f2[_0x1f29('0xb4')][_0x325672][_0x1f29('0xbf')]));_0x231412[_0x1f29('0x9a')](_0x367f88(_0x1f29('0xc1'),_0x46a6f2[_0x1f29('0xb4')][_0x325672]['dataValues']));_0x231412[_0x1f29('0x9a')](_0x367f88(_0x1f29('0xc2'),_0x46a6f2[_0x1f29('0xb4')][_0x325672][_0x1f29('0xbf')]));}return Promise[_0x1f29('0x96')](_0x231412)[_0x1f29('0xa')](function(){return _0x46a6f2;});}return _0x46a6f2;});}});}}});};
\ No newline at end of file
+var _0xd28f=['agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','raw','section','Invalid\x20section\x20\x27','length','push','UserProfileSection','params','ignore','isEmpty','union','find','autoAssociation','model','all','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','foreignKey','includeAll','include','forEach','reportType','default','DefaultReports','custom','count','ids','customSorting','extraQueryConditions','Tag','Tags','color','tag','ThroughTags','rows','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','catch','map','resolve','type','resourceId','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareProjects','name','projectName','projects','CmContact','parentSections','Lists','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','FaxQueue','inboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','agent','role','telephone','queue','inbound','VoiceQueue','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','QueueCampaigns','users'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0xd28f,0x1eb));var _0xfd28=function(_0x2c0de9,_0x58f69a){_0x2c0de9=_0x2c0de9-0x0;var _0x4c592e=_0xd28f[_0x2c0de9];return _0x4c592e;};'use strict';var _=require(_0xfd28('0x0'));var attributes=require(_0xfd28('0x1'));var squel=require(_0xfd28('0x2'));module[_0xfd28('0x3')]=function(_0x415731){var _0x1bbb0b=_0x415731[_0xfd28('0x4')];function _0x1c49c7(_0x52c9c6,_0x2eaa59){return new Promise(function(_0x40b58b,_0x2f26c9){if(!_0x2eaa59)return _0x40b58b(null);var _0x59c004=_0x2eaa59[_0xfd28('0x5')]?{[_0x2eaa59[_0xfd28('0x5')][_0xfd28('0x6')]]:_0x2eaa59[_0xfd28('0x5')][_0xfd28('0x7')]}:undefined;return _0x1bbb0b[_0x52c9c6][_0xfd28('0x8')]({'where':_0x59c004,'raw':!![]})[_0xfd28('0x9')](function(_0x2bc52a){_0x2eaa59[_0xfd28('0xa')]=_['map'](_0x2bc52a,'id');_0x40b58b(_0x2eaa59);})[_0xfd28('0xb')](function(_0x3be3a9){_0x2f26c9(_0x3be3a9);});});}function _0xc31533(_0x33a376,_0x30a809){return new Promise(function(_0x1516b1,_0x3edf60){var _0x24f36d=_0x33a376['filter']?{[_0x33a376[_0xfd28('0x5')][_0xfd28('0x6')]]:_0x33a376[_0xfd28('0x5')][_0xfd28('0x7')]}:undefined;return _0x1bbb0b[_0x33a376['model']][_0xfd28('0x8')]({'where':_0x24f36d,'raw':!![]})[_0xfd28('0x9')](function(_0x265899){_0x30a809[_0xfd28('0xa')]=_[_0xfd28('0xc')](_0x265899,function(_0x29b55d){return _0x29b55d['name'];});_0x1516b1(_0x30a809);})[_0xfd28('0xb')](function(_0xac6c35){_0x3edf60(_0xac6c35);});});}function _0x199433(_0x59e410,_0x2ffdc7,_0x3725e8){if(!_0x2ffdc7)return Promise[_0xfd28('0xd')](null);return new Promise(function(_0x3c9d7b,_0x4c9ccd){return _0x1bbb0b['UserProfileResource'][_0xfd28('0x8')]({'where':{'sectionId':_0x2ffdc7['id']},'raw':!![]})[_0xfd28('0x9')](function(_0x13227b){if(_0x59e410[_0xfd28('0x6')]&&_0x59e410['field']!=='id'){_0x2ffdc7[_0xfd28('0xa')]=_['map'](_0x13227b,function(_0x447319){return _0x447319[_0x59e410[_0xfd28('0x6')]];});}else{if(_0x3725e8==='AnalyticExtractedReport'){_0x2ffdc7[_0xfd28('0xa')]=_['map'](_0x13227b,function(_0x54e00c){return{'id':_0x54e00c['resourceId'],'type':_0x54e00c[_0xfd28('0xe')]};});}else{_0x2ffdc7[_0xfd28('0xa')]=_[_0xfd28('0xc')](_0x13227b,function(_0x1b9c03){return _0x1b9c03[_0xfd28('0xf')];});}}_0x3c9d7b(_0x2ffdc7);})[_0xfd28('0xb')](function(_0x122c1d){_0x4c9ccd(_0x122c1d);});});}function _0xbc259b(_0x23a5ad,_0x479ef6){var _0x15a6a5={'parentSections':[]};switch(_0x23a5ad['toLowerCase']()){case _0xfd28('0x10'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x12');break;case _0xfd28('0x13'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x14');break;case'squarerecordings':_0x15a6a5[_0xfd28('0x11')]='SquareRecording';_0x15a6a5['parentSections']=[{'name':_0xfd28('0x15'),'field':_0xfd28('0x16'),'foreignKey':_0xfd28('0x17')}];break;case _0xfd28('0x18'):_0x15a6a5[_0xfd28('0x11')]='JscriptyProject';break;case'contacts':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x19');_0x15a6a5[_0xfd28('0x1a')]=[{'name':_0xfd28('0x1b'),'field':'id','foreignKey':_0xfd28('0x1c')}];break;case _0xfd28('0x1d'):_0x15a6a5[_0xfd28('0x11')]='CmList';break;case _0xfd28('0x1e'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x1f');break;case _0xfd28('0x20'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x21');break;case'chatqueues':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x22');break;case'chatwebsites':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x23');break;case _0xfd28('0x24'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x25');break;case'faxaccounts':_0x15a6a5[_0xfd28('0x11')]='FaxAccount';break;case _0xfd28('0x26'):case'internalroutes':case'outboundroutes':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x27');break;case _0xfd28('0x28'):_0x15a6a5[_0xfd28('0x11')]='VoiceContext';break;case _0xfd28('0x29'):_0x15a6a5['childModel']=_0xfd28('0x2a');break;case'voicerecordings':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x2b');_0x15a6a5['parentSections']=[{'name':_0xfd28('0x2c'),'field':_0xfd28('0x16'),'foreignKey':_0xfd28('0x2d'),'model':_0xfd28('0x2e'),'filter':{'field':'role','value':[_0xfd28('0x2f')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':_0xfd28('0x2e'),'filter':{'field':_0xfd28('0x30'),'value':[_0xfd28('0x31')]}},{'name':'VoiceQueues','field':_0xfd28('0x16'),'foreignKey':_0xfd28('0x32'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xfd28('0x33')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0xfd28('0x32'),'model':_0xfd28('0x34'),'filter':{'field':_0xfd28('0xe'),'value':['outbound']}}];break;case _0xfd28('0x35'):_0x15a6a5['childModel']=_0xfd28('0x36');break;case _0xfd28('0x37'):_0x15a6a5[_0xfd28('0x11')]='VoiceChanSpy';break;case _0xfd28('0x38'):_0x15a6a5['childModel']='VoicePrefix';break;case _0xfd28('0x39'):_0x15a6a5['childModel']=_0xfd28('0x3a');break;case _0xfd28('0x3b'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x3c');break;case _0xfd28('0x3d'):_0x15a6a5['childModel']=_0xfd28('0x3e');break;case'mailsubstatuses':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x3f');break;case'openchannelqueues':_0x15a6a5['childModel']=_0xfd28('0x40');break;case _0xfd28('0x41'):_0x15a6a5[_0xfd28('0x11')]='OpenchannelAccount';break;case _0xfd28('0x42'):_0x15a6a5['childModel']='SmsQueue';break;case _0xfd28('0x43'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x44');break;case'whatsappqueues':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x45');break;case _0xfd28('0x46'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x47');break;case _0xfd28('0x48'):_0x15a6a5['childModel']=_0xfd28('0x49');break;case _0xfd28('0x4a'):case _0xfd28('0x4b'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x34');if(_0x479ef6){_0x15a6a5['parentSections']=[{'name':_0xfd28('0x4c')},{'name':_0xfd28('0x4d')}];}break;case _0xfd28('0x4e'):case _0xfd28('0x4f'):case _0xfd28('0x50'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x2e');if(_0x479ef6){_0x15a6a5[_0xfd28('0x1a')]=[{'name':_0xfd28('0x51'),'filter':{'field':_0xfd28('0x30'),'value':[_0xfd28('0x52'),_0xfd28('0x53')]},'ignore':!![]},{'name':'Agents'},{'name':_0xfd28('0x54')}];}break;case _0xfd28('0x55'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x56');break;case _0xfd28('0x57'):_0x15a6a5[_0xfd28('0x11')]='SalesforceAccount';break;case _0xfd28('0x58'):_0x15a6a5[_0xfd28('0x11')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x15a6a5['childModel']=_0xfd28('0x59');break;case _0xfd28('0x5a'):_0x15a6a5[_0xfd28('0x11')]='DeskAccount';break;case _0xfd28('0x5b'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x5c');break;case'vtigeraccounts':_0x15a6a5['childModel']=_0xfd28('0x2e');break;case _0xfd28('0x5d'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x5e');break;case _0xfd28('0x5f'):_0x15a6a5['childModel']=_0xfd28('0x60');break;case _0xfd28('0x61'):_0x15a6a5['childModel']=_0xfd28('0x62');break;case _0xfd28('0x63'):_0x15a6a5['childModel']=_0xfd28('0x64');break;case _0xfd28('0x65'):_0x15a6a5[_0xfd28('0x11')]='Pause';break;case'scheduler':_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x66');break;case _0xfd28('0x67'):_0x15a6a5[_0xfd28('0x11')]='Sound';break;case _0xfd28('0x68'):_0x15a6a5['childModel']='Tag';break;case _0xfd28('0x69'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x6a');break;case _0xfd28('0x6b'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x6c');break;case _0xfd28('0x6d'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x6e');break;case _0xfd28('0x6f'):_0x15a6a5[_0xfd28('0x11')]=_0xfd28('0x70');break;case _0xfd28('0x71'):_0x15a6a5[_0xfd28('0x11')]='Plugin';break;case'extractedreports':_0x15a6a5['childModel']=_0xfd28('0x72');_0x15a6a5['parentSections']=[{'name':_0xfd28('0x73'),'field':'id','foreignKey':_0xfd28('0x74')}];break;case _0xfd28('0x75'):_0x15a6a5['childModel']=_0xfd28('0x76');break;}return _0x15a6a5;}function _0x2de0d0(_0xecddcc,_0x3c885c){var _0xfdc879=_0xecddcc[_0xfd28('0x77')](0x0)[_0xfd28('0x78')]()+_0xecddcc[_0xfd28('0x79')](0x1);var _0x1a572a={'type':_0x1bbb0b[_0xfd28('0x7a')][_0xfd28('0x7b')][_0xfd28('0x7c')],'raw':!![]};return new Promise(function(_0x307bd3,_0x5545ac){var _0xb340ca=squel['select']()[_0xfd28('0x6')](_0xfd28('0x7d')+_0xfdc879+'InteractionId','id')[_0xfd28('0x6')](_0xfd28('0x7e'))['from'](_0xfd28('0x7f')+_0xecddcc+_0xfd28('0x80'),'ui')[_0xfd28('0x81')](_0xfd28('0x82'),_0x3c885c['id']);return _0x1bbb0b[_0xfd28('0x83')][_0xfd28('0x84')](_0xb340ca[_0xfd28('0x85')](),_0x1a572a)[_0xfd28('0x9')](function(_0x5420b8){_0x3c885c[_0xfdc879+_0xfd28('0x86')]=_0x5420b8;_0x307bd3(_0x5420b8);})[_0xfd28('0xb')](function(_0x5f1092){_0x5545ac(_0x5f1092);});});}return _0x415731['define'](_0xfd28('0x87'),attributes,{'tableName':_0xfd28('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4dd71e){var _0x5a5b55=require('../../components/parsers/qs');var _0x43e33a={'raw':_0x4dd71e[_0xfd28('0x84')][_0xfd28('0x89')],'where':{}};var _0x5d7afa={};var _0x2b5c85={'count':0x0,'rows':[]};var _0x1c2f6b=_0x4dd71e['query'][_0xfd28('0x8a')];var _0x17921b=_0x4dd71e['query']['mergeResources']||![];var _0x11d8c4=_0xbc259b(_0x1c2f6b,_0x17921b);if(!_0x11d8c4['childModel'])throw new Error(_0xfd28('0x8b')+_0x1c2f6b+'\x27');var _0x294e98=[{'name':_0x1c2f6b}];if(!_['isEmpty'](_0x11d8c4[_0xfd28('0x1a')]))_0x294e98=_0x11d8c4[_0xfd28('0x1a')];var _0x10c31f=[];for(var _0xf785ab=0x0;_0xf785ab<_0x294e98[_0xfd28('0x8c')];_0xf785ab++){_0x10c31f[_0xfd28('0x8d')](_0x1bbb0b[_0xfd28('0x8e')]['find']({'where':{'userProfileId':_0x4dd71e[_0xfd28('0x8f')]['id'],'name':_0x294e98[_0xf785ab]['name']},'raw':!![]}));}return Promise['all'](_0x10c31f)[_0xfd28('0x9')](function(_0x34c15e){var _0x38da54=_[_0xfd28('0x5')](_0x34c15e,function(_0x3c7cc3){return _0x3c7cc3?_0x3c7cc3:undefined;});var _0x3a2712=_['filter'](_0x294e98,[_0xfd28('0x90'),!![]]);var _0x2dca43=_[_0xfd28('0x91')](_0x38da54)&&_[_0xfd28('0x91')](_0x3a2712)?null:_[_0xfd28('0x92')](_0x3a2712,_0x38da54);if(!_0x2dca43)return null;var _0x2a52bd=[];for(var _0x193ae5=0x0;_0x193ae5<_0x2dca43['length'];_0x193ae5++){var _0x2447d0=_[_0xfd28('0x93')](_0x294e98,function(_0x4fe2ab){return _0x2dca43[_0x193ae5]?_0x4fe2ab['name']===_0x2dca43[_0x193ae5][_0xfd28('0x16')]:null;});if(_0x2447d0){if(_0x2dca43[_0x193ae5][_0xfd28('0x90')]){_0x2a52bd[_0xfd28('0x8d')](_0x1c49c7(_0x11d8c4[_0xfd28('0x11')],_0x2dca43[_0x193ae5]));}else{if(!_0x2dca43[_0x193ae5][_0xfd28('0x94')]){_0x2a52bd[_0xfd28('0x8d')](_0x199433(_0x2447d0,_0x2dca43[_0x193ae5],_0x11d8c4['childModel']));}else{if(_0x2447d0[_0xfd28('0x95')]){_0x2a52bd[_0xfd28('0x8d')](_0xc31533(_0x2447d0,_0x2dca43[_0x193ae5]));}}}}}return Promise[_0xfd28('0x96')](_0x2a52bd);})[_0xfd28('0x9')](function(_0xa7ed17){var _0x2a1251=_0xa7ed17;var _0x2c3e1c=null;if(_0x2a1251){_0x2c3e1c=_0x2a1251[_0xfd28('0x8c')]===0x1?_0x2a1251[0x0]:null;}if(!_0x2c3e1c&&!_0x2a1251)return _0x2b5c85;var _0x25b638=_0x1bbb0b[_0x11d8c4[_0xfd28('0x11')]][_0xfd28('0x97')];_0x5d7afa[_0xfd28('0x95')]=_[_0xfd28('0x98')](_0x25b638);_0x5d7afa[_0xfd28('0x84')]=_[_0xfd28('0x98')](_0x4dd71e[_0xfd28('0x84')]);_0x5d7afa[_0xfd28('0x99')]=_['intersection'](_0x5d7afa['model'],_0x5d7afa[_0xfd28('0x84')]);_0x43e33a[_0xfd28('0x9a')]=_[_0xfd28('0x9b')](_0x5d7afa[_0xfd28('0x95')],_0x5a5b55[_0xfd28('0x9c')](_0x4dd71e[_0xfd28('0x84')][_0xfd28('0x9c')]));_0x43e33a[_0xfd28('0x9a')]=_0x43e33a[_0xfd28('0x9a')]['length']?_0x43e33a['attributes']:_0x5d7afa[_0xfd28('0x95')];if(!_0x4dd71e[_0xfd28('0x84')][_0xfd28('0x9d')](_0xfd28('0x9e'))){_0x43e33a[_0xfd28('0x9f')]=_0x5a5b55[_0xfd28('0x9f')](_0x4dd71e[_0xfd28('0x84')]['limit']);_0x43e33a[_0xfd28('0xa0')]=_0x5a5b55[_0xfd28('0xa0')](_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xa0')]);}_0x43e33a[_0xfd28('0xa1')]=_0x5a5b55[_0xfd28('0xa2')](_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xa2')]);_0x43e33a[_0xfd28('0x81')]=_0x5a5b55[_0xfd28('0x99')](_['pick'](_0x4dd71e[_0xfd28('0x84')],_0x5d7afa['filters']));if(_0x4dd71e['query'][_0xfd28('0x5')]){_0x43e33a['where']=_[_0xfd28('0xa3')](_0x43e33a['where'],{'$or':_[_0xfd28('0xc')](_0x25b638,function(_0x133a2f){if(_0x133a2f[_0xfd28('0xe')]['key']!=='VIRTUAL'){var _0x3a96fb={};_0x3a96fb[_0x133a2f[_0xfd28('0x6')]]={'$like':'%'+_0x4dd71e[_0xfd28('0x84')][_0xfd28('0x5')]+'%'};return _0x3a96fb;}})});}var _0x5d6105=[];var _0x27d9ba=null;var _0x1f434c={};if(_0x2c3e1c){_0x27d9ba=_[_0xfd28('0x93')](_0x294e98,[_0xfd28('0x16'),_0x2c3e1c[_0xfd28('0x16')]]);if(_0x27d9ba[_0xfd28('0x6')]){_0x1f434c={};if(_0x11d8c4[_0xfd28('0x11')]===_0xfd28('0x72')){_0x1f434c[_0x27d9ba[_0xfd28('0xa4')]]=_[_0xfd28('0xc')](_0x2c3e1c[_0xfd28('0xa')],'id');}else{_0x1f434c[_0x27d9ba['foreignKey']]=_0x2c3e1c[_0xfd28('0xa')];}_0x5d6105['push'](_0x1f434c);}else{_0x43e33a[_0xfd28('0x81')]['id']=_0x2c3e1c[_0xfd28('0xa')];}}else{for(var _0x23fa1d=0x0;_0x23fa1d<_0x2a1251[_0xfd28('0x8c')];_0x23fa1d++){_0x27d9ba=_['find'](_0x294e98,[_0xfd28('0x16'),_0x2a1251[_0x23fa1d][_0xfd28('0x16')]]);if(_0x27d9ba['field']){_0x1f434c={};_0x1f434c[_0x27d9ba[_0xfd28('0xa4')]]=_0x2a1251[_0x23fa1d][_0xfd28('0xa')];_0x5d6105['push'](_0x1f434c);}else{if(!_0x43e33a[_0xfd28('0x81')]['id'])_0x43e33a[_0xfd28('0x81')]['id']=[];_0x2a1251[_0x23fa1d][_0xfd28('0xa')]['forEach'](function(_0x1b5723){_0x43e33a['where']['id']['push'](_0x1b5723);});}}}if(!_[_0xfd28('0x91')](_0x5d6105)){_0x43e33a['where']=_[_0xfd28('0xa3')](_0x43e33a[_0xfd28('0x81')],{'$and':{'$or':_0x5d6105}});}_0x43e33a=_[_0xfd28('0xa3')]({},_0x43e33a,_0x4dd71e['options']);if(_0x2c3e1c&&!_0x2c3e1c[_0xfd28('0x94')]&&_0x11d8c4['childModel']==='AnalyticExtractedReport'){if(_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xa5')]){_0x43e33a[_0xfd28('0xa6')]=[{'all':!![]}];}return _0x1bbb0b[_0x11d8c4['childModel']][_0xfd28('0x8')](_0x43e33a)[_0xfd28('0x9')](function(_0x195f8f){var _0x21caca=[];_0x195f8f[_0xfd28('0xa7')](function(_0x3649c9){var _0x3df600;switch(_0x3649c9[_0xfd28('0xa8')]){case _0xfd28('0xa9'):_0x3df600=_[_0xfd28('0x93')](_0x2c3e1c[_0xfd28('0xa')],function(_0x26b24a){return _0x26b24a['id']===_0x3649c9[_0xfd28('0x74')]&&_0x26b24a[_0xfd28('0xe')]===_0xfd28('0xaa');});break;case _0xfd28('0xab'):_0x3df600=_[_0xfd28('0x93')](_0x2c3e1c[_0xfd28('0xa')],function(_0x4aace8){return _0x4aace8['id']===_0x3649c9[_0xfd28('0x74')]&&_0x4aace8[_0xfd28('0xe')]==='CustomReports';});break;}if(_0x3df600)_0x21caca['push'](_0x3649c9);});_0x2b5c85[_0xfd28('0xac')]=_0x21caca['length'];_0x2b5c85['rows']=_0x21caca;return _0x2b5c85;});}else{if(!_[_0xfd28('0x91')](_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xad')])){_0x43e33a[_0xfd28('0x81')]['id']=_0x43e33a[_0xfd28('0x81')]['id']?_[_0xfd28('0x9b')](_0x43e33a[_0xfd28('0x81')]['id'],_0x4dd71e[_0xfd28('0x84')]['ids']):_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xad')];if(_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xae')]){_0x43e33a[_0xfd28('0xa1')]=_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xae')];}}if(_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xaf')]){_0x43e33a[_0xfd28('0x81')]=_[_0xfd28('0xa3')](_0x43e33a[_0xfd28('0x81')],{'$and':_0x4dd71e['query'][_0xfd28('0xaf')]});}return _0x1bbb0b[_0x11d8c4['childModel']][_0xfd28('0xac')]({'where':_0x43e33a[_0xfd28('0x81')]})[_0xfd28('0x9')](function(_0x130d52){_0x2b5c85[_0xfd28('0xac')]=_0x130d52;if(_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xa5')]){if(_0x11d8c4['childModel']===_0xfd28('0x19')){_0x43e33a[_0xfd28('0xa6')]=[{'model':_0x1bbb0b[_0xfd28('0xb0')],'as':_0xfd28('0xb1'),'attributes':['id',_0xfd28('0x16'),_0xfd28('0xb2')],'required':_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xb3')]?!![]:![]},{'model':_0x1bbb0b['Tag'],'as':_0xfd28('0xb4'),'attributes':['id',_0xfd28('0x16'),_0xfd28('0xb2')],'through':_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xb3')]?{'attributes':[],'where':{'TagId':_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xb3')]||undefined}}:{},'required':_0x4dd71e['query'][_0xfd28('0xb3')]?!![]:![]}];}else{_0x43e33a[_0xfd28('0xa6')]=[{'all':!![]}];}}return _0x1bbb0b[_0x11d8c4[_0xfd28('0x11')]][_0xfd28('0x8')](_0x43e33a);})[_0xfd28('0x9')](function(_0x4f31de){_0x2b5c85[_0xfd28('0xb5')]=_0x4f31de;if(_0x1c2f6b===_0xfd28('0x2c')&&_0x4dd71e[_0xfd28('0x84')][_0xfd28('0xb6')]===_0xfd28('0xb7')){var _0x41de23=[];for(var _0x39fa9a=0x0;_0x39fa9a<_0x2b5c85[_0xfd28('0xb5')][_0xfd28('0x8c')];_0x39fa9a++){_0x41de23[_0xfd28('0x8d')](_0x2de0d0('chat',_0x2b5c85[_0xfd28('0xb5')][_0x39fa9a][_0xfd28('0xb8')]));_0x41de23[_0xfd28('0x8d')](_0x2de0d0(_0xfd28('0xb9'),_0x2b5c85[_0xfd28('0xb5')][_0x39fa9a]['dataValues']));_0x41de23['push'](_0x2de0d0(_0xfd28('0xba'),_0x2b5c85[_0xfd28('0xb5')][_0x39fa9a][_0xfd28('0xb8')]));_0x41de23[_0xfd28('0x8d')](_0x2de0d0(_0xfd28('0xbb'),_0x2b5c85[_0xfd28('0xb5')][_0x39fa9a][_0xfd28('0xb8')]));_0x41de23[_0xfd28('0x8d')](_0x2de0d0(_0xfd28('0xbc'),_0x2b5c85[_0xfd28('0xb5')][_0x39fa9a][_0xfd28('0xb8')]));_0x41de23['push'](_0x2de0d0(_0xfd28('0xbd'),_0x2b5c85[_0xfd28('0xb5')][_0x39fa9a][_0xfd28('0xb8')]));}return Promise[_0xfd28('0x96')](_0x41de23)['then'](function(){return _0x2b5c85;});}return _0x2b5c85;});}});}}});};
\ No newline at end of file