Built motion from commit 1243baf.|0.0.90
[motion.git] / server / config / triggers / index.js
1 var _0x326c=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2F\x75\x74\x69\x6C","\x2E\x2F\x76\x6F\x69\x63\x65","\x2E\x2F\x6D\x61\x69\x6C","\x2E\x2F\x63\x68\x61\x74","\x2E\x2F\x63\x6D","\x2E\x2E\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73","\x54\x72\x69\x67\x67\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x54\x6F\x6F\x6C\x73\x41\x63\x74\x69\x6F\x6E","\x54\x6F\x6F\x6C\x73\x43\x6F\x6E\x64\x69\x74\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x65\x78\x70\x6F\x72\x74\x73","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x54\x72\x69\x67\x67\x65\x72\x73\x20\x61\x72\x65\x20","\x6C\x65\x6E\x67\x74\x68","\x6C\x6F\x67","\x76\x6F\x69\x63\x65","\x66\x69\x6C\x74\x65\x72","\x67\x65\x74\x41\x63\x74\x69\x6F\x6E\x73\x42\x79\x54\x72\x69\x67\x67\x65\x72\x73","\x41\x66\x74\x65\x72\x20\x61\x67\x65\x6E\x74\x20\x63\x72\x65\x61\x74\x65\x2C\x20\x41\x63\x74\x69\x6F\x6E\x73\x20\x61\x72\x65\x20","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x6C\x61\x73\x74\x65\x76\x65\x6E\x74","\x63\x68\x61\x6E\x67\x65\x64","\x41\x66\x74\x65\x72\x20\x61\x67\x65\x6E\x74\x20\x75\x70\x64\x61\x74\x65\x2C\x20\x41\x63\x74\x69\x6F\x6E\x73\x20\x61\x72\x65\x20","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x6D\x61\x69\x6C","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x6C\x6C","\x73\x63\x6F\x70\x65","\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x61\x63\x74\x69\x6F\x6E\x20\x22","\x61\x63\x74\x69\x6F\x6E","\x22","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x6D\x61\x6E\x61\x67\x65\x43\x6F\x6E\x74\x61\x63\x74","\x63\x6F\x6E\x74\x61\x63\x74\x4D\x61\x6E\x61\x67\x65\x72","\x73\x65\x6E\x64\x54\x65\x6D\x70\x6C\x61\x74\x65","\x74\x65\x6D\x70\x6C\x61\x74\x65","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x6D\x61\x6E\x61\x67\x65\x45\x76\x65\x6E\x74","\x6D\x6F\x74\x69\x6F\x6E\x62\x61\x72","\x54\x72\x69\x67\x67\x65\x72\x3A\x20\x41\x63\x74\x69\x6F\x6E\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64\x20","\x66\x6F\x72\x45\x61\x63\x68","\x69\x64","\x72\x65\x6D\x6F\x76\x65","\x41\x66\x74\x65\x72\x20\x64\x65\x73\x74\x72\x6F\x79\x2C\x20\x54\x72\x69\x67\x67\x65\x72\x73\x20\x61\x72\x65\x20","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x77\x68\x65\x72\x65","\x66\x69\x6E\x64","\x41\x63\x74\x69\x6F\x6E\x73","\x61\x66\x74\x65\x72\x42\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x70\x75\x73\x68","\x61\x66\x74\x65\x72\x42\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x54\x72\x69\x67\x67\x65\x72\x41\x6C\x6C\x49\x64","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x41\x6C\x6C","\x54\x72\x69\x67\x67\x65\x72\x41\x6E\x79\x49\x64","\x41\x6E\x79","\x69\x6E\x64\x65\x78\x4F\x66","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74"];_0x326c[0];var _=require(_0x326c[1]);var Util=require(_0x326c[2]);var Voice=require(_0x326c[3]);var Mail=require(_0x326c[4]);var Chat=require(_0x326c[5]);var Cm=require(_0x326c[6]);var Integration=require(_0x326c[7]);var Trigger=require(_0x326c[9])[_0x326c[8]];var ToolsAction=require(_0x326c[9])[_0x326c[10]];var ToolsCondition=require(_0x326c[9])[_0x326c[11]];var ReportAgent=require(_0x326c[9])[_0x326c[12]];var MailMessage=require(_0x326c[9])[_0x326c[13]];module[_0x326c[14]]=function(_0xccf0xd){var _0xccf0xe= new Util();var _0xccf0xf= new Voice();var _0xccf0x10= new Chat();var _0xccf0x11= new Mail();var _0xccf0x12= new Cm();var _0xccf0x13= new Integration(_0xccf0xd);Trigger[_0x326c[35]](_0x326c[34])[_0x326c[33]]()[_0x326c[32]](function(_0xccf0x15){synchTriggers(_0xccf0x15);console[_0x326c[19]](_0x326c[17],_0xccf0x15[_0x326c[18]]);ReportAgent[_0x326c[24]](function(_0xccf0x16){var _0xccf0x17=_0xccf0xe[_0x326c[22]](_0xccf0x16,_[_0x326c[21]](_0xccf0x15,{channel:_0x326c[20]}));console[_0x326c[19]](_0x326c[23],_0xccf0x17[_0x326c[18]]);execActions(_0xccf0x17,_0xccf0x16,_0x326c[20],_0xccf0xe,_0xccf0xf,_0xccf0x11,_0xccf0x12,_0xccf0x13)});ReportAgent[_0x326c[28]](function(_0xccf0x16){if(_0xccf0x16[_0x326c[26]](_0x326c[25])){var _0xccf0x17=_0xccf0xe[_0x326c[22]](_0xccf0x16,_[_0x326c[21]](_0xccf0x15,{channel:_0x326c[20]}));console[_0x326c[19]](_0x326c[27],_0xccf0x17[_0x326c[18]]);execActions(_0xccf0x17,_0xccf0x16,_0x326c[20],_0xccf0xe,_0xccf0xf,_0xccf0x11,_0xccf0x12,_0xccf0x13)}});MailMessage[_0x326c[24]](function(_0xccf0x16){if(_0xccf0x16[_0x326c[29]]===_0x326c[30]){var _0xccf0x17=_0xccf0xe[_0x326c[22]](_0xccf0x16,_[_0x326c[21]](_0xccf0x15,{channel:_0x326c[31]}));execActions(_0xccf0x17,_0xccf0x16,_0x326c[31],_0xccf0xe,_0xccf0xf,_0xccf0x11,_0xccf0x12,_0xccf0x13)}})})[_0x326c[16]](function(_0xccf0x14){console[_0x326c[15]](_0xccf0x14)})};function execActions(_0xccf0x17,_0xccf0x16,_0xccf0x19,_0xccf0xe,_0xccf0xf,_0xccf0x11,_0xccf0x12,_0xccf0x13){_0xccf0x17[_0x326c[48]](function(_0xccf0x1a){console[_0x326c[19]](_0x326c[36]+_0xccf0x1a[_0x326c[37]]+_0x326c[38]);switch(_0xccf0x1a[_0x326c[37]]){case _0x326c[41]:_0xccf0x12[_0x326c[40]](_0xccf0x16[_0x326c[39]],_0xccf0x19);break;case _0x326c[43]:_0xccf0x11[_0x326c[42]](_0xccf0x1a);break;case _0x326c[44]:;case _0x326c[46]:_0xccf0x13[_0x326c[45]](_0xccf0x1a,_0xccf0x16,_0xccf0x19);break;default:console[_0x326c[19]](_0x326c[47],_0xccf0x1a[_0x326c[37]])}})}function synchTriggers(_0xccf0x15){Trigger[_0x326c[24]](function(_0xccf0x16,_0xccf0x1c){return Trigger[_0x326c[35]](_0x326c[34])[_0x326c[33]]()[_0x326c[32]](function(_0xccf0x1d){_0xccf0x15=_0xccf0x1d})});Trigger[_0x326c[28]](function(_0xccf0x16,_0xccf0x1c){updateCollection(_0xccf0x15,_0xccf0x16)});Trigger[_0x326c[52]](function(_0xccf0x16){_[_0x326c[50]](_0xccf0x15,{id:_0xccf0x16[_0x326c[49]]});console[_0x326c[19]](_0x326c[51],_0xccf0x15[_0x326c[18]])});ToolsAction[_0x326c[56]](function(_0xccf0x16){var _0xccf0x1e=parseInt(_0xccf0x16[_0x326c[53]].TriggerId);var _0xccf0x1f=_[_0x326c[54]](_0xccf0x15,function(_0xccf0x20){return _0xccf0x20[_0x326c[49]]===_0xccf0x1e});if(_0xccf0x1f){_0xccf0x1f[_0x326c[55]]=[]}});ToolsAction[_0x326c[58]](function(_0xccf0x16){_[_0x326c[48]](_0xccf0x16,function(_0xccf0x1a){var _0xccf0x1f=_[_0x326c[54]](_0xccf0x15,function(_0xccf0x20){return _0xccf0x20[_0x326c[49]]===parseInt(_0xccf0x1a.TriggerId)});if(_0xccf0x1f){_0xccf0x1f[_0x326c[55]][_0x326c[57]](_0xccf0x1a)}})});ToolsCondition[_0x326c[56]](function(_0xccf0x16){if(_0xccf0x16[_0x326c[53]][_0x326c[60]](_0x326c[59])){var _0xccf0x21=parseInt(_0xccf0x16[_0x326c[53]].TriggerAllId);var _0xccf0x22=_[_0x326c[54]](_0xccf0x15,function(_0xccf0x20){return _0xccf0x20[_0x326c[49]]===_0xccf0x21});if(_0xccf0x22){_0xccf0x22[_0x326c[61]]=[]}}else {if(_0xccf0x16[_0x326c[53]][_0x326c[60]](_0x326c[62])){var _0xccf0x23=parseInt(_0xccf0x16[_0x326c[53]].TriggerAnyId);var _0xccf0x24=_[_0x326c[54]](_0xccf0x15,function(_0xccf0x20){return _0xccf0x20[_0x326c[49]]===_0xccf0x23});if(_0xccf0x24){_0xccf0x24[_0x326c[63]]=[]}}}});ToolsCondition[_0x326c[58]](function(_0xccf0x16){_[_0x326c[48]](_0xccf0x16,function(_0xccf0x25){if(_0xccf0x25[_0x326c[39]][_0x326c[60]](_0x326c[59])){var _0xccf0x21=parseInt(_0xccf0x25[_0x326c[39]].TriggerAllId);var _0xccf0x22=_[_0x326c[54]](_0xccf0x15,function(_0xccf0x20){return _0xccf0x20[_0x326c[49]]===_0xccf0x21});if(_0xccf0x22){_0xccf0x22[_0x326c[61]][_0x326c[57]](_0xccf0x25)}}else {if(_0xccf0x25[_0x326c[39]][_0x326c[60]](_0x326c[62])){var _0xccf0x23=parseInt(_0xccf0x25[_0x326c[39]].TriggerAnyId);var _0xccf0x24=_[_0x326c[54]](_0xccf0x15,function(_0xccf0x20){return _0xccf0x20[_0x326c[49]]===_0xccf0x23});if(_0xccf0x24){_0xccf0x24[_0x326c[63]][_0x326c[57]](_0xccf0x25)}}}})})}function updateCollection(_0xccf0x27,_0xccf0x16){var _0xccf0x28=_[_0x326c[54]](_0xccf0x27,{id:_0xccf0x16[_0x326c[49]]});var _0xccf0x29=_0xccf0x27[_0x326c[64]](_0xccf0x28);if(_0xccf0x28){_0xccf0x27[_0xccf0x29]=_[_0x326c[65]](_0xccf0x27[_0xccf0x29],_0xccf0x16)}else {_0xccf0x27[_0x326c[66]](_0xccf0x16)}}