Built motion from commit fa8c70b.|0.0.144
[motion.git] / server / api / report_queue / report_queue.controller.js
1 var _0xd6c3=["\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","\x55\x73\x65\x72","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x69\x6E\x64\x65\x78","\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\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x64\x65\x73\x63\x72\x69\x62\x65","\x77\x61\x69\x74\x69\x6E\x67","\x63\x6F\x75\x6E\x74","\x75\x73\x65\x72","\x61\x6C\x6C","\x72\x6F\x77\x73","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x6F\x6C\x65","\x71\x75\x65\x75\x65\x50\x61\x72\x61\x6D\x65\x74\x65\x72\x73","\x6C\x69\x6D\x69\x74","\x6F\x66\x66\x73\x65\x74","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x75\x69\x54\x6F","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x5F\x75\x69\x54\x6F","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x5F\x75\x69\x54\x6F","\x6C\x6F\x67","\x73\x70\x72\x65\x61\x64","\x66\x69\x6E\x64","\x74\x6F\x74\x61\x6C\x63\x61\x6C\x6C\x73","\x66\x6F\x72\x45\x61\x63\x68","\x5F\x61\x6E\x73\x77\x65\x72\x65\x64\x46\x72\x6F\x6D","\x61\x6E\x73\x77\x65\x72\x65\x64","\x5F\x61\x6E\x73\x77\x65\x72\x65\x64\x54\x6F","\x5F\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x46\x72\x6F\x6D","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x5F\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x54\x6F","\x5F\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x46\x72\x6F\x6D","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x5F\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x54\x6F","\x5F\x6E\x61\x6D\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x72\x65\x64\x75\x63\x65","\x66\x69\x6C\x74\x65\x72","\x5F\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x73\x6C\x69\x63\x65","\x6C\x65\x6E\x67\x74\x68","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x30\x30\x3A\x30\x30\x3A\x30\x30","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x74\x6F\x74\x61\x6C\x63\x61\x6C\x6C\x73\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x6A\x6F\x69\x6E","\x27\x29\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x74\x61\x6C\x6B\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x68\x6F\x6C\x64\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x71\x75\x65\x75\x65","\x43\x4F\x55\x4E\x54","\x63\x6F\x6C","\x66\x6E","\x61\x63\x74\x69\x76\x65","\x77\x61\x69\x74\x69\x6E\x67\x43\x61\x6C\x6C\x73","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x71\x75\x65\x75\x65\x46\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x61\x76\x67\x61\x6E\x73\x77\x65\x72\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x27\x29","\x61\x76\x67\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x6E\x73\x77\x65\x72\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x62\x61\x6E\x64\x6F\x6E\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x74\x6F\x74\x61\x6C\x6F\x66\x66\x65\x72\x65\x64","\x53\x45\x4C\x45\x43\x54\x20\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x41\x6C\x6C","\x73\x68\x6F\x77"];_0xd6c3[0];var _=require(_0xd6c3[1]);var sequelize=require(_0xd6c3[3])[_0xd6c3[2]];var Agent=require(_0xd6c3[3])[_0xd6c3[4]];var ReportQueue=require(_0xd6c3[3])[_0xd6c3[5]];var VoiceQueue=require(_0xd6c3[3])[_0xd6c3[6]];var ReportQueueHistory=require(_0xd6c3[3])[_0xd6c3[8]][_0xd6c3[7]];var Util=require(_0xd6c3[9]);var Promise=require(_0xd6c3[10]);exports[_0xd6c3[11]]= function(_0x347dx9,_0x347dxa,_0x347dxb){return ReportQueue[_0xd6c3[18]](Util[_0xd6c3[17]](_0x347dx9[_0xd6c3[16]]))[_0xd6c3[15]](function(_0x347dxd){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]](_0x347dxd)})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[19]]= function(_0x347dx9,_0x347dxa){return ReportQueue[_0xd6c3[26]](_0x347dx9[_0xd6c3[25]][_0xd6c3[24]])[_0xd6c3[15]](function(_0x347dxe){if(!_0x347dxe){return _0x347dxa[_0xd6c3[20]](404)};var _0x347dxf=_[_0xd6c3[22]](_0x347dxe,_0x347dx9[_0xd6c3[21]]);return _0x347dxf[_0xd6c3[23]]()})[_0xd6c3[15]](function(_0x347dxe){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]](_0x347dxe)})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[27]]= function(_0x347dx9,_0x347dxa){return ReportQueueHistory[_0xd6c3[27]]()[_0xd6c3[15]](function(_0x347dx10){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]](_0x347dx10)})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[28]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return ReportQueue[_0xd6c3[29]]({where:{queuecallerleaveAt:null,queue:_0x347dx12}})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};function getVoiceQueues(_0x347dx14){return function(){switch(_0x347dx14[_0xd6c3[39]]){case _0xd6c3[30]:return Agent[_0xd6c3[26]](_0x347dx14[_0xd6c3[24]],{attributes:[_0xd6c3[24]]})[_0xd6c3[15]](Util[_0xd6c3[35]]())[_0xd6c3[15]](function(_0x347dx12){return _[_0xd6c3[34]](_0x347dx12[_0xd6c3[32]],_0xd6c3[33])});case _0xd6c3[37]:return Agent[_0xd6c3[26]](_0x347dx14[_0xd6c3[24]])[_0xd6c3[15]](function(_0x347dx15){return _0x347dx15[_0xd6c3[36]]({attributes:[_0xd6c3[33]]})})[_0xd6c3[15]](function(_0x347dx12){return _[_0xd6c3[34]](_0x347dx12,_0xd6c3[33])});default:return VoiceQueue[_0xd6c3[38]]()[_0xd6c3[15]](function(_0x347dx16){return {rows:_0x347dx16}})[_0xd6c3[15]](function(_0x347dx12){return _[_0xd6c3[34]](_0x347dx12[_0xd6c3[32]],_0xd6c3[33])})}}}exports[_0xd6c3[40]]= function(_0x347dx9,_0x347dxa){var _0x347dx17={_limit:_0x347dx9[_0xd6c3[16]][_0xd6c3[41]]?_0x347dx9[_0xd6c3[16]][_0xd6c3[41]]:null,_offset:_0x347dx9[_0xd6c3[16]][_0xd6c3[42]]?_0x347dx9[_0xd6c3[16]][_0xd6c3[42]]:0,_name:_0x347dx9[_0xd6c3[16]][_0xd6c3[33]]|| undefined,_answeredFrom:_0x347dx9[_0xd6c3[16]][_0xd6c3[43]]|| _0x347dx9[_0xd6c3[16]][_0xd6c3[43]]=== 0?_0x347dx9[_0xd6c3[16]][_0xd6c3[43]]:undefined,_answeredTo:_0x347dx9[_0xd6c3[16]][_0xd6c3[44]]|| _0x347dx9[_0xd6c3[16]][_0xd6c3[44]]=== 0?_0x347dx9[_0xd6c3[16]][_0xd6c3[44]]:undefined,_abandonedFrom:_0x347dx9[_0xd6c3[16]][_0xd6c3[45]]|| _0x347dx9[_0xd6c3[16]][_0xd6c3[45]]=== 0?_0x347dx9[_0xd6c3[16]][_0xd6c3[45]]:undefined,_abandonedTo:_0x347dx9[_0xd6c3[16]][_0xd6c3[46]]|| _0x347dx9[_0xd6c3[16]][_0xd6c3[46]]=== 0?_0x347dx9[_0xd6c3[16]][_0xd6c3[46]]:undefined,_unmanagedFrom:_0x347dx9[_0xd6c3[16]][_0xd6c3[47]]|| _0x347dx9[_0xd6c3[16]][_0xd6c3[47]]=== 0?_0x347dx9[_0xd6c3[16]][_0xd6c3[47]]:undefined,_unmanagedTo:_0x347dx9[_0xd6c3[16]][_0xd6c3[48]]|| _0x347dx9[_0xd6c3[16]][_0xd6c3[48]]=== 0?_0x347dx9[_0xd6c3[16]][_0xd6c3[48]]:undefined};console[_0xd6c3[49]](_0x347dx17);var _0x347dx18,_0x347dx19,_0x347dx1a,_0x347dx1b;delete _0x347dx9[_0xd6c3[16]][_0xd6c3[41]];delete _0x347dx9[_0xd6c3[16]][_0xd6c3[42]];delete _0x347dx9[_0xd6c3[16]][_0xd6c3[43]];delete _0x347dx9[_0xd6c3[16]][_0xd6c3[44]];delete _0x347dx9[_0xd6c3[16]][_0xd6c3[45]];delete _0x347dx9[_0xd6c3[16]][_0xd6c3[46]];delete _0x347dx9[_0xd6c3[16]][_0xd6c3[47]];delete _0x347dx9[_0xd6c3[16]][_0xd6c3[48]];return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){_0x347dx19= _0x347dx12;_0x347dx18= _[_0xd6c3[34]](_0x347dx12,function(_0x347dx1f){return {name:_0x347dx1f}});return ReportQueue[_0xd6c3[38]]({where:{queuecallerleaveAt:null,queue:_0x347dx19},group:_0xd6c3[84],attributes:[[_0xd6c3[84],_0xd6c3[33]],[sequelize[_0xd6c3[87]](_0xd6c3[85],sequelize[_0xd6c3[86]](_0xd6c3[24])),_0xd6c3[28]]]})})[_0xd6c3[15]](function(_0x347dx31){_0x347dx31= _[_0xd6c3[34]](_0x347dx31,_0xd6c3[82]);_0x347dx18[_0xd6c3[53]](function(_0x347dx1f,_0x347dx32){var _0x347dx20=_[_0xd6c3[51]](_0x347dx31,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[28]]= _0x347dx20?_0x347dx20[_0xd6c3[28]]:0});return ReportQueue[_0xd6c3[38]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x347dx19},group:_0xd6c3[84],attributes:[[_0xd6c3[84],_0xd6c3[33]],[sequelize[_0xd6c3[87]](_0xd6c3[85],sequelize[_0xd6c3[86]](_0xd6c3[24])),_0xd6c3[88]]]})})[_0xd6c3[15]](function(_0x347dx30){_0x347dx30= _[_0xd6c3[34]](_0x347dx30,_0xd6c3[82]);_0x347dx18[_0xd6c3[53]](function(_0x347dx1f){var _0x347dx20=_[_0xd6c3[51]](_0x347dx30,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[88]]= _0x347dx20?_0x347dx20[_0xd6c3[88]]:0});return ReportQueue[_0xd6c3[38]]({where:{queuecallercomplete:true,queue:_0x347dx19},group:_0xd6c3[84],attributes:[[_0xd6c3[84],_0xd6c3[33]],[sequelize[_0xd6c3[87]](_0xd6c3[85],sequelize[_0xd6c3[86]](_0xd6c3[24])),_0xd6c3[55]]]})})[_0xd6c3[15]](function(_0x347dx2f){_0x347dx2f= _[_0xd6c3[34]](_0x347dx2f,_0xd6c3[82]);_0x347dx18[_0xd6c3[53]](function(_0x347dx1f){var _0x347dx20=_[_0xd6c3[51]](_0x347dx2f,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[55]]= _0x347dx20?_0x347dx20[_0xd6c3[55]]:0});return ReportQueue[_0xd6c3[38]]({where:{queuecallerabandon:true,queue:_0x347dx19},group:_0xd6c3[84],attributes:[[_0xd6c3[84],_0xd6c3[33]],[sequelize[_0xd6c3[87]](_0xd6c3[85],sequelize[_0xd6c3[86]](_0xd6c3[24])),_0xd6c3[58]]]})})[_0xd6c3[15]](function(_0x347dx2e){_0x347dx2e= _[_0xd6c3[34]](_0x347dx2e,_0xd6c3[82]);_0x347dx18[_0xd6c3[53]](function(_0x347dx1f){var _0x347dx20=_[_0xd6c3[51]](_0x347dx2e,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[58]]= _0x347dx20?_0x347dx20[_0xd6c3[58]]:0});return ReportQueue[_0xd6c3[38]]({where:{queuecallerexit:true,queue:_0x347dx19},group:_0xd6c3[84],attributes:[[_0xd6c3[84],_0xd6c3[33]],[sequelize[_0xd6c3[87]](_0xd6c3[85],sequelize[_0xd6c3[86]](_0xd6c3[24])),_0xd6c3[61]]]})})[_0xd6c3[15]](function(_0x347dx2d){_0x347dx2d= _[_0xd6c3[34]](_0x347dx2d,_0xd6c3[82]);_0x347dx18[_0xd6c3[53]](function(_0x347dx1f){var _0x347dx20=_[_0xd6c3[51]](_0x347dx2d,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[61]]= _0x347dx20?_0x347dx20[_0xd6c3[61]]:0});return sequelize[_0xd6c3[16]](_0xd6c3[83]+ _0x347dx19[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[77],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx2c){_0x347dx18[_0xd6c3[53]](function(_0x347dx1f){var _0x347dx20=_[_0xd6c3[51]](_0x347dx2c,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[80]]= _0x347dx20?_0x347dx20[_0xd6c3[80]]:_0xd6c3[73]});return sequelize[_0xd6c3[16]](_0xd6c3[81]+ _0x347dx19[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[77],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx2b){_0x347dx18[_0xd6c3[53]](function(_0x347dx1f){var _0x347dx20=_[_0xd6c3[51]](_0x347dx2b,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[72]]= _0x347dx20?_0x347dx20[_0xd6c3[72]]:_0xd6c3[73]});return sequelize[_0xd6c3[16]](_0xd6c3[74]+ _0x347dx19[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[77],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx1e){_0x347dx18[_0xd6c3[53]](function(_0x347dx1f){var _0x347dx20=_[_0xd6c3[51]](_0x347dx1e,{name:_0x347dx1f[_0xd6c3[33]]});_0x347dx1f[_0xd6c3[52]]= _0x347dx20?_0x347dx20[_0xd6c3[52]]:0});var _0x347dx21=_(_[_0xd6c3[66]](_0x347dx18,function(_0x347dx1f){var _0x347dx22=_0x347dx17[_0xd6c3[54]]?(_0x347dx1f[_0xd6c3[55]]>= Number(_0x347dx17._answeredFrom)):true;var _0x347dx23=_0x347dx17[_0xd6c3[56]]?(_0x347dx1f[_0xd6c3[55]]<= Number(_0x347dx17._answeredTo)):true;var _0x347dx24=_0x347dx17[_0xd6c3[57]]?(_0x347dx1f[_0xd6c3[58]]>= Number(_0x347dx17._abandonedFrom)):true;var _0x347dx25=_0x347dx17[_0xd6c3[59]]?(_0x347dx1f[_0xd6c3[58]]<= Number(_0x347dx17._abandonedTo)):true;var _0x347dx26=_0x347dx17[_0xd6c3[60]]?(_0x347dx1f[_0xd6c3[61]]>= Number(_0x347dx17._unmanagedFrom)):true;var _0x347dx27=_0x347dx17[_0xd6c3[62]]?(_0x347dx1f[_0xd6c3[61]]<= Number(_0x347dx17._unmanagedTo)):true;var _0x347dx28=_0x347dx17[_0xd6c3[63]]?_[_0xd6c3[64]](_0x347dx1f[_0xd6c3[33]],_0x347dx17._name):true;return _[_0xd6c3[65]]([_0x347dx22,_0x347dx23,_0x347dx24,_0x347dx25,_0x347dx26,_0x347dx27,_0x347dx28],function(_0x347dx29,_0x347dx2a){return _0x347dx29&& _0x347dx2a})}));if(_0x347dx17[_0xd6c3[67]]){_0x347dx21= _0x347dx21[_0xd6c3[70]](_0x347dx17._offset)[_0xd6c3[69]](_0x347dx17._limit)[_0xd6c3[68]]()};return [_0x347dx18[_0xd6c3[71]],_0x347dx21]})[_0xd6c3[50]](function(_0x347dx1c,_0x347dx1d){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({rows:_0x347dx1d,count:_0x347dx1c})})[_0xd6c3[12]](function(_0x347dxc){console[_0xd6c3[49]](_0x347dxc);return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[89]]= function(_0x347dx9,_0x347dxa){var _0x347dx33={};if(_0x347dx9[_0xd6c3[30]][_0xd6c3[39]]=== _0xd6c3[37]){_0x347dx33[_0xd6c3[90]]= _0x347dx9[_0xd6c3[30]][_0xd6c3[91]]};return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return ReportQueue[_0xd6c3[93]](_0xd6c3[28],{method:[_0xd6c3[92],_0x347dx12]})[_0xd6c3[38]](Util[_0xd6c3[17]](_0x347dx9[_0xd6c3[16]],_0x347dx33))})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({rows:_0x347dx11,count:_0x347dx11[_0xd6c3[71]]})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[88]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return ReportQueue[_0xd6c3[29]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x347dx12}})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[55]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return ReportQueue[_0xd6c3[29]]({where:{queuecallercomplete:true,queue:_0x347dx12}})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[58]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return ReportQueue[_0xd6c3[29]]({where:{queuecallerabandon:true,queue:_0x347dx12}})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[94]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return sequelize[_0xd6c3[16]](_0xd6c3[95]+ _0x347dx12[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[96],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11[0][_0xd6c3[68]]})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[97]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return sequelize[_0xd6c3[16]](_0xd6c3[98]+ _0x347dx12[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[96],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11[0][_0xd6c3[68]]})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[99]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return sequelize[_0xd6c3[16]](_0xd6c3[100]+ _0x347dx12[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[96],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11[0][_0xd6c3[68]]})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[101]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return sequelize[_0xd6c3[16]](_0xd6c3[102]+ _0x347dx12[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[96],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11[0][_0xd6c3[68]]})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[103]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return sequelize[_0xd6c3[16]](_0xd6c3[104]+ _0x347dx12[_0xd6c3[76]](_0xd6c3[75])+ _0xd6c3[96],{type:sequelize[_0xd6c3[79]][_0xd6c3[78]]})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11[0][_0xd6c3[68]]})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[61]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return ReportQueue[_0xd6c3[29]]({where:{queuecallerexit:true,queue:_0x347dx12}})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]]({value:_0x347dx11})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[105]]= function(_0x347dx9,_0x347dxa){return Promise[_0xd6c3[31]]([])[_0xd6c3[15]](getVoiceQueues(_0x347dx9[_0xd6c3[30]]))[_0xd6c3[15]](function(_0x347dx12){return ReportQueue[_0xd6c3[18]]({where:{queuecallerabandon:true,queue:_0x347dx12}})})[_0xd6c3[15]](function(_0x347dx11){return _0x347dxa[_0xd6c3[14]](200)[_0xd6c3[13]](_0x347dx11)})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};exports[_0xd6c3[106]]= function(_0x347dx9,_0x347dxa){return ReportQueue[_0xd6c3[38]]({where:{queue:_0x347dx9[_0xd6c3[25]][_0xd6c3[84]]}})[_0xd6c3[15]](function(_0x347dx34){if(!_0x347dx34){return _0x347dxa[_0xd6c3[20]](404)};return _0x347dxa[_0xd6c3[13]]({count:_0x347dx34[_0xd6c3[71]],rows:_0x347dx34})})[_0xd6c3[12]](function(_0x347dxc){return handleError(_0x347dxa,_0x347dxc)})};function handleError(_0x347dxa,_0x347dxc){return _0x347dxa[_0xd6c3[14]](500)[_0xd6c3[13]](_0x347dxc)}