Built motion from commit 44b1f254.|2.6.26
[motion2.git] / server / services / ami / trigger / index.js
index 1c8b7c3..0255787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42f0=['custom:agentnoanswer','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','info','stringify','clone','motionChannel','voice','debug','inspect','checkTriggers','prototype','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','agents','action','toLowerCase','contactmanager','browser','data1','TemplateId','data2','render','html','uri','isNil','data3','data4','location','data5','windowHeight','data6','winapp','winArguments','format','user:%s','name','jscripty','trigger:%s','exec','voiceQueues','routeId','script','buildUri','parse','query','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','evt','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','lastevent','null','substatus','undefined','offlineMessage','created','equals','exports','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/logger','trigger','../ami','redis','localhost','popup','triggers','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber'];(function(_0x5ed3de,_0x24b412){var _0x28f740=function(_0x214f58){while(--_0x214f58){_0x5ed3de['push'](_0x5ed3de['shift']());}};_0x28f740(++_0x24b412);}(_0x42f0,0xdb));var _0x042f=function(_0x16356f,_0x2e0b87){_0x16356f=_0x16356f-0x0;var _0x4995b8=_0x42f0[_0x16356f];return _0x4995b8;};'use strict';var util=require('util');var _=require(_0x042f('0x0'));var url=require(_0x042f('0x1'));var Mustache=require('mustache');var Redis=require(_0x042f('0x2'));var urlforward=require(_0x042f('0x3'));var integration=require('./integration');var cmContact=require(_0x042f('0x4'));var script=require(_0x042f('0x5'));var config=require('../../../config/environment');var logger=require(_0x042f('0x6'))(_0x042f('0x7'));var ami=require(_0x042f('0x8'));config[_0x042f('0x9')]=_['defaults'](config['redis'],{'host':_0x042f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x042f('0x9')]));var operators={'equals':function(_0x40af5b,_0x16f5f4){return _0x40af5b==_0x16f5f4;},'not_equals':function(_0x1970f0,_0x68002b){return _0x1970f0!=_0x68002b;}};var barAndWebActions=[_0x042f('0xb'),_0x042f('0x1'),'winapp'];function Trigger(_0xeb1c1c){this[_0x042f('0xc')]=_0xeb1c1c[_0x042f('0xc')];this['agents']=_0xeb1c1c['agents'];this['voiceQueues']=_0xeb1c1c['voiceQueues'];this[_0x042f('0xd')]=_0xeb1c1c[_0x042f('0xd')];this['voiceExtensions']=_0xeb1c1c[_0x042f('0xe')];this[_0x042f('0xf')]=_0xeb1c1c['zendeskAccounts'];this[_0x042f('0x10')]=_0xeb1c1c[_0x042f('0x10')];this[_0x042f('0x11')]=_0xeb1c1c[_0x042f('0x11')];this[_0x042f('0x12')]=_0xeb1c1c[_0x042f('0x12')];this['zohoAccounts']=_0xeb1c1c[_0x042f('0x13')];this[_0x042f('0x14')]=_0xeb1c1c['deskAccounts'];this[_0x042f('0x15')]=_0xeb1c1c['vtigerAccounts'];this[_0x042f('0x16')]=_0xeb1c1c[_0x042f('0x16')];this[_0x042f('0x17')]=_0xeb1c1c[_0x042f('0x17')];this['freshsalesAccounts']=_0xeb1c1c[_0x042f('0x18')];this[_0x042f('0x19')]={'zendesk':this[_0x042f('0xf')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x042f('0x10')],'sugarcrm':this[_0x042f('0x12')],'zoho':this[_0x042f('0x13')],'desk':this[_0x042f('0x14')],'vtiger':this[_0x042f('0x15')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x042f('0x18')],'servicenow':this[_0x042f('0x16')]};ami['on'](_0x042f('0x1a'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x1d'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x1e'),this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x1f'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x20'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x21'),this[_0x042f('0x1b')]['bind'](this));ami['on']('custom:agentbusy',this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on']('custom:agentcongestion',this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x22'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x23'),this['syncCustomEvent'][_0x042f('0x1c')](this));ami['on'](_0x042f('0x24'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x25'),this[_0x042f('0x1b')]['bind'](this));ami['on']('custom:dialbegin',this[_0x042f('0x26')]['bind'](this));ami['on'](_0x042f('0x27'),this[_0x042f('0x26')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0x042f('0x29'),this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x2a'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x2b'),this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x2c'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x2d'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on']('custom:acceptmessage',this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x2e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:offlineMessage',this[_0x042f('0x1b')]['bind'](this));}Trigger['prototype'][_0x042f('0x2f')]=function(_0x194028,_0x280984,_0x4c48d2){logger[_0x042f('0x30')](_0x194028,_0x280984,JSON[_0x042f('0x31')](_0x4c48d2));io['to'](_0x194028)[_0x042f('0x2f')](_0x280984,_0x4c48d2);};Trigger['prototype'][_0x042f('0x1b')]=function(_0x963790){var _0x92ee91=_[_0x042f('0x32')](_0x963790);if(typeof _0x92ee91[_0x042f('0x33')]==='undefined'){_0x92ee91[_0x042f('0x33')]=_0x042f('0x34');}logger[_0x042f('0x35')]('syncCustomEvent',util[_0x042f('0x36')](_0x92ee91,{'showHidden':!![],'depth':null}));this[_0x042f('0x37')](_0x92ee91);};Trigger[_0x042f('0x38')]['syncAgentDial']=function(_0x5023d5){if(this['agents'][_0x5023d5[_0x042f('0x39')]]){this[_0x042f('0x1b')](_0x5023d5);}};Trigger[_0x042f('0x38')][_0x042f('0x37')]=function(_0x135d68){var _0x25dbd7;for(var _0x4e3be1 in this[_0x042f('0xc')]){if(this['triggers'][_0x042f('0x3a')](_0x4e3be1)){if(this['triggers'][_0x4e3be1][_0x042f('0x3b')]){_0x25dbd7=this[_0x042f('0x3c')](this[_0x042f('0xc')][_0x4e3be1],_0x135d68);if(_0x25dbd7){_[_0x042f('0x3d')](_0x135d68,_0x135d68[_0x042f('0x3e')]);for(var _0x43ba0b=0x0,_0x37400f,_0x2e1769,_0x36610c;_0x43ba0b<this['triggers'][_0x4e3be1][_0x042f('0x3f')][_0x042f('0x40')];_0x43ba0b+=0x1){_0x37400f=this['triggers'][_0x4e3be1]['Actions'][_0x43ba0b];if(this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]]){switch(_0x37400f[_0x042f('0x42')][_0x042f('0x43')]()){case _0x042f('0x44'):break;case'motionbar':case _0x042f('0x45'):var _0x276110={};switch(barAndWebActions[_0x37400f[_0x042f('0x46')]]){case'popup':_0x276110[_0x042f('0x47')]=_0x37400f[_0x042f('0x48')];_0x276110['html']=this['templates'][_0x37400f[_0x042f('0x48')]]?Mustache[_0x042f('0x49')](this[_0x042f('0xd')][_0x37400f[_0x042f('0x48')]][_0x042f('0x4a')],_0x135d68):'template\x20not\x20found';break;case _0x042f('0x1'):_0x276110[_0x042f('0x4b')]=this['buildUri'](_0x37400f['data2'],_0x135d68,_[_0x042f('0x4c')](_0x37400f[_0x042f('0x4d')])?!![]:parseInt(_0x37400f[_0x042f('0x4d')],0xa));if(_[_0x042f('0x4c')](_0x37400f[_0x042f('0x4e')])){_0x276110[_0x042f('0x4f')]='0';}else{_0x276110['uriLocation']=_0x37400f['data4'];_0x276110['windowWidth']=_[_0x042f('0x4c')](_0x37400f[_0x042f('0x50')])?'800':_0x37400f['data5'];_0x276110[_0x042f('0x51')]=_[_0x042f('0x4c')](_0x37400f['data6'])?'600':_0x37400f[_0x042f('0x52')];}break;case _0x042f('0x53'):_0x276110['winApplication']=_0x37400f[_0x042f('0x48')]?Mustache[_0x042f('0x49')](_0x37400f[_0x042f('0x48')],_0x135d68):'';_0x276110[_0x042f('0x54')]=_0x37400f[_0x042f('0x4d')]?Mustache[_0x042f('0x49')](_0x37400f[_0x042f('0x4d')],_0x135d68):'';break;}this[_0x042f('0x2f')](util[_0x042f('0x55')](_0x042f('0x56'),this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]][_0x042f('0x57')]),util[_0x042f('0x55')]('trigger:%s:%s',_0x37400f[_0x042f('0x42')][_0x042f('0x43')](),barAndWebActions[_0x37400f['data1']]),_['merge'](_0x276110,_0x135d68));break;case _0x042f('0x58'):this[_0x042f('0x2f')](util['format'](_0x042f('0x56'),this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]][_0x042f('0x57')]),util[_0x042f('0x55')](_0x042f('0x59'),_0x37400f['action'][_0x042f('0x43')]()),_[_0x042f('0x3d')]({'ProjectId':parseInt(_0x37400f[_0x042f('0x46')],0xa)},_0x135d68));break;default:this[_0x042f('0x2f')](util['format']('user:%s',this['agents'][_0x135d68[_0x042f('0x39')]][_0x042f('0x57')]),util['format']('trigger:%s',_0x37400f[_0x042f('0x42')][_0x042f('0x43')]()),_['merge']({},_0x37400f,_0x135d68));}}switch(_0x37400f[_0x042f('0x42')][_0x042f('0x43')]()){case _0x042f('0x44'):cmContact['exec'](this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]],this['triggers'][_0x4e3be1],_0x37400f,_0x135d68);break;case'integration':integration[_0x042f('0x5a')](_0x37400f,_0x135d68,this['accounts'],this['agents'][_0x135d68[_0x042f('0x39')]],this[_0x042f('0x5b')][_0x135d68['queue']],this[_0x042f('0xe')][_0x135d68[_0x042f('0x5c')]]);break;case'urlforward':urlforward['exec'](_0x37400f,_0x135d68);break;case _0x042f('0x5d'):script[_0x042f('0x5a')](_0x37400f,_0x135d68);break;}}}}}}};Trigger[_0x042f('0x38')][_0x042f('0x5e')]=function(_0x40e9c7,_0x8bbbc6,_0x157c1e){var _0x2cc3f5=url[_0x042f('0x5f')](Mustache['render'](_0x40e9c7,_0x8bbbc6),!![]);if(_0x157c1e){_[_0x042f('0x3d')](_0x2cc3f5[_0x042f('0x60')],_0x8bbbc6);}delete _0x2cc3f5[_0x042f('0x61')];var _0x55ed00=url[_0x042f('0x55')](_0x2cc3f5);_0x55ed00=_0x55ed00[_0x042f('0x62')](/\/\?/g,'?');return _0x55ed00;};Trigger[_0x042f('0x38')][_0x042f('0x3c')]=function(_0x1cda1e,_0x199ed9){var _0x541d21=!![];var _0xb0447f=!![];var _0x376206=![];if(_0x1cda1e[_0x042f('0x63')]===_0x199ed9['motionChannel']){_0x376206=!![];}if(_0x1cda1e['AllConditions'][_0x042f('0x40')]){_0x541d21=_[_0x042f('0x64')](_0x1cda1e[_0x042f('0x65')],this[_0x042f('0x66')](_0x199ed9,_0x1cda1e[_0x042f('0x63')]));}if(_0x1cda1e[_0x042f('0x67')]['length']){_0xb0447f=_['some'](_0x1cda1e['AnyConditions'],this[_0x042f('0x66')](_0x199ed9,_0x1cda1e[_0x042f('0x63')]));}var _0x345b88=_0x376206&&_0x541d21&&_0xb0447f;logger[_0x042f('0x35')]('checkTrigger:\x20trigger',util[_0x042f('0x36')](_0x1cda1e,{'showHidden':!![],'depth':null}),_0x042f('0x68'),util[_0x042f('0x36')](_0x199ed9,{'showHidden':!![],'depth':null}),_0x376206,_0x541d21,_0xb0447f);return _0x345b88;};Trigger[_0x042f('0x38')][_0x042f('0x66')]=function(_0x56c897,_0x3cc521){return function(_0x3be087){switch(_0x3be087[_0x042f('0x69')]){case _0x042f('0x6a'):if(_0x56c897['channel']===_0x3cc521){if(_0x3cc521===_0x042f('0x6b')){return _0x56c897[_0x042f('0x6c')]?operators[_0x3be087[_0x042f('0x6d')]](Number(_0x3be087[_0x042f('0x6e')]),_0x56c897[_0x042f('0x6c')]):![];}else{return _0x56c897[_[_0x042f('0x6f')](_0x3cc521)+_0x042f('0x70')]?operators[_0x3be087[_0x042f('0x6d')]](Number(_0x3be087[_0x042f('0x6e')]),_0x56c897[_['upperFirst'](_0x3cc521)+_0x042f('0x70')]):![];}}break;case _0x042f('0x71'):case _0x042f('0x72'):if(_0x56c897['channel']===_0x3cc521){return _0x56c897[_0x042f('0x73')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897[_0x042f('0x73')]):![];}break;case'queue':return _0x56c897[_0x042f('0x74')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897[_0x042f('0x74')]):![];case _0x042f('0x75'):return _0x56c897['membername']?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087['value'],_0x56c897['membername']):![];case'lastevent':return _0x56c897[_0x042f('0x76')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897['lastevent']):![];case'routeId':return _0x56c897[_0x042f('0x5c')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087['value'],_0x56c897[_0x042f('0x5c')]):![];case'mailSubstatus':if(_0x3be087[_0x042f('0x6e')]===_0x042f('0x77'))_0x3be087[_0x042f('0x6e')]=null;return typeof _0x56c897[_0x042f('0x78')]!==_0x042f('0x79')?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897[_0x042f('0x78')]):![];case _0x042f('0x7a'):if(_0x56c897[_0x042f('0x63')]===_0x3cc521){return _0x3be087[_0x042f('0x6e')]===_0x042f('0x7b')&&_0x3be087['operator']===_0x042f('0x7c')?!![]:![];}break;}return![];};};module[_0x042f('0x7d')]=Trigger;
\ No newline at end of file
+var _0x3333=['custom:dialconnect','custom:dialend','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','emit','stringify','clone','motionChannel','undefined','inspect','checkTriggers','prototype','hasOwnProperty','status','checkTrigger','variables','Actions','action','toLowerCase','contactmanager','browser','data1','popup','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','data6','600','winArguments','format','user:%s','interface','trigger:%s:%s','merge','name','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','search','channel','every','AllConditions','AnyConditions','some','checkTrigger:\x20trigger','evt','checkConditions','account','chat','ChatWebsiteId','operator','upperFirst','value','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','defaults','redis','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin'];(function(_0x3f651b,_0x41e753){var _0x1fe705=function(_0x575588){while(--_0x575588){_0x3f651b['push'](_0x3f651b['shift']());}};_0x1fe705(++_0x41e753);}(_0x3333,0x1dd));var _0x3333=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x3333[_0x34bf97];return _0x292719;};'use strict';var util=require(_0x3333('0x0'));var _=require(_0x3333('0x1'));var url=require(_0x3333('0x2'));var Mustache=require(_0x3333('0x3'));var Redis=require(_0x3333('0x4'));var urlforward=require('./urlforward');var integration=require(_0x3333('0x5'));var cmContact=require(_0x3333('0x6'));var script=require(_0x3333('0x7'));var config=require(_0x3333('0x8'));var logger=require(_0x3333('0x9'))('trigger');var ami=require(_0x3333('0xa'));config['redis']=_[_0x3333('0xb')](config[_0x3333('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x3333('0xd'))(new Redis(config[_0x3333('0xc')]));var operators={'equals':function(_0x39ebd2,_0x19d247){return _0x39ebd2==_0x19d247;},'not_equals':function(_0x17e324,_0x3ef33f){return _0x17e324!=_0x3ef33f;}};var barAndWebActions=['popup',_0x3333('0x2'),_0x3333('0xe')];function Trigger(_0x1473dc){this[_0x3333('0xf')]=_0x1473dc['triggers'];this['agents']=_0x1473dc[_0x3333('0x10')];this[_0x3333('0x11')]=_0x1473dc[_0x3333('0x11')];this[_0x3333('0x12')]=_0x1473dc[_0x3333('0x12')];this[_0x3333('0x13')]=_0x1473dc['voiceExtensions'];this['zendeskAccounts']=_0x1473dc[_0x3333('0x14')];this[_0x3333('0x15')]=_0x1473dc[_0x3333('0x15')];this[_0x3333('0x16')]=_0x1473dc[_0x3333('0x16')];this[_0x3333('0x17')]=_0x1473dc[_0x3333('0x17')];this[_0x3333('0x18')]=_0x1473dc['zohoAccounts'];this['deskAccounts']=_0x1473dc[_0x3333('0x19')];this[_0x3333('0x1a')]=_0x1473dc[_0x3333('0x1a')];this[_0x3333('0x1b')]=_0x1473dc[_0x3333('0x1b')];this[_0x3333('0x1c')]=_0x1473dc[_0x3333('0x1c')];this[_0x3333('0x1d')]=_0x1473dc[_0x3333('0x1d')];this[_0x3333('0x1e')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x3333('0x16')],'freshdesk':this[_0x3333('0x15')],'sugarcrm':this[_0x3333('0x17')],'zoho':this[_0x3333('0x18')],'desk':this[_0x3333('0x19')],'vtiger':this[_0x3333('0x1a')],'dynamics365':this[_0x3333('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x3333('0x1b')]};ami['on'](_0x3333('0x1f'),this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x21'),this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x22'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x24'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x25'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x26'),this[_0x3333('0x23')]['bind'](this));ami['on'](_0x3333('0x27'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on']('custom:agentcongestion',this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0x3333('0x20')](this));ami['on']('custom:amd',this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x28'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x29'),this[_0x3333('0x23')]['bind'](this));ami['on'](_0x3333('0x2a'),this['syncAgentDial'][_0x3333('0x20')](this));ami['on'](_0x3333('0x2b'),this['syncAgentDial'][_0x3333('0x20')](this));ami['on'](_0x3333('0x2c'),this[_0x3333('0x2d')]['bind'](this));ami['on'](_0x3333('0x2e'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x2f'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x30'),this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x31'),this[_0x3333('0x23')]['bind'](this));ami['on']('custom:acceptmessage',this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x32'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x33'),this[_0x3333('0x23')][_0x3333('0x20')](this));}Trigger['prototype'][_0x3333('0x34')]=function(_0x801bef,_0x2d6617,_0x17e5ac){logger['info'](_0x801bef,_0x2d6617,JSON[_0x3333('0x35')](_0x17e5ac));io['to'](_0x801bef)['emit'](_0x2d6617,_0x17e5ac);};Trigger['prototype'][_0x3333('0x23')]=function(_0x1defe7){var _0x5527b3=_[_0x3333('0x36')](_0x1defe7);if(typeof _0x5527b3[_0x3333('0x37')]===_0x3333('0x38')){_0x5527b3['motionChannel']='voice';}logger['debug'](_0x3333('0x23'),util[_0x3333('0x39')](_0x5527b3,{'showHidden':!![],'depth':null}));this[_0x3333('0x3a')](_0x5527b3);};Trigger[_0x3333('0x3b')][_0x3333('0x2d')]=function(_0x4501ca){if(this[_0x3333('0x10')][_0x4501ca['interface']]){this['syncCustomEvent'](_0x4501ca);}};Trigger[_0x3333('0x3b')]['checkTriggers']=function(_0x536b2c){var _0x26a1a8;for(var _0x37928e in this['triggers']){if(this[_0x3333('0xf')][_0x3333('0x3c')](_0x37928e)){if(this[_0x3333('0xf')][_0x37928e][_0x3333('0x3d')]){_0x26a1a8=this[_0x3333('0x3e')](this[_0x3333('0xf')][_0x37928e],_0x536b2c);if(_0x26a1a8){_['merge'](_0x536b2c,_0x536b2c[_0x3333('0x3f')]);for(var _0xf1a583=0x0,_0x46906c,_0x4a8241,_0xddfb56;_0xf1a583<this[_0x3333('0xf')][_0x37928e][_0x3333('0x40')]['length'];_0xf1a583+=0x1){_0x46906c=this[_0x3333('0xf')][_0x37928e][_0x3333('0x40')][_0xf1a583];if(this[_0x3333('0x10')][_0x536b2c['interface']]){switch(_0x46906c[_0x3333('0x41')][_0x3333('0x42')]()){case _0x3333('0x43'):break;case'motionbar':case _0x3333('0x44'):var _0x1f4ba6={};switch(barAndWebActions[_0x46906c[_0x3333('0x45')]]){case _0x3333('0x46'):_0x1f4ba6['TemplateId']=_0x46906c[_0x3333('0x47')];_0x1f4ba6[_0x3333('0x48')]=this['templates'][_0x46906c[_0x3333('0x47')]]?Mustache[_0x3333('0x49')](this[_0x3333('0x12')][_0x46906c[_0x3333('0x47')]][_0x3333('0x48')],_0x536b2c):_0x3333('0x4a');break;case _0x3333('0x2'):_0x1f4ba6[_0x3333('0x4b')]=this[_0x3333('0x4c')](_0x46906c[_0x3333('0x47')],_0x536b2c,_[_0x3333('0x4d')](_0x46906c[_0x3333('0x4e')])?!![]:parseInt(_0x46906c[_0x3333('0x4e')],0xa));if(_[_0x3333('0x4d')](_0x46906c[_0x3333('0x4f')])){_0x1f4ba6[_0x3333('0x50')]='0';}else{_0x1f4ba6[_0x3333('0x51')]=_0x46906c[_0x3333('0x4f')];_0x1f4ba6['windowWidth']=_['isNil'](_0x46906c[_0x3333('0x52')])?_0x3333('0x53'):_0x46906c[_0x3333('0x52')];_0x1f4ba6[_0x3333('0x54')]=_['isNil'](_0x46906c[_0x3333('0x55')])?_0x3333('0x56'):_0x46906c[_0x3333('0x55')];}break;case _0x3333('0xe'):_0x1f4ba6['winApplication']=_0x46906c[_0x3333('0x47')]?Mustache['render'](_0x46906c[_0x3333('0x47')],_0x536b2c):'';_0x1f4ba6[_0x3333('0x57')]=_0x46906c['data3']?Mustache[_0x3333('0x49')](_0x46906c['data3'],_0x536b2c):'';break;}this[_0x3333('0x34')](util[_0x3333('0x58')](_0x3333('0x59'),this[_0x3333('0x10')][_0x536b2c[_0x3333('0x5a')]]['name']),util[_0x3333('0x58')](_0x3333('0x5b'),_0x46906c[_0x3333('0x41')]['toLowerCase'](),barAndWebActions[_0x46906c[_0x3333('0x45')]]),_[_0x3333('0x5c')](_0x1f4ba6,_0x536b2c));break;case'jscripty':this[_0x3333('0x34')](util[_0x3333('0x58')](_0x3333('0x59'),this[_0x3333('0x10')][_0x536b2c[_0x3333('0x5a')]][_0x3333('0x5d')]),util['format']('trigger:%s',_0x46906c[_0x3333('0x41')][_0x3333('0x42')]()),_[_0x3333('0x5c')]({'ProjectId':parseInt(_0x46906c[_0x3333('0x45')],0xa)},_0x536b2c));break;default:this['emit'](util[_0x3333('0x58')]('user:%s',this['agents'][_0x536b2c[_0x3333('0x5a')]][_0x3333('0x5d')]),util[_0x3333('0x58')](_0x3333('0x5e'),_0x46906c[_0x3333('0x41')][_0x3333('0x42')]()),_['merge']({},_0x46906c,_0x536b2c));}}switch(_0x46906c['action'][_0x3333('0x42')]()){case'contactmanager':cmContact[_0x3333('0x5f')](this['agents'][_0x536b2c[_0x3333('0x5a')]],this['triggers'][_0x37928e],_0x46906c,_0x536b2c);break;case _0x3333('0x60'):integration[_0x3333('0x5f')](_0x46906c,_0x536b2c,this[_0x3333('0x1e')],this[_0x3333('0x10')][_0x536b2c[_0x3333('0x5a')]],this[_0x3333('0x11')][_0x536b2c[_0x3333('0x61')]],this[_0x3333('0x13')][_0x536b2c[_0x3333('0x62')]]);break;case _0x3333('0x63'):urlforward['exec'](_0x46906c,_0x536b2c);break;case _0x3333('0x64'):script[_0x3333('0x5f')](_0x46906c,_0x536b2c);break;}}}}}}};Trigger[_0x3333('0x3b')]['buildUri']=function(_0x294756,_0x385dc5,_0x461062){var _0xaca69f=url[_0x3333('0x65')](Mustache[_0x3333('0x49')](_0x294756,_0x385dc5),!![]);if(_0x461062){_[_0x3333('0x5c')](_0xaca69f[_0x3333('0x66')],_0x385dc5);}delete _0xaca69f[_0x3333('0x67')];var _0x1ad99f=url[_0x3333('0x58')](_0xaca69f);_0x1ad99f=_0x1ad99f['replace'](/\/\?/g,'?');return _0x1ad99f;};Trigger['prototype'][_0x3333('0x3e')]=function(_0x213f56,_0x514ade){var _0x61f53=!![];var _0x16c8c7=!![];var _0x272f46=![];if(_0x213f56[_0x3333('0x68')]===_0x514ade[_0x3333('0x37')]){_0x272f46=!![];}if(_0x213f56['AllConditions']['length']){_0x61f53=_[_0x3333('0x69')](_0x213f56[_0x3333('0x6a')],this['checkConditions'](_0x514ade,_0x213f56[_0x3333('0x68')]));}if(_0x213f56[_0x3333('0x6b')]['length']){_0x16c8c7=_[_0x3333('0x6c')](_0x213f56['AnyConditions'],this['checkConditions'](_0x514ade,_0x213f56[_0x3333('0x68')]));}var _0x383061=_0x272f46&&_0x61f53&&_0x16c8c7;logger['debug'](_0x3333('0x6d'),util['inspect'](_0x213f56,{'showHidden':!![],'depth':null}),_0x3333('0x6e'),util[_0x3333('0x39')](_0x514ade,{'showHidden':!![],'depth':null}),_0x272f46,_0x61f53,_0x16c8c7);return _0x383061;};Trigger['prototype'][_0x3333('0x6f')]=function(_0xcdda3e,_0x582223){return function(_0x5d1fc1){switch(_0x5d1fc1['field']){case _0x3333('0x70'):if(_0xcdda3e[_0x3333('0x68')]===_0x582223){if(_0x582223===_0x3333('0x71')){return _0xcdda3e[_0x3333('0x72')]?operators[_0x5d1fc1[_0x3333('0x73')]](Number(_0x5d1fc1['value']),_0xcdda3e[_0x3333('0x72')]):![];}else{return _0xcdda3e[_[_0x3333('0x74')](_0x582223)+'AccountId']?operators[_0x5d1fc1[_0x3333('0x73')]](Number(_0x5d1fc1[_0x3333('0x75')]),_0xcdda3e[_[_0x3333('0x74')](_0x582223)+'AccountId']):![];}}break;case _0x3333('0x76'):case _0x3333('0x77'):if(_0xcdda3e['channel']===_0x582223){return _0xcdda3e[_0x3333('0x78')]?operators[_0x5d1fc1[_0x3333('0x73')]](_0x5d1fc1[_0x3333('0x75')],_0xcdda3e[_0x3333('0x78')]):![];}break;case _0x3333('0x61'):return _0xcdda3e['queue']?operators[_0x5d1fc1[_0x3333('0x73')]](_0x5d1fc1['value'],_0xcdda3e['queue']):![];case _0x3333('0x79'):return _0xcdda3e[_0x3333('0x7a')]?operators[_0x5d1fc1[_0x3333('0x73')]](_0x5d1fc1[_0x3333('0x75')],_0xcdda3e[_0x3333('0x7a')]):![];case'lastevent':return _0xcdda3e[_0x3333('0x7b')]?operators[_0x5d1fc1[_0x3333('0x73')]](_0x5d1fc1[_0x3333('0x75')],_0xcdda3e['lastevent']):![];case'routeId':return _0xcdda3e[_0x3333('0x62')]?operators[_0x5d1fc1[_0x3333('0x73')]](_0x5d1fc1[_0x3333('0x75')],_0xcdda3e[_0x3333('0x62')]):![];case _0x3333('0x7c'):if(_0x5d1fc1[_0x3333('0x75')]==='null')_0x5d1fc1[_0x3333('0x75')]=null;return typeof _0xcdda3e[_0x3333('0x7d')]!==_0x3333('0x38')?operators[_0x5d1fc1[_0x3333('0x73')]](_0x5d1fc1[_0x3333('0x75')],_0xcdda3e[_0x3333('0x7d')]):![];case _0x3333('0x7e'):if(_0xcdda3e[_0x3333('0x68')]===_0x582223){return _0x5d1fc1[_0x3333('0x75')]===_0x3333('0x7f')&&_0x5d1fc1[_0x3333('0x73')]===_0x3333('0x80')?!![]:![];}break;}return![];};};module[_0x3333('0x81')]=Trigger;
\ No newline at end of file