Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / agi / graph / index.js
index 9bc1189..921d900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a31=['getsecretdigits','vertices','edges','prototype','addVertex','addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','menu','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','getdigits'];(function(_0x234515,_0x46700e){var _0x5bdd8f=function(_0x56e5b3){while(--_0x56e5b3){_0x234515['push'](_0x234515['shift']());}};_0x5bdd8f(++_0x46700e);}(_0x9a31,0x1a1));var _0x19a3=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0x9a31[_0x27c24e];return _0x39004a;};'use strict';var _=require(_0x19a3('0x0'));var logger=require(_0x19a3('0x1'))('agi');var verticesWithRetry=['menu',_0x19a3('0x2'),_0x19a3('0x3')];var Graph=function(){this[_0x19a3('0x4')]={};this[_0x19a3('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x19a3('0x6')][_0x19a3('0x7')]=function(_0x401994){this[_0x19a3('0x4')][_0x401994['id']]=_0x401994;this[_0x19a3('0x5')][_0x401994['id']]=[];};Graph[_0x19a3('0x6')][_0x19a3('0x8')]=function(_0x5ac212,_0x4c0291,_0x4d3833){this[_0x19a3('0x5')][_0x5ac212][_0x19a3('0x9')]({'target':_0x4c0291,'condition':_0x4d3833});this[_0x19a3('0xa')]+=0x1;};Graph[_0x19a3('0x6')][_0x19a3('0xb')]=function(){return _[_0x19a3('0xb')](this['vertices']);};Graph[_0x19a3('0x6')][_0x19a3('0xc')]=function(){return this[_0x19a3('0xa')];};Graph[_0x19a3('0x6')][_0x19a3('0xd')]=function(_0x50e26c){return this[_0x19a3('0x4')][_0x50e26c];};Graph[_0x19a3('0x6')][_0x19a3('0xe')]=function(_0x37c05f,_0x35d835){if(!this[_0x19a3('0x4')][_0x37c05f]){return logger['info'](_0x19a3('0xf'));}var _0x1b67ca=_0x35d835(this[_0x19a3('0x4')][_0x37c05f]);if(!_0x1b67ca){return logger[_0x19a3('0x10')]('stop\x20traverse');}if(this[_0x19a3('0x5')][_0x37c05f][_0x19a3('0x11')]===0x0){return logger[_0x19a3('0x10')](_0x19a3('0x12'));}for(var _0x498f3b=0x0,_0xb348cf=[],_0x2dfd18=![];_0x498f3b<this[_0x19a3('0x5')][_0x37c05f][_0x19a3('0x11')];_0x498f3b+=0x1){if(this[_0x19a3('0x5')][_0x37c05f][_0x498f3b][_0x19a3('0x13')]){_0xb348cf=this[_0x19a3('0x5')][_0x37c05f][_0x498f3b][_0x19a3('0x13')]['split'](',');for(var _0x537c6d=0x0;_0x537c6d<_0xb348cf['length'];_0x537c6d+=0x1){if(this[_0x19a3('0x4')][_0x37c05f][_0x19a3('0x14')]===_0x19a3('0x15')&&_0xb348cf[_0x537c6d]==='-'){_0x2dfd18=this[_0x19a3('0x5')][_0x37c05f][_0x498f3b][_0x19a3('0x16')];logger[_0x19a3('0x10')](_0x19a3('0x17'),_0xb348cf[_0x537c6d],this['edges'][_0x37c05f][_0x498f3b][_0x19a3('0x16')]);}else if(this[_0x19a3('0x4')][_0x37c05f][_0x19a3('0x14')]===_0x19a3('0x18')&&_0xb348cf[_0x537c6d]==='i'){_0x2dfd18=this[_0x19a3('0x5')][_0x37c05f][_0x498f3b]['target'];logger[_0x19a3('0x10')](_0x19a3('0x19'),_0xb348cf[_0x537c6d],this[_0x19a3('0x5')][_0x37c05f][_0x498f3b][_0x19a3('0x16')]);}if(_0xb348cf[_0x537c6d]===_0x1b67ca){return this['traverseBFS'](this[_0x19a3('0x5')][_0x37c05f][_0x498f3b]['target'],_0x35d835);}}}else{return this[_0x19a3('0xe')](this['edges'][_0x37c05f][_0x498f3b][_0x19a3('0x16')],_0x35d835);}}if(_0xb348cf[_0x19a3('0x11')]){if(this[_0x19a3('0x4')][_0x37c05f][_0x19a3('0x14')]===_0x19a3('0x15')){if(_0x2dfd18){return this['traverseBFS'](_0x2dfd18,_0x35d835);}return logger[_0x19a3('0x10')](_0x19a3('0x1a'));}else if(_[_0x19a3('0x1b')](verticesWithRetry,this[_0x19a3('0x4')][_0x37c05f][_0x19a3('0x14')])){if(_0x1b67ca==='-'){return logger['info']('max\x20retry\x20reach');}if(_0x2dfd18&&_0x1b67ca!=='t'){return this[_0x19a3('0xe')](_0x2dfd18,_0x35d835);}return this[_0x19a3('0xe')](_0x37c05f,_0x35d835);}return logger[_0x19a3('0x10')](_0x19a3('0x1c'));}};module[_0x19a3('0x1d')]=Graph;
\ No newline at end of file
+var _0x26d5=['no\x20edge/s\x20available','length','condition','agicommand','target','vswitch','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getdigits','vertices','edges','numberOfEdges','prototype','addVertex','size','relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0x26d5,0x14f));var _0x526d=function(_0x54ebec,_0x4ef157){_0x54ebec=_0x54ebec-0x0;var _0x34b0a0=_0x26d5[_0x54ebec];return _0x34b0a0;};'use strict';var _=require('lodash');var logger=require(_0x526d('0x0'))(_0x526d('0x1'));var verticesWithRetry=[_0x526d('0x2'),_0x526d('0x3'),'getsecretdigits'];var Graph=function(){this[_0x526d('0x4')]={};this[_0x526d('0x5')]={};this[_0x526d('0x6')]=0x0;};Graph[_0x526d('0x7')][_0x526d('0x8')]=function(_0x81167f){this[_0x526d('0x4')][_0x81167f['id']]=_0x81167f;this['edges'][_0x81167f['id']]=[];};Graph[_0x526d('0x7')]['addEdge']=function(_0x2eda62,_0x542a46,_0x113f77){this[_0x526d('0x5')][_0x2eda62]['push']({'target':_0x542a46,'condition':_0x113f77});this['numberOfEdges']+=0x1;};Graph[_0x526d('0x7')][_0x526d('0x9')]=function(){return _[_0x526d('0x9')](this['vertices']);};Graph['prototype'][_0x526d('0xa')]=function(){return this[_0x526d('0x6')];};Graph[_0x526d('0x7')]['getVertex']=function(_0x9fd3df){return this['vertices'][_0x9fd3df];};Graph[_0x526d('0x7')][_0x526d('0xb')]=function(_0x181512,_0x1131bb){if(!this[_0x526d('0x4')][_0x181512]){return logger['info'](_0x526d('0xc'));}var _0x5acf20=_0x1131bb(this[_0x526d('0x4')][_0x181512]);if(!_0x5acf20){return logger[_0x526d('0xd')](_0x526d('0xe'));}if(this[_0x526d('0x5')][_0x181512]['length']===0x0){return logger['info'](_0x526d('0xf'));}for(var _0x733485=0x0,_0x3c657b=[],_0x2f5a61=![];_0x733485<this[_0x526d('0x5')][_0x181512][_0x526d('0x10')];_0x733485+=0x1){if(this[_0x526d('0x5')][_0x181512][_0x733485]['condition']){_0x3c657b=this[_0x526d('0x5')][_0x181512][_0x733485][_0x526d('0x11')]['split'](',');for(var _0x810027=0x0;_0x810027<_0x3c657b[_0x526d('0x10')];_0x810027+=0x1){if(this[_0x526d('0x4')][_0x181512][_0x526d('0x12')]==='vswitch'&&_0x3c657b[_0x810027]==='-'){_0x2f5a61=this['edges'][_0x181512][_0x733485]['target'];logger['info']('default',_0x3c657b[_0x810027],this[_0x526d('0x5')][_0x181512][_0x733485]['target']);}else if(this['vertices'][_0x181512][_0x526d('0x12')]===_0x526d('0x2')&&_0x3c657b[_0x810027]==='i'){_0x2f5a61=this['edges'][_0x181512][_0x733485][_0x526d('0x13')];logger[_0x526d('0xd')]('invalid',_0x3c657b[_0x810027],this[_0x526d('0x5')][_0x181512][_0x733485]['target']);}if(_0x3c657b[_0x810027]===_0x5acf20){return this[_0x526d('0xb')](this['edges'][_0x181512][_0x733485][_0x526d('0x13')],_0x1131bb);}}}else{return this[_0x526d('0xb')](this['edges'][_0x181512][_0x733485][_0x526d('0x13')],_0x1131bb);}}if(_0x3c657b[_0x526d('0x10')]){if(this[_0x526d('0x4')][_0x181512]['agicommand']===_0x526d('0x14')){if(_0x2f5a61){return this[_0x526d('0xb')](_0x2f5a61,_0x1131bb);}return logger[_0x526d('0xd')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x526d('0x15')](verticesWithRetry,this[_0x526d('0x4')][_0x181512]['agicommand'])){if(_0x5acf20==='-'){return logger[_0x526d('0xd')](_0x526d('0x16'));}if(_0x2f5a61&&_0x5acf20!=='t'){return this['traverseBFS'](_0x2f5a61,_0x1131bb);}return this[_0x526d('0xb')](_0x181512,_0x1131bb);}return logger['info'](_0x526d('0x17'));}};module[_0x526d('0x18')]=Graph;
\ No newline at end of file