d95fbeb782ed71df735e5468e39d573d7db9929f
[motion-next.git] / server / api / userProfile / userProfile.controller.js
1 const a667_0x2955=['Plugin','map','findAll','Trunk','mergeResources','count','VoiceExtension','templates','type','tag','rawAttributes','filter','FaxQueue','zohoaccounts','undefined','VoiceQueues','VoiceChanSpy','ChatQueue','chatwebsites','register','Users','VIRTUAL','query','push','../../mysqldb','ThroughTags','openchannelaccounts','addResources','squareprojects','update','whatsappqueues','FaxAccount','nolimit','Tags','enabled','vtigeraccounts','lists','cannedanswers','childModel','json','MailQueue','sort','Tag','telephones','updatedAt','removeResources','get','VoicePrefix','error','associatedResources','crudPermissions','faxaccounts','parentSections','Reports','metrics','FreshdeskAccount','agent','CmList','forEach','custom','catch','end','stack','chanspies','resourceId','and','UserProfileResource','ignore','length','voicemails','omit','send','OpenchannelQueue','CmContact','membername','AnalyticExtractedReport','User','keys','dispositions','SalesforceAccount','ids','projects','autoAssociation','UserProfile','removeSections','odbc','findOne','options','sequelize','transaction','SmsQueue','Variable','SquareProjects','section','union','index','zendeskaccounts','limit','Disposition','intervals','trunks','VoiceRecording','create','filters','fields','body','then','DefaultReports','UserProfileSection','./userProfile.socket','inbound','mailsubstatuses','triggers','CannedAnswer','find','reportId','each','destroy','Agents','../../components/parsers/qs','sendStatus','scheduler','SquareProject','Resources','globalcustomfields','clone','VoiceMail','rows','outboundroutes','includes','userProfileId','createdAt','role','CmCompany','bulkCreate','Pause','lodash','internalroutes','all','plugins','MailAccount','sectionId','QueueCampaigns','subsections','describe','voiceprefixes','inboundroutes','Content-Range','chatqueues','toLowerCase','Dashboard','sounds','SmsAccount','sugarcrmaccounts','smsaccounts','include','name','variables','outbound','model','Sound','contexts','salesforceaccounts','intersection','reportType','projectName','ivrcampaigns','SquareRecording','Interval','musiconholds','merge','like','WhatsappAccount','VoiceQueue','color','Telephones','field','ListId','mailqueues','status','key','teams','where','attributes','agents','faxqueues','DeskAccount','includeAll','isEmpty','pauses','addSections','whatsappaccounts','Trigger','openchannelqueues','foreignKey','Campaign','value','queue','show','getResources','offset','../../rediscache','mailaccounts','admin','params','default'];(function(_0x437b30,_0x295521){const _0x61d0f=function(_0x270521){while(--_0x270521){_0x437b30['push'](_0x437b30['shift']());}};_0x61d0f(++_0x295521);}(a667_0x2955,0x192));const a667_0x61d0=function(_0x437b30,_0x295521){_0x437b30=_0x437b30-0x0;let _0x61d0f=a667_0x2955[_0x437b30];return _0x61d0f;};const _0x4a6e06=a667_0x61d0;'use strict';const _=require(_0x4a6e06('0x92')),qs=require(_0x4a6e06('0x81')),logger=require('../../config/logger')('api'),{getSocket}=require(_0x4a6e06('0x5')),socket=getSocket(),db=require(_0x4a6e06('0x22'))['db'],{Op,ValidationError}=require(_0x4a6e06('0x62'));require(_0x4a6e06('0x77'))[_0x4a6e06('0x1d')](socket);function respondWithStatusCode(_0x270521,_0x2eeb2d){return _0x2eeb2d=_0x2eeb2d||0xcc,function(_0x341384){const _0x20bbde=a667_0x61d0;if(_0x341384)return _0x270521[_0x20bbde('0x82')](_0x2eeb2d);return _0x270521[_0x20bbde('0xbd')](_0x2eeb2d)[_0x20bbde('0x47')]();};}function respondWithResult(_0x2896f1,_0xc5bd92){return _0xc5bd92=_0xc5bd92||0xc8,function(_0x2b1dc9){if(_0x2b1dc9)return _0x2896f1['status'](_0xc5bd92)['json'](_0x2b1dc9);};}function respondWithFilteredResult(_0x380989,_0x5edb60){return function(_0x5f1975){const _0x3d6b13=a667_0x61d0;if(_0x5f1975){const _0xa836cb=_0x5f1975[_0x3d6b13('0xf')],_0x45b4e2=_0x5edb60[_0x3d6b13('0x4')];let _0x3c478e=_0x5edb60[_0x3d6b13('0x4')]+_0x5edb60[_0x3d6b13('0x6b')],_0x1f6772;return _0x3c478e>=_0xa836cb?(_0x3c478e=_0xa836cb,_0x1f6772=0xc8):_0x1f6772=0xce,_0x380989[_0x3d6b13('0xbd')](_0x1f6772),_0x380989['set'](_0x3d6b13('0x9d'),_0x45b4e2+'-'+_0x3c478e+'/'+_0xa836cb)[_0x3d6b13('0x31')](_0x5f1975);}return null;};}function saveUpdates(_0x131c24){return function(_0x3f173b){const _0x1b60f6=a667_0x61d0;if(_0x3f173b)return _0x3f173b[_0x1b60f6('0x27')](_0x131c24)[_0x1b60f6('0x74')](function(_0x26ec44){return _0x26ec44;});return null;};}function removeEntity(_0x5e9bd9){return function(_0x29f25e){const _0xeda7bc=a667_0x61d0;if(_0x29f25e)return _0x29f25e[_0xeda7bc('0x7f')]()['then'](function(){const _0x5721aa=_0xeda7bc;_0x5e9bd9[_0x5721aa('0xbd')](0xcc)['end']();});};}function handleEntityNotFound(_0x5c05bd){return function(_0x2d614b){const _0x4cd4b8=a667_0x61d0;return!_0x2d614b&&_0x5c05bd[_0x4cd4b8('0x82')](0x194),_0x2d614b;};}function handleError(_0x57be0b,_0x306b95){return _0x306b95=_0x306b95||0x1f4,function(_0x37f2a4){const _0x529a87=a667_0x61d0;logger[_0x529a87('0x3a')](_0x37f2a4[_0x529a87('0x48')]),_0x37f2a4[_0x529a87('0xa6')]&&delete _0x37f2a4[_0x529a87('0xa6')],_0x57be0b[_0x529a87('0xbd')](_0x306b95)[_0x529a87('0x51')](_0x37f2a4);};}exports[_0x4a6e06('0x69')]=function(_0x5a11cb,_0x6ec893){const _0xcfb4fb=_0x4a6e06;let _0x1208b2={};const _0x59ef69={},_0x48d452={'count':0x0,'rows':[]},_0x5dd2ec=_[_0xcfb4fb('0xb')](db[_0xcfb4fb('0x5d')][_0xcfb4fb('0x14')],function(_0x233179){const _0x55e19c=_0xcfb4fb;return{'name':_0x233179['fieldName'],'type':_0x233179[_0x55e19c('0x12')][_0x55e19c('0xbe')]};});_0x59ef69[_0xcfb4fb('0xa9')]=_[_0xcfb4fb('0xb')](_0x5dd2ec,_0xcfb4fb('0xa6')),_0x59ef69[_0xcfb4fb('0x20')]=_[_0xcfb4fb('0x57')](_0x5a11cb[_0xcfb4fb('0x20')]),_0x59ef69['filters']=_[_0xcfb4fb('0xad')](_0x59ef69[_0xcfb4fb('0xa9')],_0x59ef69[_0xcfb4fb('0x20')]),_0x1208b2[_0xcfb4fb('0xc1')]=_[_0xcfb4fb('0xad')](_0x59ef69['model'],qs['fields'](_0x5a11cb['query'][_0xcfb4fb('0x72')])),_0x1208b2['attributes']=_0x1208b2[_0xcfb4fb('0xc1')][_0xcfb4fb('0x4e')]?_0x1208b2['attributes']:_0x59ef69[_0xcfb4fb('0xa9')];typeof _0x5a11cb[_0xcfb4fb('0x20')][_0xcfb4fb('0x2a')]===_0xcfb4fb('0x18')&&(_0x1208b2[_0xcfb4fb('0x6b')]=qs[_0xcfb4fb('0x6b')](_0x5a11cb[_0xcfb4fb('0x20')][_0xcfb4fb('0x6b')]),_0x1208b2['offset']=qs['offset'](_0x5a11cb[_0xcfb4fb('0x20')][_0xcfb4fb('0x4')]));_0x1208b2['order']=qs[_0xcfb4fb('0x33')](_0x5a11cb[_0xcfb4fb('0x20')][_0xcfb4fb('0x33')]),_0x1208b2[_0xcfb4fb('0xc0')]=qs[_0xcfb4fb('0x71')](_['pick'](_0x5a11cb[_0xcfb4fb('0x20')],_0x59ef69['filters']),_0x5dd2ec);_0x5a11cb[_0xcfb4fb('0x20')][_0xcfb4fb('0x15')]&&(_0x1208b2['where']=_['merge'](_0x1208b2['where'],{[Op['or']]:_['map'](_0x5dd2ec,function(_0x54f0ab){const _0x1b179f=_0xcfb4fb;if(_0x54f0ab[_0x1b179f('0x12')]!=='VIRTUAL'){const _0x10d935={};return _0x10d935[_0x54f0ab[_0x1b179f('0xa6')]]={[Op['like']]:'%'+_0x5a11cb[_0x1b179f('0x20')][_0x1b179f('0x15')]+'%'},_0x10d935;}})}));_0x1208b2=_['merge']({},_0x1208b2,_0x5a11cb[_0xcfb4fb('0x61')]);const _0x385584={'where':_0x1208b2[_0xcfb4fb('0xc0')]};return db[_0xcfb4fb('0x5d')][_0xcfb4fb('0xf')](_0x385584)['then'](function(_0xfe8da2){const _0x5b0516=_0xcfb4fb;return _0x48d452[_0x5b0516('0xf')]=_0xfe8da2,_0x5a11cb[_0x5b0516('0x20')]['includeAll']&&(_0x1208b2[_0x5b0516('0xa5')]=[{'all':!![]}]),db['UserProfile'][_0x5b0516('0xc')](_0x1208b2);})[_0xcfb4fb('0x74')](function(_0xc9583c){const _0x41fea7=_0xcfb4fb;return _0x48d452[_0x41fea7('0x89')]=_0xc9583c,_0x48d452;})['then'](respondWithFilteredResult(_0x6ec893,_0x1208b2))[_0xcfb4fb('0x46')](handleError(_0x6ec893,null));},exports[_0x4a6e06('0x2')]=function(_0x51b708,_0x5375ae){const _0xfe2c53=_0x4a6e06;let _0x4ea8f8={'raw':![],'where':{'id':_0x51b708[_0xfe2c53('0x8')]['id']}};const _0xfcbc61={};return _0xfcbc61[_0xfe2c53('0xa9')]=_['keys'](db[_0xfe2c53('0x5d')]['rawAttributes']),_0xfcbc61[_0xfe2c53('0x20')]=_[_0xfe2c53('0x57')](_0x51b708[_0xfe2c53('0x20')]),_0xfcbc61[_0xfe2c53('0x71')]=_['intersection'](_0xfcbc61[_0xfe2c53('0xa9')],_0xfcbc61[_0xfe2c53('0x20')]),_0x4ea8f8['attributes']=_[_0xfe2c53('0xad')](_0xfcbc61[_0xfe2c53('0xa9')],qs['fields'](_0x51b708[_0xfe2c53('0x20')][_0xfe2c53('0x72')])),_0x4ea8f8['attributes']=_0x4ea8f8[_0xfe2c53('0xc1')][_0xfe2c53('0x4e')]?_0x4ea8f8[_0xfe2c53('0xc1')]:_0xfcbc61[_0xfe2c53('0xa9')],_0x51b708[_0xfe2c53('0x20')][_0xfe2c53('0xc5')]&&(_0x4ea8f8[_0xfe2c53('0xa5')]=[{'all':!![]}]),_0x4ea8f8=_['merge']({},_0x4ea8f8,_0x51b708['options']),db['UserProfile']['findOne'](_0x4ea8f8)['then'](handleEntityNotFound(_0x5375ae))[_0xfe2c53('0x74')](respondWithResult(_0x5375ae,null))['catch'](handleError(_0x5375ae,null));},exports[_0x4a6e06('0x70')]=function(_0x2da48c,_0x2810a1){const _0x61e10a=_0x4a6e06;return db[_0x61e10a('0x5d')]['create'](_0x2da48c[_0x61e10a('0x73')],{})[_0x61e10a('0x74')](respondWithResult(_0x2810a1,0xc9))[_0x61e10a('0x46')](handleError(_0x2810a1,null));},exports[_0x4a6e06('0x87')]=function(_0x35865f,_0x2682c0){const _0x11cf1a=_0x4a6e06;let _0x4dec7e={'where':{'id':_0x35865f[_0x11cf1a('0x8')]['id']}};const _0x52b8f1={};return _0x52b8f1['model']=_[_0x11cf1a('0x57')](db[_0x11cf1a('0x5d')][_0x11cf1a('0x14')]),_0x4dec7e[_0x11cf1a('0xc1')]=_[_0x11cf1a('0xad')](_0x52b8f1['model'],qs[_0x11cf1a('0x72')](_0x35865f[_0x11cf1a('0x20')][_0x11cf1a('0x72')])),_0x4dec7e[_0x11cf1a('0xc1')]=_0x4dec7e[_0x11cf1a('0xc1')][_0x11cf1a('0x4e')]?_0x4dec7e[_0x11cf1a('0xc1')]:_0x52b8f1[_0x11cf1a('0xa9')],_0x35865f[_0x11cf1a('0x20')]['includeAll']&&(_0x4dec7e[_0x11cf1a('0xa5')]=[{'all':!![]}]),_0x4dec7e=_[_0x11cf1a('0xb4')]({},_0x4dec7e,_0x35865f[_0x11cf1a('0x61')]),db[_0x11cf1a('0x5d')]['findOne'](_0x4dec7e)['then'](handleEntityNotFound(_0x2682c0))[_0x11cf1a('0x74')](function(_0x1ec985){const _0x51595d=_0x11cf1a;if(_0x1ec985){let _0x141c15=_0x1ec985[_0x51595d('0x38')]({'plain':!![]});return _0x141c15=qs[_0x51595d('0x50')](_0x141c15,['id',_0x51595d('0x8d'),_0x51595d('0x36'),_0x51595d('0x3c')]),_0x35865f[_0x51595d('0x73')]=_[_0x51595d('0x50')](_0x35865f[_0x51595d('0x73')],['id',_0x51595d('0x8d'),'updatedAt']),db[_0x51595d('0x62')][_0x51595d('0x63')](function(_0x31ddb2){const _0x500582=_0x51595d;return db[_0x500582('0x5d')]['create'](_['merge'](_0x141c15,_0x35865f[_0x500582('0x73')]),{'include':_0x35865f[_0x500582('0x20')][_0x500582('0xc5')]?[{'all':!![]}]:undefined,'transaction':_0x31ddb2})[_0x500582('0x74')](function(_0x225ef2){const _0x4076cb=_0x500582,_0x3643bf=_0x225ef2[_0x4076cb('0x38')]({'plain':!![]});return db[_0x4076cb('0x76')][_0x4076cb('0xc')]({'where':{'userProfileId':_0x35865f[_0x4076cb('0x8')]['id']},'raw':!![]})[_0x4076cb('0x74')](function(_0x34a9f6){const _0x529e76=_0x4076cb;if(_0x34a9f6)return Promise[_0x529e76('0x7e')](_0x34a9f6,function(_0x316f02){const _0x3b588a=_0x529e76;return new Promise(function(_0x478ff3,_0x5d10f6){const _0x57b662=a667_0x61d0;if(_0x316f02[_0x57b662('0x5c')]===null||_0x316f02[_0x57b662('0x5c')]===0x1)_0x478ff3(null);return db[_0x57b662('0x4c')]['findAll']({'where':{'sectionId':_0x316f02['id']},'raw':!![]})[_0x57b662('0x74')](function(_0x4bc56c){const _0x5112ae=_0x57b662,_0x559ee4=_[_0x5112ae('0xb')](_0x4bc56c,function(_0x4df53b){const _0x118af9=_0x5112ae;return qs[_0x118af9('0x50')](_0x4df53b,['id','createdAt',_0x118af9('0x36'),_0x118af9('0x97')]);});_0x478ff3(_0x559ee4);})['catch'](function(_0x1a06e0){_0x5d10f6(_0x1a06e0);});})[_0x3b588a('0x74')](function(_0x292ed9){const _0x407930=_0x3b588a,_0x338ab8=qs['omit'](_0x316f02,['id',_0x407930('0x8d'),'updatedAt']);_0x338ab8['userProfileId']=_0x3643bf['id'];if(_0x292ed9)_0x338ab8[_0x407930('0x85')]=_0x292ed9;return _0x338ab8;})[_0x3b588a('0x74')](function(_0x3b59db){const _0x2eec95=_0x3b588a;return db['UserProfileSection'][_0x2eec95('0x70')](_0x3b59db,{'include':[{'model':db[_0x2eec95('0x4c')],'as':_0x2eec95('0x85')}],'raw':!![],'transaction':_0x31ddb2});});})[_0x529e76('0x74')](function(){return _0x3643bf;});});});});}})['then'](respondWithResult(_0x2682c0,0xc9))[_0x11cf1a('0x46')](handleError(_0x2682c0,null));},exports[_0x4a6e06('0x27')]=function(_0x5745b2,_0x2c347e){const _0x14cecd=_0x4a6e06;return _0x5745b2[_0x14cecd('0x73')]['id']&&delete _0x5745b2['body']['id'],db[_0x14cecd('0x5d')][_0x14cecd('0x60')]({'where':{'id':_0x5745b2['params']['id']}})['then'](handleEntityNotFound(_0x2c347e))[_0x14cecd('0x74')](saveUpdates(_0x5745b2[_0x14cecd('0x73')],null))[_0x14cecd('0x74')](respondWithResult(_0x2c347e,null))['catch'](handleError(_0x2c347e,null));},exports[_0x4a6e06('0x7f')]=function(_0x49e35f,_0xa2ea86){const _0x5921e8=_0x4a6e06;return db[_0x5921e8('0x5d')][_0x5921e8('0x60')]({'where':{'id':_0x49e35f['params']['id']}})[_0x5921e8('0x74')](handleEntityNotFound(_0xa2ea86))[_0x5921e8('0x74')](removeEntity(_0xa2ea86,null))[_0x5921e8('0x46')](handleError(_0xa2ea86,null));},exports['describe']=function(_0x5638de,_0x544268){const _0x1c6316=_0x4a6e06;return db[_0x1c6316('0x5d')][_0x1c6316('0x9a')]()[_0x1c6316('0x74')](respondWithResult(_0x544268,null))[_0x1c6316('0x46')](handleError(_0x544268,null));},exports[_0x4a6e06('0xc8')]=function(_0x2dd174,_0x2436f5){const _0x31c17f=_0x4a6e06,_0x4dfd88=_0x2dd174[_0x31c17f('0x73')];return db[_0x31c17f('0x5d')][_0x31c17f('0x60')]({'where':{'id':_0x2dd174[_0x31c17f('0x8')]['id']}})[_0x31c17f('0x74')](handleEntityNotFound(_0x2436f5))[_0x31c17f('0x74')](function(_0x5c541c){const _0xf162d7=_0x31c17f;if(_0x5c541c)return db[_0xf162d7('0x62')][_0xf162d7('0x63')](function(_0x1a27fa){const _0x5378f3=_0xf162d7;return db[_0x5378f3('0x76')][_0x5378f3('0x7f')]({'where':{'userProfileId':_0x2dd174['params']['id'],'sectionId':_['map'](_0x4dfd88,function(_0x5b54e5){const _0x448a88=_0x5378f3;return _0x5b54e5[_0x448a88('0x97')];})},'transaction':_0x1a27fa})[_0x5378f3('0x74')](function(){const _0x35c804=_0x5378f3,_0x530b6e=_[_0x35c804('0xb')](_0x4dfd88,function(_0x3e3edd){const _0x177624=_0x35c804;return _0x3e3edd[_0x177624('0x8c')]=_0x2dd174[_0x177624('0x8')]['id'],_0x3e3edd;}),_0x2b0a1f=[];return Promise[_0x35c804('0x7e')](_0x530b6e,function(_0x3f1c50){const _0x268f67=_0x35c804;return db['UserProfileSection'][_0x268f67('0x70')](_0x3f1c50,{'include':[{'model':db['UserProfileResource'],'as':_0x268f67('0x85')}],'raw':!![],'transaction':_0x1a27fa})[_0x268f67('0x74')](function(_0x407766){const _0x4e5a24=_0x268f67;_0x2b0a1f[_0x4e5a24('0x21')](_0x407766[_0x4e5a24('0x38')]({'plain':!![]}));});})[_0x35c804('0x74')](function(){return _0x2b0a1f;});});});})[_0x31c17f('0x74')](function(_0x350639){return _0x350639;})[_0x31c17f('0x74')](respondWithResult(_0x2436f5,null))[_0x31c17f('0x46')](handleError(_0x2436f5,null));},exports[_0x4a6e06('0x5e')]=function(_0x177494,_0x12bac1){const _0x577788=_0x4a6e06;let _0x4a1fc9;return db['UserProfile'][_0x577788('0x60')]({'where':{'id':_0x177494[_0x577788('0x8')]['id']},'attributes':['id',_0x577788('0xa6')]})['then'](handleEntityNotFound(_0x12bac1))[_0x577788('0x74')](function(_0x257208){const _0x266045=_0x577788;if(_0x257208)return _0x4a1fc9=_0x257208,db[_0x266045('0x76')][_0x266045('0x7f')]({'where':{'userProfileId':_0x177494['params']['id'],'sectionId':_0x177494['query'][_0x266045('0x5a')]}});})['then'](function(){return _0x4a1fc9;})['then'](respondWithStatusCode(_0x12bac1,null))['catch'](handleError(_0x12bac1,null));},exports['getSections']=function(_0x599009,_0x223a56){const _0x4f2a67=_0x4a6e06;let _0x6a00a9=[],_0x5513ba=[];return db[_0x4f2a67('0x76')][_0x4f2a67('0xc')]({'where':{'userProfileId':_0x599009[_0x4f2a67('0x8')]['id']},'raw':!![]})[_0x4f2a67('0x74')](function(_0xe6642c){const _0xf8adba=_0x4f2a67;_0x6a00a9=_[_0xf8adba('0x15')](_0xe6642c,function(_0x9ac8c6){const _0x35b04d=_0xf8adba;return _0x9ac8c6[_0x35b04d('0x2c')]===0x1||_[_0x35b04d('0x8b')]([0x3eb,0x709],_0x9ac8c6[_0x35b04d('0x97')]);});if(!_[_0xf8adba('0xc6')](_0x6a00a9))return _[_0xf8adba('0xb')](_0x6a00a9,function(_0x342599){return _0x342599['sectionId'];});else return;})[_0x4f2a67('0x74')](function(_0x3e67f0){const _0x21aacc=_0x4f2a67;if(_0x3e67f0)_0x5513ba=_0x3e67f0;if(_['includes'](_0x5513ba,0x64)){const _0x2950a8=_[_0x21aacc('0x7c')](_0x6a00a9,{'sectionId':0x64});return hasDefaultDashboard(_0x2950a8)[_0x21aacc('0x74')](function(_0x18dda5){const _0x378a40=_0x21aacc;return _[_0x378a40('0xb')](_0x6a00a9,function(_0x34ed1e){const _0x3b8b6e=_0x378a40;return _0x34ed1e[_0x3b8b6e('0x97')]===0x64&&(_0x34ed1e[_0x3b8b6e('0x99')]=_0x18dda5),_0x34ed1e;});});}else return;})[_0x4f2a67('0x74')](function(_0x4f4b82){const _0x5072ad=_0x4f2a67;if(_0x4f4b82)_0x6a00a9=_0x4f4b82;if(_['includes'](_0x5513ba,0x3eb)){const _0x5a2d98=_[_0x5072ad('0x7c')](_0x6a00a9,{'sectionId':0x3eb});return getCustomDashboards(_0x5a2d98)[_0x5072ad('0x74')](function(_0x4b7f52){const _0x4be9a5=_0x5072ad;return _[_0x4be9a5('0xb')](_0x6a00a9,function(_0x37de4d){const _0x591a1f=_0x4be9a5;return _0x5a2d98[_0x591a1f('0x2c')]?_0x37de4d['sectionId']===0x3eb&&(_0x37de4d[_0x591a1f('0x99')]=_0x4b7f52):_0x37de4d['sectionId']===0x64&&(_0x37de4d[_0x591a1f('0x99')]=_0x4b7f52),_0x37de4d;});});}else return;})[_0x4f2a67('0x74')](function(_0x5d1760){const _0x441ce7=_0x4f2a67;if(_0x5d1760)_0x6a00a9=_0x5d1760;if(_[_0x441ce7('0x8b')](_0x5513ba,0x709)){const _0x4deeb1=_['find'](_0x6a00a9,{'sectionId':0x709});return getPlugins(_0x4deeb1)[_0x441ce7('0x74')](function(_0x4c491c){const _0x17e5aa=_0x441ce7;if(_0x4deeb1[_0x17e5aa('0x2c')])return _['map'](_0x6a00a9,function(_0x1d38e2){const _0x14273c=_0x17e5aa;return _0x1d38e2['sectionId']===0x709&&(_0x1d38e2[_0x14273c('0x99')]=_0x4c491c),_0x1d38e2;});else{const _0x3fa2d4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4c491c},_0x1ade56=_[_0x17e5aa('0xb')](_0x6a00a9);return _0x1ade56['push'](_0x3fa2d4),_0x1ade56;}});}else return;})[_0x4f2a67('0x74')](function(_0x22713f){const _0x5e5ae4=_0x4f2a67;if(_0x22713f)_0x6a00a9=_0x22713f;return _[_0x5e5ae4('0x15')](_0x6a00a9,[_0x5e5ae4('0x2c'),0x1]);})[_0x4f2a67('0x74')](respondWithResult(_0x223a56,null))[_0x4f2a67('0x46')](handleError(_0x223a56,null));};function hasDefaultDashboard(_0x37ca9b){const _0x542e04=[0x65];return new Promise(function(_0x4f919c,_0x39aec1){const _0xaf5f97=a667_0x61d0;try{if(_0x37ca9b['autoAssociation'])_0x4f919c(_0x542e04);else return db['UserProfileResource'][_0xaf5f97('0x60')]({'where':{'sectionId':_0x37ca9b['id']},'raw':!![]})[_0xaf5f97('0x74')](function(_0x4a6392){_0x4a6392?_0x4f919c(_0x542e04):_0x4f919c();});}catch(_0x151791){_0x39aec1(_0x151791);}});}function getCustomDashboards(_0x17fe7b){const _0x58b6de=[];return new Promise(function(_0x117b27,_0x50b13e){const _0x56a910=a667_0x61d0;try{return _0x17fe7b[_0x56a910('0x5c')]?db[_0x56a910('0xa0')][_0x56a910('0xc')]({'raw':!![]})[_0x56a910('0x74')](function(_0x3c418a){const _0x639312=_0x56a910;_0x3c418a[_0x639312('0x44')](function(_0x29b484){const _0x3477a1=_0x639312;_0x58b6de[_0x3477a1('0x21')](_0x29b484['id']+0x1869f);}),_0x117b27(_0x58b6de);}):db[_0x56a910('0x4c')][_0x56a910('0xc')]({'where':{'sectionId':_0x17fe7b['id']},'raw':!![]})[_0x56a910('0x74')](function(_0x4d0c41){const _0x232835=_0x56a910;_0x4d0c41[_0x232835('0x44')](function(_0xf2718){const _0x2654b4=_0x232835;_0x58b6de[_0x2654b4('0x21')](_0xf2718['resourceId']+0x1869f);}),_0x117b27(_0x58b6de);});}catch(_0x53267e){_0x50b13e(_0x53267e);}});}function getPlugins(_0x5518dc){const _0x2fec33=[];return new Promise(function(_0x330575,_0x394a0e){const _0x4f8d9a=a667_0x61d0;try{return _0x5518dc[_0x4f8d9a('0x5c')]?db[_0x4f8d9a('0xa')][_0x4f8d9a('0xc')]({'raw':!![]})['then'](function(_0x2d08e0){const _0x39ef2=_0x4f8d9a;_0x2d08e0[_0x39ef2('0x44')](function(_0x45479f){const _0x39bd8c=_0x39ef2;_0x2fec33[_0x39bd8c('0x21')](_0x45479f['id']+0x15b38);}),_0x330575(_0x2fec33);}):db['UserProfileResource']['findAll']({'where':{'sectionId':_0x5518dc['id']},'raw':!![]})[_0x4f8d9a('0x74')](function(_0x16d7b2){_0x16d7b2['forEach'](function(_0x2ad3b4){const _0xbcb6a1=a667_0x61d0;_0x2fec33[_0xbcb6a1('0x21')](_0x2ad3b4[_0xbcb6a1('0x4a')]+0x15b38);}),_0x330575(_0x2fec33);});}catch(_0x2efac2){_0x394a0e(_0x2efac2);}});}exports[_0x4a6e06('0x25')]=function(_0x33225f,_0x1adb13){const _0xd9cc58=_0x4a6e06;return db[_0xd9cc58('0x5d')][_0xd9cc58('0x60')]({'where':{'id':_0x33225f[_0xd9cc58('0x8')]['id']}})[_0xd9cc58('0x74')](handleEntityNotFound(_0x1adb13))[_0xd9cc58('0x74')](function(_0x436567){const _0x5d09ba=_0xd9cc58;if(_0x436567)return db['sequelize'][_0x5d09ba('0x63')](function(_0x54b5e7){const _0x3520cb=_0x5d09ba;return db[_0x3520cb('0x76')][_0x3520cb('0xc')]({'where':{'userProfileId':_0x33225f[_0x3520cb('0x8')]['id']},'attributes':['id'],'raw':!![]})[_0x3520cb('0x74')](function(_0x269054){const _0x31d5b7=_0x3520cb;if(_0x269054)return db['UserProfileSection'][_0x31d5b7('0x7f')]({'where':{'userProfileId':_0x33225f[_0x31d5b7('0x8')]['id'],'id':_[_0x31d5b7('0xb')](_0x269054,function(_0x4f263b){return _0x4f263b['id'];})},'transaction':_0x54b5e7});})[_0x3520cb('0x74')](function(){const _0x5765ab=_0x3520cb,_0x3af8da=_['map'](_0x33225f['body'],function(_0x5e0fa7){const _0xd40b29=a667_0x61d0;return _0x5e0fa7[_0xd40b29('0x8c')]=_0x33225f['params']['id'],_0x5e0fa7;});return db[_0x5765ab('0x76')][_0x5765ab('0x90')](_0x3af8da,{'raw':!![],'transaction':_0x54b5e7});})[_0x3520cb('0x74')](function(_0x4d523c){const _0x211ae0=_0x3520cb,_0x446d8c=_[_0x211ae0('0x15')](_[_0x211ae0('0xb')](_0x4d523c,function(_0x2e0510){return _0x2e0510['get']({'plain':!![]});}),{'includeAll':![]});if(_0x446d8c)return db[_0x211ae0('0x76')][_0x211ae0('0xc')]({'where':{'userProfileId':_0x33225f[_0x211ae0('0x8')]['id'],'sectionId':_[_0x211ae0('0xb')](_0x446d8c,function(_0x8af7bc){const _0x171a3c=_0x211ae0;return _0x8af7bc[_0x171a3c('0x97')];})},'attributes':['id',_0x211ae0('0x97')],'raw':!![]})[_0x211ae0('0x74')](function(){const _0x3f9fae=_0x211ae0,_0x140099=_[_0x3f9fae('0xb')](_0x33225f[_0x3f9fae('0x73')],function(_0x5e1563){const _0x3faafc=_0x3f9fae;return _0x5e1563[_0x3faafc('0x8c')]=_0x33225f[_0x3faafc('0x8')]['id'],_0x5e1563;});return db[_0x3f9fae('0x4c')]['bulkCreate'](_0x140099,{'raw':!![],'transaction':_0x54b5e7});});})[_0x3520cb('0x46')](handleError(_0x1adb13,null));});})[_0xd9cc58('0x74')](function(){})[_0xd9cc58('0x74')](respondWithResult(_0x1adb13,null))[_0xd9cc58('0x46')](handleError(_0x1adb13,null));},exports[_0x4a6e06('0x37')]=function(_0x43e0f8,_0x319808){const _0x2846a2=_0x4a6e06;return db[_0x2846a2('0x5d')][_0x2846a2('0x60')]({'where':{'id':_0x43e0f8[_0x2846a2('0x8')]['id']}})[_0x2846a2('0x74')](handleEntityNotFound(_0x319808))[_0x2846a2('0x74')](function(_0x1f05ac){const _0x54b81b=_0x2846a2;if(_0x1f05ac)return _0x1f05ac[_0x54b81b('0x37')](_0x43e0f8[_0x54b81b('0x20')][_0x54b81b('0x5a')]);})['then'](respondWithStatusCode(_0x319808,null))[_0x2846a2('0x46')](handleError(_0x319808,null));},exports[_0x4a6e06('0x3')]=function(_0x1f482d,_0x205f59){const _0x3bf339=_0x4a6e06;let _0x6a7f4f={'raw':![],'where':{}};const _0x6ea198={},_0x52e661={'count':0x0,'rows':[]},_0x3d5be6=_0x1f482d[_0x3bf339('0x20')][_0x3bf339('0x67')];if(typeof _0x3d5be6==='undefined')throw new ValidationError('Unknown\x20section');const _0x380b71=_0x1f482d[_0x3bf339('0x20')][_0x3bf339('0xe')]||![],_0xc5892e=getQueryModels(_0x3d5be6,_0x380b71);if(typeof _0xc5892e[_0x3bf339('0x30')]===_0x3bf339('0x18'))throw new ValidationError('Invalid\x20section\x20\x27'+_0x3d5be6+'\x27');let _0x2bb8b2=[];return!_[_0x3bf339('0xc6')](_0xc5892e[_0x3bf339('0x3e')])?_0x2bb8b2=_0xc5892e[_0x3bf339('0x3e')]:_0x2bb8b2=[{'name':_0x3d5be6}],db['UserProfile'][_0x3bf339('0x60')]({'where':{'id':_0x1f482d[_0x3bf339('0x8')]['id']}})['then'](handleEntityNotFound(_0x205f59))[_0x3bf339('0x74')](function(_0x233c44){const _0x30b07c=_0x3bf339;if(_0x233c44){const _0x2a7df7=[];for(let _0x6222e1=0x0;_0x6222e1<_0x2bb8b2[_0x30b07c('0x4e')];_0x6222e1++){_0x2a7df7['push'](db[_0x30b07c('0x76')]['findOne']({'where':{'userProfileId':_0x233c44['id'],'name':_0x2bb8b2[_0x6222e1][_0x30b07c('0xa6')]},'raw':!![]}));}return Promise[_0x30b07c('0x94')](_0x2a7df7);}})[_0x3bf339('0x74')](function(_0x1216d3){const _0x46c840=_0x3bf339,_0x3771a5=_[_0x46c840('0x15')](_0x1216d3,function(_0x1b677d){return _0x1b677d?_0x1b677d:undefined;}),_0x2a4ed8=_[_0x46c840('0x15')](_0x2bb8b2,[_0x46c840('0x4d'),!![]]),_0x4ff850=_['isEmpty'](_0x3771a5)&&_[_0x46c840('0xc6')](_0x2a4ed8)?null:_[_0x46c840('0x68')](_0x2a4ed8,_0x3771a5);if(_0x4ff850){const _0x221ea9=[];for(let _0x26da73=0x0;_0x26da73<_0x4ff850[_0x46c840('0x4e')];_0x26da73++){const _0x5ce87a=_[_0x46c840('0x7c')](_0x2bb8b2,function(_0x360c7d){const _0x3ce89f=_0x46c840;return _0x4ff850[_0x26da73]?_0x360c7d['name']===_0x4ff850[_0x26da73][_0x3ce89f('0xa6')]:null;});_0x5ce87a&&(_0x4ff850[_0x26da73][_0x46c840('0x4d')]?_0x221ea9[_0x46c840('0x21')](getAllResources(_0xc5892e[_0x46c840('0x30')],_0x4ff850[_0x26da73])):!_0x4ff850[_0x26da73][_0x46c840('0x5c')]?_0x221ea9[_0x46c840('0x21')](getAllowedResources(_0x5ce87a,_0x4ff850[_0x26da73],_0xc5892e[_0x46c840('0x30')])):_0x5ce87a[_0x46c840('0xa9')]&&_0x221ea9[_0x46c840('0x21')](getAllFilteredResources(_0x5ce87a,_0x4ff850[_0x26da73])));}return Promise[_0x46c840('0x94')](_0x221ea9);}else return null;})[_0x3bf339('0x74')](function(_0x3b4b6f){const _0x8b739f=_0x3bf339,_0x1cc125=_0x3b4b6f;let _0x427b03=null;_0x1cc125&&(_0x427b03=_0x1cc125[_0x8b739f('0x4e')]===0x1?_0x1cc125[0x0]:null);if(_0x427b03||_0x1cc125){const _0x1e566d=db[_0xc5892e[_0x8b739f('0x30')]][_0x8b739f('0x14')];_0x6ea198['model']=_[_0x8b739f('0x57')](_0x1e566d),_0x6ea198[_0x8b739f('0x20')]=_[_0x8b739f('0x57')](_0x1f482d[_0x8b739f('0x20')]),_0x6ea198['filters']=_['intersection'](_0x6ea198['model'],_0x6ea198[_0x8b739f('0x20')]),_0x6a7f4f[_0x8b739f('0xc1')]=_['intersection'](_0x6ea198[_0x8b739f('0xa9')],qs[_0x8b739f('0x72')](_0x1f482d[_0x8b739f('0x20')][_0x8b739f('0x72')])),_0x6a7f4f['attributes']=_0x6a7f4f['attributes']['length']?_0x6a7f4f[_0x8b739f('0xc1')]:_0x6ea198[_0x8b739f('0xa9')];typeof _0x1f482d[_0x8b739f('0x20')]['nolimit']===_0x8b739f('0x18')&&(_0x6a7f4f[_0x8b739f('0x6b')]=qs['limit'](_0x1f482d[_0x8b739f('0x20')][_0x8b739f('0x6b')]),_0x6a7f4f[_0x8b739f('0x4')]=qs[_0x8b739f('0x4')](_0x1f482d['query'][_0x8b739f('0x4')]));_0x6a7f4f['order']=qs[_0x8b739f('0x33')](_0x1f482d[_0x8b739f('0x20')][_0x8b739f('0x33')]),_0x6a7f4f['where']=qs[_0x8b739f('0x71')](_['pick'](_0x1f482d['query'],_0x6ea198[_0x8b739f('0x71')]));_0x1f482d['query']['filter']&&(_0x6a7f4f['where']=_[_0x8b739f('0xb4')](_0x6a7f4f[_0x8b739f('0xc0')],{[Op['or']]:_[_0x8b739f('0xb')](_0x1e566d,function(_0x191348){const _0x2a52d8=_0x8b739f;if(_0x191348['type']['key']!==_0x2a52d8('0x1f')){const _0x95a35e={};return _0x95a35e[_0x191348[_0x2a52d8('0xba')]]={[Op[_0x2a52d8('0xb5')]]:'%'+_0x1f482d[_0x2a52d8('0x20')][_0x2a52d8('0x15')]+'%'},_0x95a35e;}})}));const _0x6012ed=[];if(_0x427b03){const _0x20f9dd=_[_0x8b739f('0x7c')](_0x2bb8b2,[_0x8b739f('0xa6'),_0x427b03[_0x8b739f('0xa6')]]);if(_0x20f9dd[_0x8b739f('0xba')]){const _0x2f2511={};_0xc5892e[_0x8b739f('0x30')]===_0x8b739f('0x55')?_0x2f2511[_0x20f9dd[_0x8b739f('0xcc')]]=_[_0x8b739f('0xb')](_0x427b03[_0x8b739f('0x3b')],'id'):_0x2f2511[_0x20f9dd[_0x8b739f('0xcc')]]=_0x427b03[_0x8b739f('0x3b')],_0x6012ed[_0x8b739f('0x21')](_0x2f2511);}else _0x6a7f4f[_0x8b739f('0xc0')]['id']=_0x427b03[_0x8b739f('0x3b')];}else for(let _0x1834ac=0x0;_0x1834ac<_0x1cc125[_0x8b739f('0x4e')];_0x1834ac++){const _0x31d0f4=_[_0x8b739f('0x7c')](_0x2bb8b2,[_0x8b739f('0xa6'),_0x1cc125[_0x1834ac][_0x8b739f('0xa6')]]);if(_0x31d0f4[_0x8b739f('0xba')]){const _0x4c3f7a={};_0x4c3f7a[_0x31d0f4[_0x8b739f('0xcc')]]=_0x1cc125[_0x1834ac][_0x8b739f('0x3b')],_0x6012ed['push'](_0x4c3f7a);}else{if(!_0x6a7f4f[_0x8b739f('0xc0')]['id'])_0x6a7f4f['where']['id']=[];_0x1cc125[_0x1834ac][_0x8b739f('0x3b')][_0x8b739f('0x44')](function(_0x320ada){const _0x5a1e8f=_0x8b739f;_0x6a7f4f[_0x5a1e8f('0xc0')]['id'][_0x5a1e8f('0x21')](_0x320ada);});}}return!_['isEmpty'](_0x6012ed)&&(_0x6a7f4f[_0x8b739f('0xc0')]=_['merge'](_0x6a7f4f[_0x8b739f('0xc0')],{[Op[_0x8b739f('0x4b')]]:{[Op['or']]:_0x6012ed}})),_0x6a7f4f=_[_0x8b739f('0xb4')]({},_0x6a7f4f,_0x1f482d[_0x8b739f('0x61')]),_0x427b03&&!_0x427b03[_0x8b739f('0x5c')]&&_0xc5892e[_0x8b739f('0x30')]===_0x8b739f('0x55')?(_0x1f482d['query']['includeAll']&&(_0x6a7f4f['include']=[{'all':!![]}]),db[_0xc5892e[_0x8b739f('0x30')]][_0x8b739f('0xc')](_0x6a7f4f)[_0x8b739f('0x74')](function(_0x1b7dcb){const _0x1e68b7=_0x8b739f,_0x3b8eb3=[];return _0x1b7dcb[_0x1e68b7('0x44')](function(_0x11b546){const _0x4db241=_0x1e68b7;let _0x128231;switch(_0x11b546[_0x4db241('0xae')]){case _0x4db241('0x9'):_0x128231=_[_0x4db241('0x7c')](_0x427b03[_0x4db241('0x3b')],function(_0x20cf54){const _0x538d1f=_0x4db241;return _0x20cf54['id']===_0x11b546[_0x538d1f('0x7d')]&&_0x20cf54['type']===_0x538d1f('0x75');});break;case _0x4db241('0x45'):_0x128231=_[_0x4db241('0x7c')](_0x427b03[_0x4db241('0x3b')],function(_0x568169){const _0x5cce01=_0x4db241;return _0x568169['id']===_0x11b546[_0x5cce01('0x7d')]&&_0x568169[_0x5cce01('0x12')]==='CustomReports';});break;}if(_0x128231)_0x3b8eb3[_0x4db241('0x21')](_0x11b546);}),_0x52e661[_0x1e68b7('0xf')]=_0x3b8eb3[_0x1e68b7('0x4e')],_0x52e661[_0x1e68b7('0x89')]=_0x3b8eb3,_0x52e661;})):db[_0xc5892e[_0x8b739f('0x30')]][_0x8b739f('0xf')]({'where':_0x6a7f4f[_0x8b739f('0xc0')]})[_0x8b739f('0x74')](function(_0x333587){const _0xd486b4=_0x8b739f;return _0x52e661['count']=_0x333587,_0x1f482d[_0xd486b4('0x20')][_0xd486b4('0xc5')]&&(_0xc5892e[_0xd486b4('0x30')]===_0xd486b4('0x53')?_0x6a7f4f['include']=[{'model':db[_0xd486b4('0x34')],'as':_0xd486b4('0x2b'),'attributes':['id',_0xd486b4('0xa6'),'color'],'required':_0x1f482d[_0xd486b4('0x20')]['tag']?!![]:![]},{'model':db[_0xd486b4('0x34')],'as':_0xd486b4('0x23'),'attributes':['id',_0xd486b4('0xa6'),_0xd486b4('0xb8')],'through':_0x1f482d[_0xd486b4('0x20')][_0xd486b4('0x13')]?{'attributes':[],'where':{'TagId':_0x1f482d['query'][_0xd486b4('0x13')]||undefined}}:{},'required':_0x1f482d['query']['tag']?!![]:![]}]:_0x6a7f4f[_0xd486b4('0xa5')]=[{'all':!![]}]),db[_0xc5892e[_0xd486b4('0x30')]]['findAll'](_0x6a7f4f);})[_0x8b739f('0x74')](function(_0x3d36dd){const _0x47c4d9=_0x8b739f;return _0x52e661[_0x47c4d9('0x89')]=_0x3d36dd,_0x52e661;});}else return _0x52e661;})[_0x3bf339('0x74')](respondWithFilteredResult(_0x205f59,_0x6a7f4f))[_0x3bf339('0x46')](handleError(_0x205f59,null));};function getAllResources(_0x2d59f7,_0x5a518e){return new Promise(function(_0x346c25,_0x31d36f){const _0xff1bf5=a667_0x61d0;if(_0x5a518e){const _0x5446aa=_0x5a518e[_0xff1bf5('0x15')]?{[_0x5a518e['filter'][_0xff1bf5('0xba')]]:_0x5a518e[_0xff1bf5('0x15')][_0xff1bf5('0x0')]}:undefined;return db[_0x2d59f7][_0xff1bf5('0xc')]({'where':_0x5446aa,'raw':!![]})[_0xff1bf5('0x74')](function(_0x156970){const _0x5ef8e1=_0xff1bf5;_0x5a518e['associatedResources']=_[_0x5ef8e1('0xb')](_0x156970,'id'),_0x346c25(_0x5a518e);})[_0xff1bf5('0x46')](function(_0x4b5a5f){_0x31d36f(_0x4b5a5f);});}else _0x346c25(null);});}function getAllFilteredResources(_0x58eac6,_0x187027){return new Promise(function(_0x38c044,_0x1c4dee){const _0xfc9d8b=a667_0x61d0,_0x3013a3=_0x58eac6[_0xfc9d8b('0x15')]?{[_0x58eac6['filter'][_0xfc9d8b('0xba')]]:_0x58eac6['filter'][_0xfc9d8b('0x0')]}:undefined;return db[_0x58eac6[_0xfc9d8b('0xa9')]]['findAll']({'where':_0x3013a3,'raw':!![]})[_0xfc9d8b('0x74')](function(_0x37d479){const _0xcec718=_0xfc9d8b;_0x187027[_0xcec718('0x3b')]=_[_0xcec718('0xb')](_0x37d479,function(_0x4931b4){return _0x4931b4['name'];}),_0x38c044(_0x187027);})['catch'](function(_0x246ad7){_0x1c4dee(_0x246ad7);});});}function getAllowedResources(_0x5305e5,_0x1fbdce,_0x4efc5f){return new Promise(function(_0x32054e,_0x462356){const _0x162475=a667_0x61d0;if(_0x1fbdce)return db['UserProfileResource'][_0x162475('0xc')]({'where':{'sectionId':_0x1fbdce['id']},'raw':!![]})[_0x162475('0x74')](function(_0xd55f47){const _0x1dee63=_0x162475;_0x5305e5[_0x1dee63('0xba')]&&_0x5305e5['field']!=='id'?_0x1fbdce[_0x1dee63('0x3b')]=_['map'](_0xd55f47,function(_0x3bf43b){const _0x395a81=_0x1dee63;return _0x3bf43b[_0x5305e5[_0x395a81('0xba')]];}):_0x4efc5f===_0x1dee63('0x55')?_0x1fbdce[_0x1dee63('0x3b')]=_[_0x1dee63('0xb')](_0xd55f47,function(_0x106880){const _0x27fb1a=_0x1dee63;return{'id':_0x106880[_0x27fb1a('0x4a')],'type':_0x106880[_0x27fb1a('0x12')]};}):_0x1fbdce[_0x1dee63('0x3b')]=_[_0x1dee63('0xb')](_0xd55f47,function(_0xb7d8b9){const _0x3d1fdb=_0x1dee63;return _0xb7d8b9[_0x3d1fdb('0x4a')];}),_0x32054e(_0x1fbdce);})[_0x162475('0x46')](function(_0x5d1790){_0x462356(_0x5d1790);});else _0x32054e(null);});}function getQueryModels(_0x20e421,_0x42c26d){const _0x5a2f96=_0x4a6e06,_0x1eefc4=_0x20e421[_0x5a2f96('0x9f')](),_0x9819ad={'childModel':undefined,'parentSections':[]};switch(_0x1eefc4){case _0x5a2f96('0x26'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x84');break;case _0x5a2f96('0x5f'):_0x9819ad[_0x5a2f96('0x30')]='SquareOdbc';break;case'squarerecordings':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xb1'),_0x9819ad[_0x5a2f96('0x3e')]=[{'name':_0x5a2f96('0x66'),'field':_0x5a2f96('0xa6'),'foreignKey':_0x5a2f96('0xaf')}];break;case _0x5a2f96('0x5b'):_0x9819ad[_0x5a2f96('0x30')]='JscriptyProject';break;case'contacts':_0x9819ad['childModel']='CmContact',_0x9819ad[_0x5a2f96('0x3e')]=[{'name':'Lists','field':'id','foreignKey':_0x5a2f96('0xbb')}];break;case _0x5a2f96('0x2e'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x43');break;case'companies':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x8f');break;case _0x5a2f96('0x86'):_0x9819ad[_0x5a2f96('0x30')]='CmCustomField';break;case _0x5a2f96('0x9e'):_0x9819ad['childModel']=_0x5a2f96('0x1b');break;case _0x5a2f96('0x1c'):_0x9819ad[_0x5a2f96('0x30')]='ChatWebsite';break;case _0x5a2f96('0xc3'):_0x9819ad['childModel']=_0x5a2f96('0x16');break;case _0x5a2f96('0x3d'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x29');break;case _0x5a2f96('0x9c'):case _0x5a2f96('0x93'):case _0x5a2f96('0x8a'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x10');break;case _0x5a2f96('0xab'):_0x9819ad[_0x5a2f96('0x30')]='VoiceContext';break;case _0x5a2f96('0x4f'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x88');break;case'voicerecordings':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x6f'),_0x9819ad['parentSections']=[{'name':_0x5a2f96('0x80'),'field':_0x5a2f96('0xa6'),'foreignKey':_0x5a2f96('0x54'),'model':_0x5a2f96('0x56'),'filter':{'field':_0x5a2f96('0x8e'),'value':[_0x5a2f96('0x42')]}},{'name':_0x5a2f96('0xb9'),'field':_0x5a2f96('0xa6'),'foreignKey':_0x5a2f96('0x54'),'model':_0x5a2f96('0x56'),'filter':{'field':_0x5a2f96('0x8e'),'value':['telephone']}},{'name':_0x5a2f96('0x19'),'field':'name','foreignKey':_0x5a2f96('0x1'),'model':_0x5a2f96('0xb7'),'filter':{'field':_0x5a2f96('0x12'),'value':[_0x5a2f96('0x78')]}},{'name':_0x5a2f96('0x98'),'field':_0x5a2f96('0xa6'),'foreignKey':_0x5a2f96('0x1'),'model':_0x5a2f96('0xb7'),'filter':{'field':_0x5a2f96('0x12'),'value':[_0x5a2f96('0xa8')]}}];break;case _0x5a2f96('0xb3'):_0x9819ad[_0x5a2f96('0x30')]='VoiceMusicOnHold';break;case _0x5a2f96('0x49'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x1a');break;case _0x5a2f96('0x9b'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x39');break;case _0x5a2f96('0xb0'):_0x9819ad['childModel']=_0x5a2f96('0xcd');break;case _0x5a2f96('0xbc'):_0x9819ad['childModel']=_0x5a2f96('0x32');break;case _0x5a2f96('0x6'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x96');break;case _0x5a2f96('0x79'):_0x9819ad[_0x5a2f96('0x30')]='MailSubstatus';break;case _0x5a2f96('0xcb'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x52');break;case _0x5a2f96('0x24'):_0x9819ad[_0x5a2f96('0x30')]='OpenchannelAccount';break;case'smsqueues':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x64');break;case _0x5a2f96('0xa4'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xa2');break;case _0x5a2f96('0x28'):_0x9819ad[_0x5a2f96('0x30')]='WhatsappQueue';break;case _0x5a2f96('0xc9'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xb6');break;case _0x5a2f96('0xbf'):_0x9819ad[_0x5a2f96('0x30')]='Team';break;case'voicequeues':case'queuecampaigns':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xb7');_0x42c26d&&(_0x9819ad[_0x5a2f96('0x3e')]=[{'name':_0x5a2f96('0x19')},{'name':_0x5a2f96('0x98')}]);break;case'users':case _0x5a2f96('0xc2'):case _0x5a2f96('0x35'):_0x9819ad[_0x5a2f96('0x30')]='User';_0x42c26d&&(_0x9819ad[_0x5a2f96('0x3e')]=[{'name':_0x5a2f96('0x1e'),'filter':{'field':_0x5a2f96('0x8e'),'value':[_0x5a2f96('0x7'),'user']},'ignore':!![]},{'name':_0x5a2f96('0x80')},{'name':_0x5a2f96('0xb9')}]);break;case _0x5a2f96('0x6a'):_0x9819ad[_0x5a2f96('0x30')]='ZendeskAccount';break;case _0x5a2f96('0xac'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x59');break;case'freshdeskaccounts':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x41');break;case _0x5a2f96('0xa3'):_0x9819ad[_0x5a2f96('0x30')]='SugarcrmAccount';break;case'deskaccounts':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xc4');break;case _0x5a2f96('0x17'):_0x9819ad[_0x5a2f96('0x30')]='ZohoAccount';break;case _0x5a2f96('0x2d'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x56');break;case _0x5a2f96('0x2f'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x7b');break;case _0x5a2f96('0x58'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0x6c');break;case'customdashboards':_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xa0');break;case _0x5a2f96('0x6d'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xb2');break;case _0x5a2f96('0xc7'):_0x9819ad['childModel']=_0x5a2f96('0x91');break;case _0x5a2f96('0x83'):_0x9819ad[_0x5a2f96('0x30')]='Schedule';break;case _0x5a2f96('0xa1'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xaa');break;case'tags':_0x9819ad['childModel']='Tag';break;case _0x5a2f96('0x11'):_0x9819ad['childModel']='Template';break;case _0x5a2f96('0x7a'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xca');break;case _0x5a2f96('0x6e'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xd');break;case _0x5a2f96('0xa7'):_0x9819ad['childModel']=_0x5a2f96('0x65');break;case _0x5a2f96('0x95'):_0x9819ad[_0x5a2f96('0x30')]=_0x5a2f96('0xa');break;case'extractedreports':_0x9819ad[_0x5a2f96('0x30')]='AnalyticExtractedReport',_0x9819ad[_0x5a2f96('0x3e')]=[{'name':_0x5a2f96('0x3f'),'field':'id','foreignKey':'reportId'}];break;case _0x5a2f96('0x40'):_0x9819ad['childModel']='AnalyticMetric';break;default:return _0x9819ad;}return _0x9819ad;}