Built motion from commit 2238b68.|1.0.18
[motion.git] / server / config / license / license.service.js
index eef8e56..68c2e34 100644 (file)
@@ -1 +1 @@
-var _0x7284=["\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"];_0x7284[0];var compose=require(_0x7284[1]);var moment=require(_0x7284[2]);var crypto=require(_0x7284[3]);var util=require(_0x7284[4]);var os=require(_0x7284[5]);var config=require(_0x7284[6]);var User=require(_0x7284[8])[_0x7284[7]];var Telephone=require(_0x7284[8])[_0x7284[9]];var Settings=require(_0x7284[8])[_0x7284[10]];var demoLicense={users:1,agents:1,telephones:0,chat:false,mail:false,fax:false,description:_0x7284[11]};function getUuid(){if(os[_0x7284[12]]()!==_0x7284[13]){var _0xf903xc=exec(_0x7284[15],{silent:true})[_0x7284[14]];var _0xf903xd=_0xf903xc[_0x7284[18]](_0x7284[17])[_0x7284[16]](0,-1);return _0xf903xd[0]}else {var _0xf903xc=exec(_0x7284[19],{silent:true})[_0x7284[14]];var _0xf903xd=_0xf903xc[_0x7284[18]](_0x7284[17])[_0x7284[16]](0,-1)[_0x7284[23]](function(_0xf903xe){var _0xf903xf,_0xf903x10,_0xf903xd;_0xf903x10= new RegExp(/(\w+)\=\"([^\"]+)/g);_0xf903xf={partition:_0xf903xe[_0x7284[20]](/^(\S+)\:\ /)[1]};while(_0xf903xd=_0xf903x10[_0x7284[22]](_0xf903xe)){_0xf903xf[_0xf903xd[1][_0x7284[21]]()]=_0xf903xd[2]};return _0xf903xf});return _0xf903xd[0][_0x7284[24]]}}function hasChat(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){var _0xf903x17=null,_0xf903x18=false;try{if(_0xf903x16[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x16[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};_0xf903x18=_0xf903x17[_0x7284[30]];if(!_0xf903x18){return _0xf903x13[_0x7284[31]](403)};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function hasSms(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){var _0xf903x17=null,_0xf903x1a=false;try{if(_0xf903x16[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x16[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};_0xf903x1a=_0xf903x17[_0x7284[35]];if(!_0xf903x1a){return _0xf903x13[_0x7284[31]](403)};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function hasCm(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){var _0xf903x17=null,_0xf903x1c=false;try{if(_0xf903x16[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x16[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};_0xf903x1c=_0xf903x17[_0x7284[36]];if(!_0xf903x1c){return _0xf903x13[_0x7284[31]](403)};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function hasUpdate(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){var _0xf903x17=null,_0xf903x1e=false;try{if(_0xf903x16[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x16[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};_0xf903x1e=_0xf903x17[_0x7284[37]];if(!_0xf903x1e){return _0xf903x13[_0x7284[31]](403)};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function hasMail(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){var _0xf903x17=null,_0xf903x20=false;try{if(_0xf903x16[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x16[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};_0xf903x20=_0xf903x17[_0x7284[38]];if(!_0xf903x20){return _0xf903x13[_0x7284[31]](403)};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function hasFax(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){var _0xf903x17=null,_0xf903x22=false;try{if(_0xf903x16[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x16[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};_0xf903x22=_0xf903x17[_0x7284[39]];if(!_0xf903x22){return _0xf903x13[_0x7284[31]](403)};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function isValidDate(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){var _0xf903x17=null,_0xf903x24=false;try{if(_0xf903x16[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x16[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17);if(moment()[_0x7284[41]](_0xf903x17[_0x7284[40]])){_0xf903x24=true}}}catch(err){console[_0x7284[29]](_0x7284[28],err)};if(!_0xf903x24){return _0xf903x13[_0x7284[31]](403)};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function isUsersLimit(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){var _0xf903x26;return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){_0xf903x26=_0xf903x16;return User[_0x7284[49]]({where:{$or:[{role:_0x7284[47]},{role:_0x7284[48]}]}})})[_0x7284[46]](function(_0xf903x27){var _0xf903x17=null,_0xf903x28=false;try{if(_0xf903x26[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x26[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};if(_0xf903x17[_0x7284[42]]>_0xf903x27){_0xf903x28=true};if(!_0xf903x28){return _0xf903x13[_0x7284[45]](403)[_0x7284[44]]({message:_0x7284[43]})};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function isTelephonesLimit(){return compose()[_0x7284[34]](function(_0xf903x12,_0xf903x13,_0xf903x14){var _0xf903x26;return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){_0xf903x26=_0xf903x16;return User[_0x7284[49]]({where:{role:_0x7284[52]}})})[_0x7284[46]](function(_0xf903x2a){var _0xf903x17=null,_0xf903x28=false;try{if(_0xf903x26[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x26[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};if(_0xf903x17[_0x7284[50]]>_0xf903x2a){_0xf903x28=true};if(!_0xf903x28){return _0xf903x13[_0x7284[45]](403)[_0x7284[44]]({message:_0x7284[51]})};return _0xf903x14()})[_0x7284[25]](function(_0xf903x15){return _0xf903x14(_0xf903x15)})})}function isValidAgent(){return function(_0xf903x2c){var _0xf903x26;var _0xf903x2d=false;if(_0xf903x2c[_0x7284[53]]===_0x7284[47]||_0xf903x2c[_0x7284[53]]===_0x7284[48]||(_0xf903x2c[_0x7284[53]]===_0x7284[54]&&_0xf903x2c[_0x7284[55]])){_0xf903x2d=true};return Settings[_0x7284[33]]({where:{id:1}})[_0x7284[32]](function(_0xf903x16){_0xf903x26=_0xf903x16;return User[_0x7284[49]]({where:{role:_0x7284[54],online:true}})})[_0x7284[46]](function(_0xf903x2e){var _0xf903x17=null;try{if(_0xf903x26[_0x7284[26]]){_0xf903x17=decrypt(_0xf903x26[_0x7284[26]]);_0xf903x17=JSON[_0x7284[27]](_0xf903x17)}else {_0xf903x17=demoLicense}}catch(err){console[_0x7284[29]](_0x7284[28],err);_0xf903x17=demoLicense};if(_0xf903x17[_0x7284[56]]>_0xf903x2e){_0xf903x2d=true};return _0xf903x2d})}}function decrypt(_0xf903x30){var _0xf903x31=getUuid();var _0xf903x32=_0xf903x31[_0x7284[18]](_0x7284[57])[4];var _0xf903x33=_0xf903x31[_0x7284[18]](_0x7284[57])[0];var _0xf903x34=crypto[_0x7284[61]](_0x7284[58],util[_0x7284[60]](_0x7284[59],_0xf903x32,_0xf903x31,_0xf903x33));var _0xf903x17=_0xf903x34[_0x7284[37]](_0xf903x30,_0x7284[62],_0x7284[63]);_0xf903x17+=_0xf903x34[_0x7284[64]](_0x7284[63]);return _0xf903x17}exports[_0x7284[65]]=getUuid;exports[_0x7284[66]]=isValidDate;exports[_0x7284[67]]=isUsersLimit;exports[_0x7284[68]]=isTelephonesLimit;exports[_0x7284[69]]=hasChat;exports[_0x7284[70]]=hasMail;exports[_0x7284[71]]=hasFax;exports[_0x7284[72]]=hasSms;exports[_0x7284[73]]=hasCm;exports[_0x7284[74]]=hasUpdate;exports[_0x7284[75]]=isValidAgent;exports[_0x7284[76]]=demoLicense;exports[_0x7284[77]]=decrypt
\ No newline at end of file
+var _0x66b3=["\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","\x65\x78\x65\x63\x53\x79\x6E\x63","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\x4C\x69\x63\x65\x6E\x73\x65","\x44\x45\x4D\x4F\x20\x4C\x49\x43\x45\x4E\x53\x45","\x0D\x0A","","\x72\x65\x70\x6C\x61\x63\x65","\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","\x75\x74\x66\x38","\x77\x69\x6E\x33\x32","\x2E\x2F\x68\x61\x72\x64\x77\x61\x72\x65","\x70\x6C\x61\x74\x66\x6F\x72\x6D","\x63\x61\x74\x63\x68","\x6C\x69\x63\x65\x6E\x73\x65","\x64\x61\x74\x61\x31","\x70\x61\x72\x73\x65","\x64\x65\x6D\x6F","\x4C\x69\x63\x65\x6E\x73\x65\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\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","\x63\x68\x61\x74","\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","\x63\x75\x73\x74\x6F\x6D","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x65\x78\x70\x69\x72\x61\x74\x69\x6F\x6E","\x69\x73\x53\x61\x6D\x65\x4F\x72\x42\x65\x66\x6F\x72\x65","\x4C\x69\x63\x65\x6E\x73\x65\x20\x64\x61\x74\x65\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x69\x6E\x66\x6F","\x4C\x69\x63\x65\x6E\x73\x65\x20\x75\x73\x65\x72\x73\x20\x6C\x69\x6D\x69\x74\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\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","\x4C\x69\x63\x65\x6E\x73\x65\x20\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x73\x20\x6C\x69\x6D\x69\x74\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\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","\x4C\x69\x63\x65\x6E\x73\x65\x20\x61\x67\x65\x6E\x74\x20\x76\x61\x6C\x69\x64\x69\x74\x79\x20\x63\x68\x65\x63\x6B\x20\x64\x65\x63\x72\x79\x70\x74\x20\x65\x72\x72\x6F\x72","\x61\x67\x65\x6E\x74\x73","\x2D","\x73\x70\x6C\x69\x74","\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","\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\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\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"];_0x66b3[0];var compose=require(_0x66b3[1]);var moment=require(_0x66b3[2]);var crypto=require(_0x66b3[3]);var util=require(_0x66b3[4]);var os=require(_0x66b3[5]);var exec=require(_0x66b3[7])[_0x66b3[6]];var config=require(_0x66b3[8]);var logger=require(_0x66b3[10])(_0x66b3[9]);var User=require(_0x66b3[12])[_0x66b3[11]];var Telephone=require(_0x66b3[12])[_0x66b3[13]];var Setting=require(_0x66b3[12])[_0x66b3[14]];var License=require(_0x66b3[12])[_0x66b3[15]];var demoLicense={demo:true,users:1,agents:1,telephones:0,chat:false,mail:false,fax:false,jscripty:false,messaging:false,openchannel:false,custom:false,cm:false,dialer:false,update:false,description:_0x66b3[16]};function getUuid(){switch(os[_0x66b3[24]]()){case _0x66b3[22]:return exec(_0x66b3[20],{encoding:_0x66b3[21]})[_0x66b3[19]](_0x66b3[17],_0x66b3[18]);default:return require(_0x66b3[23])(true)}}function checkLicense(_0x74e0x10){return compose()[_0x66b3[36]](function(_0x74e0x11,_0x74e0x12,_0x74e0x13){return License[_0x66b3[35]]({where:{id:1}})[_0x66b3[34]](function(_0x74e0x15){var _0x74e0x16=null;var _0x74e0x17=false;try{if(_0x74e0x15[_0x66b3[26]]){_0x74e0x16= decrypt(_0x74e0x15[_0x66b3[26]],_0x74e0x15[_0x66b3[27]]);_0x74e0x16= JSON[_0x66b3[28]](_0x74e0x16);_0x74e0x16[_0x66b3[29]]= false}else {_0x74e0x16= demoLicense;_0x74e0x16[_0x66b3[29]]= true}}catch(err){logger[_0x66b3[32]](_0x66b3[30],err[_0x66b3[31]]);_0x74e0x16= demoLicense;_0x74e0x16[_0x66b3[29]]= true};_0x74e0x17= _0x74e0x16[_0x74e0x10];if(!_0x74e0x17){return _0x74e0x12[_0x66b3[33]](403)};return _0x74e0x13()})[_0x66b3[25]](function(_0x74e0x14){return _0x74e0x13(_0x74e0x14)})})}function hasChat(){return checkLicense(_0x66b3[37])}function hasSms(){return checkLicense(_0x66b3[38])}function hasCm(){return checkLicense(_0x66b3[39])}function hasUpdate(){return checkLicense(_0x66b3[40])}function hasMail(){return checkLicense(_0x66b3[41])}function hasFax(){return checkLicense(_0x66b3[42])}function hasJscripty(){return checkLicense(_0x66b3[43])}function hasCustom(){return checkLicense(_0x66b3[44])}function hasOpenchannel(){return checkLicense(_0x66b3[45])}function isValidDate(){return compose()[_0x66b3[36]](function(_0x74e0x11,_0x74e0x12,_0x74e0x13){return License[_0x66b3[35]]({where:{id:1}})[_0x66b3[34]](function(_0x74e0x15){var _0x74e0x16=null,_0x74e0x22=false;try{if(_0x74e0x15[_0x66b3[26]]){_0x74e0x16= decrypt(_0x74e0x15[_0x66b3[26]],_0x74e0x15[_0x66b3[27]]);_0x74e0x16= JSON[_0x66b3[28]](_0x74e0x16);if(moment()[_0x66b3[47]](_0x74e0x16[_0x66b3[46]])){_0x74e0x22= true}}}catch(err){logger[_0x66b3[49]](_0x66b3[48],err[_0x66b3[31]])};if(!_0x74e0x22){return _0x74e0x12[_0x66b3[33]](403)};return _0x74e0x13()})[_0x66b3[25]](function(_0x74e0x14){return _0x74e0x13(_0x74e0x14)})})}function isUsersLimit(){return compose()[_0x66b3[36]](function(_0x74e0x11,_0x74e0x12,_0x74e0x13){var _0x74e0x15;return License[_0x66b3[35]]({where:{id:1}})[_0x66b3[34]](function(_0x74e0x26){_0x74e0x15= _0x74e0x26;return User[_0x66b3[58]]({where:{$or:[{role:_0x66b3[56]},{role:_0x66b3[57]}]}})})[_0x66b3[55]](function(_0x74e0x24){var _0x74e0x16=null,_0x74e0x25=false;try{if(_0x74e0x15[_0x66b3[26]]){_0x74e0x16= decrypt(_0x74e0x15[_0x66b3[26]],_0x74e0x15[_0x66b3[27]]);_0x74e0x16= JSON[_0x66b3[28]](_0x74e0x16)}else {_0x74e0x16= demoLicense}}catch(err){logger[_0x66b3[49]](_0x66b3[50],err[_0x66b3[31]]);_0x74e0x16= demoLicense};if(_0x74e0x16[_0x66b3[51]]> _0x74e0x24){_0x74e0x25= true};if(!_0x74e0x25){return _0x74e0x12[_0x66b3[54]](403)[_0x66b3[53]]({message:_0x66b3[52]})};return _0x74e0x13()})[_0x66b3[25]](function(_0x74e0x14){return _0x74e0x13(_0x74e0x14)})})}function isTelephonesLimit(){return compose()[_0x66b3[36]](function(_0x74e0x11,_0x74e0x12,_0x74e0x13){var _0x74e0x15;return License[_0x66b3[35]]({where:{id:1}})[_0x66b3[34]](function(_0x74e0x26){_0x74e0x15= _0x74e0x26;return User[_0x66b3[58]]({where:{role:_0x66b3[62]}})})[_0x66b3[55]](function(_0x74e0x28){var _0x74e0x16=null,_0x74e0x25=false;try{if(_0x74e0x15[_0x66b3[26]]){_0x74e0x16= decrypt(_0x74e0x15[_0x66b3[26]],_0x74e0x15[_0x66b3[27]]);_0x74e0x16= JSON[_0x66b3[28]](_0x74e0x16)}else {_0x74e0x16= demoLicense}}catch(err){logger[_0x66b3[49]](_0x66b3[59],err[_0x66b3[31]]);_0x74e0x16= demoLicense};if(_0x74e0x16[_0x66b3[60]]> _0x74e0x28){_0x74e0x25= true};if(!_0x74e0x25){return _0x74e0x12[_0x66b3[54]](403)[_0x66b3[53]]({message:_0x66b3[61]})};return _0x74e0x13()})[_0x66b3[25]](function(_0x74e0x14){return _0x74e0x13(_0x74e0x14)})})}function isValidAgent(){return function(_0x74e0x2a){var _0x74e0x15;var _0x74e0x2b=false;if(_0x74e0x2a[_0x66b3[63]]=== _0x66b3[56]|| _0x74e0x2a[_0x66b3[63]]=== _0x66b3[57]|| (_0x74e0x2a[_0x66b3[63]]=== _0x66b3[64]&& _0x74e0x2a[_0x66b3[65]])){_0x74e0x2b= true};return License[_0x66b3[35]]({where:{id:1}})[_0x66b3[34]](function(_0x74e0x26){_0x74e0x15= _0x74e0x26;return User[_0x66b3[58]]({where:{role:_0x66b3[64],online:true}})})[_0x66b3[55]](function(_0x74e0x2c){var _0x74e0x16=null;try{if(_0x74e0x15[_0x66b3[26]]){_0x74e0x16= decrypt(_0x74e0x15[_0x66b3[26]],_0x74e0x15[_0x66b3[27]]);_0x74e0x16= JSON[_0x66b3[28]](_0x74e0x16)}else {_0x74e0x16= demoLicense}}catch(err){logger[_0x66b3[49]](_0x66b3[66],err);_0x74e0x16= demoLicense};if(_0x74e0x16[_0x66b3[67]]> _0x74e0x2c){_0x74e0x2b= true};return _0x74e0x2b})}}function decrypt(_0x74e0x2e,_0x74e0x2f){var _0x74e0x30=_0x74e0x2f[_0x66b3[69]](_0x66b3[68])[4];var _0x74e0x31=_0x74e0x2f[_0x66b3[69]](_0x66b3[68])[0];var _0x74e0x32=crypto[_0x66b3[73]](_0x66b3[70],util[_0x66b3[72]](_0x66b3[71],_0x74e0x30,_0x74e0x2f,_0x74e0x31));var _0x74e0x15=_0x74e0x32[_0x66b3[40]](_0x74e0x2e,_0x66b3[74],_0x66b3[21]);_0x74e0x15+= _0x74e0x32[_0x66b3[75]](_0x66b3[21]);return _0x74e0x15}exports[_0x66b3[76]]= getUuid;exports[_0x66b3[77]]= isValidDate;exports[_0x66b3[78]]= isUsersLimit;exports[_0x66b3[79]]= isTelephonesLimit;exports[_0x66b3[80]]= hasChat;exports[_0x66b3[81]]= hasMail;exports[_0x66b3[82]]= hasFax;exports[_0x66b3[83]]= hasOpenchannel;exports[_0x66b3[84]]= hasSms;exports[_0x66b3[85]]= hasJscripty;exports[_0x66b3[86]]= hasCm;exports[_0x66b3[87]]= hasUpdate;exports[_0x66b3[88]]= isValidAgent;exports[_0x66b3[89]]= demoLicense;exports[_0x66b3[90]]= decrypt
\ No newline at end of file