Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / api / voicePrefix / voicePrefix.controller.js
index 00e0adb..6039c94 100644 (file)
@@ -1 +1 @@
-const a746_0x2f69=['update','UserProfileResource','rawAttributes','./voicePrefix.socket','PREFIX-CALLERIDALL=','body','get','model','Set','includeAll','VoicePrefix','description','query','No\x20callerid\x20available','autoAssociation','emit','sequelize','api','send','userProfileId','key','destroy','VoicePrefixes','like','lodash','map','system-','goto','VIRTUAL','priority','type','fields','then','user','filter','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','where','catch','json','offset','options','VoicePrefixId','limit','Content-Range','../../components/parsers/qs','userVoicePrefix:remove','role','pick','getAgents','addAgents','params','NoOp','findOne','User','create','sendStatus','nolimit','fieldName','CDR(prefix)=','attributes','show','count','rows','UserProfileSection','include','ids','merge','keys','omit','bulkCreate','error','intersection','push','undefined','length','filters','VoiceExtension','${EXTEN:','sort','context','charAt','prefix','app','status','from-sip','register','findAll','index','callerIdAll','end','name','stack','Voice\x20Prefix'];(function(_0xa30956,_0x2f692b){const _0x566f1c=function(_0x1b77e4){while(--_0x1b77e4){_0xa30956['push'](_0xa30956['shift']());}};_0x566f1c(++_0x2f692b);}(a746_0x2f69,0x110));const a746_0x566f=function(_0xa30956,_0x2f692b){_0xa30956=_0xa30956-0x0;let _0x566f1c=a746_0x2f69[_0xa30956];return _0x566f1c;};const _0x4f352d=a746_0x566f;'use strict';const _=require(_0x4f352d('0x1f')),qs=require(_0x4f352d('0x33')),logger=require('../../config/logger')(_0x4f352d('0x18')),{getSocket}=require('../../rediscache'),socket=getSocket(),db=require('../../mysqldb')['db'],{Op}=require('sequelize');require(_0x4f352d('0xa'))[_0x4f352d('0x5c')](socket);function respondWithStatusCode(_0x1b77e4,_0x5c45ce){return _0x5c45ce=_0x5c45ce||0xcc,function(_0x521114){const _0x1c274b=a746_0x566f;if(_0x521114)return _0x1b77e4[_0x1c274b('0x3e')](_0x5c45ce);return _0x1b77e4[_0x1c274b('0x5a')](_0x5c45ce)[_0x1c274b('0x3')]();};}function respondWithResult(_0x1def9e,_0x11ced8){return _0x11ced8=_0x11ced8||0xc8,function(_0x5414d7){if(_0x5414d7)return _0x1def9e['status'](_0x11ced8)['json'](_0x5414d7);};}function respondWithFilteredResult(_0x218605,_0x5ccc92){return function(_0x47d627){const _0x2ccc45=a746_0x566f;if(_0x47d627){const _0x33bdfc=_0x47d627['count'],_0x5802f1=_0x5ccc92[_0x2ccc45('0x2e')];let _0x4f59a1=_0x5ccc92[_0x2ccc45('0x2e')]+_0x5ccc92[_0x2ccc45('0x31')],_0x230b13;return _0x4f59a1>=_0x33bdfc?(_0x4f59a1=_0x33bdfc,_0x230b13=0xc8):_0x230b13=0xce,_0x218605[_0x2ccc45('0x5a')](_0x230b13),_0x218605['set'](_0x2ccc45('0x32'),_0x5802f1+'-'+_0x4f59a1+'/'+_0x33bdfc)[_0x2ccc45('0x2d')](_0x47d627);}return null;};}function removeEntity(_0xf02351){return function(_0x4e3374){const _0x20d144=a746_0x566f;if(_0x4e3374)return _0x4e3374['destroy']()[_0x20d144('0x27')](function(){const _0x49f0d0=_0x20d144,_0x5108f2=_0x4e3374[_0x49f0d0('0xd')]({'plain':!![]}),_0x40f6aa=_0x49f0d0('0x1d');return db[_0x49f0d0('0x8')][_0x49f0d0('0x1c')]({'where':{'type':_0x40f6aa,'resourceId':_0x5108f2['id']}})['then'](function(){return _0x4e3374;});})[_0x20d144('0x27')](function(){const _0x2a1848=_0x20d144;_0xf02351[_0x2a1848('0x5a')](0xcc)[_0x2a1848('0x3')]();});};}function handleEntityNotFound(_0x288de1){return function(_0x243d8b){const _0x4de937=a746_0x566f;return!_0x243d8b&&_0x288de1[_0x4de937('0x3e')](0x194),_0x243d8b;};}function handleError(_0xbb9301,_0x10916b){return _0x10916b=_0x10916b||0x1f4,function(_0x3b6aad){const _0xf4e07c=a746_0x566f;logger[_0xf4e07c('0x4d')](_0x3b6aad[_0xf4e07c('0x5')]),_0x3b6aad[_0xf4e07c('0x4')]&&delete _0x3b6aad['name'],_0xbb9301[_0xf4e07c('0x5a')](_0x10916b)[_0xf4e07c('0x19')](_0x3b6aad);};}exports[_0x4f352d('0x1')]=function(_0x10e741,_0x566f13){const _0x1fcfe7=_0x4f352d;let _0x14d53f={};const _0x1174cf={},_0x5997b2={'count':0x0,'rows':[]},_0x32f280=_[_0x1fcfe7('0x20')](db[_0x1fcfe7('0x11')]['rawAttributes'],function(_0x1666d2){const _0x3b9ed0=_0x1fcfe7;return{'name':_0x1666d2[_0x3b9ed0('0x40')],'type':_0x1666d2[_0x3b9ed0('0x25')][_0x3b9ed0('0x1b')]};});_0x1174cf[_0x1fcfe7('0xe')]=_[_0x1fcfe7('0x20')](_0x32f280,_0x1fcfe7('0x4')),_0x1174cf[_0x1fcfe7('0x13')]=_[_0x1fcfe7('0x4a')](_0x10e741[_0x1fcfe7('0x13')]),_0x1174cf[_0x1fcfe7('0x52')]=_[_0x1fcfe7('0x4e')](_0x1174cf[_0x1fcfe7('0xe')],_0x1174cf[_0x1fcfe7('0x13')]),_0x14d53f[_0x1fcfe7('0x42')]=_[_0x1fcfe7('0x4e')](_0x1174cf[_0x1fcfe7('0xe')],qs[_0x1fcfe7('0x26')](_0x10e741[_0x1fcfe7('0x13')][_0x1fcfe7('0x26')])),_0x14d53f[_0x1fcfe7('0x42')]=_0x14d53f[_0x1fcfe7('0x42')][_0x1fcfe7('0x51')]?_0x14d53f[_0x1fcfe7('0x42')]:_0x1174cf[_0x1fcfe7('0xe')];typeof _0x10e741[_0x1fcfe7('0x13')][_0x1fcfe7('0x3f')]==='undefined'&&(_0x14d53f[_0x1fcfe7('0x31')]=qs[_0x1fcfe7('0x31')](_0x10e741[_0x1fcfe7('0x13')][_0x1fcfe7('0x31')]),_0x14d53f[_0x1fcfe7('0x2e')]=qs['offset'](_0x10e741['query'][_0x1fcfe7('0x2e')]));_0x14d53f['order']=qs[_0x1fcfe7('0x55')](_0x10e741[_0x1fcfe7('0x13')][_0x1fcfe7('0x55')]),_0x14d53f[_0x1fcfe7('0x2b')]=qs['filters'](_[_0x1fcfe7('0x36')](_0x10e741['query'],_0x1174cf['filters']),_0x32f280);_0x10e741[_0x1fcfe7('0x13')][_0x1fcfe7('0x29')]&&(_0x14d53f[_0x1fcfe7('0x2b')]=_[_0x1fcfe7('0x49')](_0x14d53f[_0x1fcfe7('0x2b')],{[Op['or']]:_[_0x1fcfe7('0x20')](_0x32f280,function(_0x5ce19e){const _0x1b8ce3=_0x1fcfe7;if(_0x5ce19e[_0x1b8ce3('0x25')]!==_0x1b8ce3('0x23')){const _0x3bb574={};return _0x3bb574[_0x5ce19e[_0x1b8ce3('0x4')]]={[Op[_0x1b8ce3('0x1e')]]:'%'+_0x10e741['query'][_0x1b8ce3('0x29')]+'%'},_0x3bb574;}})}));_0x14d53f=_[_0x1fcfe7('0x49')]({},_0x14d53f,_0x10e741[_0x1fcfe7('0x2f')]);const _0x2e91aa={'where':_0x14d53f['where']};return db[_0x1fcfe7('0x11')]['count'](_0x2e91aa)[_0x1fcfe7('0x27')](function(_0x1af3ea){const _0xaff328=_0x1fcfe7;return _0x5997b2[_0xaff328('0x44')]=_0x1af3ea,_0x10e741['query']['includeAll']&&(_0x14d53f[_0xaff328('0x47')]=[{'all':!![]}]),db[_0xaff328('0x11')][_0xaff328('0x0')](_0x14d53f);})[_0x1fcfe7('0x27')](function(_0x3c38fb){const _0x4ea05c=_0x1fcfe7;return _0x5997b2[_0x4ea05c('0x45')]=_0x3c38fb,_0x5997b2;})['then'](respondWithFilteredResult(_0x566f13,_0x14d53f))[_0x1fcfe7('0x2c')](handleError(_0x566f13,null));},exports[_0x4f352d('0x43')]=function(_0x57bcc5,_0x49fc3e){const _0x2518e4=_0x4f352d;let _0x119a22={'raw':![],'where':{'id':_0x57bcc5[_0x2518e4('0x39')]['id']}};const _0x1e5685={};return _0x1e5685['model']=_['keys'](db[_0x2518e4('0x11')][_0x2518e4('0x9')]),_0x1e5685[_0x2518e4('0x13')]=_['keys'](_0x57bcc5['query']),_0x1e5685[_0x2518e4('0x52')]=_[_0x2518e4('0x4e')](_0x1e5685[_0x2518e4('0xe')],_0x1e5685['query']),_0x119a22[_0x2518e4('0x42')]=_[_0x2518e4('0x4e')](_0x1e5685[_0x2518e4('0xe')],qs[_0x2518e4('0x26')](_0x57bcc5[_0x2518e4('0x13')]['fields'])),_0x119a22[_0x2518e4('0x42')]=_0x119a22[_0x2518e4('0x42')]['length']?_0x119a22[_0x2518e4('0x42')]:_0x1e5685[_0x2518e4('0xe')],_0x57bcc5[_0x2518e4('0x13')][_0x2518e4('0x10')]&&(_0x119a22['include']=[{'all':!![]}]),_0x119a22=_[_0x2518e4('0x49')]({},_0x119a22,_0x57bcc5[_0x2518e4('0x2f')]),db[_0x2518e4('0x11')][_0x2518e4('0x3b')](_0x119a22)[_0x2518e4('0x27')](handleEntityNotFound(_0x49fc3e,null))[_0x2518e4('0x27')](respondWithResult(_0x49fc3e,null))[_0x2518e4('0x2c')](handleError(_0x49fc3e,null));},exports[_0x4f352d('0x1c')]=function(_0x3eecc5,_0x363db1){const _0x4ea2d6=_0x4f352d;return db[_0x4ea2d6('0x11')][_0x4ea2d6('0x3b')]({'where':{'id':_0x3eecc5[_0x4ea2d6('0x39')]['id']}})['then'](handleEntityNotFound(_0x363db1,null))[_0x4ea2d6('0x27')](removeEntity(_0x363db1,null))['catch'](handleError(_0x363db1,null));},exports['describe']=function(_0x34a993,_0x38008d){const _0x4e1e06=_0x4f352d;return db['VoicePrefix']['describe']()[_0x4e1e06('0x27')](respondWithResult(_0x38008d,null))['catch'](handleError(_0x38008d,null));},exports['create']=function(_0x3c9949,_0x1f3db1){const _0x2b187b=_0x4f352d;let _0x2efc4d;return db[_0x2b187b('0x17')]['transaction'](function(_0x233d7b){const _0x35b225=_0x2b187b;return db[_0x35b225('0x11')][_0x35b225('0x3d')](_0x3c9949[_0x35b225('0xc')],{'transaction':_0x233d7b})[_0x35b225('0x27')](function(_0x4ead80){const _0x2bebd1=_0x35b225;return _0x2efc4d=_0x4ead80[_0x2bebd1('0xd')]({'plain':!![]}),db[_0x2bebd1('0x53')][_0x2bebd1('0x3b')]({'where':{'id':_0x2efc4d['VoiceExtensionId']},'raw':!![]})[_0x2bebd1('0x27')](function(_0x697308){return createVoicePrefixExtensions(_0x2efc4d,_0x697308,_0x233d7b);});});})[_0x2b187b('0x27')](function(){const _0x7d96c4=_0x2b187b,_0x5ae27e=_0x3c9949[_0x7d96c4('0x28')][_0x7d96c4('0xd')]({'plain':!![]});if(!_0x5ae27e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ae27e[_0x7d96c4('0x35')]===_0x7d96c4('0x28')){const _0x8a2ad0=_0x2efc4d;return db[_0x7d96c4('0x46')][_0x7d96c4('0x3b')]({'where':{'name':_0x7d96c4('0x1d'),'userProfileId':_0x5ae27e[_0x7d96c4('0x1a')]},'raw':!![]})['then'](function(_0x385f7d){const _0x1692e7=_0x7d96c4;return _0x385f7d&&_0x385f7d[_0x1692e7('0x15')]===0x0?db[_0x1692e7('0x8')][_0x1692e7('0x3d')]({'name':_0x8a2ad0[_0x1692e7('0x4')],'resourceId':_0x8a2ad0['id'],'type':_0x385f7d[_0x1692e7('0x4')],'sectionId':_0x385f7d['id']},{})[_0x1692e7('0x27')](function(){return _0x2efc4d;}):_0x2efc4d;})['catch'](function(_0x15206b){const _0xf331b0=_0x7d96c4;logger['error'](_0xf331b0('0x2a'),_0x15206b);throw _0x15206b;});}return _0x2efc4d;})[_0x2b187b('0x27')](respondWithResult(_0x1f3db1,null))[_0x2b187b('0x2c')](handleError(_0x1f3db1,null));};function Extension(_0x3cb590,_0x4f303f,_0x206b6c,_0x4da8ee){const _0x3a120e=_0x4f352d;this[_0x3a120e('0x56')]=_0x3a120e('0x5b'),this['exten']=_0x3cb590,this[_0x3a120e('0x59')]=_0x206b6c,this[_0x3a120e('0x25')]='system',this[_0x3a120e('0x12')]='Voice\x20Prefix\x20Extension',this[_0x3a120e('0x24')]=_0x4f303f,this['appdata']=_0x4da8ee;}function createVoicePrefixExtensions(_0x16245a,_0x471a4d,_0x5d244b){return new Promise(function(_0x308eb4,_0x4026f3){const _0xf6eb3e=a746_0x566f,_0x547660=new Extension(formatPrefixName(_0x16245a['prefix']),0x1,_0xf6eb3e('0x3a'),_0xf6eb3e('0x6'));return _0x547660[_0xf6eb3e('0x30')]=_0x16245a['id'],db['VoiceExtension'][_0xf6eb3e('0x3d')](_0x547660,{'transaction':_0x5d244b})[_0xf6eb3e('0x27')](function(_0x52e42a){const _0x503df6=_0xf6eb3e,_0x50a284=_0x52e42a[_0x503df6('0xd')]({'plain':!![]}),_0xa73cdd=_[_0x503df6('0x20')](addVoicePrefixExtensions(_0x16245a,_0x471a4d),function(_0x490065){const _0x3d8bc6=_0x503df6;return _0x490065['VoiceExtensionId']=_0x50a284['id'],_0x490065[_0x3d8bc6('0x30')]=_0x16245a['id'],_0x490065;});return db['VoiceExtension'][_0x503df6('0x4c')](_0xa73cdd,{'transaction':_0x5d244b})[_0x503df6('0x27')](function(_0x15a9b1){return!_0x15a9b1?_0x4026f3('Extensions\x20creation\x20failed'):_0x308eb4(_0x15a9b1);})[_0x503df6('0x2c')](function(_0x2848ee){return _0x4026f3(_0x2848ee);});});});}function addVoicePrefixExtensions(_0x68842a,_0xe98ab9){const _0x5227f7=_0x4f352d,_0xb6e17e=[],_0x1df3df=formatPrefixName(_0x68842a[_0x5227f7('0x58')]);return _0xb6e17e[_0x5227f7('0x4f')](new Extension(_0x1df3df,0x2,_0x5227f7('0xf'),_0x5227f7('0x41')+_0x68842a['name'])),_0x68842a[_0x5227f7('0x2')]?_0xb6e17e[_0x5227f7('0x4f')](new Extension(_0x1df3df,0x3,_0x5227f7('0xf'),_0x5227f7('0xb')+_0x68842a[_0x5227f7('0x2')])):_0xb6e17e[_0x5227f7('0x4f')](new Extension(_0x1df3df,0x3,_0x5227f7('0x3a'),_0x5227f7('0x14'))),_0xb6e17e[_0x5227f7('0x4f')](new Extension(_0x1df3df,0x4,_0x5227f7('0x22'),_0xe98ab9[_0x5227f7('0x56')]+','+_0x5227f7('0x54')+(0x8+_0x68842a['name']['length'])+'}'+','+0x1)),_0xb6e17e;}function formatPrefixName(_0x1cd9fb){const _0x4a119e=_0x4f352d;let _0x5a8acf='_';for(let _0x4c571c=0x0;_0x4c571c<_0x1cd9fb[_0x4a119e('0x51')];_0x4c571c++){_0x1cd9fb[_0x4a119e('0x57')](_0x4c571c)=='-'?_0x5a8acf+=_0x1cd9fb[_0x4a119e('0x57')](_0x4c571c):_0x5a8acf+='['+_0x1cd9fb[_0x4a119e('0x57')](_0x4c571c)+']';}return _0x5a8acf+='.',_0x5a8acf;}exports[_0x4f352d('0x7')]=function(_0x3e9feb,_0x1cfd8a){const _0x3cdde9=_0x4f352d,_0x4a988f=_0x3e9feb['body'];return _0x4a988f[_0x3cdde9('0x58')]=_0x3cdde9('0x21')+_0x4a988f['name']+'-',db[_0x3cdde9('0x17')]['transaction'](function(_0x15f667){const _0x1edc25=_0x3cdde9;return db[_0x1edc25('0x11')]['update'](_0x4a988f,{'where':{'id':_0x4a988f['id']},'transaction':_0x15f667})[_0x1edc25('0x27')](function(){const _0x236936=_0x1edc25;return db['VoiceExtension'][_0x236936('0x1c')]({'where':{'VoicePrefixId':_0x4a988f['id']},'transaction':_0x15f667})[_0x236936('0x27')](function(){const _0xc68c09=_0x236936;return db[_0xc68c09('0x53')][_0xc68c09('0x3b')]({'where':{'id':_0x4a988f['VoiceExtensionId']},'raw':!![]})[_0xc68c09('0x27')](function(_0x298b94){return createVoicePrefixExtensions(_0x4a988f,_0x298b94,_0x15f667);});});});})[_0x3cdde9('0x27')](function(){return db['VoicePrefix']['findByPk'](_0x4a988f['id']);})[_0x3cdde9('0x27')](respondWithResult(_0x1cfd8a,null))[_0x3cdde9('0x2c')](handleError(_0x1cfd8a,null));},exports[_0x4f352d('0x38')]=function(_0x3b9ebb,_0x18b2c5){const _0x104ca8=_0x4f352d;return db['VoicePrefix'][_0x104ca8('0x3b')]({'where':{'id':_0x3b9ebb['params']['id']}})[_0x104ca8('0x27')](function(_0x1e1388){const _0x5418b2=_0x104ca8;if(_0x1e1388)return _0x1e1388[_0x5418b2('0x38')](_0x3b9ebb[_0x5418b2('0xc')]['ids'],{'through':_[_0x5418b2('0x4b')](_0x3b9ebb['body'],[_0x5418b2('0x48'),'id'])})[_0x5418b2('0x27')](function(_0x4b2b3a){const _0xac1c38=_0x5418b2;for(let _0x5ecbd9=0x0;_0x5ecbd9<_0x3b9ebb[_0xac1c38('0xc')][_0xac1c38('0x48')][_0xac1c38('0x51')];_0x5ecbd9+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':_0x3b9ebb[_0xac1c38('0xc')][_0xac1c38('0x48')][_0x5ecbd9],'VoicePrefixId':_0x3b9ebb[_0xac1c38('0x39')]['id']});}return _0x4b2b3a;});})['then'](respondWithResult(_0x18b2c5,null))[_0x104ca8('0x2c')](handleError(_0x18b2c5,null));},exports['removeAgents']=function(_0x36a76f,_0x406bbb){const _0x1118fd=_0x4f352d;return db[_0x1118fd('0x11')][_0x1118fd('0x3b')]({'where':{'id':_0x36a76f[_0x1118fd('0x39')]['id']}})['then'](handleEntityNotFound(_0x406bbb,null))[_0x1118fd('0x27')](function(_0x5c3c64){const _0x247a9a=_0x1118fd;if(_0x5c3c64)return _0x5c3c64['removeAgents'](_0x36a76f[_0x247a9a('0x13')]['ids'])[_0x247a9a('0x27')](function(){const _0x28b593=_0x247a9a;if(_['isArray'](_0x36a76f[_0x28b593('0x13')][_0x28b593('0x48')]))for(let _0x5a8fdc=0x0;_0x5a8fdc<_0x36a76f['query'][_0x28b593('0x48')][_0x28b593('0x51')];_0x5a8fdc+=0x1){socket[_0x28b593('0x16')](_0x28b593('0x34'),{'UserId':Number(_0x36a76f[_0x28b593('0x13')][_0x28b593('0x48')][_0x5a8fdc]),'VoicePrefixId':Number(_0x36a76f['params']['id'])});}else socket[_0x28b593('0x16')](_0x28b593('0x34'),{'UserId':Number(_0x36a76f[_0x28b593('0x13')][_0x28b593('0x48')]),'VoicePrefixId':Number(_0x36a76f[_0x28b593('0x39')]['id'])});});})[_0x1118fd('0x27')](respondWithStatusCode(_0x406bbb,null))[_0x1118fd('0x2c')](handleError(_0x406bbb,null));},exports[_0x4f352d('0x37')]=function(_0x1add55,_0x2ec2d2){const _0x1264a5=_0x4f352d;let _0x28209d={};const _0x52942f={};let _0xa4e798,_0x41fb30;return db[_0x1264a5('0x11')][_0x1264a5('0x3b')]({'where':{'id':_0x1add55[_0x1264a5('0x39')]['id']}})[_0x1264a5('0x27')](handleEntityNotFound(_0x2ec2d2,null))[_0x1264a5('0x27')](function(_0x415d92){const _0x812f9f=_0x1264a5;if(_0x415d92)return _0xa4e798=_0x415d92,_0x52942f['model']=_[_0x812f9f('0x4a')](db[_0x812f9f('0x3c')]['rawAttributes']),_0x52942f['query']=_[_0x812f9f('0x4a')](_0x1add55['query']),_0x52942f[_0x812f9f('0x52')]=_[_0x812f9f('0x4e')](_0x52942f[_0x812f9f('0xe')],_0x52942f[_0x812f9f('0x13')]),_0x28209d[_0x812f9f('0x42')]=_['intersection'](_0x52942f[_0x812f9f('0xe')],qs[_0x812f9f('0x26')](_0x1add55[_0x812f9f('0x13')][_0x812f9f('0x26')])),_0x28209d[_0x812f9f('0x42')]=_0x28209d[_0x812f9f('0x42')][_0x812f9f('0x51')]?_0x28209d[_0x812f9f('0x42')]:_0x52942f[_0x812f9f('0xe')],_0x28209d['order']=qs[_0x812f9f('0x55')](_0x1add55[_0x812f9f('0x13')][_0x812f9f('0x55')]),_0x28209d[_0x812f9f('0x2b')]=qs[_0x812f9f('0x52')](_[_0x812f9f('0x36')](_0x1add55['query'],_0x52942f['filters'])),_0x1add55['query'][_0x812f9f('0x29')]&&(_0x28209d[_0x812f9f('0x2b')]=_[_0x812f9f('0x49')](_0x28209d['where'],{[Op['or']]:_['map'](_0x28209d['attributes'],function(_0x4e1ae1){const _0x31a4e7=_0x812f9f,_0x14a281={};return _0x14a281[_0x4e1ae1]={[Op[_0x31a4e7('0x1e')]]:'%'+_0x1add55[_0x31a4e7('0x13')]['filter']+'%'},_0x14a281;})})),_0x28209d=_[_0x812f9f('0x49')]({},_0x28209d,_0x1add55[_0x812f9f('0x2f')]),_0xa4e798[_0x812f9f('0x37')](_0x28209d);})['then'](function(_0x50bf0b){const _0x15162b=_0x1264a5;if(_0x50bf0b)return _0x41fb30=_0x50bf0b[_0x15162b('0x51')],typeof _0x1add55['query'][_0x15162b('0x3f')]===_0x15162b('0x50')&&(_0x28209d[_0x15162b('0x31')]=qs[_0x15162b('0x31')](_0x1add55[_0x15162b('0x13')]['limit']),_0x28209d['offset']=qs[_0x15162b('0x2e')](_0x1add55['query']['offset'])),_0xa4e798[_0x15162b('0x37')](_0x28209d);})[_0x1264a5('0x27')](function(_0x118c21){if(_0x118c21)return _0x118c21?{'count':_0x41fb30,'rows':_0x118c21}:null;})[_0x1264a5('0x27')](respondWithResult(_0x2ec2d2,null))[_0x1264a5('0x2c')](handleError(_0x2ec2d2,null));};
\ No newline at end of file
+const a746_0x2d48=['transaction','goto','./voicePrefix.socket','error','Set','get','stack','create','VIRTUAL','VoicePrefixes','prefix','VoicePrefixId','describe','map','sort','sendStatus','No\x20callerid\x20available','body','includeAll','type','UserProfileResource','filter','attributes','addAgents','offset','set','fieldName','ids','User','charAt','removeAgents','count','lodash','user','params','keys','order','end','sequelize','status','findByPk','emit','like','key','userVoicePrefix:save','system','bulkCreate','json','findOne','then','catch','../../components/parsers/qs','appdata','destroy','push','intersection','userVoicePrefix:remove','role','VoicePrefix','findAll','show','VoiceExtensionId','where','name','merge','../../mysqldb','VoiceExtension','exten','limit','UserProfileSection','nolimit','context','fields','undefined','model','app','priority','query','../../config/logger','length','getAgents','Content-Range','filters','NoOp','rawAttributes','send','Extensions\x20creation\x20failed','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','pick','isArray','Voice\x20Prefix','Voice\x20Prefix\x20Extension','update','options','api','callerIdAll','PREFIX-CALLERIDALL=','from-sip','description'];(function(_0xe740b9,_0x2d48d4){const _0x35bdfc=function(_0x2d737c){while(--_0x2d737c){_0xe740b9['push'](_0xe740b9['shift']());}};_0x35bdfc(++_0x2d48d4);}(a746_0x2d48,0x146));const a746_0x35bd=function(_0xe740b9,_0x2d48d4){_0xe740b9=_0xe740b9-0x0;let _0x35bdfc=a746_0x2d48[_0xe740b9];return _0x35bdfc;};const _0x1255d3=a746_0x35bd;'use strict';const _=require(_0x1255d3('0x6')),qs=require(_0x1255d3('0x19')),logger=require(_0x1255d3('0x34'))(_0x1255d3('0x45')),{getSocket}=require('../../rediscache'),socket=getSocket(),db=require(_0x1255d3('0x27'))['db'],{Op}=require('sequelize');require(_0x1255d3('0x4c'))['register'](socket);function respondWithStatusCode(_0x2d737c,_0x32c97f){return _0x32c97f=_0x32c97f||0xcc,function(_0x3e5d07){const _0x538234=a746_0x35bd;if(_0x3e5d07)return _0x2d737c['sendStatus'](_0x32c97f);return _0x2d737c[_0x538234('0xd')](_0x32c97f)[_0x538234('0xb')]();};}function respondWithResult(_0x2345b6,_0x526120){return _0x526120=_0x526120||0xc8,function(_0x303381){const _0x57ba04=a746_0x35bd;if(_0x303381)return _0x2345b6[_0x57ba04('0xd')](_0x526120)[_0x57ba04('0x15')](_0x303381);};}function respondWithFilteredResult(_0x34f0d3,_0x5df4f3){return function(_0x2245a6){const _0x137fc2=a746_0x35bd;if(_0x2245a6){const _0x381215=_0x2245a6[_0x137fc2('0x5')],_0x2109d1=_0x5df4f3['offset'];let _0xd57c34=_0x5df4f3['offset']+_0x5df4f3[_0x137fc2('0x2a')],_0x1e75b0;return _0xd57c34>=_0x381215?(_0xd57c34=_0x381215,_0x1e75b0=0xc8):_0x1e75b0=0xce,_0x34f0d3[_0x137fc2('0xd')](_0x1e75b0),_0x34f0d3[_0x137fc2('0x63')](_0x137fc2('0x37'),_0x2109d1+'-'+_0xd57c34+'/'+_0x381215)[_0x137fc2('0x15')](_0x2245a6);}return null;};}function removeEntity(_0x3a598e){return function(_0x82b983){const _0x15058f=a746_0x35bd;if(_0x82b983)return _0x82b983[_0x15058f('0x1b')]()[_0x15058f('0x17')](function(){const _0x51eccc=_0x15058f,_0x3cce5d=_0x82b983[_0x51eccc('0x4f')]({'plain':!![]}),_0x119d82=_0x51eccc('0x53');return db[_0x51eccc('0x5e')][_0x51eccc('0x1b')]({'where':{'type':_0x119d82,'resourceId':_0x3cce5d['id']}})[_0x51eccc('0x17')](function(){return _0x82b983;});})[_0x15058f('0x17')](function(){const _0x36aea9=_0x15058f;_0x3a598e[_0x36aea9('0xd')](0xcc)[_0x36aea9('0xb')]();});};}function handleEntityNotFound(_0x32a749){return function(_0x671857){const _0x39ec6f=a746_0x35bd;return!_0x671857&&_0x32a749[_0x39ec6f('0x59')](0x194),_0x671857;};}function handleError(_0xa74e63,_0x47fb7c){return _0x47fb7c=_0x47fb7c||0x1f4,function(_0x2d1f2d){const _0x2e839c=a746_0x35bd;logger[_0x2e839c('0x4d')](_0x2d1f2d[_0x2e839c('0x50')]),_0x2d1f2d[_0x2e839c('0x25')]&&delete _0x2d1f2d['name'],_0xa74e63[_0x2e839c('0xd')](_0x47fb7c)[_0x2e839c('0x3b')](_0x2d1f2d);};}exports['index']=function(_0x2dcc0b,_0x61e882){const _0xf4d73b=_0x1255d3;let _0xc588f9={};const _0x49a1cf={},_0x1213bd={'count':0x0,'rows':[]},_0x52d01c=_[_0xf4d73b('0x57')](db[_0xf4d73b('0x20')][_0xf4d73b('0x3a')],function(_0x241e60){const _0x5d7c50=_0xf4d73b;return{'name':_0x241e60[_0x5d7c50('0x0')],'type':_0x241e60[_0x5d7c50('0x5d')][_0x5d7c50('0x11')]};});_0x49a1cf[_0xf4d73b('0x30')]=_[_0xf4d73b('0x57')](_0x52d01c,_0xf4d73b('0x25')),_0x49a1cf[_0xf4d73b('0x33')]=_['keys'](_0x2dcc0b[_0xf4d73b('0x33')]),_0x49a1cf[_0xf4d73b('0x38')]=_['intersection'](_0x49a1cf[_0xf4d73b('0x30')],_0x49a1cf[_0xf4d73b('0x33')]),_0xc588f9[_0xf4d73b('0x60')]=_[_0xf4d73b('0x1d')](_0x49a1cf['model'],qs[_0xf4d73b('0x2e')](_0x2dcc0b['query']['fields'])),_0xc588f9[_0xf4d73b('0x60')]=_0xc588f9[_0xf4d73b('0x60')]['length']?_0xc588f9[_0xf4d73b('0x60')]:_0x49a1cf[_0xf4d73b('0x30')];typeof _0x2dcc0b['query'][_0xf4d73b('0x2c')]===_0xf4d73b('0x2f')&&(_0xc588f9['limit']=qs['limit'](_0x2dcc0b[_0xf4d73b('0x33')]['limit']),_0xc588f9[_0xf4d73b('0x62')]=qs[_0xf4d73b('0x62')](_0x2dcc0b[_0xf4d73b('0x33')][_0xf4d73b('0x62')]));_0xc588f9[_0xf4d73b('0xa')]=qs['sort'](_0x2dcc0b[_0xf4d73b('0x33')][_0xf4d73b('0x58')]),_0xc588f9[_0xf4d73b('0x24')]=qs['filters'](_[_0xf4d73b('0x3f')](_0x2dcc0b[_0xf4d73b('0x33')],_0x49a1cf[_0xf4d73b('0x38')]),_0x52d01c);_0x2dcc0b[_0xf4d73b('0x33')][_0xf4d73b('0x5f')]&&(_0xc588f9[_0xf4d73b('0x24')]=_[_0xf4d73b('0x26')](_0xc588f9['where'],{[Op['or']]:_[_0xf4d73b('0x57')](_0x52d01c,function(_0x32d680){const _0x346601=_0xf4d73b;if(_0x32d680['type']!==_0x346601('0x52')){const _0x388827={};return _0x388827[_0x32d680[_0x346601('0x25')]]={[Op[_0x346601('0x10')]]:'%'+_0x2dcc0b['query'][_0x346601('0x5f')]+'%'},_0x388827;}})}));_0xc588f9=_[_0xf4d73b('0x26')]({},_0xc588f9,_0x2dcc0b['options']);const _0x2e02a5={'where':_0xc588f9[_0xf4d73b('0x24')]};return db[_0xf4d73b('0x20')]['count'](_0x2e02a5)[_0xf4d73b('0x17')](function(_0x518c1f){const _0x5cb579=_0xf4d73b;return _0x1213bd[_0x5cb579('0x5')]=_0x518c1f,_0x2dcc0b[_0x5cb579('0x33')][_0x5cb579('0x5c')]&&(_0xc588f9['include']=[{'all':!![]}]),db[_0x5cb579('0x20')][_0x5cb579('0x21')](_0xc588f9);})['then'](function(_0x1745c7){return _0x1213bd['rows']=_0x1745c7,_0x1213bd;})['then'](respondWithFilteredResult(_0x61e882,_0xc588f9))['catch'](handleError(_0x61e882,null));},exports[_0x1255d3('0x22')]=function(_0x4c767c,_0x1ef0f7){const _0x415bcf=_0x1255d3;let _0x3ce055={'raw':![],'where':{'id':_0x4c767c[_0x415bcf('0x8')]['id']}};const _0x29f732={};return _0x29f732[_0x415bcf('0x30')]=_[_0x415bcf('0x9')](db['VoicePrefix'][_0x415bcf('0x3a')]),_0x29f732[_0x415bcf('0x33')]=_[_0x415bcf('0x9')](_0x4c767c[_0x415bcf('0x33')]),_0x29f732[_0x415bcf('0x38')]=_['intersection'](_0x29f732[_0x415bcf('0x30')],_0x29f732[_0x415bcf('0x33')]),_0x3ce055[_0x415bcf('0x60')]=_[_0x415bcf('0x1d')](_0x29f732[_0x415bcf('0x30')],qs[_0x415bcf('0x2e')](_0x4c767c[_0x415bcf('0x33')]['fields'])),_0x3ce055[_0x415bcf('0x60')]=_0x3ce055[_0x415bcf('0x60')][_0x415bcf('0x35')]?_0x3ce055[_0x415bcf('0x60')]:_0x29f732[_0x415bcf('0x30')],_0x4c767c[_0x415bcf('0x33')][_0x415bcf('0x5c')]&&(_0x3ce055['include']=[{'all':!![]}]),_0x3ce055=_[_0x415bcf('0x26')]({},_0x3ce055,_0x4c767c[_0x415bcf('0x44')]),db[_0x415bcf('0x20')][_0x415bcf('0x16')](_0x3ce055)[_0x415bcf('0x17')](handleEntityNotFound(_0x1ef0f7,null))[_0x415bcf('0x17')](respondWithResult(_0x1ef0f7,null))[_0x415bcf('0x18')](handleError(_0x1ef0f7,null));},exports[_0x1255d3('0x1b')]=function(_0x5b63b9,_0x2b22b0){const _0x632b31=_0x1255d3;return db[_0x632b31('0x20')][_0x632b31('0x16')]({'where':{'id':_0x5b63b9[_0x632b31('0x8')]['id']}})[_0x632b31('0x17')](handleEntityNotFound(_0x2b22b0,null))[_0x632b31('0x17')](removeEntity(_0x2b22b0,null))[_0x632b31('0x18')](handleError(_0x2b22b0,null));},exports[_0x1255d3('0x56')]=function(_0x186aca,_0x42497a){const _0x583bc3=_0x1255d3;return db[_0x583bc3('0x20')][_0x583bc3('0x56')]()['then'](respondWithResult(_0x42497a,null))[_0x583bc3('0x18')](handleError(_0x42497a,null));},exports[_0x1255d3('0x51')]=function(_0x51dfb5,_0x468956){const _0x47f9ce=_0x1255d3;let _0x284550;return db['sequelize'][_0x47f9ce('0x4a')](function(_0x304437){const _0x2bc1ca=_0x47f9ce;return db[_0x2bc1ca('0x20')][_0x2bc1ca('0x51')](_0x51dfb5[_0x2bc1ca('0x5b')],{'transaction':_0x304437})[_0x2bc1ca('0x17')](function(_0x33fe3d){const _0xbf6925=_0x2bc1ca;return _0x284550=_0x33fe3d[_0xbf6925('0x4f')]({'plain':!![]}),db[_0xbf6925('0x28')][_0xbf6925('0x16')]({'where':{'id':_0x284550[_0xbf6925('0x23')]},'raw':!![]})['then'](function(_0x58d2d9){return createVoicePrefixExtensions(_0x284550,_0x58d2d9,_0x304437);});});})[_0x47f9ce('0x17')](function(){const _0x2efa9c=_0x47f9ce,_0x14217f=_0x51dfb5[_0x2efa9c('0x7')][_0x2efa9c('0x4f')]({'plain':!![]});if(!_0x14217f)throw new Error(_0x2efa9c('0x3d'));if(_0x14217f[_0x2efa9c('0x1f')]===_0x2efa9c('0x7')){const _0x5f486e=_0x284550;return db[_0x2efa9c('0x2b')]['findOne']({'where':{'name':_0x2efa9c('0x53'),'userProfileId':_0x14217f['userProfileId']},'raw':!![]})[_0x2efa9c('0x17')](function(_0x1d1d2a){const _0x1396de=_0x2efa9c;return _0x1d1d2a&&_0x1d1d2a[_0x1396de('0x3e')]===0x0?db[_0x1396de('0x5e')][_0x1396de('0x51')]({'name':_0x5f486e[_0x1396de('0x25')],'resourceId':_0x5f486e['id'],'type':_0x1d1d2a['name'],'sectionId':_0x1d1d2a['id']},{})[_0x1396de('0x17')](function(){return _0x284550;}):_0x284550;})[_0x2efa9c('0x18')](function(_0x3d669c){const _0x4f8c00=_0x2efa9c;logger[_0x4f8c00('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d669c);throw _0x3d669c;});}return _0x284550;})['then'](respondWithResult(_0x468956,null))['catch'](handleError(_0x468956,null));};function Extension(_0x275c91,_0x2f6220,_0x301fa9,_0x17f2ef){const _0x12c9b8=_0x1255d3;this[_0x12c9b8('0x2d')]=_0x12c9b8('0x48'),this[_0x12c9b8('0x29')]=_0x275c91,this[_0x12c9b8('0x31')]=_0x301fa9,this['type']=_0x12c9b8('0x13'),this[_0x12c9b8('0x49')]=_0x12c9b8('0x42'),this[_0x12c9b8('0x32')]=_0x2f6220,this[_0x12c9b8('0x1a')]=_0x17f2ef;}function createVoicePrefixExtensions(_0x175240,_0x5b44a6,_0x2467c6){return new Promise(function(_0x23ca8d,_0x3ab705){const _0x240559=a746_0x35bd,_0xd82f11=new Extension(formatPrefixName(_0x175240[_0x240559('0x54')]),0x1,_0x240559('0x39'),_0x240559('0x41'));return _0xd82f11['VoicePrefixId']=_0x175240['id'],db[_0x240559('0x28')][_0x240559('0x51')](_0xd82f11,{'transaction':_0x2467c6})[_0x240559('0x17')](function(_0x350f18){const _0x466aae=_0x240559,_0x245209=_0x350f18['get']({'plain':!![]}),_0x4d01de=_['map'](addVoicePrefixExtensions(_0x175240,_0x5b44a6),function(_0x36e11b){const _0x149dbb=a746_0x35bd;return _0x36e11b[_0x149dbb('0x23')]=_0x245209['id'],_0x36e11b[_0x149dbb('0x55')]=_0x175240['id'],_0x36e11b;});return db[_0x466aae('0x28')][_0x466aae('0x14')](_0x4d01de,{'transaction':_0x2467c6})['then'](function(_0x5e5220){const _0x10e4d4=_0x466aae;return!_0x5e5220?_0x3ab705(_0x10e4d4('0x3c')):_0x23ca8d(_0x5e5220);})[_0x466aae('0x18')](function(_0x5487c0){return _0x3ab705(_0x5487c0);});});});}function addVoicePrefixExtensions(_0x8febc8,_0x5abd4e){const _0x3635d9=_0x1255d3,_0x1b14f8=[],_0xe4d0e4=formatPrefixName(_0x8febc8[_0x3635d9('0x54')]);return _0x1b14f8['push'](new Extension(_0xe4d0e4,0x2,_0x3635d9('0x4e'),'CDR(prefix)='+_0x8febc8[_0x3635d9('0x25')])),_0x8febc8[_0x3635d9('0x46')]?_0x1b14f8[_0x3635d9('0x1c')](new Extension(_0xe4d0e4,0x3,_0x3635d9('0x4e'),_0x3635d9('0x47')+_0x8febc8[_0x3635d9('0x46')])):_0x1b14f8[_0x3635d9('0x1c')](new Extension(_0xe4d0e4,0x3,_0x3635d9('0x39'),_0x3635d9('0x5a'))),_0x1b14f8[_0x3635d9('0x1c')](new Extension(_0xe4d0e4,0x4,_0x3635d9('0x4b'),_0x5abd4e['context']+','+'${EXTEN:'+(0x8+_0x8febc8[_0x3635d9('0x25')]['length'])+'}'+','+0x1)),_0x1b14f8;}function formatPrefixName(_0x469636){const _0x3c67fe=_0x1255d3;let _0x55fbf9='_';for(let _0x14fc3c=0x0;_0x14fc3c<_0x469636[_0x3c67fe('0x35')];_0x14fc3c++){_0x469636['charAt'](_0x14fc3c)=='-'?_0x55fbf9+=_0x469636[_0x3c67fe('0x3')](_0x14fc3c):_0x55fbf9+='['+_0x469636[_0x3c67fe('0x3')](_0x14fc3c)+']';}return _0x55fbf9+='.',_0x55fbf9;}exports[_0x1255d3('0x43')]=function(_0x1632c6,_0x1fa827){const _0x2f2ce8=_0x1255d3,_0x521286=_0x1632c6[_0x2f2ce8('0x5b')];return _0x521286[_0x2f2ce8('0x54')]='system-'+_0x521286[_0x2f2ce8('0x25')]+'-',db[_0x2f2ce8('0xc')][_0x2f2ce8('0x4a')](function(_0x26c67d){const _0x335a62=_0x2f2ce8;return db[_0x335a62('0x20')][_0x335a62('0x43')](_0x521286,{'where':{'id':_0x521286['id']},'transaction':_0x26c67d})[_0x335a62('0x17')](function(){const _0x6a129a=_0x335a62;return db[_0x6a129a('0x28')]['destroy']({'where':{'VoicePrefixId':_0x521286['id']},'transaction':_0x26c67d})[_0x6a129a('0x17')](function(){const _0x5e885b=_0x6a129a;return db[_0x5e885b('0x28')][_0x5e885b('0x16')]({'where':{'id':_0x521286[_0x5e885b('0x23')]},'raw':!![]})[_0x5e885b('0x17')](function(_0x5ccf1f){return createVoicePrefixExtensions(_0x521286,_0x5ccf1f,_0x26c67d);});});});})[_0x2f2ce8('0x17')](function(){const _0x4afe78=_0x2f2ce8;return db[_0x4afe78('0x20')][_0x4afe78('0xe')](_0x521286['id']);})[_0x2f2ce8('0x17')](respondWithResult(_0x1fa827,null))[_0x2f2ce8('0x18')](handleError(_0x1fa827,null));},exports[_0x1255d3('0x61')]=function(_0x5f3cab,_0x5c617b){const _0x3164ae=_0x1255d3;return db[_0x3164ae('0x20')][_0x3164ae('0x16')]({'where':{'id':_0x5f3cab['params']['id']}})[_0x3164ae('0x17')](function(_0x5f2771){const _0xf20df0=_0x3164ae;if(_0x5f2771)return _0x5f2771[_0xf20df0('0x61')](_0x5f3cab['body'][_0xf20df0('0x1')],{'through':_['omit'](_0x5f3cab[_0xf20df0('0x5b')],[_0xf20df0('0x1'),'id'])})[_0xf20df0('0x17')](function(_0x4e4ca9){const _0x139cd1=_0xf20df0;for(let _0x365932=0x0;_0x365932<_0x5f3cab[_0x139cd1('0x5b')][_0x139cd1('0x1')]['length'];_0x365932+=0x1){socket[_0x139cd1('0xf')](_0x139cd1('0x12'),{'UserId':_0x5f3cab['body'][_0x139cd1('0x1')][_0x365932],'VoicePrefixId':_0x5f3cab[_0x139cd1('0x8')]['id']});}return _0x4e4ca9;});})[_0x3164ae('0x17')](respondWithResult(_0x5c617b,null))[_0x3164ae('0x18')](handleError(_0x5c617b,null));},exports[_0x1255d3('0x4')]=function(_0xc0dde6,_0x1def9d){const _0xb38eb9=_0x1255d3;return db[_0xb38eb9('0x20')][_0xb38eb9('0x16')]({'where':{'id':_0xc0dde6[_0xb38eb9('0x8')]['id']}})[_0xb38eb9('0x17')](handleEntityNotFound(_0x1def9d,null))[_0xb38eb9('0x17')](function(_0x4defba){const _0x4e929a=_0xb38eb9;if(_0x4defba)return _0x4defba[_0x4e929a('0x4')](_0xc0dde6[_0x4e929a('0x33')]['ids'])[_0x4e929a('0x17')](function(){const _0x32b8d5=_0x4e929a;if(_[_0x32b8d5('0x40')](_0xc0dde6[_0x32b8d5('0x33')][_0x32b8d5('0x1')]))for(let _0x300b3d=0x0;_0x300b3d<_0xc0dde6['query'][_0x32b8d5('0x1')][_0x32b8d5('0x35')];_0x300b3d+=0x1){socket['emit'](_0x32b8d5('0x1e'),{'UserId':Number(_0xc0dde6[_0x32b8d5('0x33')][_0x32b8d5('0x1')][_0x300b3d]),'VoicePrefixId':Number(_0xc0dde6[_0x32b8d5('0x8')]['id'])});}else socket['emit'](_0x32b8d5('0x1e'),{'UserId':Number(_0xc0dde6[_0x32b8d5('0x33')][_0x32b8d5('0x1')]),'VoicePrefixId':Number(_0xc0dde6[_0x32b8d5('0x8')]['id'])});});})['then'](respondWithStatusCode(_0x1def9d,null))[_0xb38eb9('0x18')](handleError(_0x1def9d,null));},exports[_0x1255d3('0x36')]=function(_0x520c8a,_0x476c28){const _0x3e3c8d=_0x1255d3;let _0x2f3594={};const _0x9e025f={};let _0x157f16,_0x45fc76;return db[_0x3e3c8d('0x20')][_0x3e3c8d('0x16')]({'where':{'id':_0x520c8a[_0x3e3c8d('0x8')]['id']}})['then'](handleEntityNotFound(_0x476c28,null))[_0x3e3c8d('0x17')](function(_0x388581){const _0xf8ab3d=_0x3e3c8d;if(_0x388581)return _0x157f16=_0x388581,_0x9e025f[_0xf8ab3d('0x30')]=_[_0xf8ab3d('0x9')](db[_0xf8ab3d('0x2')]['rawAttributes']),_0x9e025f[_0xf8ab3d('0x33')]=_[_0xf8ab3d('0x9')](_0x520c8a[_0xf8ab3d('0x33')]),_0x9e025f[_0xf8ab3d('0x38')]=_[_0xf8ab3d('0x1d')](_0x9e025f[_0xf8ab3d('0x30')],_0x9e025f['query']),_0x2f3594[_0xf8ab3d('0x60')]=_[_0xf8ab3d('0x1d')](_0x9e025f[_0xf8ab3d('0x30')],qs[_0xf8ab3d('0x2e')](_0x520c8a['query'][_0xf8ab3d('0x2e')])),_0x2f3594['attributes']=_0x2f3594[_0xf8ab3d('0x60')][_0xf8ab3d('0x35')]?_0x2f3594[_0xf8ab3d('0x60')]:_0x9e025f[_0xf8ab3d('0x30')],_0x2f3594['order']=qs['sort'](_0x520c8a['query'][_0xf8ab3d('0x58')]),_0x2f3594['where']=qs[_0xf8ab3d('0x38')](_['pick'](_0x520c8a[_0xf8ab3d('0x33')],_0x9e025f[_0xf8ab3d('0x38')])),_0x520c8a[_0xf8ab3d('0x33')][_0xf8ab3d('0x5f')]&&(_0x2f3594[_0xf8ab3d('0x24')]=_['merge'](_0x2f3594[_0xf8ab3d('0x24')],{[Op['or']]:_[_0xf8ab3d('0x57')](_0x2f3594['attributes'],function(_0x5284b7){const _0x38ec30=_0xf8ab3d,_0x42538b={};return _0x42538b[_0x5284b7]={[Op[_0x38ec30('0x10')]]:'%'+_0x520c8a[_0x38ec30('0x33')][_0x38ec30('0x5f')]+'%'},_0x42538b;})})),_0x2f3594=_['merge']({},_0x2f3594,_0x520c8a[_0xf8ab3d('0x44')]),_0x157f16[_0xf8ab3d('0x36')](_0x2f3594);})[_0x3e3c8d('0x17')](function(_0xb3c692){const _0x3d6fa4=_0x3e3c8d;if(_0xb3c692)return _0x45fc76=_0xb3c692[_0x3d6fa4('0x35')],typeof _0x520c8a['query'][_0x3d6fa4('0x2c')]===_0x3d6fa4('0x2f')&&(_0x2f3594[_0x3d6fa4('0x2a')]=qs[_0x3d6fa4('0x2a')](_0x520c8a[_0x3d6fa4('0x33')][_0x3d6fa4('0x2a')]),_0x2f3594['offset']=qs[_0x3d6fa4('0x62')](_0x520c8a['query'][_0x3d6fa4('0x62')])),_0x157f16[_0x3d6fa4('0x36')](_0x2f3594);})['then'](function(_0xd31981){if(_0xd31981)return _0xd31981?{'count':_0x45fc76,'rows':_0xd31981}:null;})['then'](respondWithResult(_0x476c28,null))[_0x3e3c8d('0x18')](handleError(_0x476c28,null));};
\ No newline at end of file