Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / services / agi / graph / index.js
1 const a1027_0x4844=['addVertex','agi','size','getVertex','info','condition','exports','edges','default\x20on\x20switch\x20not\x20found','addEdge','numberOfEdges','menu','prototype','target','getdigits','stop\x20traverse','length','getsecretdigits','agicommand','invalid','vertices','traverseBFS','includes','condition\x20not\x20found','lodash','no\x20vertex\x20found'];(function(_0x1a339d,_0x484420){const _0x47f3e9=function(_0x306d89){while(--_0x306d89){_0x1a339d['push'](_0x1a339d['shift']());}};_0x47f3e9(++_0x484420);}(a1027_0x4844,0x19d));const a1027_0x47f3=function(_0x1a339d,_0x484420){_0x1a339d=_0x1a339d-0x0;let _0x47f3e9=a1027_0x4844[_0x1a339d];return _0x47f3e9;};const _0x4b1b76=a1027_0x47f3;'use strict';const _=require(_0x4b1b76('0x1')),logger=require('../../../config/logger')(_0x4b1b76('0x4')),verticesWithRetry=[_0x4b1b76('0xe'),_0x4b1b76('0x11'),_0x4b1b76('0x14')],Graph=function(){const _0x1c870d=_0x4b1b76;this[_0x1c870d('0x17')]={},this[_0x1c870d('0xa')]={},this[_0x1c870d('0xd')]=0x0;};Graph[_0x4b1b76('0xf')][_0x4b1b76('0x3')]=function(_0x306d89){const _0x402d85=_0x4b1b76;this[_0x402d85('0x17')][_0x306d89['id']]=_0x306d89,this['edges'][_0x306d89['id']]=[];},Graph['prototype'][_0x4b1b76('0xc')]=function(_0x272d4a,_0x5665a0,_0xab1321){const _0x24537e=_0x4b1b76;this[_0x24537e('0xa')][_0x272d4a]['push']({'target':_0x5665a0,'condition':_0xab1321}),this[_0x24537e('0xd')]+=0x1;},Graph[_0x4b1b76('0xf')][_0x4b1b76('0x5')]=function(){const _0x32a5b1=_0x4b1b76;return _[_0x32a5b1('0x5')](this[_0x32a5b1('0x17')]);},Graph[_0x4b1b76('0xf')]['relations']=function(){const _0x45c7f7=_0x4b1b76;return this[_0x45c7f7('0xd')];},Graph[_0x4b1b76('0xf')][_0x4b1b76('0x6')]=function(_0x5083d9){const _0x35615d=_0x4b1b76;return this[_0x35615d('0x17')][_0x5083d9];},Graph[_0x4b1b76('0xf')][_0x4b1b76('0x18')]=function(_0x703866,_0x3c54a5){const _0x2fec90=_0x4b1b76;if(!this['vertices'][_0x703866])return logger[_0x2fec90('0x7')](_0x2fec90('0x2'));const _0xfeee73=_0x3c54a5(this['vertices'][_0x703866]);if(!_0xfeee73)return logger[_0x2fec90('0x7')](_0x2fec90('0x12'));if(this[_0x2fec90('0xa')][_0x703866][_0x2fec90('0x13')]===0x0)return logger[_0x2fec90('0x7')]('no\x20edge/s\x20available');const _0x352f19=![],_0x1c7017=[];for(let _0x19209b=0x0,_0x2b5eef=[],_0x1291ab=![];_0x19209b<this['edges'][_0x703866]['length'];_0x19209b+=0x1){if(this['edges'][_0x703866][_0x19209b]['condition']){_0x2b5eef=this[_0x2fec90('0xa')][_0x703866][_0x19209b][_0x2fec90('0x8')]['split'](',');for(let _0x1e6844=0x0;_0x1e6844<_0x2b5eef[_0x2fec90('0x13')];_0x1e6844+=0x1){if(this[_0x2fec90('0x17')][_0x703866][_0x2fec90('0x15')]==='vswitch'&&_0x2b5eef[_0x1e6844]==='-')_0x1291ab=this['edges'][_0x703866][_0x19209b][_0x2fec90('0x10')],logger[_0x2fec90('0x7')]('default',_0x1291ab,_0x2b5eef[_0x1e6844],this['edges'][_0x703866][_0x19209b][_0x2fec90('0x10')]);else this[_0x2fec90('0x17')][_0x703866]['agicommand']===_0x2fec90('0xe')&&_0x2b5eef[_0x1e6844]==='i'&&(_0x1291ab=this[_0x2fec90('0xa')][_0x703866][_0x19209b][_0x2fec90('0x10')],logger[_0x2fec90('0x7')](_0x2fec90('0x16'),_0x1291ab,_0x2b5eef[_0x1e6844],this[_0x2fec90('0xa')][_0x703866][_0x19209b][_0x2fec90('0x10')]));if(_0x2b5eef[_0x1e6844]===_0xfeee73)return this['traverseBFS'](this[_0x2fec90('0xa')][_0x703866][_0x19209b][_0x2fec90('0x10')],_0x3c54a5);}}else return this['traverseBFS'](this[_0x2fec90('0xa')][_0x703866][_0x19209b][_0x2fec90('0x10')],_0x3c54a5);}if(_0x1c7017[_0x2fec90('0x13')]){if(this[_0x2fec90('0x17')][_0x703866]['agicommand']==='vswitch'){if(_0x352f19)return this['traverseBFS'](_0x352f19,_0x3c54a5);return logger[_0x2fec90('0x7')](_0x2fec90('0xb'));}else{if(_[_0x2fec90('0x19')](verticesWithRetry,this[_0x2fec90('0x17')][_0x703866][_0x2fec90('0x15')])){if(_0xfeee73==='-')return logger['info']('max\x20retry\x20reach');if(_0x352f19&&_0xfeee73!=='t')return this[_0x2fec90('0x18')](_0x352f19,_0x3c54a5);return this[_0x2fec90('0x18')](_0x703866,_0x3c54a5);}}return logger[_0x2fec90('0x7')](_0x2fec90('0x0'));}},module[_0x4b1b76('0x9')]=Graph;