Built motion from commit fade34fd.|2.5.41
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 2a2dac1..bcb6faf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf1=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string'];(function(_0x49a283,_0x415e0c){var _0x44aadf=function(_0x3c7c72){while(--_0x3c7c72){_0x49a283['push'](_0x49a283['shift']());}};_0x44aadf(++_0x415e0c);}(_0xbaf1,0x1ca));var _0x1baf=function(_0x17eae8,_0x2bc1fa){_0x17eae8=_0x17eae8-0x0;var _0x5d6dcb=_0xbaf1[_0x17eae8];return _0x5d6dcb;};'use strict';var schema=require(_0x1baf('0x0'));var _=require('lodash');var htmlToText=require(_0x1baf('0x1'));var utils=require(_0x1baf('0x2'));var logger=require(_0x1baf('0x3'))(_0x1baf('0x4'));var gotoif=schema({'condition':{'type':_0x1baf('0x5'),'required':!![],'message':_0x1baf('0x6')},'priorityTrue':{'type':_0x1baf('0x7'),'message':_0x1baf('0x8')},'priorityFalse':{'type':'number','message':_0x1baf('0x9')}});exports['consequence']=function(_0x277874,_0x53b8ee){return function(_0x5d662b){try{var _0x3a50ea={'condition':htmlToText[_0x1baf('0xa')](utils[_0x1baf('0xb')](_0x53b8ee[0x0],this),{'wordwrap':![]})[_0x1baf('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x53b8ee[0x1],'priorityFalse':_0x53b8ee[0x2]};var _0x2361ae=gotoif[_0x1baf('0x0')](_0x3a50ea,{'typecast':!![]});if(_0x2361ae[_0x1baf('0xd')]){logger[_0x1baf('0xe')](_0x1baf('0xf'),_0x277874,_[_0x1baf('0x10')](_0x2361ae,'message')[_0x1baf('0x11')](',\x20'));_0x5d662b[_0x1baf('0x12')]();}else{try{var _0x2e77a0=eval('('+_0x3a50ea[_0x1baf('0x13')]+')');var _0x4b53ec=_0x2e77a0?_0x3a50ea[_0x1baf('0x14')]:_0x3a50ea[_0x1baf('0x15')];logger[_0x1baf('0x16')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x277874,_0x3a50ea['condition'],_0x2e77a0,_0x4b53ec||_0x1baf('0x17'));if(_0x4b53ec){var _0x1d05a6=_[_0x1baf('0x18')](_0x5d662b[_0x1baf('0x19')](),{'p':_0x4b53ec});if(_0x1d05a6>=0x0){logger[_0x1baf('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x277874,_0x4b53ec||_0x1baf('0x17'),_0x1d05a6);_0x5d662b[_0x1baf('0x17')](_0x1d05a6);}else{logger[_0x1baf('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x277874,_0x4b53ec||_0x1baf('0x17'));_0x5d662b[_0x1baf('0x12')]();}}else{_0x5d662b[_0x1baf('0x17')]();}}catch(_0x5a0e04){logger['error'](_0x1baf('0x1a'),_0x277874,_0x5a0e04[_0x1baf('0x1b')]);_0x5d662b['stop']();}}}catch(_0x2c1052){logger[_0x1baf('0xe')](_0x1baf('0xf'),_0x277874,JSON[_0x1baf('0x1c')](_0x2c1052));_0x5d662b[_0x1baf('0x12')]();}};};
\ No newline at end of file
+var _0xeb12=['condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','replace','validate','length','error','message','join'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0xeb12,0x1ab));var _0x2eb1=function(_0x4b8df0,_0x5c59f1){_0x4b8df0=_0x4b8df0-0x0;var _0x2ad3fe=_0xeb12[_0x4b8df0];return _0x2ad3fe;};'use strict';var schema=require('validate');var _=require(_0x2eb1('0x0'));var htmlToText=require(_0x2eb1('0x1'));var utils=require(_0x2eb1('0x2'));var logger=require('../../../../config/logger')(_0x2eb1('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x2eb1('0x4')},'priorityTrue':{'type':'number','message':_0x2eb1('0x5')},'priorityFalse':{'type':_0x2eb1('0x6'),'message':_0x2eb1('0x7')}});exports[_0x2eb1('0x8')]=function(_0x32aa11,_0x1108bf){return function(_0x4a14f4){try{var _0x56f81c={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x1108bf[0x0],this),{'wordwrap':![]})[_0x2eb1('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1108bf[0x1],'priorityFalse':_0x1108bf[0x2]};var _0x22eae2=gotoif[_0x2eb1('0xa')](_0x56f81c,{'typecast':!![]});if(_0x22eae2[_0x2eb1('0xb')]){logger[_0x2eb1('0xc')]('[%s][GOTOIF]\x20%s',_0x32aa11,_['map'](_0x22eae2,_0x2eb1('0xd'))[_0x2eb1('0xe')](',\x20'));_0x4a14f4['stop']();}else{try{var _0xcc7982=eval('('+_0x56f81c[_0x2eb1('0xf')]+')');var _0x11187f=_0xcc7982?_0x56f81c['priorityTrue']:_0x56f81c[_0x2eb1('0x10')];logger[_0x2eb1('0x11')](_0x2eb1('0x12'),_0x32aa11,_0x56f81c[_0x2eb1('0xf')],_0xcc7982,_0x11187f||_0x2eb1('0x13'));if(_0x11187f){var _0x4546a3=_['findIndex'](_0x4a14f4[_0x2eb1('0x14')](),{'p':_0x11187f});if(_0x4546a3>=0x0){logger['info'](_0x2eb1('0x15'),_0x32aa11,_0x11187f||_0x2eb1('0x13'),_0x4546a3);_0x4a14f4[_0x2eb1('0x13')](_0x4546a3);}else{logger[_0x2eb1('0x11')](_0x2eb1('0x16'),_0x32aa11,_0x11187f||_0x2eb1('0x13'));_0x4a14f4[_0x2eb1('0x17')]();}}else{_0x4a14f4[_0x2eb1('0x13')]();}}catch(_0x2f56a0){logger[_0x2eb1('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x32aa11,_0x2f56a0[_0x2eb1('0xd')]);_0x4a14f4['stop']();}}}catch(_0x4b71a3){logger[_0x2eb1('0xc')](_0x2eb1('0x18'),_0x32aa11,JSON[_0x2eb1('0x19')](_0x4b71a3));_0x4a14f4[_0x2eb1('0x17')]();}};};
\ No newline at end of file