Built motion from commit 9e1399f3.|2.5.37
[motion2.git] / server / api / setting / setting.controller.js
index 29fe65c..8e20be0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf424=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','save','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','count','include','findAll','rows','show','params','keys','length','includeAll','options','find','update','body','get','readFileSync','root','server/files/templates/stun.ejs','render','join','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','logo','filename','loginLogo','../../config/license/util','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','upperFirst','custom','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.png','gdpr','getPreferred','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','lodash','squel','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x108c5f,_0x505e54){var _0x108ed9=function(_0x30d1ae){while(--_0x30d1ae){_0x108c5f['push'](_0x108c5f['shift']());}};_0x108ed9(++_0x505e54);}(_0xf424,0x15d));var _0x4f42=function(_0x2d4340,_0x14bd7f){_0x2d4340=_0x2d4340-0x0;var _0x5a2e9e=_0xf424[_0x2d4340];return _0x5a2e9e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4f42('0x0'));var rimraf=require(_0x4f42('0x1'));var zipdir=require(_0x4f42('0x2'));var jsonpatch=require(_0x4f42('0x3'));var rp=require('request-promise');var moment=require(_0x4f42('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f42('0x5'));var util=require('util');var path=require(_0x4f42('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f42('0x7'));var squel=require(_0x4f42('0x8'));var crypto=require('crypto');var jsforce=require(_0x4f42('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4f42('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f42('0xb'));var authService=require(_0x4f42('0xc'));var qs=require(_0x4f42('0xd'));var as=require(_0x4f42('0xe'));var hardwareService=require(_0x4f42('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x4f42('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x4f42('0x11'));var client=jayson[_0x4f42('0x12')]['http']({'port':0x232a});function checkPasswordPattern(_0x103c65,_0x16d07a,_0xbb2b70){if(_0xbb2b70){var _0x96bd08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x96bd08['test'](_0x16d07a)){return _0x103c65;}else{throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_0x4f42('0x15'));}}else{return _0x103c65;}}function respondWithRpcPromise(_0x4c5596,_0x53cf38,_0x337884,_0x1afa15){return new BPromise(function(_0x3a0c81,_0x4ce2d4){var _0x51cf10=_0x1afa15||client;return _0x51cf10[_0x4f42('0x16')](_0x4c5596,_0x337884)[_0x4f42('0x17')](function(_0x2c5696){logger[_0x4f42('0x18')]('Setting,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'));logger[_0x4f42('0x1a')]('Setting,\x20%s,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'),JSON[_0x4f42('0x1b')](_0x2c5696));if(_0x2c5696[_0x4f42('0x1c')]){if(_0x2c5696[_0x4f42('0x1c')][_0x4f42('0x1d')]===0x1f4){logger['error'](_0x4f42('0x1e'),_0x53cf38,_0x2c5696['error']['message']);return _0x4ce2d4(_0x2c5696[_0x4f42('0x1c')][_0x4f42('0x1f')]);}logger[_0x4f42('0x1c')]('Setting,\x20%s,\x20%s',_0x53cf38,_0x2c5696['error']['message']);return _0x3a0c81(_0x2c5696['error'][_0x4f42('0x1f')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'));_0x3a0c81(_0x2c5696[_0x4f42('0x20')][_0x4f42('0x1f')]);}})[_0x4f42('0x21')](function(_0x523ae1){logger[_0x4f42('0x1c')](_0x4f42('0x1e'),_0x53cf38,_0x523ae1);_0x4ce2d4(_0x523ae1);});});}function respondWithStatusCode(_0x536392,_0x5d1b1d){_0x5d1b1d=_0x5d1b1d||0xcc;return function(_0x1d2d89){if(_0x1d2d89){return _0x536392[_0x4f42('0x22')](_0x5d1b1d);}return _0x536392[_0x4f42('0x23')](_0x5d1b1d)[_0x4f42('0x24')]();};}function respondWithResult(_0x756ff5,_0x31af0b){_0x31af0b=_0x31af0b||0xc8;return function(_0xd4daf0){if(_0xd4daf0){return _0x756ff5['status'](_0x31af0b)[_0x4f42('0x25')](_0xd4daf0);}};}function respondWithFilteredResult(_0x5b556d,_0x1ef797){return function(_0x18de8f){if(_0x18de8f){var _0x483d01=_0x18de8f['count'],_0x50dc1d=_0x1ef797[_0x4f42('0x26')],_0x2a75ab=_0x1ef797[_0x4f42('0x26')]+_0x1ef797['limit'],_0x5f22c6;if(_0x2a75ab>=_0x483d01){_0x2a75ab=_0x483d01;_0x5f22c6=0xc8;}else{_0x5f22c6=0xce;}_0x5b556d[_0x4f42('0x23')](_0x5f22c6);return _0x5b556d[_0x4f42('0x27')](_0x4f42('0x28'),_0x50dc1d+'-'+_0x2a75ab+'/'+_0x483d01)[_0x4f42('0x25')](_0x18de8f);}return null;};}function patchUpdates(_0xdb3c01){return function(_0x14b5d3){try{jsonpatch['apply'](_0x14b5d3,_0xdb3c01,!![]);}catch(_0x2d832d){return BPromise['reject'](_0x2d832d);}return _0x14b5d3[_0x4f42('0x29')]();};}function saveUpdates(_0x173847,_0x2fd896){return function(_0x23c463){if(_0x23c463){return _0x23c463['update'](_0x173847)[_0x4f42('0x17')](function(_0x2f849a){return _0x2f849a;});}return null;};}function removeEntity(_0x77edb7,_0x50cf0a){return function(_0x1356b4){if(_0x1356b4){return _0x1356b4[_0x4f42('0x2a')]()[_0x4f42('0x17')](function(){_0x77edb7['status'](0xcc)[_0x4f42('0x24')]();});}};}function handleEntityNotFound(_0x284d55,_0x4e0884){return function(_0x5ca6a0){if(!_0x5ca6a0){_0x284d55[_0x4f42('0x22')](0x194);}return _0x5ca6a0;};}function handleError(_0x51dd20,_0x54c545){_0x54c545=_0x54c545||0x1f4;return function(_0x3fbeca){logger[_0x4f42('0x1c')](_0x3fbeca[_0x4f42('0x2b')]);if(_0x3fbeca[_0x4f42('0x2c')]){delete _0x3fbeca[_0x4f42('0x2c')];}_0x51dd20[_0x4f42('0x23')](_0x54c545)[_0x4f42('0x2d')](_0x3fbeca);};}exports[_0x4f42('0x2e')]=function(_0x4a51a0,_0x2c9f2f){var _0x22cca4={},_0x542198={},_0x115ffa={'count':0x0,'rows':[]};var _0x4f2464=_[_0x4f42('0x2f')](db[_0x4f42('0x30')][_0x4f42('0x31')],function(_0x51059e){return{'name':_0x51059e[_0x4f42('0x32')],'type':_0x51059e[_0x4f42('0x33')][_0x4f42('0x34')]};});_0x542198['model']=_[_0x4f42('0x2f')](_0x4f2464,_0x4f42('0x2c'));_0x542198['query']=_['keys'](_0x4a51a0[_0x4f42('0x35')]);_0x542198[_0x4f42('0x36')]=_[_0x4f42('0x37')](_0x542198['model'],_0x542198[_0x4f42('0x35')]);_0x22cca4['attributes']=_[_0x4f42('0x37')](_0x542198[_0x4f42('0x38')],qs[_0x4f42('0x39')](_0x4a51a0[_0x4f42('0x35')]['fields']));_0x22cca4[_0x4f42('0x3a')]=_0x22cca4[_0x4f42('0x3a')]['length']?_0x22cca4[_0x4f42('0x3a')]:_0x542198[_0x4f42('0x38')];if(!_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3b')]('nolimit')){_0x22cca4['limit']=qs[_0x4f42('0x3c')](_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3c')]);_0x22cca4['offset']=qs['offset'](_0x4a51a0['query'][_0x4f42('0x26')]);}_0x22cca4[_0x4f42('0x3d')]=qs[_0x4f42('0x3e')](_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3e')]);_0x22cca4[_0x4f42('0x3f')]=qs['filters'](_['pick'](_0x4a51a0['query'],_0x542198[_0x4f42('0x36')]));if(_0x4a51a0[_0x4f42('0x35')]['filter']){_0x22cca4[_0x4f42('0x3f')]=_['merge'](_0x22cca4[_0x4f42('0x3f')],{'$or':_[_0x4f42('0x2f')](_0x4f2464,function(_0x2d5d51){if(_0x2d5d51[_0x4f42('0x33')]!=='VIRTUAL'){var _0x5a0ce7={};_0x5a0ce7[_0x2d5d51['name']]={'$like':'%'+_0x4a51a0[_0x4f42('0x35')]['filter']+'%'};return _0x5a0ce7;}})});}_0x22cca4=_['merge']({},_0x22cca4,_0x4a51a0['options']);var _0x4e5f75={'where':_0x22cca4['where']};return db[_0x4f42('0x30')][_0x4f42('0x40')](_0x4e5f75)['then'](function(_0x161b12){_0x115ffa[_0x4f42('0x40')]=_0x161b12;if(_0x4a51a0[_0x4f42('0x35')]['includeAll']){_0x22cca4[_0x4f42('0x41')]=[{'all':!![]}];}return db[_0x4f42('0x30')][_0x4f42('0x42')](_0x22cca4);})[_0x4f42('0x17')](function(_0x48c708){_0x115ffa[_0x4f42('0x43')]=_0x48c708;return _0x115ffa;})[_0x4f42('0x17')](respondWithFilteredResult(_0x2c9f2f,_0x22cca4))[_0x4f42('0x21')](handleError(_0x2c9f2f,null));};exports[_0x4f42('0x44')]=function(_0x2cd8be,_0x46ce68){var _0x541532={'raw':![],'where':{'id':_0x2cd8be[_0x4f42('0x45')]['id']}},_0x3553d0={};_0x3553d0[_0x4f42('0x38')]=_[_0x4f42('0x46')](db['Setting'][_0x4f42('0x31')]);_0x3553d0[_0x4f42('0x35')]=_[_0x4f42('0x46')](_0x2cd8be[_0x4f42('0x35')]);_0x3553d0[_0x4f42('0x36')]=_[_0x4f42('0x37')](_0x3553d0[_0x4f42('0x38')],_0x3553d0[_0x4f42('0x35')]);_0x541532[_0x4f42('0x3a')]=_[_0x4f42('0x37')](_0x3553d0['model'],qs[_0x4f42('0x39')](_0x2cd8be[_0x4f42('0x35')]['fields']));_0x541532[_0x4f42('0x3a')]=_0x541532[_0x4f42('0x3a')][_0x4f42('0x47')]?_0x541532['attributes']:_0x3553d0['model'];if(_0x2cd8be['query'][_0x4f42('0x48')]){_0x541532[_0x4f42('0x41')]=[{'all':!![]}];}_0x541532=_['merge']({},_0x541532,_0x2cd8be[_0x4f42('0x49')]);return db[_0x4f42('0x30')][_0x4f42('0x4a')](_0x541532)[_0x4f42('0x17')](handleEntityNotFound(_0x46ce68,null))[_0x4f42('0x17')](respondWithResult(_0x46ce68,null))[_0x4f42('0x21')](handleError(_0x46ce68,null));};exports[_0x4f42('0x4b')]=function(_0x715117,_0xfb8520,_0x4af7e5){var _0x5c5a2e;return db[_0x4f42('0x30')]['find']({'where':{'id':_0x715117[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0xfb8520,null))['then'](saveUpdates(_0x715117[_0x4f42('0x4c')],null))[_0x4f42('0x17')](function(_0x274820){if(_0x274820){_0x5c5a2e=_0x274820[_0x4f42('0x4d')]({'plain':!![]});var _0x5f2133=fs[_0x4f42('0x4e')](path['join'](config[_0x4f42('0x4f')],_0x4f42('0x50')),'utf8');var _0x57309b=ejs[_0x4f42('0x51')](_0x5f2133,_0x5c5a2e);var _0x1a4927=fs[_0x4f42('0x4e')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x4f42('0x53')),_0x4f42('0x54'));var _0x5e787e=ejs[_0x4f42('0x51')](_0x1a4927,_0x5c5a2e);fs[_0x4f42('0x55')](_0x4f42('0x56'),_0x57309b);fs[_0x4f42('0x55')](_0x4f42('0x57'),_0x5e787e);return respondWithRpcPromise(_0x4f42('0x58'),_0x4f42('0x4b'),{'module':_0x4f42('0x59')});}})[_0x4f42('0x17')](function(){return respondWithRpcPromise(_0x4f42('0x58'),'update',{'module':_0x4f42('0x5a')});})['then'](function(){return _0x5c5a2e||null;})[_0x4f42('0x17')](respondWithResult(_0xfb8520,null))[_0x4f42('0x21')](handleError(_0xfb8520,null));};exports[_0x4f42('0x5b')]=function(_0x573979,_0x498bfb,_0x4207c0){if(_0x573979[_0x4f42('0x5c')]&&_0x573979[_0x4f42('0x5c')]['filename']){_0x573979[_0x4f42('0x4c')][_0x4f42('0x5d')]=_0x573979[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db['Setting'][_0x4f42('0x4a')]({'where':{'id':_0x573979[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0x498bfb,null))[_0x4f42('0x17')](saveUpdates(_0x573979[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x498bfb,null))['catch'](handleError(_0x498bfb,null));};exports['addLogoLogin']=function(_0xd46172,_0x32b414,_0x4fbb7c){if(_0xd46172[_0x4f42('0x5c')]&&_0xd46172[_0x4f42('0x5c')][_0x4f42('0x5e')]){_0xd46172[_0x4f42('0x4c')][_0x4f42('0x5f')]=_0xd46172[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0xd46172['params']['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0x32b414,null))['then'](saveUpdates(_0xd46172[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x32b414,null))[_0x4f42('0x21')](handleError(_0x32b414,null));};var utilLicense=require(_0x4f42('0x60'));exports['getLogo']=function(_0x4584f6,_0x5bc08b,_0x255293){var _0x2795c4='server/files/images/logos';var _0x329988={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x35db60){if(_0x35db60){_0x329988=_0x35db60;}return db[_0x4f42('0x30')]['find']({'where':{'id':_0x4584f6[_0x4f42('0x45')]['id']},'attributes':['logo','loginLogo',_0x4f42('0x62'),'favicon',_0x4f42('0x63'),_0x4f42('0x64'),_0x4f42('0x65'),_0x4f42('0x66')],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x5bc08b,null))['then'](function(_0x1fa3e8){if(_0x1fa3e8){var _0x5e1858=_0x1fa3e8['logo']&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x2795c4,_['toLower'](_0x1fa3e8['logo'])))?path[_0x4f42('0x52')](config['root'],_0x2795c4,_[_0x4f42('0x68')](_0x1fa3e8[_0x4f42('0x5d')])):path['join'](config['root'],_0x2795c4,_[_0x4f42('0x68')](_0x4f42('0x69')));var _0x46f5fa=_0x4f42('0x6a')+_[_0x4f42('0x6b')](_0x4f42('0x5d'));if(_0x1fa3e8[_0x46f5fa]||!_0x329988[_0x4f42('0x6c')]){_0x5e1858=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x2795c4,_[_0x4f42('0x68')]('default_logo.png'));}if(!fs[_0x4f42('0x67')](_0x5e1858)){throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_[_0x4f42('0x6b')]('logo')+_0x4f42('0x6d'));}return _0x5bc08b[_0x4f42('0x6e')](_0x5e1858);}})[_0x4f42('0x21')](handleError(_0x5bc08b,null));};var utilLicense=require(_0x4f42('0x60'));exports[_0x4f42('0x6f')]=function(_0x559cbd,_0x58562a,_0x5b1712){var _0x29b2f7=_0x4f42('0x70');var _0x472198={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x58a0a7){if(_0x58a0a7){_0x472198=_0x58a0a7;}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x559cbd[_0x4f42('0x45')]['id']},'attributes':[_0x4f42('0x5d'),'loginLogo',_0x4f42('0x62'),'favicon','defaultLogo',_0x4f42('0x64'),_0x4f42('0x65'),'defaultFavicon'],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x58562a,null))[_0x4f42('0x17')](function(_0x447b58){if(_0x447b58){var _0x4ce19a=_0x447b58['loginLogo']&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x29b2f7,_[_0x4f42('0x68')](_0x447b58[_0x4f42('0x5f')])))?path['join'](config[_0x4f42('0x4f')],_0x29b2f7,_['toLower'](_0x447b58['loginLogo'])):path['join'](config['root'],_0x29b2f7,_[_0x4f42('0x68')](_0x4f42('0x71')));var _0x5d2432=_0x4f42('0x6a')+_['upperFirst'](_0x4f42('0x5f'));if(_0x447b58[_0x5d2432]||!_0x472198['custom']){_0x4ce19a=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x29b2f7,_['toLower'](_0x4f42('0x71')));}if(!fs[_0x4f42('0x67')](_0x4ce19a)){throw new db[(_0x4f42('0x13'))]['ValidationError'](_['upperFirst'](_0x4f42('0x5f'))+_0x4f42('0x6d'));}return _0x58562a['download'](_0x4ce19a);}})['catch'](handleError(_0x58562a,null));};exports[_0x4f42('0x72')]=function(_0x3b55a5,_0x1e6a94){return db[_0x4f42('0x30')]['find']({'where':{'id':_0x3b55a5[_0x4f42('0x45')]['id']},'attributes':['securePassword']})[_0x4f42('0x17')](respondWithResult(_0x1e6a94,null))[_0x4f42('0x21')](handleError(_0x1e6a94,null));};exports['addPreferred']=function(_0x24ef5f,_0xfa42f5,_0x204792){if(_0x24ef5f[_0x4f42('0x5c')]&&_0x24ef5f['file']['filename']){_0x24ef5f['body'][_0x4f42('0x62')]=_0x24ef5f[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x24ef5f[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0xfa42f5,null))['then'](saveUpdates(_0x24ef5f[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0xfa42f5,null))[_0x4f42('0x21')](handleError(_0xfa42f5,null));};var utilLicense=require(_0x4f42('0x60'));exports[_0x4f42('0x73')]=function(_0x5b5fbc,_0x357944,_0xae8bf4){var _0x28f49d=_0x4f42('0x70');var _0x3fcc27={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0xacf312){if(_0xacf312){_0x3fcc27=_0xacf312;}return db['Setting'][_0x4f42('0x4a')]({'where':{'id':_0x5b5fbc['params']['id']},'attributes':[_0x4f42('0x5d'),_0x4f42('0x5f'),_0x4f42('0x62'),_0x4f42('0x74'),'defaultLogo',_0x4f42('0x64'),_0x4f42('0x65'),_0x4f42('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x357944,null))[_0x4f42('0x17')](function(_0x4f6cf8){if(_0x4f6cf8){var _0x37c147=_0x4f6cf8[_0x4f42('0x62')]&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x28f49d,_['toLower'](_0x4f6cf8[_0x4f42('0x62')])))?path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x28f49d,_[_0x4f42('0x68')](_0x4f6cf8[_0x4f42('0x62')])):path['join'](config['root'],_0x28f49d,_[_0x4f42('0x68')](_0x4f42('0x75')));var _0x4570f2=_0x4f42('0x6a')+_[_0x4f42('0x6b')](_0x4f42('0x62'));if(_0x4f6cf8[_0x4570f2]||!_0x3fcc27['custom']||!_0x3fcc27[_0x4f42('0x62')]){_0x37c147=path['join'](config[_0x4f42('0x4f')],_0x28f49d,_[_0x4f42('0x68')]('default_preferred.png'));}if(!fs[_0x4f42('0x67')](_0x37c147)){throw new db['Sequelize'][(_0x4f42('0x14'))](_[_0x4f42('0x6b')]('preferred')+_0x4f42('0x6d'));}return _0x357944['download'](_0x37c147);}})[_0x4f42('0x21')](handleError(_0x357944,null));};exports[_0x4f42('0x76')]=function(_0x1e0022,_0x295a82,_0x4dbb36){if(_0x1e0022['file']&&_0x1e0022['file'][_0x4f42('0x5e')]){_0x1e0022[_0x4f42('0x4c')][_0x4f42('0x74')]=_0x1e0022['file'][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x1e0022['params']['id']}})['then'](handleEntityNotFound(_0x295a82,null))[_0x4f42('0x17')](saveUpdates(_0x1e0022[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x295a82,null))['catch'](handleError(_0x295a82,null));};var utilLicense=require('../../config/license/util');exports[_0x4f42('0x77')]=function(_0x571afe,_0x3805ed,_0x24fa3c){var _0xc5dec9=_0x4f42('0x70');var _0x26ba59={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x3c1d2e){if(_0x3c1d2e){_0x26ba59=_0x3c1d2e;}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x571afe['params']['id']},'attributes':[_0x4f42('0x5d'),_0x4f42('0x5f'),_0x4f42('0x62'),_0x4f42('0x74'),_0x4f42('0x63'),'defaultLoginLogo',_0x4f42('0x65'),'defaultFavicon'],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x3805ed,null))[_0x4f42('0x17')](function(_0x519b8d){if(_0x519b8d){var _0x22f40a=_0x519b8d[_0x4f42('0x74')]&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x519b8d[_0x4f42('0x74')])))?path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x519b8d[_0x4f42('0x74')])):path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x4f42('0x78')));var _0x4b05bf=_0x4f42('0x6a')+_[_0x4f42('0x6b')]('favicon');if(_0x519b8d[_0x4b05bf]||!_0x26ba59[_0x4f42('0x6c')]){_0x22f40a=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_['toLower']('default_favicon.ico'));}if(!fs['existsSync'](_0x22f40a)){throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_[_0x4f42('0x6b')](_0x4f42('0x74'))+_0x4f42('0x6d'));}return _0x3805ed[_0x4f42('0x6e')](_0x22f40a);}})[_0x4f42('0x21')](handleError(_0x3805ed,null));};
\ No newline at end of file
+var _0x9b60=['download','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','apply','reject','update','end','stack','name','send','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Setting','findAll','show','params','keys','rawAttributes','include','find','body','file','filename','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','toLower','root','default','default_logo.svg','Sequelize','ValidationError','upperFirst','getLogoLogin','defaultPreferred','custom','default_loginLogo.svg','\x20not\x20found'];(function(_0x5bb3ef,_0x1269f6){var _0x1c1c17=function(_0xaf3ecb){while(--_0xaf3ecb){_0x5bb3ef['push'](_0x5bb3ef['shift']());}};_0x1c1c17(++_0x1269f6);}(_0x9b60,0x174));var _0x09b6=function(_0x538f9f,_0x31210d){_0x538f9f=_0x538f9f-0x0;var _0x4c9ff9=_0x9b60[_0x538f9f];return _0x4c9ff9;};'use strict';var emlformat=require(_0x09b6('0x0'));var rimraf=require(_0x09b6('0x1'));var zipdir=require(_0x09b6('0x2'));var jsonpatch=require(_0x09b6('0x3'));var rp=require(_0x09b6('0x4'));var moment=require(_0x09b6('0x5'));var BPromise=require(_0x09b6('0x6'));var Mustache=require(_0x09b6('0x7'));var util=require('util');var path=require('path');var sox=require(_0x09b6('0x8'));var csv=require(_0x09b6('0x9'));var ejs=require(_0x09b6('0xa'));var fs=require('fs');var fs_extra=require(_0x09b6('0xb'));var _=require(_0x09b6('0xc'));var squel=require(_0x09b6('0xd'));var crypto=require(_0x09b6('0xe'));var jsforce=require(_0x09b6('0xf'));var deskjs=require(_0x09b6('0x10'));var toCsv=require(_0x09b6('0x9'));var querystring=require(_0x09b6('0x11'));var Papa=require(_0x09b6('0x12'));var Redis=require(_0x09b6('0x13'));var authService=require(_0x09b6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x09b6('0x15'));var hardwareService=require(_0x09b6('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x09b6('0x17'));var config=require(_0x09b6('0x18'));var licenseUtil=require(_0x09b6('0x19'));var db=require(_0x09b6('0x1a'))['db'];var jayson=require(_0x09b6('0x1b'));var client=jayson['client'][_0x09b6('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1a0,_0x25e3b6,_0x4b7352,_0x53d356){return new BPromise(function(_0x51a10f,_0xf630f2){var _0x3818d5=_0x53d356||client;return _0x3818d5[_0x09b6('0x1d')](_0x2ac1a0,_0x4b7352)[_0x09b6('0x1e')](function(_0x785343){logger['info'](_0x09b6('0x1f'),_0x25e3b6,_0x09b6('0x20'));logger[_0x09b6('0x21')](_0x09b6('0x22'),_0x25e3b6,_0x09b6('0x20'),JSON['stringify'](_0x785343));if(_0x785343[_0x09b6('0x23')]){if(_0x785343[_0x09b6('0x23')][_0x09b6('0x24')]===0x1f4){logger[_0x09b6('0x23')](_0x09b6('0x1f'),_0x25e3b6,_0x785343['error'][_0x09b6('0x25')]);return _0xf630f2(_0x785343[_0x09b6('0x23')][_0x09b6('0x25')]);}logger[_0x09b6('0x23')](_0x09b6('0x1f'),_0x25e3b6,_0x785343[_0x09b6('0x23')]['message']);return _0x51a10f(_0x785343[_0x09b6('0x23')]['message']);}else{logger[_0x09b6('0x26')](_0x09b6('0x1f'),_0x25e3b6,'request\x20sent');_0x51a10f(_0x785343[_0x09b6('0x27')]['message']);}})[_0x09b6('0x28')](function(_0x700746){logger[_0x09b6('0x23')](_0x09b6('0x1f'),_0x25e3b6,_0x700746);_0xf630f2(_0x700746);});});}function respondWithStatusCode(_0x2f3d61,_0x557cdf){_0x557cdf=_0x557cdf||0xcc;return function(_0x430ec0){if(_0x430ec0){return _0x2f3d61[_0x09b6('0x29')](_0x557cdf);}return _0x2f3d61[_0x09b6('0x2a')](_0x557cdf)['end']();};}function respondWithResult(_0x31226c,_0xb2747f){_0xb2747f=_0xb2747f||0xc8;return function(_0x11d52c){if(_0x11d52c){return _0x31226c[_0x09b6('0x2a')](_0xb2747f)[_0x09b6('0x2b')](_0x11d52c);}};}function respondWithFilteredResult(_0x2bff9f,_0x22474e){return function(_0x348cdb){if(_0x348cdb){var _0x578d73=typeof _0x22474e[_0x09b6('0x2c')]==='undefined'&&typeof _0x22474e['limit']===_0x09b6('0x2d');var _0xd35847=_0x348cdb[_0x09b6('0x2e')];var _0x1c558f=_0x578d73?0x0:_0x22474e[_0x09b6('0x2c')];var _0x28aa08=_0x578d73?_0x348cdb[_0x09b6('0x2e')]:_0x22474e['offset']+_0x22474e[_0x09b6('0x2f')];var _0x3e9fba;if(_0x28aa08>=_0xd35847){_0x28aa08=_0xd35847;_0x3e9fba=0xc8;}else{_0x3e9fba=0xce;}_0x2bff9f[_0x09b6('0x2a')](_0x3e9fba);return _0x2bff9f['set']('Content-Range',_0x1c558f+'-'+_0x28aa08+'/'+_0xd35847)[_0x09b6('0x2b')](_0x348cdb);}return null;};}function patchUpdates(_0x2d9ec4){return function(_0x1bc3b5){try{jsonpatch[_0x09b6('0x30')](_0x1bc3b5,_0x2d9ec4,!![]);}catch(_0x11309b){return BPromise[_0x09b6('0x31')](_0x11309b);}return _0x1bc3b5['save']();};}function saveUpdates(_0x38847f,_0x262c3d){return function(_0x457be7){if(_0x457be7){return _0x457be7[_0x09b6('0x32')](_0x38847f)[_0x09b6('0x1e')](function(_0x2c6465){return _0x2c6465;});}return null;};}function removeEntity(_0x19b9c9,_0x58e4a6){return function(_0x1d8fcf){if(_0x1d8fcf){return _0x1d8fcf['destroy']()[_0x09b6('0x1e')](function(){_0x19b9c9['status'](0xcc)[_0x09b6('0x33')]();});}};}function handleEntityNotFound(_0x33f68c,_0x282efa){return function(_0x4a2e83){if(!_0x4a2e83){_0x33f68c[_0x09b6('0x29')](0x194);}return _0x4a2e83;};}function handleError(_0x1eefa0,_0x72d38b){_0x72d38b=_0x72d38b||0x1f4;return function(_0x4a95d3){logger['error'](_0x4a95d3[_0x09b6('0x34')]);if(_0x4a95d3[_0x09b6('0x35')]){delete _0x4a95d3[_0x09b6('0x35')];}_0x1eefa0[_0x09b6('0x2a')](_0x72d38b)[_0x09b6('0x36')](_0x4a95d3);};}exports['index']=function(_0x40e7cb,_0x1ff6d7){var _0x4d5396={},_0x459e5c={},_0xabccd1={'count':0x0,'rows':[]};var _0x1df249=_['map'](db['Setting']['rawAttributes'],function(_0x15a70){return{'name':_0x15a70[_0x09b6('0x37')],'type':_0x15a70[_0x09b6('0x38')][_0x09b6('0x39')]};});_0x459e5c[_0x09b6('0x3a')]=_['map'](_0x1df249,_0x09b6('0x35'));_0x459e5c[_0x09b6('0x3b')]=_['keys'](_0x40e7cb['query']);_0x459e5c[_0x09b6('0x3c')]=_[_0x09b6('0x3d')](_0x459e5c['model'],_0x459e5c[_0x09b6('0x3b')]);_0x4d5396[_0x09b6('0x3e')]=_['intersection'](_0x459e5c[_0x09b6('0x3a')],qs[_0x09b6('0x3f')](_0x40e7cb['query'][_0x09b6('0x3f')]));_0x4d5396[_0x09b6('0x3e')]=_0x4d5396['attributes'][_0x09b6('0x40')]?_0x4d5396[_0x09b6('0x3e')]:_0x459e5c['model'];if(!_0x40e7cb[_0x09b6('0x3b')][_0x09b6('0x41')](_0x09b6('0x42'))){_0x4d5396[_0x09b6('0x2f')]=qs['limit'](_0x40e7cb['query'][_0x09b6('0x2f')]);_0x4d5396[_0x09b6('0x2c')]=qs['offset'](_0x40e7cb[_0x09b6('0x3b')]['offset']);}_0x4d5396[_0x09b6('0x43')]=qs[_0x09b6('0x44')](_0x40e7cb[_0x09b6('0x3b')][_0x09b6('0x44')]);_0x4d5396[_0x09b6('0x45')]=qs[_0x09b6('0x3c')](_[_0x09b6('0x46')](_0x40e7cb[_0x09b6('0x3b')],_0x459e5c[_0x09b6('0x3c')]),_0x1df249);if(_0x40e7cb[_0x09b6('0x3b')][_0x09b6('0x47')]){_0x4d5396[_0x09b6('0x45')]=_[_0x09b6('0x48')](_0x4d5396[_0x09b6('0x45')],{'$or':_['map'](_0x1df249,function(_0xc3affc){if(_0xc3affc[_0x09b6('0x38')]!=='VIRTUAL'){var _0x5e417e={};_0x5e417e[_0xc3affc['name']]={'$like':'%'+_0x40e7cb['query'][_0x09b6('0x47')]+'%'};return _0x5e417e;}})});}_0x4d5396=_['merge']({},_0x4d5396,_0x40e7cb[_0x09b6('0x49')]);var _0xbb41fc={'where':_0x4d5396[_0x09b6('0x45')]};return db[_0x09b6('0x4a')][_0x09b6('0x2e')](_0xbb41fc)[_0x09b6('0x1e')](function(_0x5a834e){_0xabccd1['count']=_0x5a834e;if(_0x40e7cb['query']['includeAll']){_0x4d5396['include']=[{'all':!![]}];}return db['Setting'][_0x09b6('0x4b')](_0x4d5396);})[_0x09b6('0x1e')](function(_0x3fff30){_0xabccd1['rows']=_0x3fff30;return _0xabccd1;})[_0x09b6('0x1e')](respondWithFilteredResult(_0x1ff6d7,_0x4d5396))[_0x09b6('0x28')](handleError(_0x1ff6d7,null));};exports[_0x09b6('0x4c')]=function(_0x16b945,_0x47783b){var _0x9c2249={'raw':![],'where':{'id':_0x16b945[_0x09b6('0x4d')]['id']}},_0x5a3f68={};_0x5a3f68[_0x09b6('0x3a')]=_[_0x09b6('0x4e')](db[_0x09b6('0x4a')][_0x09b6('0x4f')]);_0x5a3f68[_0x09b6('0x3b')]=_['keys'](_0x16b945[_0x09b6('0x3b')]);_0x5a3f68[_0x09b6('0x3c')]=_[_0x09b6('0x3d')](_0x5a3f68[_0x09b6('0x3a')],_0x5a3f68[_0x09b6('0x3b')]);_0x9c2249[_0x09b6('0x3e')]=_[_0x09b6('0x3d')](_0x5a3f68['model'],qs[_0x09b6('0x3f')](_0x16b945['query'][_0x09b6('0x3f')]));_0x9c2249['attributes']=_0x9c2249[_0x09b6('0x3e')][_0x09b6('0x40')]?_0x9c2249['attributes']:_0x5a3f68['model'];if(_0x16b945[_0x09b6('0x3b')]['includeAll']){_0x9c2249[_0x09b6('0x50')]=[{'all':!![]}];}_0x9c2249=_['merge']({},_0x9c2249,_0x16b945[_0x09b6('0x49')]);return db['Setting'][_0x09b6('0x51')](_0x9c2249)[_0x09b6('0x1e')](handleEntityNotFound(_0x47783b,null))[_0x09b6('0x1e')](respondWithResult(_0x47783b,null))[_0x09b6('0x28')](handleError(_0x47783b,null));};exports[_0x09b6('0x32')]=function(_0x54020c,_0x55cdc8){if(_0x54020c[_0x09b6('0x52')]['id']){delete _0x54020c[_0x09b6('0x52')]['id'];}return db[_0x09b6('0x4a')][_0x09b6('0x51')]({'where':{'id':_0x54020c['params']['id']}})[_0x09b6('0x1e')](handleEntityNotFound(_0x55cdc8,null))[_0x09b6('0x1e')](saveUpdates(_0x54020c[_0x09b6('0x52')],null))[_0x09b6('0x1e')](respondWithResult(_0x55cdc8,null))[_0x09b6('0x28')](handleError(_0x55cdc8,null));};exports['addLogo']=function(_0x16d261,_0x483595,_0x4aae12){if(_0x16d261[_0x09b6('0x53')]&&_0x16d261[_0x09b6('0x53')]['filename']){_0x16d261[_0x09b6('0x52')]['logo']=_0x16d261[_0x09b6('0x53')][_0x09b6('0x54')];}return db[_0x09b6('0x4a')][_0x09b6('0x51')]({'where':{'id':_0x16d261['params']['id']}})[_0x09b6('0x1e')](handleEntityNotFound(_0x483595,null))[_0x09b6('0x1e')](saveUpdates(_0x16d261[_0x09b6('0x52')],null))['then'](respondWithResult(_0x483595,null))[_0x09b6('0x28')](handleError(_0x483595,null));};exports['addLogoLogin']=function(_0x3c308a,_0x149b47,_0x19eaf7){if(_0x3c308a['file']&&_0x3c308a[_0x09b6('0x53')][_0x09b6('0x54')]){_0x3c308a[_0x09b6('0x52')][_0x09b6('0x55')]=_0x3c308a[_0x09b6('0x53')]['filename'];}return db['Setting'][_0x09b6('0x51')]({'where':{'id':_0x3c308a[_0x09b6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x149b47,null))[_0x09b6('0x1e')](saveUpdates(_0x3c308a['body'],null))[_0x09b6('0x1e')](respondWithResult(_0x149b47,null))[_0x09b6('0x28')](handleError(_0x149b47,null));};var utilLicense=require(_0x09b6('0x19'));exports['getLogo']=function(_0x254bf1,_0x37514f,_0x1bec8a){var _0x31b79e=_0x09b6('0x56');var _0x434434={'custom':![]};return utilLicense[_0x09b6('0x57')]()[_0x09b6('0x1e')](function(_0x5a2509){if(_0x5a2509){_0x434434=_0x5a2509;}return db[_0x09b6('0x4a')]['find']({'where':{'id':_0x254bf1[_0x09b6('0x4d')]['id']},'attributes':[_0x09b6('0x58'),_0x09b6('0x55'),_0x09b6('0x59'),_0x09b6('0x5a'),_0x09b6('0x5b'),_0x09b6('0x5c'),'defaultPreferred',_0x09b6('0x5d')],'raw':!![]});})[_0x09b6('0x1e')](handleEntityNotFound(_0x37514f,null))[_0x09b6('0x1e')](function(_0x33009a){if(_0x33009a){var _0x1d98e5=_0x33009a[_0x09b6('0x58')]&&fs[_0x09b6('0x5e')](path[_0x09b6('0x5f')](config['root'],_0x31b79e,_[_0x09b6('0x60')](_0x33009a[_0x09b6('0x58')])))?path[_0x09b6('0x5f')](config[_0x09b6('0x61')],_0x31b79e,_[_0x09b6('0x60')](_0x33009a[_0x09b6('0x58')])):path['join'](config['root'],_0x31b79e,_[_0x09b6('0x60')]('default_logo.svg'));var _0x1671ea=_0x09b6('0x62')+_['upperFirst']('logo');if(_0x33009a[_0x1671ea]||!_0x434434['custom']){_0x1d98e5=path['join'](config['root'],_0x31b79e,_[_0x09b6('0x60')](_0x09b6('0x63')));}if(!fs[_0x09b6('0x5e')](_0x1d98e5)){throw new db[(_0x09b6('0x64'))][(_0x09b6('0x65'))](_[_0x09b6('0x66')]('logo')+'\x20not\x20found');}return _0x37514f['download'](_0x1d98e5);}})[_0x09b6('0x28')](handleError(_0x37514f,null));};var utilLicense=require('../../config/license/util');exports[_0x09b6('0x67')]=function(_0x3ba18f,_0x4ea827,_0x50303e){var _0xe4e31f=_0x09b6('0x56');var _0x569c7b={'custom':![]};return utilLicense[_0x09b6('0x57')]()[_0x09b6('0x1e')](function(_0x26423e){if(_0x26423e){_0x569c7b=_0x26423e;}return db['Setting']['find']({'where':{'id':_0x3ba18f[_0x09b6('0x4d')]['id']},'attributes':[_0x09b6('0x58'),'loginLogo',_0x09b6('0x59'),_0x09b6('0x5a'),_0x09b6('0x5b'),_0x09b6('0x5c'),_0x09b6('0x68'),'defaultFavicon'],'raw':!![]});})[_0x09b6('0x1e')](handleEntityNotFound(_0x4ea827,null))[_0x09b6('0x1e')](function(_0x3fc4d8){if(_0x3fc4d8){var _0x3d9aae=_0x3fc4d8[_0x09b6('0x55')]&&fs[_0x09b6('0x5e')](path[_0x09b6('0x5f')](config[_0x09b6('0x61')],_0xe4e31f,_[_0x09b6('0x60')](_0x3fc4d8[_0x09b6('0x55')])))?path[_0x09b6('0x5f')](config['root'],_0xe4e31f,_[_0x09b6('0x60')](_0x3fc4d8['loginLogo'])):path[_0x09b6('0x5f')](config[_0x09b6('0x61')],_0xe4e31f,_[_0x09b6('0x60')]('default_loginLogo.svg'));var _0x32e5da=_0x09b6('0x62')+_[_0x09b6('0x66')](_0x09b6('0x55'));if(_0x3fc4d8[_0x32e5da]||!_0x569c7b[_0x09b6('0x69')]){_0x3d9aae=path[_0x09b6('0x5f')](config[_0x09b6('0x61')],_0xe4e31f,_[_0x09b6('0x60')](_0x09b6('0x6a')));}if(!fs[_0x09b6('0x5e')](_0x3d9aae)){throw new db[(_0x09b6('0x64'))][(_0x09b6('0x65'))](_[_0x09b6('0x66')](_0x09b6('0x55'))+_0x09b6('0x6b'));}return _0x4ea827[_0x09b6('0x6c')](_0x3d9aae);}})['catch'](handleError(_0x4ea827,null));};exports[_0x09b6('0x6d')]=function(_0x4f9338,_0x583c59){return db[_0x09b6('0x4a')][_0x09b6('0x51')]({'where':{'id':_0x4f9338['params']['id']},'attributes':[_0x09b6('0x6e')]})[_0x09b6('0x1e')](respondWithResult(_0x583c59,null))[_0x09b6('0x28')](handleError(_0x583c59,null));};exports[_0x09b6('0x6f')]=function(_0x2b0bb8,_0x36d21b,_0x3be17a){if(_0x2b0bb8[_0x09b6('0x53')]&&_0x2b0bb8[_0x09b6('0x53')][_0x09b6('0x54')]){_0x2b0bb8[_0x09b6('0x52')][_0x09b6('0x59')]=_0x2b0bb8[_0x09b6('0x53')]['filename'];}return db[_0x09b6('0x4a')][_0x09b6('0x51')]({'where':{'id':_0x2b0bb8['params']['id']}})['then'](handleEntityNotFound(_0x36d21b,null))[_0x09b6('0x1e')](saveUpdates(_0x2b0bb8[_0x09b6('0x52')],null))['then'](respondWithResult(_0x36d21b,null))['catch'](handleError(_0x36d21b,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x2b5dd3,_0x11560f,_0x275045){var _0x458fc6=_0x09b6('0x56');var _0x30b0ff={'custom':![]};return utilLicense[_0x09b6('0x57')]()[_0x09b6('0x1e')](function(_0x3c4cb4){if(_0x3c4cb4){_0x30b0ff=_0x3c4cb4;}return db[_0x09b6('0x4a')]['find']({'where':{'id':_0x2b5dd3['params']['id']},'attributes':['logo','loginLogo',_0x09b6('0x59'),'favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x09b6('0x1e')](handleEntityNotFound(_0x11560f,null))['then'](function(_0xe0a911){if(_0xe0a911){var _0x6037fa=_0xe0a911[_0x09b6('0x59')]&&fs['existsSync'](path['join'](config[_0x09b6('0x61')],_0x458fc6,_[_0x09b6('0x60')](_0xe0a911[_0x09b6('0x59')])))?path['join'](config['root'],_0x458fc6,_[_0x09b6('0x60')](_0xe0a911[_0x09b6('0x59')])):path[_0x09b6('0x5f')](config['root'],_0x458fc6,_['toLower'](_0x09b6('0x70')));var _0x2709b9=_0x09b6('0x62')+_[_0x09b6('0x66')]('preferred');if(_0xe0a911[_0x2709b9]||!_0x30b0ff['custom']||!_0x30b0ff[_0x09b6('0x59')]){_0x6037fa=path[_0x09b6('0x5f')](config['root'],_0x458fc6,_[_0x09b6('0x60')]('default_preferred.png'));}if(!fs[_0x09b6('0x5e')](_0x6037fa)){throw new db[(_0x09b6('0x64'))][(_0x09b6('0x65'))](_['upperFirst'](_0x09b6('0x59'))+_0x09b6('0x6b'));}return _0x11560f[_0x09b6('0x6c')](_0x6037fa);}})['catch'](handleError(_0x11560f,null));};exports[_0x09b6('0x71')]=function(_0x2b8dab,_0x5f5403,_0x5d6714){if(_0x2b8dab[_0x09b6('0x53')]&&_0x2b8dab[_0x09b6('0x53')]['filename']){_0x2b8dab[_0x09b6('0x52')][_0x09b6('0x5a')]=_0x2b8dab[_0x09b6('0x53')][_0x09b6('0x54')];}return db['Setting'][_0x09b6('0x51')]({'where':{'id':_0x2b8dab[_0x09b6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5f5403,null))['then'](saveUpdates(_0x2b8dab[_0x09b6('0x52')],null))['then'](respondWithResult(_0x5f5403,null))[_0x09b6('0x28')](handleError(_0x5f5403,null));};var utilLicense=require(_0x09b6('0x19'));exports['getFavicon']=function(_0x17e281,_0x3a1c69,_0x3dfd8b){var _0x5db262=_0x09b6('0x56');var _0x42e016={'custom':![]};return utilLicense[_0x09b6('0x57')]()[_0x09b6('0x1e')](function(_0x58a18f){if(_0x58a18f){_0x42e016=_0x58a18f;}return db[_0x09b6('0x4a')][_0x09b6('0x51')]({'where':{'id':_0x17e281['params']['id']},'attributes':['logo',_0x09b6('0x55'),_0x09b6('0x59'),_0x09b6('0x5a'),'defaultLogo',_0x09b6('0x5c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x09b6('0x1e')](handleEntityNotFound(_0x3a1c69,null))[_0x09b6('0x1e')](function(_0x208131){if(_0x208131){var _0x2825bc=_0x208131[_0x09b6('0x5a')]&&fs[_0x09b6('0x5e')](path['join'](config[_0x09b6('0x61')],_0x5db262,_[_0x09b6('0x60')](_0x208131[_0x09b6('0x5a')])))?path[_0x09b6('0x5f')](config['root'],_0x5db262,_[_0x09b6('0x60')](_0x208131[_0x09b6('0x5a')])):path[_0x09b6('0x5f')](config[_0x09b6('0x61')],_0x5db262,_['toLower'](_0x09b6('0x72')));var _0x2029dd='default'+_[_0x09b6('0x66')](_0x09b6('0x5a'));if(_0x208131[_0x2029dd]||!_0x42e016[_0x09b6('0x69')]){_0x2825bc=path[_0x09b6('0x5f')](config[_0x09b6('0x61')],_0x5db262,_[_0x09b6('0x60')](_0x09b6('0x72')));}if(!fs[_0x09b6('0x5e')](_0x2825bc)){throw new db[(_0x09b6('0x64'))]['ValidationError'](_[_0x09b6('0x66')]('favicon')+_0x09b6('0x6b'));}return _0x3a1c69[_0x09b6('0x6c')](_0x2825bc);}})[_0x09b6('0x28')](handleError(_0x3a1c69,null));};exports[_0x09b6('0x73')]=function(_0x4ed8ea,_0x39da49){var _0x462346={'offset':moment()[_0x09b6('0x74')]()};_0x462346[_0x09b6('0x75')]=moment()[_0x09b6('0x74')](_0x462346['offset'])[_0x09b6('0x76')](_0x09b6('0x77'));return _0x39da49[_0x09b6('0x2a')](0xc8)['send'](_0x462346);};
\ No newline at end of file