b56ff16f479a6a5f98af94728428a3589fd29093
[motion2.git] / server / api / userProfile / userProfile.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xe6ff=['clone','params','find','get','omit','createdAt','updatedAt','crudPermissions','body','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','sequelize','push','ids','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','childModel','undefined','Invalid\x20section\x20\x27','parentSections','all','ignore','union','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','reportId','DefaultReports','custom','CustomReports','CmContact','color','tag','Tag','ThroughTags','value','squareprojects','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','inbound','queue','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Interval','pauses','Pause','scheduler','sounds','Sound','tags','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','register','sendStatus','status','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','create','catch'];(function(_0x208b40,_0x3625c5){var _0x2d77dc=function(_0x865192){while(--_0x865192){_0x208b40['push'](_0x208b40['shift']());}};_0x2d77dc(++_0x3625c5);}(_0xe6ff,0x18d));var _0xfe6f=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xe6ff[_0x29d915];return _0x160f86;};'use strict';var pdf=require(_0xfe6f('0x0'));var emlformat=require(_0xfe6f('0x1'));var rimraf=require(_0xfe6f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe6f('0x3'));var rp=require(_0xfe6f('0x4'));var moment=require(_0xfe6f('0x5'));var BPromise=require(_0xfe6f('0x6'));var Mustache=require(_0xfe6f('0x7'));var util=require(_0xfe6f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfe6f('0x9'));var ejs=require(_0xfe6f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfe6f('0xb'));var crypto=require(_0xfe6f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfe6f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfe6f('0xe'));var Papa=require(_0xfe6f('0xf'));var Redis=require(_0xfe6f('0x10'));var authService=require(_0xfe6f('0x11'));var qs=require(_0xfe6f('0x12'));var as=require(_0xfe6f('0x13'));var hardwareService=require(_0xfe6f('0x14'));var logger=require(_0xfe6f('0x15'))('api');var utils=require(_0xfe6f('0x16'));var config=require(_0xfe6f('0x17'));var licenseUtil=require(_0xfe6f('0x18'));var db=require(_0xfe6f('0x19'))['db'];config[_0xfe6f('0x1a')]=_[_0xfe6f('0x1b')](config[_0xfe6f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe6f('0x1a')]));require(_0xfe6f('0x1c'))[_0xfe6f('0x1d')](socket);function respondWithStatusCode(_0x6c189a,_0x50c869){_0x50c869=_0x50c869||0xcc;return function(_0x4fead7){if(_0x4fead7){return _0x6c189a[_0xfe6f('0x1e')](_0x50c869);}return _0x6c189a[_0xfe6f('0x1f')](_0x50c869)['end']();};}function respondWithResult(_0x4be08a,_0x291482){_0x291482=_0x291482||0xc8;return function(_0x5b97fe){if(_0x5b97fe){return _0x4be08a[_0xfe6f('0x1f')](_0x291482)['json'](_0x5b97fe);}};}function respondWithFilteredResult(_0x2f290d,_0x19918b){return function(_0x11762b){if(_0x11762b){var _0x2f9a2a=_0x11762b[_0xfe6f('0x20')],_0xdaaee=_0x19918b['offset'],_0x6bb941=_0x19918b['offset']+_0x19918b[_0xfe6f('0x21')],_0x1275a1;if(_0x6bb941>=_0x2f9a2a){_0x6bb941=_0x2f9a2a;_0x1275a1=0xc8;}else{_0x1275a1=0xce;}_0x2f290d[_0xfe6f('0x1f')](_0x1275a1);return _0x2f290d[_0xfe6f('0x22')](_0xfe6f('0x23'),_0xdaaee+'-'+_0x6bb941+'/'+_0x2f9a2a)[_0xfe6f('0x24')](_0x11762b);}return null;};}function patchUpdates(_0x3399f8){return function(_0x6fdaf4){try{jsonpatch['apply'](_0x6fdaf4,_0x3399f8,!![]);}catch(_0x4dd97e){return BPromise[_0xfe6f('0x25')](_0x4dd97e);}return _0x6fdaf4[_0xfe6f('0x26')]();};}function saveUpdates(_0x122e9b,_0x1e94ff){return function(_0x4db267){if(_0x4db267){return _0x4db267[_0xfe6f('0x27')](_0x122e9b)[_0xfe6f('0x28')](function(_0x21072e){return _0x21072e;});}return null;};}function removeEntity(_0x44fe9c,_0x4cfa9c){return function(_0x1aefbf){if(_0x1aefbf){return _0x1aefbf[_0xfe6f('0x29')]()['then'](function(){_0x44fe9c[_0xfe6f('0x1f')](0xcc)[_0xfe6f('0x2a')]();});}};}function handleEntityNotFound(_0x7d63e7,_0x2add79){return function(_0x4a9e27){if(!_0x4a9e27){_0x7d63e7[_0xfe6f('0x1e')](0x194);}return _0x4a9e27;};}function handleError(_0x49c42e,_0x27de74){_0x27de74=_0x27de74||0x1f4;return function(_0x5b9e3a){logger[_0xfe6f('0x2b')](_0x5b9e3a[_0xfe6f('0x2c')]);if(_0x5b9e3a['name']){delete _0x5b9e3a[_0xfe6f('0x2d')];}_0x49c42e[_0xfe6f('0x1f')](_0x27de74)['send'](_0x5b9e3a);};}exports[_0xfe6f('0x2e')]=function(_0x181a7c,_0x1d617c){var _0x338ed9={},_0x5e0ca5={},_0x1cae23={'count':0x0,'rows':[]};var _0x5287ae=_[_0xfe6f('0x2f')](db[_0xfe6f('0x30')][_0xfe6f('0x31')],function(_0x1eff5d){return{'name':_0x1eff5d[_0xfe6f('0x32')],'type':_0x1eff5d[_0xfe6f('0x33')][_0xfe6f('0x34')]};});_0x5e0ca5[_0xfe6f('0x35')]=_[_0xfe6f('0x2f')](_0x5287ae,'name');_0x5e0ca5[_0xfe6f('0x36')]=_[_0xfe6f('0x37')](_0x181a7c[_0xfe6f('0x36')]);_0x5e0ca5['filters']=_['intersection'](_0x5e0ca5[_0xfe6f('0x35')],_0x5e0ca5[_0xfe6f('0x36')]);_0x338ed9[_0xfe6f('0x38')]=_[_0xfe6f('0x39')](_0x5e0ca5[_0xfe6f('0x35')],qs[_0xfe6f('0x3a')](_0x181a7c[_0xfe6f('0x36')][_0xfe6f('0x3a')]));_0x338ed9[_0xfe6f('0x38')]=_0x338ed9[_0xfe6f('0x38')]['length']?_0x338ed9[_0xfe6f('0x38')]:_0x5e0ca5[_0xfe6f('0x35')];if(!_0x181a7c['query'][_0xfe6f('0x3b')](_0xfe6f('0x3c'))){_0x338ed9['limit']=qs[_0xfe6f('0x21')](_0x181a7c[_0xfe6f('0x36')][_0xfe6f('0x21')]);_0x338ed9[_0xfe6f('0x3d')]=qs[_0xfe6f('0x3d')](_0x181a7c[_0xfe6f('0x36')]['offset']);}_0x338ed9[_0xfe6f('0x3e')]=qs[_0xfe6f('0x3f')](_0x181a7c[_0xfe6f('0x36')][_0xfe6f('0x3f')]);_0x338ed9['where']=qs[_0xfe6f('0x40')](_[_0xfe6f('0x41')](_0x181a7c[_0xfe6f('0x36')],_0x5e0ca5[_0xfe6f('0x40')]),_0x5287ae);if(_0x181a7c[_0xfe6f('0x36')][_0xfe6f('0x42')]){_0x338ed9[_0xfe6f('0x43')]=_[_0xfe6f('0x44')](_0x338ed9['where'],{'$or':_[_0xfe6f('0x2f')](_0x5287ae,function(_0x2a839c){if(_0x2a839c[_0xfe6f('0x33')]!==_0xfe6f('0x45')){var _0x17503d={};_0x17503d[_0x2a839c['name']]={'$like':'%'+_0x181a7c['query'][_0xfe6f('0x42')]+'%'};return _0x17503d;}})});}_0x338ed9=_['merge']({},_0x338ed9,_0x181a7c[_0xfe6f('0x46')]);var _0x207c46={'where':_0x338ed9[_0xfe6f('0x43')]};return db[_0xfe6f('0x30')][_0xfe6f('0x20')](_0x207c46)[_0xfe6f('0x28')](function(_0x87c3ab){_0x1cae23[_0xfe6f('0x20')]=_0x87c3ab;if(_0x181a7c[_0xfe6f('0x36')][_0xfe6f('0x47')]){_0x338ed9[_0xfe6f('0x48')]=[{'all':!![]}];}return db[_0xfe6f('0x30')][_0xfe6f('0x49')](_0x338ed9);})[_0xfe6f('0x28')](function(_0x5607bf){_0x1cae23[_0xfe6f('0x4a')]=_0x5607bf;return _0x1cae23;})[_0xfe6f('0x28')](respondWithFilteredResult(_0x1d617c,_0x338ed9))['catch'](handleError(_0x1d617c,null));};exports[_0xfe6f('0x4b')]=function(_0x408ee7,_0x4c738b){var _0x4ed4fd={'raw':![],'where':{'id':_0x408ee7['params']['id']}},_0x175221={};_0x175221['model']=_['keys'](db[_0xfe6f('0x30')][_0xfe6f('0x31')]);_0x175221[_0xfe6f('0x36')]=_['keys'](_0x408ee7[_0xfe6f('0x36')]);_0x175221[_0xfe6f('0x40')]=_[_0xfe6f('0x39')](_0x175221['model'],_0x175221[_0xfe6f('0x36')]);_0x4ed4fd[_0xfe6f('0x38')]=_[_0xfe6f('0x39')](_0x175221[_0xfe6f('0x35')],qs[_0xfe6f('0x3a')](_0x408ee7[_0xfe6f('0x36')][_0xfe6f('0x3a')]));_0x4ed4fd[_0xfe6f('0x38')]=_0x4ed4fd['attributes'][_0xfe6f('0x4c')]?_0x4ed4fd[_0xfe6f('0x38')]:_0x175221[_0xfe6f('0x35')];if(_0x408ee7[_0xfe6f('0x36')]['includeAll']){_0x4ed4fd[_0xfe6f('0x48')]=[{'all':!![]}];}_0x4ed4fd=_[_0xfe6f('0x44')]({},_0x4ed4fd,_0x408ee7[_0xfe6f('0x46')]);return db['UserProfile']['find'](_0x4ed4fd)[_0xfe6f('0x28')](handleEntityNotFound(_0x4c738b,null))[_0xfe6f('0x28')](respondWithResult(_0x4c738b,null))['catch'](handleError(_0x4c738b,null));};exports[_0xfe6f('0x4d')]=function(_0x2ed621,_0x13a6f0){return db[_0xfe6f('0x30')]['create'](_0x2ed621['body'],{})[_0xfe6f('0x28')](respondWithResult(_0x13a6f0,0xc9))[_0xfe6f('0x4e')](handleError(_0x13a6f0,null));};exports[_0xfe6f('0x4f')]=function(_0x28b7d3,_0x290eae){var _0x578e02={'where':{'id':_0x28b7d3[_0xfe6f('0x50')]['id']}},_0x5b9021={};_0x5b9021[_0xfe6f('0x35')]=_[_0xfe6f('0x37')](db[_0xfe6f('0x30')][_0xfe6f('0x31')]);_0x578e02[_0xfe6f('0x38')]=_[_0xfe6f('0x39')](_0x5b9021[_0xfe6f('0x35')],qs[_0xfe6f('0x3a')](_0x28b7d3[_0xfe6f('0x36')][_0xfe6f('0x3a')]));_0x578e02[_0xfe6f('0x38')]=_0x578e02['attributes'][_0xfe6f('0x4c')]?_0x578e02[_0xfe6f('0x38')]:_0x5b9021[_0xfe6f('0x35')];if(_0x28b7d3[_0xfe6f('0x36')]['includeAll']){_0x578e02[_0xfe6f('0x48')]=[{'all':!![]}];}_0x578e02=_[_0xfe6f('0x44')]({},_0x578e02,_0x28b7d3[_0xfe6f('0x46')]);return db[_0xfe6f('0x30')][_0xfe6f('0x51')](_0x578e02)[_0xfe6f('0x28')](handleEntityNotFound(_0x290eae,null))[_0xfe6f('0x28')](function(_0xb77378){if(_0xb77378){var _0x261b35=_0xb77378[_0xfe6f('0x52')]({'plain':!![]});_0x261b35=qs[_0xfe6f('0x53')](_0x261b35,['id',_0xfe6f('0x54'),_0xfe6f('0x55'),_0xfe6f('0x56')]);_0x28b7d3[_0xfe6f('0x57')]=_[_0xfe6f('0x53')](_0x28b7d3[_0xfe6f('0x57')],['id',_0xfe6f('0x54'),_0xfe6f('0x55')]);return db['sequelize'][_0xfe6f('0x58')](function(_0x2d8f28){return db[_0xfe6f('0x30')]['create'](_['merge'](_0x261b35,_0x28b7d3[_0xfe6f('0x57')]),{'include':_0x28b7d3['query'][_0xfe6f('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x2d8f28})['then'](function(_0x335182){var _0x3c166c=_0x335182[_0xfe6f('0x52')]({'plain':!![]});return db[_0xfe6f('0x59')][_0xfe6f('0x49')]({'where':{'userProfileId':_0x28b7d3[_0xfe6f('0x50')]['id']},'raw':!![]})['then'](function(_0x5f3d39){if(_0x5f3d39){return BPromise['each'](_0x5f3d39,function(_0x4dd278){return new BPromise(function(_0x2f4671,_0x10a009){if(_0x4dd278[_0xfe6f('0x5a')]===null||_0x4dd278[_0xfe6f('0x5a')]===0x1)_0x2f4671(null);return db[_0xfe6f('0x5b')][_0xfe6f('0x49')]({'where':{'sectionId':_0x4dd278['id']},'raw':!![]})[_0xfe6f('0x28')](function(_0x2170a3){var _0x52130c=_[_0xfe6f('0x2f')](_0x2170a3,function(_0x1a973a){return qs['omit'](_0x1a973a,['id',_0xfe6f('0x54'),'updatedAt',_0xfe6f('0x5c')]);});_0x2f4671(_0x52130c);})[_0xfe6f('0x4e')](function(_0x487a42){_0x10a009(_0x487a42);});})['then'](function(_0x4bf2f1){var _0x2096d6=qs['omit'](_0x4dd278,['id',_0xfe6f('0x54'),_0xfe6f('0x55')]);_0x2096d6[_0xfe6f('0x5d')]=_0x3c166c['id'];if(_0x4bf2f1)_0x2096d6[_0xfe6f('0x5e')]=_0x4bf2f1;return _0x2096d6;})[_0xfe6f('0x28')](function(_0x138571){return db[_0xfe6f('0x59')]['create'](_0x138571,{'include':[{'model':db[_0xfe6f('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x2d8f28});});})['then'](function(){return _0x3c166c;});}});});});}})[_0xfe6f('0x28')](respondWithResult(_0x290eae,0xc9))[_0xfe6f('0x4e')](handleError(_0x290eae,null));};exports[_0xfe6f('0x27')]=function(_0x2b0f1c,_0x1cbc03){if(_0x2b0f1c[_0xfe6f('0x57')]['id']){delete _0x2b0f1c[_0xfe6f('0x57')]['id'];}return db[_0xfe6f('0x30')]['find']({'where':{'id':_0x2b0f1c[_0xfe6f('0x50')]['id']}})[_0xfe6f('0x28')](handleEntityNotFound(_0x1cbc03,null))[_0xfe6f('0x28')](saveUpdates(_0x2b0f1c[_0xfe6f('0x57')],null))[_0xfe6f('0x28')](respondWithResult(_0x1cbc03,null))[_0xfe6f('0x4e')](handleError(_0x1cbc03,null));};exports[_0xfe6f('0x29')]=function(_0x351190,_0x39c932){return db['UserProfile'][_0xfe6f('0x51')]({'where':{'id':_0x351190[_0xfe6f('0x50')]['id']}})[_0xfe6f('0x28')](handleEntityNotFound(_0x39c932,null))[_0xfe6f('0x28')](removeEntity(_0x39c932,null))[_0xfe6f('0x4e')](handleError(_0x39c932,null));};exports['describe']=function(_0x171009,_0x2251d7){return db[_0xfe6f('0x30')][_0xfe6f('0x5f')]()['then'](respondWithResult(_0x2251d7,null))[_0xfe6f('0x4e')](handleError(_0x2251d7,null));};exports[_0xfe6f('0x60')]=function(_0x42b454,_0x364f44){var _0x3f15e5=_0x42b454[_0xfe6f('0x57')];return db[_0xfe6f('0x30')]['find']({'where':{'id':_0x42b454['params']['id']}})['then'](handleEntityNotFound(_0x364f44,null))[_0xfe6f('0x28')](function(_0x40b92b){if(_0x40b92b){return db[_0xfe6f('0x61')][_0xfe6f('0x58')](function(_0x2d71c6){return db[_0xfe6f('0x59')][_0xfe6f('0x29')]({'where':{'userProfileId':_0x42b454[_0xfe6f('0x50')]['id'],'sectionId':_[_0xfe6f('0x2f')](_0x3f15e5,function(_0x4c400d){return _0x4c400d[_0xfe6f('0x5c')];})},'transaction':_0x2d71c6})['then'](function(){var _0x3ce09e=_[_0xfe6f('0x2f')](_0x3f15e5,function(_0x835f82){_0x835f82[_0xfe6f('0x5d')]=_0x42b454['params']['id'];return _0x835f82;});var _0x47c4f7=[];return BPromise['each'](_0x3ce09e,function(_0x3758cf){return db[_0xfe6f('0x59')][_0xfe6f('0x4d')](_0x3758cf,{'include':[{'model':db['UserProfileResource'],'as':_0xfe6f('0x5e')}],'raw':!![],'transaction':_0x2d71c6})[_0xfe6f('0x28')](function(_0x16813c){_0x47c4f7[_0xfe6f('0x62')](_0x16813c[_0xfe6f('0x52')]({'plain':!![]}));});})[_0xfe6f('0x28')](function(){return _0x47c4f7;});});});}})[_0xfe6f('0x28')](function(_0x2b36c0){return _0x2b36c0;})['then'](respondWithResult(_0x364f44,null))[_0xfe6f('0x4e')](handleError(_0x364f44,null));};exports['removeSections']=function(_0x23bc58,_0xc8c9c0){var _0x43ce21;return db['UserProfile'][_0xfe6f('0x51')]({'where':{'id':_0x23bc58[_0xfe6f('0x50')]['id']},'attributes':['id',_0xfe6f('0x2d')]})[_0xfe6f('0x28')](handleEntityNotFound(_0xc8c9c0,null))[_0xfe6f('0x28')](function(_0x164b78){if(_0x164b78){_0x43ce21=_0x164b78;return db[_0xfe6f('0x59')]['destroy']({'where':{'userProfileId':_0x23bc58[_0xfe6f('0x50')]['id'],'sectionId':_0x23bc58[_0xfe6f('0x36')][_0xfe6f('0x63')]}});}})['then'](function(){return _0x43ce21;})[_0xfe6f('0x28')](respondWithStatusCode(_0xc8c9c0,null))[_0xfe6f('0x4e')](handleError(_0xc8c9c0,null));};exports['getSections']=function(_0x3cdb85,_0x35aa4e){var _0x462768=[];var _0x21d3f6=[];return db[_0xfe6f('0x59')][_0xfe6f('0x49')]({'where':{'userProfileId':_0x3cdb85[_0xfe6f('0x50')]['id']},'raw':!![]})[_0xfe6f('0x28')](function(_0x3e2f44){_0x462768=_[_0xfe6f('0x42')](_0x3e2f44,function(_0x23d115){return _0x23d115[_0xfe6f('0x64')]===0x1||_[_0xfe6f('0x65')]([0x3eb,0x709],_0x23d115[_0xfe6f('0x5c')]);});if(!_[_0xfe6f('0x66')](_0x462768)){return _['map'](_0x462768,function(_0x1205a6){return _0x1205a6['sectionId'];});}else{return;}})[_0xfe6f('0x28')](function(_0x38c863){if(_0x38c863)_0x21d3f6=_0x38c863;if(_[_0xfe6f('0x65')](_0x21d3f6,0x64)){var _0x916eb7=_['find'](_0x462768,{'sectionId':0x64});return hasDefaultDashboard(_0x916eb7)[_0xfe6f('0x28')](function(_0x5b7de8){return _[_0xfe6f('0x2f')](_0x462768,function(_0x21dec8){if(_0x21dec8['sectionId']===0x64){_0x21dec8[_0xfe6f('0x67')]=_0x5b7de8;}return _0x21dec8;});});}else{return;}})[_0xfe6f('0x28')](function(_0x3fce59){if(_0x3fce59)_0x462768=_0x3fce59;if(_[_0xfe6f('0x65')](_0x21d3f6,0x3eb)){var _0x46f7ad=_[_0xfe6f('0x51')](_0x462768,{'sectionId':0x3eb});return getCustomDashboards(_0x46f7ad)[_0xfe6f('0x28')](function(_0xa7092){return _[_0xfe6f('0x2f')](_0x462768,function(_0x5490ce){if(_0x46f7ad[_0xfe6f('0x64')]){if(_0x5490ce['sectionId']===0x3eb){_0x5490ce[_0xfe6f('0x67')]=_0xa7092;}}else{if(_0x5490ce[_0xfe6f('0x5c')]===0x64){_0x5490ce[_0xfe6f('0x67')]=_0xa7092;}}return _0x5490ce;});});}else{return;}})[_0xfe6f('0x28')](function(_0x5cc168){if(_0x5cc168)_0x462768=_0x5cc168;if(_[_0xfe6f('0x65')](_0x21d3f6,0x709)){var _0x2ec6c9=_[_0xfe6f('0x51')](_0x462768,{'sectionId':0x709});return getPlugins(_0x2ec6c9)['then'](function(_0x5da358){if(_0x2ec6c9['enabled']){return _[_0xfe6f('0x2f')](_0x462768,function(_0x373287){if(_0x373287[_0xfe6f('0x5c')]===0x709){_0x373287[_0xfe6f('0x67')]=_0x5da358;}return _0x373287;});}else{var _0x63a3c4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5da358};var _0x55c43b=_[_0xfe6f('0x2f')](_0x462768);_0x55c43b[_0xfe6f('0x62')](_0x63a3c4);return _0x55c43b;}});}else{return;}})['then'](function(_0xd9dd7a){if(_0xd9dd7a)_0x462768=_0xd9dd7a;return _[_0xfe6f('0x42')](_0x462768,[_0xfe6f('0x64'),0x1]);})[_0xfe6f('0x28')](respondWithResult(_0x35aa4e,null))[_0xfe6f('0x4e')](handleError(_0x35aa4e,null));};function hasDefaultDashboard(_0x56fd18){var _0x64b3b0=[0x65];return new BPromise(function(_0x317f47,_0x5b51f2){try{if(_0x56fd18[_0xfe6f('0x5a')]){_0x317f47(_0x64b3b0);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x56fd18['id']},'raw':!![]})[_0xfe6f('0x28')](function(_0x14a033){_0x14a033?_0x317f47(_0x64b3b0):_0x317f47();});}}catch(_0x576b9a){_0x5b51f2(_0x576b9a);}});}function getCustomDashboards(_0x234d50){var _0x593312=[];return new BPromise(function(_0x438bb7,_0x4ba1c8){try{if(_0x234d50[_0xfe6f('0x5a')]){return db[_0xfe6f('0x68')][_0xfe6f('0x49')]({'raw':!![]})[_0xfe6f('0x28')](function(_0x4162fb){_0x4162fb['forEach'](function(_0x6aa047){_0x593312[_0xfe6f('0x62')](_0x6aa047['id']+0x1869f);});_0x438bb7(_0x593312);});}else{return db[_0xfe6f('0x5b')][_0xfe6f('0x49')]({'where':{'sectionId':_0x234d50['id']},'raw':!![]})[_0xfe6f('0x28')](function(_0x38f3ea){_0x38f3ea[_0xfe6f('0x69')](function(_0x5f2480){_0x593312['push'](_0x5f2480[_0xfe6f('0x6a')]+0x1869f);});_0x438bb7(_0x593312);});}}catch(_0x1265c6){_0x4ba1c8(_0x1265c6);}});}function getPlugins(_0x4ef390){var _0x272a0d=[];return new BPromise(function(_0xc339f,_0xc8950d){try{if(_0x4ef390['autoAssociation']){return db[_0xfe6f('0x6b')][_0xfe6f('0x49')]({'raw':!![]})['then'](function(_0x584222){_0x584222[_0xfe6f('0x69')](function(_0x2a34df){_0x272a0d['push'](_0x2a34df['id']+0x15b38);});_0xc339f(_0x272a0d);});}else{return db[_0xfe6f('0x5b')]['findAll']({'where':{'sectionId':_0x4ef390['id']},'raw':!![]})[_0xfe6f('0x28')](function(_0x1a0a52){_0x1a0a52[_0xfe6f('0x69')](function(_0x4d3230){_0x272a0d['push'](_0x4d3230[_0xfe6f('0x6a')]+0x15b38);});_0xc339f(_0x272a0d);});}}catch(_0x33f66a){_0xc8950d(_0x33f66a);}});}exports[_0xfe6f('0x6c')]=function(_0x3e28a2,_0x10c657){return db['UserProfile']['find']({'where':{'id':_0x3e28a2[_0xfe6f('0x50')]['id']}})[_0xfe6f('0x28')](handleEntityNotFound(_0x10c657,null))[_0xfe6f('0x28')](function(_0x1ca0b9){if(_0x1ca0b9){return db[_0xfe6f('0x61')]['transaction'](function(_0x4d48d5){return db[_0xfe6f('0x59')][_0xfe6f('0x49')]({'where':{'userProfileId':_0x3e28a2[_0xfe6f('0x50')]['id']},'attributes':['id'],'raw':!![]})[_0xfe6f('0x28')](function(_0x24b196){if(_0x24b196){return db[_0xfe6f('0x59')][_0xfe6f('0x29')]({'where':{'userProfileId':_0x3e28a2[_0xfe6f('0x50')]['id'],'id':_['map'](_0x24b196,function(_0x2f77a6){return _0x2f77a6['id'];})},'transaction':_0x4d48d5});}})[_0xfe6f('0x28')](function(_0x48ed4e){var _0x2218c2=_['map'](_0x3e28a2[_0xfe6f('0x57')],function(_0x1851e8){_0x1851e8[_0xfe6f('0x5d')]=_0x3e28a2['params']['id'];return _0x1851e8;});return db[_0xfe6f('0x59')][_0xfe6f('0x6d')](_0x2218c2,{'raw':!![],'transaction':_0x4d48d5});})[_0xfe6f('0x28')](function(_0x320408){var _0x1fb4d7=_[_0xfe6f('0x42')](_['map'](_0x320408,function(_0x4a2f7d){return _0x4a2f7d['get']({'plain':!![]});}),{'includeAll':![]});if(_0x1fb4d7){return db[_0xfe6f('0x59')]['findAll']({'where':{'userProfileId':_0x3e28a2['params']['id'],'sectionId':_[_0xfe6f('0x2f')](_0x1fb4d7,function(_0x3b2873){return _0x3b2873[_0xfe6f('0x5c')];})},'attributes':['id',_0xfe6f('0x5c')],'raw':!![]})['then'](function(_0x5f05b0){var _0xb29ab3=_[_0xfe6f('0x2f')](_0x3e28a2[_0xfe6f('0x57')],function(_0x3976f2){_0x3976f2['userProfileId']=_0x3e28a2[_0xfe6f('0x50')]['id'];return _0x3976f2;});return db[_0xfe6f('0x5b')]['bulkCreate'](_0xb29ab3,{'raw':!![],'transaction':_0x4d48d5});});}})[_0xfe6f('0x4e')](handleError(_0x10c657,null));});}})[_0xfe6f('0x28')](function(_0xcf1dbd){var _0x5ae99f=_[_0xfe6f('0x2f')](_0xcf1dbd,function(_0x240c3e){return _0x240c3e[_0xfe6f('0x52')]({'plain':!![]});});})[_0xfe6f('0x28')](respondWithResult(_0x10c657,null))[_0xfe6f('0x4e')](handleError(_0x10c657,null));};exports[_0xfe6f('0x6e')]=function(_0x5530ca,_0x216e32,_0x3aa28f){return db[_0xfe6f('0x30')][_0xfe6f('0x51')]({'where':{'id':_0x5530ca[_0xfe6f('0x50')]['id']}})[_0xfe6f('0x28')](handleEntityNotFound(_0x216e32,null))[_0xfe6f('0x28')](function(_0x1e1a8b){if(_0x1e1a8b){return _0x1e1a8b['removeResources'](_0x5530ca['query'][_0xfe6f('0x63')]);}})[_0xfe6f('0x28')](respondWithStatusCode(_0x216e32,null))['catch'](handleError(_0x216e32,null));};exports[_0xfe6f('0x6f')]=function(_0x4df665,_0x2a7065){var _0x1408b7={'raw':![],'where':{}};var _0x1f3f63={};var _0x561e73={'count':0x0,'rows':[]};var _0x15a33c=_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x70')];if(typeof _0x15a33c==='undefined'){throw new db[(_0xfe6f('0x71'))][(_0xfe6f('0x72'))](_0xfe6f('0x73'));}var _0x596706=_0x4df665['query']['mergeResources']||![];var _0x58b96c=getQueryModels(_0x15a33c,_0x596706);if(typeof _0x58b96c[_0xfe6f('0x74')]===_0xfe6f('0x75')){throw new db[(_0xfe6f('0x71'))][(_0xfe6f('0x72'))](_0xfe6f('0x76')+_0x15a33c+'\x27');}var _0x525d88=[];if(!_['isEmpty'](_0x58b96c[_0xfe6f('0x77')])){_0x525d88=_0x58b96c['parentSections'];}else{_0x525d88=[{'name':_0x15a33c}];}return db['UserProfile']['findOne']({'where':{'id':_0x4df665[_0xfe6f('0x50')]['id']}})[_0xfe6f('0x28')](handleEntityNotFound(_0x2a7065,null))['then'](function(_0x5e2b65){if(_0x5e2b65){var _0x107bf8=[];for(var _0x4e451f=0x0;_0x4e451f<_0x525d88[_0xfe6f('0x4c')];_0x4e451f++){_0x107bf8['push'](db['UserProfileSection']['findOne']({'where':{'userProfileId':_0x5e2b65['id'],'name':_0x525d88[_0x4e451f][_0xfe6f('0x2d')]},'raw':!![]}));}return BPromise[_0xfe6f('0x78')](_0x107bf8);}})['then'](function(_0x268d8d){var _0x519eba=_[_0xfe6f('0x42')](_0x268d8d,function(_0x43c1e7){return _0x43c1e7?_0x43c1e7:undefined;});var _0x380120=_['filter'](_0x525d88,[_0xfe6f('0x79'),!![]]);var _0x19555b=_[_0xfe6f('0x66')](_0x519eba)&&_[_0xfe6f('0x66')](_0x380120)?null:_[_0xfe6f('0x7a')](_0x380120,_0x519eba);if(_0x19555b){var _0x1ddbd7=[];for(var _0x1c773d=0x0;_0x1c773d<_0x19555b[_0xfe6f('0x4c')];_0x1c773d++){var _0x5e405b=_['find'](_0x525d88,function(_0x594198){return _0x19555b[_0x1c773d]?_0x594198[_0xfe6f('0x2d')]===_0x19555b[_0x1c773d][_0xfe6f('0x2d')]:null;});if(_0x5e405b){if(_0x19555b[_0x1c773d]['ignore']){_0x1ddbd7[_0xfe6f('0x62')](getAllResources(_0x58b96c[_0xfe6f('0x74')],_0x19555b[_0x1c773d]));}else{if(!_0x19555b[_0x1c773d][_0xfe6f('0x5a')]){_0x1ddbd7[_0xfe6f('0x62')](getAllowedResources(_0x5e405b,_0x19555b[_0x1c773d],_0x58b96c[_0xfe6f('0x74')]));}else{if(_0x5e405b[_0xfe6f('0x35')]){_0x1ddbd7[_0xfe6f('0x62')](getAllFilteredResources(_0x5e405b,_0x19555b[_0x1c773d]));}}}}}return BPromise[_0xfe6f('0x78')](_0x1ddbd7);}else{return null;}})[_0xfe6f('0x28')](function(_0x17ee2f){var _0x3d0308=_0x17ee2f;var _0x138198=null;if(_0x3d0308){_0x138198=_0x3d0308[_0xfe6f('0x4c')]===0x1?_0x3d0308[0x0]:null;}if(_0x138198||_0x3d0308){var _0x137e08=db[_0x58b96c[_0xfe6f('0x74')]][_0xfe6f('0x31')];_0x1f3f63[_0xfe6f('0x35')]=_[_0xfe6f('0x37')](_0x137e08);_0x1f3f63[_0xfe6f('0x36')]=_[_0xfe6f('0x37')](_0x4df665['query']);_0x1f3f63[_0xfe6f('0x40')]=_[_0xfe6f('0x39')](_0x1f3f63['model'],_0x1f3f63[_0xfe6f('0x36')]);_0x1408b7[_0xfe6f('0x38')]=_['intersection'](_0x1f3f63[_0xfe6f('0x35')],qs[_0xfe6f('0x3a')](_0x4df665['query'][_0xfe6f('0x3a')]));_0x1408b7[_0xfe6f('0x38')]=_0x1408b7[_0xfe6f('0x38')]['length']?_0x1408b7[_0xfe6f('0x38')]:_0x1f3f63[_0xfe6f('0x35')];if(!_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x3b')](_0xfe6f('0x3c'))){_0x1408b7['limit']=qs[_0xfe6f('0x21')](_0x4df665['query'][_0xfe6f('0x21')]);_0x1408b7[_0xfe6f('0x3d')]=qs['offset'](_0x4df665['query'][_0xfe6f('0x3d')]);}_0x1408b7['order']=qs[_0xfe6f('0x3f')](_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x3f')]);_0x1408b7['where']=qs['filters'](_[_0xfe6f('0x41')](_0x4df665['query'],_0x1f3f63[_0xfe6f('0x40')]));if(_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x42')]){_0x1408b7[_0xfe6f('0x43')]=_['merge'](_0x1408b7[_0xfe6f('0x43')],{'$or':_['map'](_0x137e08,function(_0x3e875b){if(_0x3e875b[_0xfe6f('0x33')]['key']!==_0xfe6f('0x45')){var _0x151d97={};_0x151d97[_0x3e875b[_0xfe6f('0x7b')]]={'$like':'%'+_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x42')]+'%'};return _0x151d97;}})});}var _0x2f7627=[];if(_0x138198){var _0x919483=_[_0xfe6f('0x51')](_0x525d88,[_0xfe6f('0x2d'),_0x138198['name']]);if(_0x919483[_0xfe6f('0x7b')]){var _0x4c4d69={};if(_0x58b96c[_0xfe6f('0x74')]===_0xfe6f('0x7c')){_0x4c4d69[_0x919483[_0xfe6f('0x7d')]]=_[_0xfe6f('0x2f')](_0x138198[_0xfe6f('0x7e')],'id');}else{_0x4c4d69[_0x919483[_0xfe6f('0x7d')]]=_0x138198['associatedResources'];}_0x2f7627[_0xfe6f('0x62')](_0x4c4d69);}else{_0x1408b7[_0xfe6f('0x43')]['id']=_0x138198[_0xfe6f('0x7e')];}}else{for(var _0x1e976a=0x0;_0x1e976a<_0x3d0308[_0xfe6f('0x4c')];_0x1e976a++){var _0x919483=_['find'](_0x525d88,[_0xfe6f('0x2d'),_0x3d0308[_0x1e976a][_0xfe6f('0x2d')]]);if(_0x919483[_0xfe6f('0x7b')]){var _0x4c4d69={};_0x4c4d69[_0x919483['foreignKey']]=_0x3d0308[_0x1e976a][_0xfe6f('0x7e')];_0x2f7627[_0xfe6f('0x62')](_0x4c4d69);}else{if(!_0x1408b7['where']['id'])_0x1408b7['where']['id']=[];_0x3d0308[_0x1e976a][_0xfe6f('0x7e')][_0xfe6f('0x69')](function(_0x2c291a){_0x1408b7[_0xfe6f('0x43')]['id'][_0xfe6f('0x62')](_0x2c291a);});}}}if(!_[_0xfe6f('0x66')](_0x2f7627)){_0x1408b7[_0xfe6f('0x43')]=_[_0xfe6f('0x44')](_0x1408b7[_0xfe6f('0x43')],{'$and':{'$or':_0x2f7627}});}_0x1408b7=_[_0xfe6f('0x44')]({},_0x1408b7,_0x4df665[_0xfe6f('0x46')]);if(_0x138198&&!_0x138198[_0xfe6f('0x5a')]&&_0x58b96c['childModel']===_0xfe6f('0x7c')){if(_0x4df665[_0xfe6f('0x36')]['includeAll']){_0x1408b7[_0xfe6f('0x48')]=[{'all':!![]}];}return db[_0x58b96c['childModel']][_0xfe6f('0x49')](_0x1408b7)['then'](function(_0x320245){var _0x16c9f0=[];_0x320245[_0xfe6f('0x69')](function(_0x4947c2){var _0xdc6262;switch(_0x4947c2[_0xfe6f('0x7f')]){case'default':_0xdc6262=_['find'](_0x138198[_0xfe6f('0x7e')],function(_0x355f4c){return _0x355f4c['id']===_0x4947c2[_0xfe6f('0x80')]&&_0x355f4c[_0xfe6f('0x33')]===_0xfe6f('0x81');});break;case _0xfe6f('0x82'):_0xdc6262=_['find'](_0x138198[_0xfe6f('0x7e')],function(_0x2cced1){return _0x2cced1['id']===_0x4947c2[_0xfe6f('0x80')]&&_0x2cced1['type']===_0xfe6f('0x83');});break;}if(_0xdc6262)_0x16c9f0[_0xfe6f('0x62')](_0x4947c2);});_0x561e73[_0xfe6f('0x20')]=_0x16c9f0['length'];_0x561e73[_0xfe6f('0x4a')]=_0x16c9f0;return _0x561e73;});}else{return db[_0x58b96c['childModel']][_0xfe6f('0x20')]({'where':_0x1408b7['where']})[_0xfe6f('0x28')](function(_0x17094b){_0x561e73['count']=_0x17094b;if(_0x4df665[_0xfe6f('0x36')]['includeAll']){if(_0x58b96c[_0xfe6f('0x74')]===_0xfe6f('0x84')){_0x1408b7[_0xfe6f('0x48')]=[{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfe6f('0x2d'),_0xfe6f('0x85')],'required':_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x86')]?!![]:![]},{'model':db[_0xfe6f('0x87')],'as':_0xfe6f('0x88'),'attributes':['id',_0xfe6f('0x2d'),_0xfe6f('0x85')],'through':_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x86')]?{'attributes':[],'where':{'TagId':_0x4df665[_0xfe6f('0x36')]['tag']||undefined}}:{},'required':_0x4df665[_0xfe6f('0x36')][_0xfe6f('0x86')]?!![]:![]}];}else{_0x1408b7[_0xfe6f('0x48')]=[{'all':!![]}];}}return db[_0x58b96c[_0xfe6f('0x74')]][_0xfe6f('0x49')](_0x1408b7);})[_0xfe6f('0x28')](function(_0x3700dd){_0x561e73[_0xfe6f('0x4a')]=_0x3700dd;return _0x561e73;});}}else{return _0x561e73;}})[_0xfe6f('0x28')](respondWithFilteredResult(_0x2a7065,_0x1408b7))[_0xfe6f('0x4e')](handleError(_0x2a7065,null));};function getAllResources(_0x364826,_0x1d7a0c){return new BPromise(function(_0x449acd,_0x46fc85){if(_0x1d7a0c){var _0x12b10e=_0x1d7a0c[_0xfe6f('0x42')]?{[_0x1d7a0c[_0xfe6f('0x42')][_0xfe6f('0x7b')]]:_0x1d7a0c['filter']['value']}:undefined;return db[_0x364826][_0xfe6f('0x49')]({'where':_0x12b10e,'raw':!![]})[_0xfe6f('0x28')](function(_0x3b2d1c){_0x1d7a0c[_0xfe6f('0x7e')]=_[_0xfe6f('0x2f')](_0x3b2d1c,'id');_0x449acd(_0x1d7a0c);})['catch'](function(_0x5ba6fe){_0x46fc85(_0x5ba6fe);});}else{_0x449acd(null);}});}function getAllFilteredResources(_0x337636,_0x42df76){return new BPromise(function(_0x2d7294,_0x432018){var _0x251163=_0x337636[_0xfe6f('0x42')]?{[_0x337636[_0xfe6f('0x42')][_0xfe6f('0x7b')]]:_0x337636[_0xfe6f('0x42')][_0xfe6f('0x89')]}:undefined;return db[_0x337636['model']]['findAll']({'where':_0x251163,'raw':!![]})[_0xfe6f('0x28')](function(_0x39cc52){_0x42df76[_0xfe6f('0x7e')]=_['map'](_0x39cc52,function(_0x343cca){return _0x343cca[_0xfe6f('0x2d')];});_0x2d7294(_0x42df76);})[_0xfe6f('0x4e')](function(_0x32ca01){_0x432018(_0x32ca01);});});}function getAllowedResources(_0x1f4eea,_0x595cbe,_0x322b0c){return new BPromise(function(_0x3c15db,_0x403ad8){if(_0x595cbe){return db[_0xfe6f('0x5b')][_0xfe6f('0x49')]({'where':{'sectionId':_0x595cbe['id']},'raw':!![]})['then'](function(_0x3206c3){if(_0x1f4eea[_0xfe6f('0x7b')]&&_0x1f4eea[_0xfe6f('0x7b')]!=='id'){_0x595cbe['associatedResources']=_['map'](_0x3206c3,function(_0x1dcc2e){return _0x1dcc2e[_0x1f4eea[_0xfe6f('0x7b')]];});}else{if(_0x322b0c===_0xfe6f('0x7c')){_0x595cbe['associatedResources']=_[_0xfe6f('0x2f')](_0x3206c3,function(_0x40b1bf){return{'id':_0x40b1bf[_0xfe6f('0x6a')],'type':_0x40b1bf[_0xfe6f('0x33')]};});}else{_0x595cbe[_0xfe6f('0x7e')]=_[_0xfe6f('0x2f')](_0x3206c3,function(_0x1fd760){return _0x1fd760[_0xfe6f('0x6a')];});}}_0x3c15db(_0x595cbe);})[_0xfe6f('0x4e')](function(_0xc2e164){_0x403ad8(_0xc2e164);});}else{_0x3c15db(null);}});}function getQueryModels(_0x1260db,_0x428a8f){var _0x3bd3b0=_0x1260db['toLowerCase']();var _0x30bea6={'childModel':undefined,'parentSections':[]};switch(_0x3bd3b0){case _0xfe6f('0x8a'):_0x30bea6[_0xfe6f('0x74')]='SquareProject';break;case'odbc':_0x30bea6[_0xfe6f('0x74')]='SquareOdbc';break;case _0xfe6f('0x8b'):_0x30bea6['childModel']=_0xfe6f('0x8c');_0x30bea6[_0xfe6f('0x77')]=[{'name':_0xfe6f('0x8d'),'field':_0xfe6f('0x2d'),'foreignKey':_0xfe6f('0x8e')}];break;case _0xfe6f('0x8f'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x90');break;case _0xfe6f('0x91'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x84');_0x30bea6['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0xfe6f('0x92'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x93');break;case _0xfe6f('0x94'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x95');break;case _0xfe6f('0x96'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x97');break;case _0xfe6f('0x98'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x99');break;case _0xfe6f('0x9a'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x9b');break;case _0xfe6f('0x9c'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x9d');break;case'faxaccounts':_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x9e');break;case'inboundroutes':case'internalroutes':case _0xfe6f('0x9f'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xa0');break;case _0xfe6f('0xa1'):_0x30bea6[_0xfe6f('0x74')]='VoiceContext';break;case'voicemails':_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xa2');break;case _0xfe6f('0xa3'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xa4');_0x30bea6[_0xfe6f('0x77')]=[{'name':_0xfe6f('0xa5'),'field':_0xfe6f('0x2d'),'foreignKey':_0xfe6f('0xa6'),'model':'User','filter':{'field':_0xfe6f('0xa7'),'value':[_0xfe6f('0xa8')]}},{'name':_0xfe6f('0xa9'),'field':'name','foreignKey':'membername','model':_0xfe6f('0xaa'),'filter':{'field':_0xfe6f('0xa7'),'value':[_0xfe6f('0xab')]}},{'name':_0xfe6f('0xac'),'field':_0xfe6f('0x2d'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0xfe6f('0xad')]}},{'name':'QueueCampaigns','field':_0xfe6f('0x2d'),'foreignKey':_0xfe6f('0xae'),'model':_0xfe6f('0xaf'),'filter':{'field':_0xfe6f('0x33'),'value':[_0xfe6f('0xb0')]}}];break;case'musiconholds':_0x30bea6['childModel']=_0xfe6f('0xb1');break;case _0xfe6f('0xb2'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xb3');break;case'voiceprefixes':_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xb4');break;case _0xfe6f('0xb5'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xb6');break;case _0xfe6f('0xb7'):_0x30bea6['childModel']='MailQueue';break;case _0xfe6f('0xb8'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xb9');break;case'mailsubstatuses':_0x30bea6['childModel']=_0xfe6f('0xba');break;case _0xfe6f('0xbb'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xbc');break;case _0xfe6f('0xbd'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xbe');break;case _0xfe6f('0xbf'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xc0');break;case _0xfe6f('0xc1'):_0x30bea6['childModel']=_0xfe6f('0xc2');break;case'whatsappqueues':_0x30bea6['childModel']='WhatsappQueue';break;case _0xfe6f('0xc3'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xc4');break;case _0xfe6f('0xc5'):_0x30bea6[_0xfe6f('0x74')]='Team';break;case _0xfe6f('0xc6'):case _0xfe6f('0xc7'):_0x30bea6['childModel']=_0xfe6f('0xaf');if(_0x428a8f){_0x30bea6[_0xfe6f('0x77')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case'users':case _0xfe6f('0xc8'):case _0xfe6f('0xc9'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xaa');if(_0x428a8f){_0x30bea6[_0xfe6f('0x77')]=[{'name':_0xfe6f('0xca'),'filter':{'field':_0xfe6f('0xa7'),'value':[_0xfe6f('0xcb'),_0xfe6f('0xcc')]},'ignore':!![]},{'name':'Agents'},{'name':_0xfe6f('0xa9')}];}break;case _0xfe6f('0xcd'):_0x30bea6[_0xfe6f('0x74')]='ZendeskAccount';break;case _0xfe6f('0xce'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xcf');break;case _0xfe6f('0xd0'):_0x30bea6['childModel']='FreshdeskAccount';break;case _0xfe6f('0xd1'):_0x30bea6[_0xfe6f('0x74')]='SugarcrmAccount';break;case _0xfe6f('0xd2'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xd3');break;case _0xfe6f('0xd4'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xd5');break;case _0xfe6f('0xd6'):_0x30bea6['childModel']=_0xfe6f('0xaa');break;case _0xfe6f('0xd7'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xd8');break;case _0xfe6f('0xd9'):_0x30bea6[_0xfe6f('0x74')]='Disposition';break;case _0xfe6f('0xda'):_0x30bea6['childModel']=_0xfe6f('0x68');break;case'intervals':_0x30bea6['childModel']=_0xfe6f('0xdb');break;case _0xfe6f('0xdc'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xdd');break;case _0xfe6f('0xde'):_0x30bea6[_0xfe6f('0x74')]='Schedule';break;case _0xfe6f('0xdf'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xe0');break;case _0xfe6f('0xe1'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x87');break;case _0xfe6f('0xe2'):_0x30bea6['childModel']=_0xfe6f('0xe3');break;case _0xfe6f('0xe4'):_0x30bea6['childModel']=_0xfe6f('0xe5');break;case'trunks':_0x30bea6['childModel']=_0xfe6f('0xe6');break;case _0xfe6f('0xe7'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xe8');break;case _0xfe6f('0xe9'):_0x30bea6['childModel']=_0xfe6f('0x6b');break;case _0xfe6f('0xea'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0x7c');_0x30bea6['parentSections']=[{'name':_0xfe6f('0xeb'),'field':'id','foreignKey':_0xfe6f('0x80')}];break;case _0xfe6f('0xec'):_0x30bea6[_0xfe6f('0x74')]=_0xfe6f('0xed');break;case _0xfe6f('0xc3'):_0x30bea6['childModel']='WhatsappAccount';break;default:return _0x30bea6;}return _0x30bea6;}