6efea45471d230bab143a906bf0bd7f7619f3d32
[motion.git] / server / api / agent / agent.controller.js
1 var _0x8534=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x46\x61\x78\x51\x75\x65\x75\x65","\x53\x6D\x73\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x54\x65\x61\x6D","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4C\x69\x73\x74","\x69\x6E\x64\x65\x78","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x61\x64\x64\x51\x75\x65\x75\x65\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x61\x64\x64\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x76\x6F\x69\x63\x65","\x61\x64\x64\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x63\x68\x61\x74","\x61\x64\x64\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x6D\x61\x69\x6C","\x61\x64\x64\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x66\x61\x78","\x61\x64\x64\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x73\x6D\x73","\x61\x64\x64\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x63\x68\x61\x6E\x6E\x65\x6C","\x70\x61\x72\x61\x6D\x73","\x72\x65\x6D\x6F\x76\x65\x51\x75\x65\x75\x65\x73","\x69\x64\x73","\x72\x65\x6D\x6F\x76\x65\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x49\x6E\x64\x65\x78","\x6C\x6F\x67","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x71\x75\x65\x75\x65\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x56\x6F\x69\x63\x65\x49\x6E\x64\x65\x78","\x72\x6F\x77\x73","\x6E\x61\x6D\x65","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x6D\x65\x72\x67\x65","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x43\x68\x61\x74\x49\x6E\x64\x65\x78","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x4D\x61\x69\x6C\x49\x6E\x64\x65\x78","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x46\x61\x78\x49\x6E\x64\x65\x78","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x53\x6D\x73\x49\x6E\x64\x65\x78","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x49\x6E\x64\x65\x78","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x6C\x65\x6E\x67\x74\x68","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x63\x72\x65\x61\x74\x65","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x64\x64\x55\x73\x65\x72","\x66\x69\x6E\x64\x4F\x6E\x65","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\x61\x6D\x6F\x75\x6E\x74","\x63\x6C\x6F\x6E\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x40","\x73\x70\x6C\x69\x74","\x70\x75\x73\x68","\x4E\x6F\x20\x61\x67\x65\x6E\x74\x73\x20\x61\x6D\x6F\x75\x6E\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x21","\x61\x64\x64\x55\x73\x65\x72\x73","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x68\x61\x6E\x64\x6C\x65\x46\x6F\x72\x65\x69\x67\x6E\x4B\x65\x79\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x63\x68\x61\x6E\x67\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x6F\x6C\x64\x50\x61\x73\x73\x77\x6F\x72\x64","\x6E\x65\x77\x50\x61\x73\x73\x77\x6F\x72\x64","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x72\x65\x73\x65\x74\x50\x61\x73\x73\x77\x6F\x72\x64"];_0x8534[0];var _=require(_0x8534[1]);var sequelize=require(_0x8534[3])[_0x8534[2]];var Util=require(_0x8534[4]);var Agent=require(_0x8534[3])[_0x8534[5]];var VoiceQueue=require(_0x8534[3])[_0x8534[6]];var ChatQueue=require(_0x8534[3])[_0x8534[7]];var MailQueue=require(_0x8534[3])[_0x8534[8]];var FaxQueue=require(_0x8534[3])[_0x8534[9]];var SmsQueue=require(_0x8534[3])[_0x8534[10]];var OpenchannelQueue=require(_0x8534[3])[_0x8534[11]];var User=require(_0x8534[3])[_0x8534[5]];var Team=require(_0x8534[3])[_0x8534[12]];var MailRoom=require(_0x8534[3])[_0x8534[13]];var List=require(_0x8534[3])[_0x8534[14]];exports[_0x8534[15]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[22]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[16]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[31]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){return Agent[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](401)};switch(_0x19f3xf[_0x8534[47]][_0x8534[46]]){case _0x8534[35]:return _0x19f3x15[_0x8534[34]](_0x19f3xf[_0x8534[33]]);case _0x8534[37]:return _0x19f3x15[_0x8534[36]](_0x19f3xf[_0x8534[33]]);case _0x8534[39]:return _0x19f3x15[_0x8534[38]](_0x19f3xf[_0x8534[33]]);case _0x8534[41]:return _0x19f3x15[_0x8534[40]](_0x19f3xf[_0x8534[33]]);case _0x8534[43]:return _0x19f3x15[_0x8534[42]](_0x19f3xf[_0x8534[33]]);case _0x8534[45]:return _0x19f3x15[_0x8534[44]](_0x19f3xf[_0x8534[33]]);default:return null}})[_0x8534[20]](function(_0x19f3x14){return _0x19f3x10[_0x8534[32]](_0x19f3x14?200:401)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[16]](_0x19f3x12)})};exports[_0x8534[48]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){return Agent[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](401)};switch(_0x19f3xf[_0x8534[47]][_0x8534[46]]){case _0x8534[35]:return _0x19f3x15[_0x8534[50]](_0x19f3xf[_0x8534[21]][_0x8534[49]]);case _0x8534[37]:return _0x19f3x15[_0x8534[51]](_0x19f3xf[_0x8534[21]][_0x8534[49]]);case _0x8534[39]:return _0x19f3x15[_0x8534[52]](_0x19f3xf[_0x8534[21]][_0x8534[49]]);case _0x8534[43]:return _0x19f3x15[_0x8534[53]](_0x19f3xf[_0x8534[21]][_0x8534[49]]);case _0x8534[41]:return _0x19f3x15[_0x8534[54]](_0x19f3xf[_0x8534[21]][_0x8534[49]]);case _0x8534[45]:return _0x19f3x15[_0x8534[55]](_0x19f3xf[_0x8534[21]][_0x8534[49]]);default:return null}})[_0x8534[20]](function(_0x19f3x14){return _0x19f3x10[_0x8534[32]](_0x19f3x14?200:401)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[16]](_0x19f3x12)})};exports[_0x8534[56]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[22]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]},_0x8534[62])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[63]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:var _0x19f3x16=[];return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[70]]({},{attributes:[_0x8534[65]],include:[{raw:true,model:User,attributes:[_0x8534[23]]}]}))[_0x8534[20]](function(_0x19f3x14){var _0x19f3x17=_[_0x8534[66]](_0x19f3x14[_0x8534[64]],_0x8534[65]);_0x19f3x14[_0x8534[64]][_0x8534[68]](function(_0x19f3x18){_0x19f3x16= _[_0x8534[67]](_0x19f3x16,_[_0x8534[66]](_0x19f3x18.Users,_0x8534[23]))});return User[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]})[_0x8534[27]](_[_0x8534[69]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]],{id:{$in:_0x19f3x16}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x19f3x17}},required:false}]}))})[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]},_0x8534[62])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[71]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:var _0x19f3x16=[];return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[72]]({},{attributes:[_0x8534[23]],include:[{raw:true,model:User,attributes:[_0x8534[23]]}]}))[_0x8534[20]](function(_0x19f3x14){var _0x19f3x19=_[_0x8534[66]](_0x19f3x14[_0x8534[64]],_0x8534[23]);_0x19f3x14[_0x8534[64]][_0x8534[68]](function(_0x19f3x18){_0x19f3x16= _[_0x8534[67]](_0x19f3x16,_[_0x8534[66]](_0x19f3x18.Users,_0x8534[23]))});return User[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]})[_0x8534[27]](_[_0x8534[69]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]],{id:{$in:_0x19f3x16}}),{include:[{model:ChatQueue,where:{id:{$in:_0x19f3x19}},required:false}]}))})[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]},_0x8534[62])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[73]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:var _0x19f3x16=[];return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[74]]({},{attributes:[_0x8534[23]],include:[{raw:true,model:User,attributes:[_0x8534[23]]}]}))[_0x8534[20]](function(_0x19f3x14){var _0x19f3x1a=_[_0x8534[66]](_0x19f3x14[_0x8534[64]],_0x8534[23]);_0x19f3x14[_0x8534[64]][_0x8534[68]](function(_0x19f3x18){_0x19f3x16= _[_0x8534[67]](_0x19f3x16,_[_0x8534[66]](_0x19f3x18.Users,_0x8534[23]))});return User[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]})[_0x8534[27]](_[_0x8534[69]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]],{id:{$in:_0x19f3x16}}),{include:[{model:MailQueue,where:{id:{$in:_0x19f3x1a}},required:false}]}))})[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]},_0x8534[62])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[75]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:var _0x19f3x16=[];return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[76]]({},{attributes:[_0x8534[23]],include:[{raw:true,model:User,attributes:[_0x8534[23]]}]}))[_0x8534[20]](function(_0x19f3x14){var _0x19f3x1b=_[_0x8534[66]](_0x19f3x14[_0x8534[64]],_0x8534[23]);_0x19f3x14[_0x8534[64]][_0x8534[68]](function(_0x19f3x18){_0x19f3x16= _[_0x8534[67]](_0x19f3x16,_[_0x8534[66]](_0x19f3x18.Users,_0x8534[23]))});return User[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]})[_0x8534[27]](_[_0x8534[69]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]],{id:{$in:_0x19f3x16}}),{include:[{model:FaxQueue,where:{id:{$in:_0x19f3x1b}},required:false}]}))})[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]},_0x8534[62])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[77]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:var _0x19f3x16=[];return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[78]]({},{attributes:[_0x8534[23]],include:[{raw:true,model:User,attributes:[_0x8534[23]]}]}))[_0x8534[20]](function(_0x19f3x14){var _0x19f3x1c=_[_0x8534[66]](_0x19f3x14[_0x8534[64]],_0x8534[23]);_0x19f3x14[_0x8534[64]][_0x8534[68]](function(_0x19f3x18){_0x19f3x16= _[_0x8534[67]](_0x19f3x16,_[_0x8534[66]](_0x19f3x18.Users,_0x8534[23]))});return User[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]})[_0x8534[27]](_[_0x8534[69]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]],{id:{$in:_0x19f3x16}}),{include:[{model:SmsQueue,where:{id:{$in:_0x19f3x1c}},required:false}]}))})[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]},_0x8534[62])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[79]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){switch(_0x19f3xf[_0x8534[24]][_0x8534[30]]){case _0x8534[24]:var _0x19f3x16=[];return User[_0x8534[25]](_0x19f3xf[_0x8534[24]][_0x8534[23]],{attributes:[_0x8534[23]]})[_0x8534[20]](Util[_0x8534[80]]({},{attributes:[_0x8534[23]],include:[{raw:true,model:User,attributes:[_0x8534[23]]}]}))[_0x8534[20]](function(_0x19f3x14){var _0x19f3x1d=_[_0x8534[66]](_0x19f3x14[_0x8534[64]],_0x8534[23]);_0x19f3x14[_0x8534[64]][_0x8534[68]](function(_0x19f3x18){_0x19f3x16= _[_0x8534[67]](_0x19f3x16,_[_0x8534[66]](_0x19f3x18.Users,_0x8534[23]))});return User[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]})[_0x8534[27]](_[_0x8534[69]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]],{id:{$in:_0x19f3x16}}),{include:[{model:OpenchannelQueue,where:{id:{$in:_0x19f3x1d}},required:false}]}))})[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)});default:return Agent[_0x8534[29]](_0x8534[28],{method:[_0x8534[58],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[59],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[60],_0x19f3xf[_0x8534[21]]]},{method:[_0x8534[61],_0x19f3xf[_0x8534[21]]]},_0x8534[62])[_0x8534[27]](Util[_0x8534[26]](_0x19f3xf[_0x8534[21]]))[_0x8534[20]](function(_0x19f3x13){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x13)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})}};exports[_0x8534[81]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x10[_0x8534[18]](_0x19f3x15)})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[82]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x15[_0x8534[84]]({attributes:[_0x8534[65]]})})[_0x8534[20]](function(_0x19f3x17){return _0x19f3x10[_0x8534[18]]({count:_0x19f3x17[_0x8534[83]],rows:_0x19f3x17})})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[85]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x15[_0x8534[86]]({attributes:[_0x8534[23]]})})[_0x8534[20]](function(_0x19f3x19){return _0x19f3x10[_0x8534[18]]({count:_0x19f3x19[_0x8534[83]],rows:_0x19f3x19})})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[87]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x15[_0x8534[88]]({attributes:[_0x8534[23]]})})[_0x8534[20]](function(_0x19f3x1a){return _0x19f3x10[_0x8534[18]]({count:_0x19f3x1a[_0x8534[83]],rows:_0x19f3x1a})})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[89]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x15[_0x8534[90]]({attributes:[_0x8534[23]]})})[_0x8534[20]](function(_0x19f3x1b){return _0x19f3x10[_0x8534[18]]({count:_0x19f3x1b[_0x8534[83]],rows:_0x19f3x1b})})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[91]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x15[_0x8534[92]]({attributes:[_0x8534[23]]})})[_0x8534[20]](function(_0x19f3x1c){return _0x19f3x10[_0x8534[18]]({count:_0x19f3x1c[_0x8534[83]],rows:_0x19f3x1c})})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[93]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x15[_0x8534[94]]({attributes:[_0x8534[23]]})})[_0x8534[20]](function(_0x19f3x1e){return _0x19f3x10[_0x8534[18]]({count:_0x19f3x1e[_0x8534[83]],rows:_0x19f3x1e})})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[95]]= function(_0x19f3xf,_0x19f3x10){var _0x19f3x1f;_0x19f3xf[_0x8534[33]][_0x8534[30]]= _0x8534[28];return sequelize[_0x8534[100]](function(_0x19f3x20){return Agent[_0x8534[29]](_0x8534[28])[_0x8534[95]](_0x19f3xf[_0x8534[33]],{transaction:_0x19f3x20})[_0x8534[20]](function(_0x19f3x15){_0x19f3x1f= _0x19f3x15;return Team[_0x8534[99]]({where:{defaultEntry:true}})})[_0x8534[20]](function(_0x19f3x22){return _0x19f3x22[_0x8534[98]](_0x19f3x1f[_0x8534[23]],{transaction:_0x19f3x20})})[_0x8534[20]](function(){return List[_0x8534[99]]({where:{defaultEntry:true}})})[_0x8534[20]](function(_0x19f3x21){return _0x19f3x21[_0x8534[98]](_0x19f3x1f[_0x8534[23]],{transaction:_0x19f3x20})})})[_0x8534[20]](function(){return _0x19f3x10[_0x8534[19]](201)[_0x8534[18]](_0x19f3x1f)})[_0x8534[17]](sequelize.UniqueConstraintError,function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return Util[_0x8534[97]][_0x8534[96]](_0x19f3x10,_0x19f3x12)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[101]]= function(_0x19f3xf,_0x19f3x10){var _0x19f3x23;var _0x19f3x24=[];var _0x19f3x25=String(_0x19f3xf[_0x8534[33]][_0x8534[102]]);if(!(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/[_0x8534[103]](_0x19f3x25))){return handleError(_0x19f3x10,{message:_0x8534[104]})};if(_0x19f3xf[_0x8534[33]][_0x8534[105]]){_0x19f3xf[_0x8534[33]][_0x8534[30]]= _0x8534[28];for(var _0x19f3x26=0;_0x19f3x26< _0x19f3xf[_0x8534[33]][_0x8534[105]];_0x19f3x26++){var _0x19f3x27=_[_0x8534[106]](_0x19f3xf[_0x8534[33]]);_0x19f3x27[_0x8534[107]]+= _0x19f3x26;_0x19f3x27[_0x8534[65]]= _0x19f3x27[_0x8534[65]]+ _0x19f3x26;_0x19f3x27[_0x8534[108]]= _0x19f3x27[_0x8534[108]]+ _0x19f3x26;_0x19f3x27[_0x8534[109]]= _0x19f3x27[_0x8534[109]][_0x8534[111]](_0x8534[110])[0]+ _0x19f3x26+ _0x8534[110]+ _0x19f3x27[_0x8534[109]][_0x8534[111]](_0x8534[110])[1];_0x19f3x24[_0x8534[112]](_0x19f3x27)}}else {return handleError(_0x19f3x10,{message:_0x8534[113]})};return sequelize[_0x8534[100]](function(_0x19f3x20){return Agent[_0x8534[101]](_0x19f3x24,{transaction:_0x19f3x20,individualHooks:true})[_0x8534[20]](function(_0x19f3x16){_0x19f3x23= _0x19f3x16;return Team[_0x8534[99]]({where:{defaultEntry:true}})})[_0x8534[20]](function(_0x19f3x22){return _0x19f3x22[_0x8534[114]](_[_0x8534[66]](_0x19f3x23,_0x8534[23]),{transaction:_0x19f3x20})})})[_0x8534[20]](function(){return _0x19f3x10[_0x8534[32]](201)})[_0x8534[17]](sequelize.UniqueConstraintError,function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return Util[_0x8534[97]][_0x8534[96]](_0x19f3x10,_0x19f3x12)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[115]]= function(_0x19f3xf,_0x19f3x10){if(_0x19f3xf[_0x8534[33]][_0x8534[23]]){delete _0x19f3xf[_0x8534[33]][_0x8534[23]]};delete _0x19f3xf[_0x8534[33]][_0x8534[30]];delete _0x19f3xf[_0x8534[33]][_0x8534[102]];return sequelize[_0x8534[100]](function(_0x19f3x20){return Agent[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};var _0x19f3x28=_[_0x8534[69]](_0x19f3x15,_0x19f3xf[_0x8534[33]]);return _0x19f3x28[_0x8534[116]]({transaction:_0x19f3x20})})[_0x8534[20]](function(_0x19f3x15){return _0x19f3x10[_0x8534[19]](200)[_0x8534[18]](_0x19f3x15)})})[_0x8534[17]](sequelize.UniqueConstraintError,function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return Util[_0x8534[97]][_0x8534[96]](_0x19f3x10,_0x19f3x12)})[_0x8534[17]](function(_0x19f3x12){console[_0x8534[57]](_0x19f3x12);return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[117]]= function(_0x19f3xf,_0x19f3x10){var _0x19f3x1f;return Agent[_0x8534[25]](_0x19f3xf[_0x8534[47]][_0x8534[23]])[_0x8534[20]](function(_0x19f3x15){_0x19f3x1f= _0x19f3x15;if(!_0x19f3x15){return _0x19f3x10[_0x8534[32]](404)};return _0x19f3x15[_0x8534[117]]()})[_0x8534[20]](function(){return _0x19f3x10[_0x8534[32]](204)})[_0x8534[17]](sequelize.ForeignKeyConstraintError,function(_0x19f3x12){return Util[_0x8534[97]][_0x8534[118]](_0x19f3x10,_0x8534[28],_0x19f3x1f[_0x8534[65]],_0x19f3x12)})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[119]]= function(_0x19f3xf,_0x19f3x10){return Agent[_0x8534[117]]({where:{id:_0x19f3xf[_0x8534[21]][_0x8534[49]]},individualHooks:true})[_0x8534[20]](function(){return _0x19f3x10[_0x8534[32]](204)})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};exports[_0x8534[120]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){var _0x19f3x29=_0x19f3xf[_0x8534[24]][_0x8534[23]];var _0x19f3x2a=String(_0x19f3xf[_0x8534[33]][_0x8534[121]]);var _0x19f3x2b=String(_0x19f3xf[_0x8534[33]][_0x8534[122]]);return Agent[_0x8534[25]](_0x19f3x29)[_0x8534[20]](function(_0x19f3x2c){if(_0x19f3x2c[_0x8534[123]](_0x19f3x2a)){_0x19f3x2c[_0x8534[102]]= _0x19f3x2b;_0x19f3x2c[_0x8534[116]]()[_0x8534[20]](function(){return _0x19f3x10[_0x8534[32]](200)})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})}else {return _0x19f3x10[_0x8534[32]](403)}})};exports[_0x8534[124]]= function(_0x19f3xf,_0x19f3x10,_0x19f3x11){var _0x19f3x29=_0x19f3xf[_0x8534[47]][_0x8534[23]];var _0x19f3x2b=String(_0x19f3xf[_0x8534[33]][_0x8534[122]]);return Agent[_0x8534[25]](_0x19f3x29)[_0x8534[20]](function(_0x19f3x2c){_0x19f3x2c[_0x8534[102]]= _0x19f3x2b;return _0x19f3x2c[_0x8534[116]]()})[_0x8534[20]](function(){return _0x19f3x10[_0x8534[32]](200)})[_0x8534[17]](function(_0x19f3x12){return handleError(_0x19f3x10,_0x19f3x12)})};function handleError(_0x19f3x10,_0x19f3x12){return _0x19f3x10[_0x8534[19]](500)[_0x8534[18]](_0x19f3x12)}