Built motion from commit 1020cd7.|0.0.107
[motion.git] / server / config / license / license.service.js
index 8f4794b..e940940 100644 (file)
@@ -1 +1 @@
-var _0x79aa=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x63\x6F\x6D\x70\x6F\x73\x61\x62\x6C\x65\x2D\x6D\x69\x64\x64\x6C\x65\x77\x61\x72\x65","\x6D\x6F\x6D\x65\x6E\x74","\x63\x72\x79\x70\x74\x6F","\x75\x74\x69\x6C","\x6F\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x53\x65\x74\x74\x69\x6E\x67\x73","\x44\x45\x4D\x4F\x20\x4C\x49\x43\x45\x4E\x53\x45","\x70\x6C\x61\x74\x66\x6F\x72\x6D","\x6C\x69\x6E\x75\x78","\x6F\x75\x74\x70\x75\x74","\x64\x6D\x69\x64\x65\x63\x6F\x64\x65\x20\x2D\x2D\x73\x74\x72\x69\x6E\x67\x20\x73\x79\x73\x74\x65\x6D\x2D\x75\x75\x69\x64","\x73\x6C\x69\x63\x65","\x0A","\x73\x70\x6C\x69\x74","\x62\x6C\x6B\x69\x64\x20\x2D\x67\x20\x26\x26\x20\x62\x6C\x6B\x69\x64","\x6D\x61\x74\x63\x68","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x65\x78\x65\x63","\x6D\x61\x70","\x75\x75\x69\x64","\x63\x61\x74\x63\x68","\x6C\x69\x63\x65\x6E\x73\x65","\x70\x61\x72\x73\x65","\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x6C\x6F\x67","\x63\x68\x61\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x73\x70\x72\x65\x61\x64","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x75\x73\x65","\x6D\x65\x73\x73\x61\x67\x69\x6E\x67","\x63\x6D","\x75\x70\x64\x61\x74\x65","\x6D\x61\x69\x6C","\x66\x61\x78","\x65\x78\x70\x69\x72\x61\x74\x69\x6F\x6E","\x69\x73\x53\x61\x6D\x65\x4F\x72\x42\x65\x66\x6F\x72\x65","\x75\x73\x65\x72\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x75\x73\x65\x72\x73\x20\x6C\x69\x6D\x69\x74\x20\x68\x61\x76\x65\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x61\x64\x6D\x69\x6E","\x75\x73\x65\x72","\x63\x6F\x75\x6E\x74","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x20\x6C\x69\x6D\x69\x74\x20\x68\x61\x76\x65\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74","\x6F\x6E\x6C\x69\x6E\x65","\x61\x67\x65\x6E\x74\x73","\x2D","\x61\x65\x73\x2D\x32\x35\x36\x2D\x63\x74\x72","\x25\x73\x3A\x25\x73\x3A\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x63\x72\x65\x61\x74\x65\x44\x65\x63\x69\x70\x68\x65\x72","\x62\x61\x73\x65\x36\x34","\x75\x74\x66\x38","\x66\x69\x6E\x61\x6C","\x67\x65\x74\x55\x75\x69\x64","\x69\x73\x56\x61\x6C\x69\x64\x44\x61\x74\x65","\x69\x73\x55\x73\x65\x72\x73\x4C\x69\x6D\x69\x74","\x69\x73\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x4C\x69\x6D\x69\x74","\x68\x61\x73\x43\x68\x61\x74","\x68\x61\x73\x4D\x61\x69\x6C","\x68\x61\x73\x46\x61\x78","\x68\x61\x73\x53\x6D\x73","\x68\x61\x73\x43\x6D","\x68\x61\x73\x55\x70\x64\x61\x74\x65","\x69\x73\x56\x61\x6C\x69\x64\x41\x67\x65\x6E\x74","\x64\x65\x6D\x6F\x4C\x69\x63\x65\x6E\x73\x65","\x64\x65\x63\x72\x79\x70\x74"];_0x79aa[0];var compose=require(_0x79aa[1]);var moment=require(_0x79aa[2]);var crypto=require(_0x79aa[3]);var util=require(_0x79aa[4]);var os=require(_0x79aa[5]);var config=require(_0x79aa[6]);var User=require(_0x79aa[8])[_0x79aa[7]];var Telephone=require(_0x79aa[8])[_0x79aa[9]];var Settings=require(_0x79aa[8])[_0x79aa[10]];var demoLicense={users:1,agents:1,telephones:0,chat:false,mail:false,fax:false,description:_0x79aa[11]};function getUuid(){if(os[_0x79aa[12]]()!==_0x79aa[13]){var _0xeb23xc=exec(_0x79aa[15],{silent:true})[_0x79aa[14]];var _0xeb23xd=_0xeb23xc[_0x79aa[18]](_0x79aa[17])[_0x79aa[16]](0,-1);return _0xeb23xd[0]}else {var _0xeb23xc=exec(_0x79aa[19],{silent:true})[_0x79aa[14]];var _0xeb23xd=_0xeb23xc[_0x79aa[18]](_0x79aa[17])[_0x79aa[16]](0,-1)[_0x79aa[23]](function(_0xeb23xe){var _0xeb23xf,_0xeb23x10,_0xeb23xd;_0xeb23x10= new RegExp(/(\w+)\=\"([^\"]+)/g);_0xeb23xf={partition:_0xeb23xe[_0x79aa[20]](/^(\S+)\:\ /)[1]};while(_0xeb23xd=_0xeb23x10[_0x79aa[22]](_0xeb23xe)){_0xeb23xf[_0xeb23xd[1][_0x79aa[21]]()]=_0xeb23xd[2]};return _0xeb23xf});return _0xeb23xd[0][_0x79aa[24]]}}function hasChat(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){var _0xeb23x17=null,_0xeb23x18=false;try{if(_0xeb23x16[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x16[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};_0xeb23x18=_0xeb23x17[_0x79aa[30]];if(!_0xeb23x18){return _0xeb23x13[_0x79aa[31]](403)};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function hasSms(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){var _0xeb23x17=null,_0xeb23x1a=false;try{if(_0xeb23x16[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x16[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};_0xeb23x1a=_0xeb23x17[_0x79aa[35]];if(!_0xeb23x1a){return _0xeb23x13[_0x79aa[31]](403)};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function hasCm(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){var _0xeb23x17=null,_0xeb23x1c=false;try{if(_0xeb23x16[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x16[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};_0xeb23x1c=_0xeb23x17[_0x79aa[36]];if(!_0xeb23x1c){return _0xeb23x13[_0x79aa[31]](403)};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function hasUpdate(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){var _0xeb23x17=null,_0xeb23x1e=false;try{if(_0xeb23x16[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x16[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};_0xeb23x1e=_0xeb23x17[_0x79aa[37]];if(!_0xeb23x1e){return _0xeb23x13[_0x79aa[31]](403)};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function hasMail(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){var _0xeb23x17=null,_0xeb23x20=false;try{if(_0xeb23x16[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x16[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};_0xeb23x20=_0xeb23x17[_0x79aa[38]];if(!_0xeb23x20){return _0xeb23x13[_0x79aa[31]](403)};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function hasFax(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){var _0xeb23x17=null,_0xeb23x22=false;try{if(_0xeb23x16[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x16[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};_0xeb23x22=_0xeb23x17[_0x79aa[39]];if(!_0xeb23x22){return _0xeb23x13[_0x79aa[31]](403)};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function isValidDate(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){var _0xeb23x17=null,_0xeb23x24=false;try{if(_0xeb23x16[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x16[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17);if(moment()[_0x79aa[41]](_0xeb23x17[_0x79aa[40]])){_0xeb23x24=true}}}catch(err){console[_0x79aa[29]](_0x79aa[28],err)};if(!_0xeb23x24){return _0xeb23x13[_0x79aa[31]](403)};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function isUsersLimit(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){var _0xeb23x26;return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){_0xeb23x26=_0xeb23x16;return User[_0x79aa[49]]({where:{$or:[{role:_0x79aa[47]},{role:_0x79aa[48]}]}})})[_0x79aa[46]](function(_0xeb23x27){var _0xeb23x17=null,_0xeb23x28=false;try{if(_0xeb23x26[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x26[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};if(_0xeb23x17[_0x79aa[42]]>_0xeb23x27){_0xeb23x28=true};if(!_0xeb23x28){return _0xeb23x13[_0x79aa[45]](403)[_0x79aa[44]]({message:_0x79aa[43]})};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function isTelephonesLimit(){return compose()[_0x79aa[34]](function(_0xeb23x12,_0xeb23x13,_0xeb23x14){var _0xeb23x26;return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){_0xeb23x26=_0xeb23x16;return User[_0x79aa[49]]({where:{role:_0x79aa[52]}})})[_0x79aa[46]](function(_0xeb23x2a){var _0xeb23x17=null,_0xeb23x28=false;try{if(_0xeb23x26[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x26[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};if(_0xeb23x17[_0x79aa[50]]>_0xeb23x2a){_0xeb23x28=true};if(!_0xeb23x28){return _0xeb23x13[_0x79aa[45]](403)[_0x79aa[44]]({message:_0x79aa[51]})};return _0xeb23x14()})[_0x79aa[25]](function(_0xeb23x15){return _0xeb23x14(_0xeb23x15)})})}function isValidAgent(){return function(_0xeb23x2c){var _0xeb23x26;var _0xeb23x2d=false;if(_0xeb23x2c[_0x79aa[53]]===_0x79aa[47]||_0xeb23x2c[_0x79aa[53]]===_0x79aa[48]||(_0xeb23x2c[_0x79aa[53]]===_0x79aa[54]&&_0xeb23x2c[_0x79aa[55]])){_0xeb23x2d=true};return Settings[_0x79aa[33]]({where:{id:1}})[_0x79aa[32]](function(_0xeb23x16){_0xeb23x26=_0xeb23x16;return User[_0x79aa[49]]({where:{role:_0x79aa[54],online:true}})})[_0x79aa[46]](function(_0xeb23x2e){var _0xeb23x17=null;try{if(_0xeb23x26[_0x79aa[26]]){_0xeb23x17=decrypt(_0xeb23x26[_0x79aa[26]]);_0xeb23x17=JSON[_0x79aa[27]](_0xeb23x17)}else {_0xeb23x17=demoLicense}}catch(err){console[_0x79aa[29]](_0x79aa[28],err);_0xeb23x17=demoLicense};if(_0xeb23x17[_0x79aa[56]]>_0xeb23x2e){_0xeb23x2d=true};return _0xeb23x2d})}}function decrypt(_0xeb23x30){var _0xeb23x31=getUuid();var _0xeb23x32=_0xeb23x31[_0x79aa[18]](_0x79aa[57])[4];var _0xeb23x33=_0xeb23x31[_0x79aa[18]](_0x79aa[57])[0];var _0xeb23x34=crypto[_0x79aa[61]](_0x79aa[58],util[_0x79aa[60]](_0x79aa[59],_0xeb23x32,_0xeb23x31,_0xeb23x33));var _0xeb23x17=_0xeb23x34[_0x79aa[37]](_0xeb23x30,_0x79aa[62],_0x79aa[63]);_0xeb23x17+=_0xeb23x34[_0x79aa[64]](_0x79aa[63]);return _0xeb23x17}exports[_0x79aa[65]]=getUuid;exports[_0x79aa[66]]=isValidDate;exports[_0x79aa[67]]=isUsersLimit;exports[_0x79aa[68]]=isTelephonesLimit;exports[_0x79aa[69]]=hasChat;exports[_0x79aa[70]]=hasMail;exports[_0x79aa[71]]=hasFax;exports[_0x79aa[72]]=hasSms;exports[_0x79aa[73]]=hasCm;exports[_0x79aa[74]]=hasUpdate;exports[_0x79aa[75]]=isValidAgent;exports[_0x79aa[76]]=demoLicense;exports[_0x79aa[77]]=decrypt
\ No newline at end of file
+var _0xfbf5=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x63\x6F\x6D\x70\x6F\x73\x61\x62\x6C\x65\x2D\x6D\x69\x64\x64\x6C\x65\x77\x61\x72\x65","\x6D\x6F\x6D\x65\x6E\x74","\x63\x72\x79\x70\x74\x6F","\x75\x74\x69\x6C","\x6F\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x53\x65\x74\x74\x69\x6E\x67\x73","\x44\x45\x4D\x4F\x20\x4C\x49\x43\x45\x4E\x53\x45","\x6F\x75\x74\x70\x75\x74","\x64\x6D\x69\x64\x65\x63\x6F\x64\x65\x20\x2D\x2D\x73\x74\x72\x69\x6E\x67\x20\x73\x79\x73\x74\x65\x6D\x2D\x75\x75\x69\x64","\x73\x6C\x69\x63\x65","\x0D\x0A","\x73\x70\x6C\x69\x74","\x77\x69\x6E\x33\x32","\x0A","\x64\x61\x72\x77\x69\x6E","\x62\x6C\x6B\x69\x64\x20\x2D\x67\x20\x26\x26\x20\x62\x6C\x6B\x69\x64","\x6D\x61\x74\x63\x68","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x65\x78\x65\x63","\x6D\x61\x70","\x75\x75\x69\x64","\x70\x6C\x61\x74\x66\x6F\x72\x6D","\x63\x61\x74\x63\x68","\x6C\x69\x63\x65\x6E\x73\x65","\x70\x61\x72\x73\x65","\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x6C\x6F\x67","\x63\x68\x61\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x73\x70\x72\x65\x61\x64","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x75\x73\x65","\x6D\x65\x73\x73\x61\x67\x69\x6E\x67","\x63\x6D","\x75\x70\x64\x61\x74\x65","\x6D\x61\x69\x6C","\x66\x61\x78","\x6A\x73\x63\x72\x69\x70\x74\x79","\x65\x78\x70\x69\x72\x61\x74\x69\x6F\x6E","\x69\x73\x53\x61\x6D\x65\x4F\x72\x42\x65\x66\x6F\x72\x65","\x75\x73\x65\x72\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x75\x73\x65\x72\x73\x20\x6C\x69\x6D\x69\x74\x20\x68\x61\x76\x65\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x61\x64\x6D\x69\x6E","\x75\x73\x65\x72","\x63\x6F\x75\x6E\x74","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73","\x4D\x61\x78\x69\x6D\x75\x6D\x20\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x20\x6C\x69\x6D\x69\x74\x20\x68\x61\x76\x65\x20\x62\x65\x65\x6E\x20\x72\x65\x61\x63\x68\x65\x64","\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74","\x6F\x6E\x6C\x69\x6E\x65","\x61\x67\x65\x6E\x74\x73","\x2D","\x61\x65\x73\x2D\x32\x35\x36\x2D\x63\x74\x72","\x25\x73\x3A\x25\x73\x3A\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x63\x72\x65\x61\x74\x65\x44\x65\x63\x69\x70\x68\x65\x72","\x62\x61\x73\x65\x36\x34","\x75\x74\x66\x38","\x66\x69\x6E\x61\x6C","\x67\x65\x74\x55\x75\x69\x64","\x69\x73\x56\x61\x6C\x69\x64\x44\x61\x74\x65","\x69\x73\x55\x73\x65\x72\x73\x4C\x69\x6D\x69\x74","\x69\x73\x54\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x4C\x69\x6D\x69\x74","\x68\x61\x73\x43\x68\x61\x74","\x68\x61\x73\x4D\x61\x69\x6C","\x68\x61\x73\x46\x61\x78","\x68\x61\x73\x53\x6D\x73","\x68\x61\x73\x4A\x73\x63\x72\x69\x70\x74\x79","\x68\x61\x73\x43\x6D","\x68\x61\x73\x55\x70\x64\x61\x74\x65","\x69\x73\x56\x61\x6C\x69\x64\x41\x67\x65\x6E\x74","\x64\x65\x6D\x6F\x4C\x69\x63\x65\x6E\x73\x65","\x64\x65\x63\x72\x79\x70\x74"];_0xfbf5[0];var compose=require(_0xfbf5[1]);var moment=require(_0xfbf5[2]);var crypto=require(_0xfbf5[3]);var util=require(_0xfbf5[4]);var os=require(_0xfbf5[5]);var config=require(_0xfbf5[6]);var User=require(_0xfbf5[8])[_0xfbf5[7]];var Telephone=require(_0xfbf5[8])[_0xfbf5[9]];var Settings=require(_0xfbf5[8])[_0xfbf5[10]];var demoLicense={users:1,agents:1,telephones:0,chat:false,mail:false,fax:false,jscripty:false,description:_0xfbf5[11]};function getUuid(){var _0x5d19xc;var _0x5d19xd;switch(os[_0xfbf5[26]]()){case _0xfbf5[17]:_0x5d19xc=exec(_0xfbf5[13],{silent:true})[_0xfbf5[12]];_0x5d19xd=_0x5d19xc[_0xfbf5[16]](_0xfbf5[15])[_0xfbf5[14]](0,-1);return _0x5d19xd[0];case _0xfbf5[19]:_0x5d19xc=exec(_0xfbf5[13],{silent:true})[_0xfbf5[12]];_0x5d19xd=_0x5d19xc[_0xfbf5[16]](_0xfbf5[18])[_0xfbf5[14]](0,-1);return _0x5d19xd[0];default:_0x5d19xc=exec(_0xfbf5[20],{silent:true})[_0xfbf5[12]];_0x5d19xd=_0x5d19xc[_0xfbf5[16]](_0xfbf5[18])[_0xfbf5[14]](0,-1)[_0xfbf5[24]](function(_0x5d19xe){var _0x5d19xf,_0x5d19x10,_0x5d19xd;_0x5d19x10= new RegExp(/(\w+)\=\"([^\"]+)/g);_0x5d19xf={partition:_0x5d19xe[_0xfbf5[21]](/^(\S+)\:\ /)[1]};while(_0x5d19xd=_0x5d19x10[_0xfbf5[23]](_0x5d19xe)){_0x5d19xf[_0x5d19xd[1][_0xfbf5[22]]()]=_0x5d19xd[2]};return _0x5d19xf});return _0x5d19xd[0][_0xfbf5[25]]}}function hasChat(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x18=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};_0x5d19x18=_0x5d19x17[_0xfbf5[32]];if(!_0x5d19x18){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function hasSms(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x1a=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};_0x5d19x1a=_0x5d19x17[_0xfbf5[37]];if(!_0x5d19x1a){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function hasCm(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x1c=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};_0x5d19x1c=_0x5d19x17[_0xfbf5[38]];if(!_0x5d19x1c){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function hasUpdate(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x1e=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};_0x5d19x1e=_0x5d19x17[_0xfbf5[39]];if(!_0x5d19x1e){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function hasMail(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x20=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};_0x5d19x20=_0x5d19x17[_0xfbf5[40]];if(!_0x5d19x20){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function hasFax(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x22=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};_0x5d19x22=_0x5d19x17[_0xfbf5[41]];if(!_0x5d19x22){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function hasJscripty(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x24=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};_0x5d19x24=_0x5d19x17[_0xfbf5[42]];if(!_0x5d19x24){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function isValidDate(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){var _0x5d19x17=null,_0x5d19x26=false;try{if(_0x5d19x16[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x16[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17);if(moment()[_0xfbf5[44]](_0x5d19x17[_0xfbf5[43]])){_0x5d19x26=true}}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err)};if(!_0x5d19x26){return _0x5d19x13[_0xfbf5[33]](403)};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function isUsersLimit(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){var _0x5d19x28;return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){_0x5d19x28=_0x5d19x16;return User[_0xfbf5[52]]({where:{$or:[{role:_0xfbf5[50]},{role:_0xfbf5[51]}]}})})[_0xfbf5[49]](function(_0x5d19x29){var _0x5d19x17=null,_0x5d19x2a=false;try{if(_0x5d19x28[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x28[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};if(_0x5d19x17[_0xfbf5[45]]>_0x5d19x29){_0x5d19x2a=true};if(!_0x5d19x2a){return _0x5d19x13[_0xfbf5[48]](403)[_0xfbf5[47]]({message:_0xfbf5[46]})};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function isTelephonesLimit(){return compose()[_0xfbf5[36]](function(_0x5d19x12,_0x5d19x13,_0x5d19x14){var _0x5d19x28;return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){_0x5d19x28=_0x5d19x16;return User[_0xfbf5[52]]({where:{role:_0xfbf5[55]}})})[_0xfbf5[49]](function(_0x5d19x2c){var _0x5d19x17=null,_0x5d19x2a=false;try{if(_0x5d19x28[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x28[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};if(_0x5d19x17[_0xfbf5[53]]>_0x5d19x2c){_0x5d19x2a=true};if(!_0x5d19x2a){return _0x5d19x13[_0xfbf5[48]](403)[_0xfbf5[47]]({message:_0xfbf5[54]})};return _0x5d19x14()})[_0xfbf5[27]](function(_0x5d19x15){return _0x5d19x14(_0x5d19x15)})})}function isValidAgent(){return function(_0x5d19x2e){var _0x5d19x28;var _0x5d19x2f=false;if(_0x5d19x2e[_0xfbf5[56]]===_0xfbf5[50]||_0x5d19x2e[_0xfbf5[56]]===_0xfbf5[51]||(_0x5d19x2e[_0xfbf5[56]]===_0xfbf5[57]&&_0x5d19x2e[_0xfbf5[58]])){_0x5d19x2f=true};return Settings[_0xfbf5[35]]({where:{id:1}})[_0xfbf5[34]](function(_0x5d19x16){_0x5d19x28=_0x5d19x16;return User[_0xfbf5[52]]({where:{role:_0xfbf5[57],online:true}})})[_0xfbf5[49]](function(_0x5d19x30){var _0x5d19x17=null;try{if(_0x5d19x28[_0xfbf5[28]]){_0x5d19x17=decrypt(_0x5d19x28[_0xfbf5[28]]);_0x5d19x17=JSON[_0xfbf5[29]](_0x5d19x17)}else {_0x5d19x17=demoLicense}}catch(err){console[_0xfbf5[31]](_0xfbf5[30],err);_0x5d19x17=demoLicense};if(_0x5d19x17[_0xfbf5[59]]>_0x5d19x30){_0x5d19x2f=true};return _0x5d19x2f})}}function decrypt(_0x5d19x32){var _0x5d19x33=getUuid();var _0x5d19x34=_0x5d19x33[_0xfbf5[16]](_0xfbf5[60])[4];var _0x5d19x35=_0x5d19x33[_0xfbf5[16]](_0xfbf5[60])[0];var _0x5d19x36=crypto[_0xfbf5[64]](_0xfbf5[61],util[_0xfbf5[63]](_0xfbf5[62],_0x5d19x34,_0x5d19x33,_0x5d19x35));var _0x5d19x17=_0x5d19x36[_0xfbf5[39]](_0x5d19x32,_0xfbf5[65],_0xfbf5[66]);_0x5d19x17+=_0x5d19x36[_0xfbf5[67]](_0xfbf5[66]);return _0x5d19x17}exports[_0xfbf5[68]]=getUuid;exports[_0xfbf5[69]]=isValidDate;exports[_0xfbf5[70]]=isUsersLimit;exports[_0xfbf5[71]]=isTelephonesLimit;exports[_0xfbf5[72]]=hasChat;exports[_0xfbf5[73]]=hasMail;exports[_0xfbf5[74]]=hasFax;exports[_0xfbf5[75]]=hasSms;exports[_0xfbf5[76]]=hasJscripty;exports[_0xfbf5[77]]=hasCm;exports[_0xfbf5[78]]=hasUpdate;exports[_0xfbf5[79]]=isValidAgent;exports[_0xfbf5[80]]=demoLicense;exports[_0xfbf5[81]]=decrypt
\ No newline at end of file