Built motion from commit b51cdcb3f2cb46634587ce1d55ea1b8f32dacea6. Version 3.0.0...
[motion-next.git] / server / services / routing / server / applications / gotoif.js
1 const a1204_0x2485=['stop','length','priority\x20false\x20is\x20a\x20number','error','join','priorityTrue','rules','lodash','condition','[%s][GOTOIF]\x20eval\x20error:\x20%s','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][GOTOIF]\x20%s','validate','message','replace','next','string','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','stringify','priority\x20true\x20is\x20a\x20number','info','getMustacheRender','../../../../config/logger','number','routing','map','html-to-text'];(function(_0x57fa10,_0x248542){const _0x36b6ee=function(_0x136361){while(--_0x136361){_0x57fa10['push'](_0x57fa10['shift']());}};_0x36b6ee(++_0x248542);}(a1204_0x2485,0xcb));const a1204_0x36b6=function(_0x57fa10,_0x248542){_0x57fa10=_0x57fa10-0x0;let _0x36b6ee=a1204_0x2485[_0x57fa10];return _0x36b6ee;};const _0x49ab47=a1204_0x36b6;'use strict';const schema=require(_0x49ab47('0xc')),_=require(_0x49ab47('0x7')),htmlToText=require(_0x49ab47('0x1c')),utils=require('./utils'),logger=require(_0x49ab47('0x18'))(_0x49ab47('0x1a')),gotoif=schema({'condition':{'type':_0x49ab47('0x10'),'required':!![],'message':_0x49ab47('0xa')},'priorityTrue':{'type':_0x49ab47('0x19'),'message':_0x49ab47('0x15')},'priorityFalse':{'type':_0x49ab47('0x19'),'message':_0x49ab47('0x2')}});exports['consequence']=function(_0x136361,_0xa37ad7){return function(_0x22a6cd){const _0x5e5241=a1204_0x36b6;try{const _0x50d9e3={'condition':htmlToText['fromString'](utils[_0x5e5241('0x17')](_0xa37ad7[0x0],this),{'wordwrap':![]})[_0x5e5241('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xa37ad7[0x1],'priorityFalse':_0xa37ad7[0x2]},_0x55e0fa=gotoif['validate'](_0x50d9e3,{'typecast':!![]});if(_0x55e0fa[_0x5e5241('0x1')])logger[_0x5e5241('0x3')](_0x5e5241('0xb'),_0x136361,_[_0x5e5241('0x1b')](_0x55e0fa,_0x5e5241('0xd'))[_0x5e5241('0x4')](',\x20')),_0x22a6cd[_0x5e5241('0x0')]();else try{const _0x167c0d=eval('('+_0x50d9e3[_0x5e5241('0x8')]+')'),_0x541ffa=_0x167c0d?_0x50d9e3[_0x5e5241('0x5')]:_0x50d9e3[_0x5e5241('0x11')];logger['info'](_0x5e5241('0x12'),_0x136361,_0x50d9e3[_0x5e5241('0x8')],_0x167c0d,_0x541ffa||_0x5e5241('0xf'));if(_0x541ffa){const _0x223dcf=_[_0x5e5241('0x13')](_0x22a6cd[_0x5e5241('0x6')](),{'p':_0x541ffa});_0x223dcf>=0x0?(logger[_0x5e5241('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x136361,_0x541ffa||_0x5e5241('0xf'),_0x223dcf),_0x22a6cd[_0x5e5241('0xf')](_0x223dcf)):(logger[_0x5e5241('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x136361,_0x541ffa||_0x5e5241('0xf')),_0x22a6cd[_0x5e5241('0x0')]());}else _0x22a6cd['next']();}catch(_0x19f480){logger[_0x5e5241('0x3')](_0x5e5241('0x9'),_0x136361,_0x19f480[_0x5e5241('0xd')]),_0x22a6cd[_0x5e5241('0x0')]();}}catch(_0x1f23fe){logger[_0x5e5241('0x3')](_0x5e5241('0xb'),_0x136361,JSON[_0x5e5241('0x14')](_0x1f23fe)),_0x22a6cd[_0x5e5241('0x0')]();}};};