Built motion from commit ac06311e.|2.6.28
[motion2.git] / server / services / ami / trigger / index.js
index 7fab781..a6a0769 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd757=['field','account','chat','ChatWebsiteId','operator','AccountId','value','message','event','membername','lastevent','routeId','mailSubstatus','substatus','offlineMessage','created','equals','exports','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','socket.io-emitter','popup','winapp','triggers','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','emit','motionChannel','undefined','voice','debug','inspect','checkTriggers','agents','interface','hasOwnProperty','status','checkTrigger','merge','variables','length','action','toLowerCase','contactmanager','browser','data1','html','templates','data2','render','uri','buildUri','data3','isNil','data4','uriLocation','windowWidth','data5','800','data6','600','winApplication','winArguments','user:%s','name','format','jscripty','trigger:%s','exec','integration','accounts','queue','urlforward','parse','replace','channel','every','AllConditions','some','AnyConditions','checkConditions','checkTrigger:\x20trigger','evt'];(function(_0x340821,_0x95405d){var _0x3321b2=function(_0x4e12d3){while(--_0x4e12d3){_0x340821['push'](_0x340821['shift']());}};_0x3321b2(++_0x95405d);}(_0xd757,0x18f));var _0x7d75=function(_0x3de613,_0x3e8a1e){_0x3de613=_0x3de613-0x0;var _0x574313=_0xd757[_0x3de613];return _0x574313;};'use strict';var util=require('util');var _=require(_0x7d75('0x0'));var url=require(_0x7d75('0x1'));var Mustache=require(_0x7d75('0x2'));var Redis=require(_0x7d75('0x3'));var urlforward=require('./urlforward');var integration=require(_0x7d75('0x4'));var cmContact=require(_0x7d75('0x5'));var script=require(_0x7d75('0x6'));var config=require(_0x7d75('0x7'));var logger=require(_0x7d75('0x8'))(_0x7d75('0x9'));var ami=require('../ami');config[_0x7d75('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7d75('0xb'))(new Redis(config[_0x7d75('0xa')]));var operators={'equals':function(_0x37c05c,_0x3bbfd3){return _0x37c05c==_0x3bbfd3;},'not_equals':function(_0x4cfd4c,_0x4bdf29){return _0x4cfd4c!=_0x4bdf29;}};var barAndWebActions=[_0x7d75('0xc'),_0x7d75('0x1'),_0x7d75('0xd')];function Trigger(_0x3c1b4d){this[_0x7d75('0xe')]=_0x3c1b4d['triggers'];this['agents']=_0x3c1b4d['agents'];this[_0x7d75('0xf')]=_0x3c1b4d[_0x7d75('0xf')];this['templates']=_0x3c1b4d['templates'];this[_0x7d75('0x10')]=_0x3c1b4d[_0x7d75('0x10')];this[_0x7d75('0x11')]=_0x3c1b4d[_0x7d75('0x11')];this['freshdeskAccounts']=_0x3c1b4d[_0x7d75('0x12')];this[_0x7d75('0x13')]=_0x3c1b4d[_0x7d75('0x13')];this[_0x7d75('0x14')]=_0x3c1b4d['sugarcrmAccounts'];this[_0x7d75('0x15')]=_0x3c1b4d['zohoAccounts'];this['deskAccounts']=_0x3c1b4d[_0x7d75('0x16')];this[_0x7d75('0x17')]=_0x3c1b4d['vtigerAccounts'];this[_0x7d75('0x18')]=_0x3c1b4d[_0x7d75('0x18')];this[_0x7d75('0x19')]=_0x3c1b4d[_0x7d75('0x19')];this['freshsalesAccounts']=_0x3c1b4d[_0x7d75('0x1a')];this['accounts']={'zendesk':this[_0x7d75('0x11')],'salesforce':this[_0x7d75('0x13')],'freshdesk':this[_0x7d75('0x12')],'sugarcrm':this[_0x7d75('0x14')],'zoho':this[_0x7d75('0x15')],'desk':this[_0x7d75('0x16')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x7d75('0x19')],'freshsales':this[_0x7d75('0x1a')],'servicenow':this['servicenowAccounts']};ami['on'](_0x7d75('0x1b'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x1e'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x1f'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x20'),this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x21'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x22'),this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x23'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x24'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentreject',this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x25'),this[_0x7d75('0x1c')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x26'),this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x27'),this[_0x7d75('0x28')][_0x7d75('0x1d')](this));ami['on']('custom:dialconnect',this[_0x7d75('0x28')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x29'),this['syncAgentDial'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2a'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2b'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2c'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2d'),this[_0x7d75('0x1c')]['bind'](this));ami['on'](_0x7d75('0x2e'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x2f'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));ami['on'](_0x7d75('0x30'),this[_0x7d75('0x1c')][_0x7d75('0x1d')](this));}Trigger[_0x7d75('0x31')]['emit']=function(_0x2c0ffc,_0x44111e,_0x53bba0){logger[_0x7d75('0x32')](_0x2c0ffc,_0x44111e,JSON[_0x7d75('0x33')](_0x53bba0));io['to'](_0x2c0ffc)[_0x7d75('0x34')](_0x44111e,_0x53bba0);};Trigger[_0x7d75('0x31')][_0x7d75('0x1c')]=function(_0x5eaf75){var _0x5caebb=_['clone'](_0x5eaf75);if(typeof _0x5caebb[_0x7d75('0x35')]===_0x7d75('0x36')){_0x5caebb[_0x7d75('0x35')]=_0x7d75('0x37');}logger[_0x7d75('0x38')]('syncCustomEvent',util[_0x7d75('0x39')](_0x5caebb,{'showHidden':!![],'depth':null}));this[_0x7d75('0x3a')](_0x5caebb);};Trigger[_0x7d75('0x31')][_0x7d75('0x28')]=function(_0x5d60c6){if(this[_0x7d75('0x3b')][_0x5d60c6[_0x7d75('0x3c')]]){this[_0x7d75('0x1c')](_0x5d60c6);}};Trigger[_0x7d75('0x31')][_0x7d75('0x3a')]=function(_0x6610d5){var _0x54926a;for(var _0xf0593f in this['triggers']){if(this['triggers'][_0x7d75('0x3d')](_0xf0593f)){if(this[_0x7d75('0xe')][_0xf0593f][_0x7d75('0x3e')]){_0x54926a=this[_0x7d75('0x3f')](this['triggers'][_0xf0593f],_0x6610d5);if(_0x54926a){_[_0x7d75('0x40')](_0x6610d5,_0x6610d5[_0x7d75('0x41')]);for(var _0x1e3a4f=0x0,_0x11ac68,_0x1d93f3,_0x2bd26a;_0x1e3a4f<this[_0x7d75('0xe')][_0xf0593f]['Actions'][_0x7d75('0x42')];_0x1e3a4f+=0x1){_0x11ac68=this[_0x7d75('0xe')][_0xf0593f]['Actions'][_0x1e3a4f];if(this[_0x7d75('0x3b')][_0x6610d5[_0x7d75('0x3c')]]){switch(_0x11ac68[_0x7d75('0x43')][_0x7d75('0x44')]()){case _0x7d75('0x45'):break;case'motionbar':case _0x7d75('0x46'):var _0x5bd3ce={};switch(barAndWebActions[_0x11ac68[_0x7d75('0x47')]]){case _0x7d75('0xc'):_0x5bd3ce['TemplateId']=_0x11ac68['data2'];_0x5bd3ce[_0x7d75('0x48')]=this[_0x7d75('0x49')][_0x11ac68[_0x7d75('0x4a')]]?Mustache[_0x7d75('0x4b')](this[_0x7d75('0x49')][_0x11ac68[_0x7d75('0x4a')]][_0x7d75('0x48')],_0x6610d5):'template\x20not\x20found';break;case _0x7d75('0x1'):_0x5bd3ce[_0x7d75('0x4c')]=this[_0x7d75('0x4d')](_0x11ac68['data2'],_0x6610d5,_['isNil'](_0x11ac68['data3'])?!![]:parseInt(_0x11ac68[_0x7d75('0x4e')],0xa));if(_[_0x7d75('0x4f')](_0x11ac68[_0x7d75('0x50')])){_0x5bd3ce['location']='0';}else{_0x5bd3ce[_0x7d75('0x51')]=_0x11ac68[_0x7d75('0x50')];_0x5bd3ce[_0x7d75('0x52')]=_[_0x7d75('0x4f')](_0x11ac68[_0x7d75('0x53')])?_0x7d75('0x54'):_0x11ac68['data5'];_0x5bd3ce['windowHeight']=_[_0x7d75('0x4f')](_0x11ac68[_0x7d75('0x55')])?_0x7d75('0x56'):_0x11ac68[_0x7d75('0x55')];}break;case _0x7d75('0xd'):_0x5bd3ce[_0x7d75('0x57')]=_0x11ac68[_0x7d75('0x4a')]?Mustache[_0x7d75('0x4b')](_0x11ac68[_0x7d75('0x4a')],_0x6610d5):'';_0x5bd3ce[_0x7d75('0x58')]=_0x11ac68['data3']?Mustache['render'](_0x11ac68[_0x7d75('0x4e')],_0x6610d5):'';break;}this[_0x7d75('0x34')](util['format'](_0x7d75('0x59'),this['agents'][_0x6610d5[_0x7d75('0x3c')]][_0x7d75('0x5a')]),util[_0x7d75('0x5b')]('trigger:%s:%s',_0x11ac68[_0x7d75('0x43')]['toLowerCase'](),barAndWebActions[_0x11ac68[_0x7d75('0x47')]]),_[_0x7d75('0x40')](_0x5bd3ce,_0x6610d5));break;case _0x7d75('0x5c'):this[_0x7d75('0x34')](util[_0x7d75('0x5b')](_0x7d75('0x59'),this['agents'][_0x6610d5[_0x7d75('0x3c')]][_0x7d75('0x5a')]),util['format'](_0x7d75('0x5d'),_0x11ac68['action']['toLowerCase']()),_[_0x7d75('0x40')]({'ProjectId':parseInt(_0x11ac68[_0x7d75('0x47')],0xa)},_0x6610d5));break;default:this[_0x7d75('0x34')](util[_0x7d75('0x5b')](_0x7d75('0x59'),this[_0x7d75('0x3b')][_0x6610d5[_0x7d75('0x3c')]][_0x7d75('0x5a')]),util['format'](_0x7d75('0x5d'),_0x11ac68['action'][_0x7d75('0x44')]()),_['merge']({},_0x11ac68,_0x6610d5));}}switch(_0x11ac68[_0x7d75('0x43')][_0x7d75('0x44')]()){case _0x7d75('0x45'):cmContact[_0x7d75('0x5e')](this['agents'][_0x6610d5[_0x7d75('0x3c')]],this[_0x7d75('0xe')][_0xf0593f],_0x11ac68,_0x6610d5);break;case _0x7d75('0x5f'):integration[_0x7d75('0x5e')](_0x11ac68,_0x6610d5,this[_0x7d75('0x60')],this[_0x7d75('0x3b')][_0x6610d5[_0x7d75('0x3c')]],this[_0x7d75('0xf')][_0x6610d5[_0x7d75('0x61')]],this[_0x7d75('0x10')][_0x6610d5['routeId']]);break;case _0x7d75('0x62'):urlforward[_0x7d75('0x5e')](_0x11ac68,_0x6610d5);break;case'script':script[_0x7d75('0x5e')](_0x11ac68,_0x6610d5);break;}}}}}}};Trigger[_0x7d75('0x31')][_0x7d75('0x4d')]=function(_0x181c31,_0x4fe756,_0x32fd83){var _0x4374b5=url[_0x7d75('0x63')](Mustache[_0x7d75('0x4b')](_0x181c31,_0x4fe756),!![]);if(_0x32fd83){_[_0x7d75('0x40')](_0x4374b5['query'],_0x4fe756);}delete _0x4374b5['search'];var _0x71ef7e=url[_0x7d75('0x5b')](_0x4374b5);_0x71ef7e=_0x71ef7e[_0x7d75('0x64')](/\/\?/g,'?');return _0x71ef7e;};Trigger['prototype'][_0x7d75('0x3f')]=function(_0x175541,_0x38e6ef){var _0x1cdfb2=!![];var _0x395831=!![];var _0x3ae274=![];if(_0x175541[_0x7d75('0x65')]===_0x38e6ef[_0x7d75('0x35')]){_0x3ae274=!![];}if(_0x175541['AllConditions']['length']){_0x1cdfb2=_[_0x7d75('0x66')](_0x175541[_0x7d75('0x67')],this['checkConditions'](_0x38e6ef,_0x175541['channel']));}if(_0x175541['AnyConditions']['length']){_0x395831=_[_0x7d75('0x68')](_0x175541[_0x7d75('0x69')],this[_0x7d75('0x6a')](_0x38e6ef,_0x175541['channel']));}var _0x498f32=_0x3ae274&&_0x1cdfb2&&_0x395831;logger['debug'](_0x7d75('0x6b'),util[_0x7d75('0x39')](_0x175541,{'showHidden':!![],'depth':null}),_0x7d75('0x6c'),util[_0x7d75('0x39')](_0x38e6ef,{'showHidden':!![],'depth':null}),_0x3ae274,_0x1cdfb2,_0x395831);return _0x498f32;};Trigger['prototype'][_0x7d75('0x6a')]=function(_0x34179e,_0xf6e2e9){return function(_0x55a76f){switch(_0x55a76f[_0x7d75('0x6d')]){case _0x7d75('0x6e'):if(_0x34179e[_0x7d75('0x65')]===_0xf6e2e9){if(_0xf6e2e9===_0x7d75('0x6f')){return _0x34179e[_0x7d75('0x70')]?operators[_0x55a76f[_0x7d75('0x71')]](Number(_0x55a76f['value']),_0x34179e[_0x7d75('0x70')]):![];}else{return _0x34179e[_['upperFirst'](_0xf6e2e9)+_0x7d75('0x72')]?operators[_0x55a76f[_0x7d75('0x71')]](Number(_0x55a76f[_0x7d75('0x73')]),_0x34179e[_['upperFirst'](_0xf6e2e9)+_0x7d75('0x72')]):![];}}break;case'interaction':case _0x7d75('0x74'):if(_0x34179e[_0x7d75('0x65')]===_0xf6e2e9){return _0x34179e[_0x7d75('0x75')]?operators[_0x55a76f[_0x7d75('0x71')]](_0x55a76f[_0x7d75('0x73')],_0x34179e[_0x7d75('0x75')]):![];}break;case _0x7d75('0x61'):return _0x34179e[_0x7d75('0x61')]?operators[_0x55a76f[_0x7d75('0x71')]](_0x55a76f['value'],_0x34179e[_0x7d75('0x61')]):![];case'agent':return _0x34179e[_0x7d75('0x76')]?operators[_0x55a76f[_0x7d75('0x71')]](_0x55a76f[_0x7d75('0x73')],_0x34179e[_0x7d75('0x76')]):![];case _0x7d75('0x77'):return _0x34179e[_0x7d75('0x77')]?operators[_0x55a76f['operator']](_0x55a76f[_0x7d75('0x73')],_0x34179e[_0x7d75('0x77')]):![];case'routeId':return _0x34179e[_0x7d75('0x78')]?operators[_0x55a76f[_0x7d75('0x71')]](_0x55a76f[_0x7d75('0x73')],_0x34179e[_0x7d75('0x78')]):![];case _0x7d75('0x79'):if(_0x55a76f[_0x7d75('0x73')]==='null')_0x55a76f[_0x7d75('0x73')]=null;return typeof _0x34179e[_0x7d75('0x7a')]!==_0x7d75('0x36')?operators[_0x55a76f['operator']](_0x55a76f['value'],_0x34179e['substatus']):![];case _0x7d75('0x7b'):if(_0x34179e[_0x7d75('0x65')]===_0xf6e2e9){return _0x55a76f[_0x7d75('0x73')]===_0x7d75('0x7c')&&_0x55a76f[_0x7d75('0x71')]===_0x7d75('0x7d')?!![]:![];}break;}return![];};};module[_0x7d75('0x7e')]=Trigger;
\ No newline at end of file
+var _0x6a9f=['custom:agentconnect','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','inspect','checkTriggers','hasOwnProperty','status','checkTrigger','merge','Actions','interface','toLowerCase','contactmanager','motionbar','browser','TemplateId','html','data2','template\x20not\x20found','uri','buildUri','data3','isNil','location','uriLocation','data4','windowWidth','data5','800','600','data6','render','winArguments','format','user:%s','trigger:%s:%s','action','jscripty','name','trigger:%s','data1','exec','integration','queue','routeId','urlforward','script','query','search','channel','AllConditions','length','every','checkConditions','debug','evt','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','event','agent','lastevent','mailSubstatus','null','substatus','undefined','offlineMessage','created','equals','exports','util','lodash','url','mustache','./urlforward','./integration','./script','../../../config/logger','trigger','../ami','defaults','redis','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind'];(function(_0xbba331,_0x2e10df){var _0x465ade=function(_0x3e0666){while(--_0x3e0666){_0xbba331['push'](_0xbba331['shift']());}};_0x465ade(++_0x2e10df);}(_0x6a9f,0x1e0));var _0xf6a9=function(_0x589352,_0x3e3dc9){_0x589352=_0x589352-0x0;var _0x67373b=_0x6a9f[_0x589352];return _0x67373b;};'use strict';var util=require(_0xf6a9('0x0'));var _=require(_0xf6a9('0x1'));var url=require(_0xf6a9('0x2'));var Mustache=require(_0xf6a9('0x3'));var Redis=require('ioredis');var urlforward=require(_0xf6a9('0x4'));var integration=require(_0xf6a9('0x5'));var cmContact=require('./cmContact');var script=require(_0xf6a9('0x6'));var config=require('../../../config/environment');var logger=require(_0xf6a9('0x7'))(_0xf6a9('0x8'));var ami=require(_0xf6a9('0x9'));config['redis']=_[_0xf6a9('0xa')](config[_0xf6a9('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf6a9('0xb')]));var operators={'equals':function(_0x2c9eb9,_0x60608c){return _0x2c9eb9==_0x60608c;},'not_equals':function(_0x420ee5,_0x4b88f4){return _0x420ee5!=_0x4b88f4;}};var barAndWebActions=[_0xf6a9('0xc'),'url',_0xf6a9('0xd')];function Trigger(_0x41e857){this[_0xf6a9('0xe')]=_0x41e857['triggers'];this[_0xf6a9('0xf')]=_0x41e857[_0xf6a9('0xf')];this[_0xf6a9('0x10')]=_0x41e857[_0xf6a9('0x10')];this['templates']=_0x41e857[_0xf6a9('0x11')];this['voiceExtensions']=_0x41e857[_0xf6a9('0x12')];this[_0xf6a9('0x13')]=_0x41e857[_0xf6a9('0x13')];this[_0xf6a9('0x14')]=_0x41e857['freshdeskAccounts'];this[_0xf6a9('0x15')]=_0x41e857[_0xf6a9('0x15')];this[_0xf6a9('0x16')]=_0x41e857['sugarcrmAccounts'];this[_0xf6a9('0x17')]=_0x41e857['zohoAccounts'];this[_0xf6a9('0x18')]=_0x41e857[_0xf6a9('0x18')];this[_0xf6a9('0x19')]=_0x41e857[_0xf6a9('0x19')];this[_0xf6a9('0x1a')]=_0x41e857[_0xf6a9('0x1a')];this['dynamics365Accounts']=_0x41e857[_0xf6a9('0x1b')];this[_0xf6a9('0x1c')]=_0x41e857[_0xf6a9('0x1c')];this[_0xf6a9('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xf6a9('0x15')],'freshdesk':this[_0xf6a9('0x14')],'sugarcrm':this[_0xf6a9('0x16')],'zoho':this[_0xf6a9('0x17')],'desk':this[_0xf6a9('0x18')],'vtiger':this[_0xf6a9('0x19')],'dynamics365':this[_0xf6a9('0x1b')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xf6a9('0x1a')]};ami['on']('custom:agentcalled',this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x20'),this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on']('custom:agentringnoanswer',this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x21'),this['syncCustomEvent']['bind'](this));ami['on'](_0xf6a9('0x22'),this[_0xf6a9('0x1e')]['bind'](this));ami['on'](_0xf6a9('0x23'),this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x24'),this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on']('custom:agentcongestion',this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x25'),this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x26'),this['syncCustomEvent'][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x27'),this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on']('custom:timeout',this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on']('custom:dialbegin',this[_0xf6a9('0x28')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x29'),this[_0xf6a9('0x28')]['bind'](this));ami['on'](_0xf6a9('0x2a'),this['syncAgentDial']['bind'](this));ami['on'](_0xf6a9('0x2b'),this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x2c'),this[_0xf6a9('0x1e')]['bind'](this));ami['on'](_0xf6a9('0x2d'),this['syncCustomEvent'][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x2e'),this[_0xf6a9('0x1e')]['bind'](this));ami['on'](_0xf6a9('0x2f'),this[_0xf6a9('0x1e')]['bind'](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x30'),this[_0xf6a9('0x1e')][_0xf6a9('0x1f')](this));ami['on'](_0xf6a9('0x31'),this['syncCustomEvent']['bind'](this));}Trigger[_0xf6a9('0x32')][_0xf6a9('0x33')]=function(_0x59a867,_0x3d35da,_0x57a1f2){logger[_0xf6a9('0x34')](_0x59a867,_0x3d35da,JSON[_0xf6a9('0x35')](_0x57a1f2));io['to'](_0x59a867)[_0xf6a9('0x33')](_0x3d35da,_0x57a1f2);};Trigger[_0xf6a9('0x32')][_0xf6a9('0x1e')]=function(_0x2b55c5){var _0x58ad9e=_[_0xf6a9('0x36')](_0x2b55c5);if(typeof _0x58ad9e[_0xf6a9('0x37')]==='undefined'){_0x58ad9e[_0xf6a9('0x37')]='voice';}logger['debug'](_0xf6a9('0x1e'),util[_0xf6a9('0x38')](_0x58ad9e,{'showHidden':!![],'depth':null}));this[_0xf6a9('0x39')](_0x58ad9e);};Trigger[_0xf6a9('0x32')][_0xf6a9('0x28')]=function(_0x32ff7b){if(this[_0xf6a9('0xf')][_0x32ff7b['interface']]){this['syncCustomEvent'](_0x32ff7b);}};Trigger['prototype'][_0xf6a9('0x39')]=function(_0x12a6bc){var _0x4ed2ef;for(var _0x5f180d in this[_0xf6a9('0xe')]){if(this['triggers'][_0xf6a9('0x3a')](_0x5f180d)){if(this[_0xf6a9('0xe')][_0x5f180d][_0xf6a9('0x3b')]){_0x4ed2ef=this[_0xf6a9('0x3c')](this[_0xf6a9('0xe')][_0x5f180d],_0x12a6bc);if(_0x4ed2ef){_[_0xf6a9('0x3d')](_0x12a6bc,_0x12a6bc['variables']);for(var _0x2eec6f=0x0,_0x540b11,_0x4e09eb,_0x96f16c;_0x2eec6f<this[_0xf6a9('0xe')][_0x5f180d]['Actions']['length'];_0x2eec6f+=0x1){_0x540b11=this[_0xf6a9('0xe')][_0x5f180d][_0xf6a9('0x3e')][_0x2eec6f];if(this[_0xf6a9('0xf')][_0x12a6bc[_0xf6a9('0x3f')]]){switch(_0x540b11['action'][_0xf6a9('0x40')]()){case _0xf6a9('0x41'):break;case _0xf6a9('0x42'):case _0xf6a9('0x43'):var _0x389544={};switch(barAndWebActions[_0x540b11['data1']]){case _0xf6a9('0xc'):_0x389544[_0xf6a9('0x44')]=_0x540b11['data2'];_0x389544[_0xf6a9('0x45')]=this['templates'][_0x540b11[_0xf6a9('0x46')]]?Mustache['render'](this[_0xf6a9('0x11')][_0x540b11['data2']][_0xf6a9('0x45')],_0x12a6bc):_0xf6a9('0x47');break;case'url':_0x389544[_0xf6a9('0x48')]=this[_0xf6a9('0x49')](_0x540b11[_0xf6a9('0x46')],_0x12a6bc,_['isNil'](_0x540b11[_0xf6a9('0x4a')])?!![]:parseInt(_0x540b11['data3'],0xa));if(_[_0xf6a9('0x4b')](_0x540b11['data4'])){_0x389544[_0xf6a9('0x4c')]='0';}else{_0x389544[_0xf6a9('0x4d')]=_0x540b11[_0xf6a9('0x4e')];_0x389544[_0xf6a9('0x4f')]=_[_0xf6a9('0x4b')](_0x540b11[_0xf6a9('0x50')])?_0xf6a9('0x51'):_0x540b11['data5'];_0x389544['windowHeight']=_[_0xf6a9('0x4b')](_0x540b11['data6'])?_0xf6a9('0x52'):_0x540b11[_0xf6a9('0x53')];}break;case _0xf6a9('0xd'):_0x389544['winApplication']=_0x540b11[_0xf6a9('0x46')]?Mustache[_0xf6a9('0x54')](_0x540b11[_0xf6a9('0x46')],_0x12a6bc):'';_0x389544[_0xf6a9('0x55')]=_0x540b11[_0xf6a9('0x4a')]?Mustache[_0xf6a9('0x54')](_0x540b11['data3'],_0x12a6bc):'';break;}this[_0xf6a9('0x33')](util[_0xf6a9('0x56')](_0xf6a9('0x57'),this[_0xf6a9('0xf')][_0x12a6bc['interface']]['name']),util['format'](_0xf6a9('0x58'),_0x540b11[_0xf6a9('0x59')][_0xf6a9('0x40')](),barAndWebActions[_0x540b11['data1']]),_[_0xf6a9('0x3d')](_0x389544,_0x12a6bc));break;case _0xf6a9('0x5a'):this['emit'](util[_0xf6a9('0x56')]('user:%s',this[_0xf6a9('0xf')][_0x12a6bc['interface']][_0xf6a9('0x5b')]),util[_0xf6a9('0x56')](_0xf6a9('0x5c'),_0x540b11[_0xf6a9('0x59')][_0xf6a9('0x40')]()),_[_0xf6a9('0x3d')]({'ProjectId':parseInt(_0x540b11[_0xf6a9('0x5d')],0xa)},_0x12a6bc));break;default:this['emit'](util[_0xf6a9('0x56')](_0xf6a9('0x57'),this['agents'][_0x12a6bc[_0xf6a9('0x3f')]][_0xf6a9('0x5b')]),util[_0xf6a9('0x56')](_0xf6a9('0x5c'),_0x540b11[_0xf6a9('0x59')][_0xf6a9('0x40')]()),_['merge']({},_0x540b11,_0x12a6bc));}}switch(_0x540b11[_0xf6a9('0x59')][_0xf6a9('0x40')]()){case _0xf6a9('0x41'):cmContact[_0xf6a9('0x5e')](this[_0xf6a9('0xf')][_0x12a6bc[_0xf6a9('0x3f')]],this['triggers'][_0x5f180d],_0x540b11,_0x12a6bc);break;case _0xf6a9('0x5f'):integration['exec'](_0x540b11,_0x12a6bc,this[_0xf6a9('0x1d')],this[_0xf6a9('0xf')][_0x12a6bc[_0xf6a9('0x3f')]],this[_0xf6a9('0x10')][_0x12a6bc[_0xf6a9('0x60')]],this[_0xf6a9('0x12')][_0x12a6bc[_0xf6a9('0x61')]]);break;case _0xf6a9('0x62'):urlforward[_0xf6a9('0x5e')](_0x540b11,_0x12a6bc);break;case _0xf6a9('0x63'):script[_0xf6a9('0x5e')](_0x540b11,_0x12a6bc);break;}}}}}}};Trigger[_0xf6a9('0x32')][_0xf6a9('0x49')]=function(_0xe03d1f,_0xe9911,_0x5b0ab0){var _0x41949f=url['parse'](Mustache[_0xf6a9('0x54')](_0xe03d1f,_0xe9911),!![]);if(_0x5b0ab0){_[_0xf6a9('0x3d')](_0x41949f[_0xf6a9('0x64')],_0xe9911);}delete _0x41949f[_0xf6a9('0x65')];var _0x10ba58=url[_0xf6a9('0x56')](_0x41949f);_0x10ba58=_0x10ba58['replace'](/\/\?/g,'?');return _0x10ba58;};Trigger[_0xf6a9('0x32')][_0xf6a9('0x3c')]=function(_0x25e7e2,_0x4af0fe){var _0x1ba49c=!![];var _0x45f824=!![];var _0x9cf8b7=![];if(_0x25e7e2[_0xf6a9('0x66')]===_0x4af0fe[_0xf6a9('0x37')]){_0x9cf8b7=!![];}if(_0x25e7e2[_0xf6a9('0x67')][_0xf6a9('0x68')]){_0x1ba49c=_[_0xf6a9('0x69')](_0x25e7e2[_0xf6a9('0x67')],this[_0xf6a9('0x6a')](_0x4af0fe,_0x25e7e2[_0xf6a9('0x66')]));}if(_0x25e7e2['AnyConditions'][_0xf6a9('0x68')]){_0x45f824=_['some'](_0x25e7e2['AnyConditions'],this[_0xf6a9('0x6a')](_0x4af0fe,_0x25e7e2[_0xf6a9('0x66')]));}var _0x3bb04f=_0x9cf8b7&&_0x1ba49c&&_0x45f824;logger[_0xf6a9('0x6b')]('checkTrigger:\x20trigger',util[_0xf6a9('0x38')](_0x25e7e2,{'showHidden':!![],'depth':null}),_0xf6a9('0x6c'),util[_0xf6a9('0x38')](_0x4af0fe,{'showHidden':!![],'depth':null}),_0x9cf8b7,_0x1ba49c,_0x45f824);return _0x3bb04f;};Trigger[_0xf6a9('0x32')]['checkConditions']=function(_0x1a3d48,_0x5bc3a4){return function(_0x72ed03){switch(_0x72ed03[_0xf6a9('0x6d')]){case _0xf6a9('0x6e'):if(_0x1a3d48[_0xf6a9('0x66')]===_0x5bc3a4){if(_0x5bc3a4===_0xf6a9('0x6f')){return _0x1a3d48[_0xf6a9('0x70')]?operators[_0x72ed03[_0xf6a9('0x71')]](Number(_0x72ed03[_0xf6a9('0x72')]),_0x1a3d48['ChatWebsiteId']):![];}else{return _0x1a3d48[_[_0xf6a9('0x73')](_0x5bc3a4)+_0xf6a9('0x74')]?operators[_0x72ed03[_0xf6a9('0x71')]](Number(_0x72ed03[_0xf6a9('0x72')]),_0x1a3d48[_[_0xf6a9('0x73')](_0x5bc3a4)+_0xf6a9('0x74')]):![];}}break;case'interaction':case'message':if(_0x1a3d48[_0xf6a9('0x66')]===_0x5bc3a4){return _0x1a3d48['event']?operators[_0x72ed03[_0xf6a9('0x71')]](_0x72ed03[_0xf6a9('0x72')],_0x1a3d48[_0xf6a9('0x75')]):![];}break;case _0xf6a9('0x60'):return _0x1a3d48[_0xf6a9('0x60')]?operators[_0x72ed03[_0xf6a9('0x71')]](_0x72ed03[_0xf6a9('0x72')],_0x1a3d48[_0xf6a9('0x60')]):![];case _0xf6a9('0x76'):return _0x1a3d48['membername']?operators[_0x72ed03['operator']](_0x72ed03[_0xf6a9('0x72')],_0x1a3d48['membername']):![];case _0xf6a9('0x77'):return _0x1a3d48[_0xf6a9('0x77')]?operators[_0x72ed03['operator']](_0x72ed03[_0xf6a9('0x72')],_0x1a3d48[_0xf6a9('0x77')]):![];case _0xf6a9('0x61'):return _0x1a3d48[_0xf6a9('0x61')]?operators[_0x72ed03['operator']](_0x72ed03[_0xf6a9('0x72')],_0x1a3d48[_0xf6a9('0x61')]):![];case _0xf6a9('0x78'):if(_0x72ed03[_0xf6a9('0x72')]===_0xf6a9('0x79'))_0x72ed03[_0xf6a9('0x72')]=null;return typeof _0x1a3d48[_0xf6a9('0x7a')]!==_0xf6a9('0x7b')?operators[_0x72ed03[_0xf6a9('0x71')]](_0x72ed03['value'],_0x1a3d48['substatus']):![];case _0xf6a9('0x7c'):if(_0x1a3d48['channel']===_0x5bc3a4){return _0x72ed03[_0xf6a9('0x72')]===_0xf6a9('0x7d')&&_0x72ed03[_0xf6a9('0x71')]===_0xf6a9('0x7e')?!![]:![];}break;}return![];};};module[_0xf6a9('0x7f')]=Trigger;
\ No newline at end of file