ffa635ee9383a2cce27bd2dcd4aad8d272440bd4
[motion.git] / server / config / integrations / salesforce.js
1 var _0x242f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6A\x73\x66\x6F\x72\x63\x65","\x6D\x6F\x6D\x65\x6E\x74","\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x68\x61\x6E\x64\x6C\x65\x45\x76\x65\x6E\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x50\x61\x73\x73\x65\x64\x20\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x73\x20\x61\x72\x65\x20\x6E\x6F\x74\x20\x65\x6E\x6F\x75\x67\x68\x20\x74\x6F\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x6E\x65\x77\x20\x74\x69\x63\x6B\x65\x74\x3A\x20\x6D\x69\x73\x73\x20\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64\x20\x6F\x72\x20\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x49\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x66\x69\x6E\x64","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E","\x72\x65\x6D\x6F\x74\x65\x55\x72\x69","\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x41\x63\x63\x6F\x75\x6E\x74","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6C\x6F\x67\x69\x6E\x2E\x73\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x2E\x63\x6F\x6D","\x63\x6C\x69\x65\x6E\x74\x49\x64","\x63\x6C\x69\x65\x6E\x74\x53\x65\x63\x72\x65\x74","\x73\x65\x63\x75\x72\x69\x74\x79\x54\x6F\x6B\x65\x6E","\x63\x6F\x6E\x63\x61\x74","\x70\x61\x73\x73\x77\x6F\x72\x64","\x63\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x6C\x6F\x67\x69\x6E","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x41\x67\x65\x6E\x74\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x65\x78\x65\x63\x75\x74\x65","\x55\x73\x65\x72","\x73\x6F\x62\x6A\x65\x63\x74","","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x76\x6F\x69\x63\x65","\x43\x68\x61\x6E\x6E\x65\x6C\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64\x3A","\x72\x65\x73\x75\x6C\x74","\x6C\x65\x6E\x67\x74\x68","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x41\x67\x65\x6E\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x61\x67\x65\x6E\x74","\x4E\x61\x6D\x65","\x66\x69\x72\x73\x74","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x41\x67\x65\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2E\x20\x55\x73\x65\x20\x74\x68\x65\x20\x61\x64\x6D\x69\x6E\x20\x61\x63\x63\x6F\x75\x6E\x74","\x69\x64\x65\x6E\x74\x69\x74\x79","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x41\x64\x6D\x69\x6E\x20\x73\x65\x6C\x65\x63\x74\x65\x64","\x75\x73\x65\x72\x5F\x69\x64","\x64\x69\x73\x70\x6C\x61\x79\x5F\x6E\x61\x6D\x65","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x43\x6F\x6E\x74\x61\x63\x74","\x50\x68\x6F\x6E\x65","\x64\x65\x73\x74\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x64\x65\x73\x74\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x65\x6E\x64\x75\x73\x65\x72","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x4C\x65\x61\x64\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x4C\x65\x61\x64","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x4C\x65\x61\x64\x20\x66\x6F\x75\x6E\x64\x3A","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x43\x6F\x6E\x74\x61\x63\x74\x2F\x4C\x65\x61\x64\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x63\x72\x65\x61\x74\x65","\x4E\x6F\x20\x43\x6F\x6D\x70\x61\x6E\x79","\x4C\x61\x73\x74\x4E\x61\x6D\x65","\x43\x61\x6C\x6C\x65\x72\x20\x2D\x20\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x73\x75\x63\x63\x65\x73\x73","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x4C\x65\x61\x64\x20\x63\x72\x65\x61\x74\x65\x64\x3A\x20","\x69\x64","\x49\x64","\x75\x74\x63","\x76\x61\x6C\x75\x65","\x66\x6F\x72\x45\x61\x63\x68","\x54\x61\x73\x6B","\x53\x75\x62\x6A\x65\x63\x74","\x73\x6F\x72\x74\x42\x79","\x74\x79\x70\x65","\x73\x74\x72\x69\x6E\x67","\x63\x6F\x6E\x74\x65\x6E\x74","\x70\x75\x73\x68","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x72\x69\x61\x62\x6C\x65\x4E\x61\x6D\x65","\x63\x75\x73\x74\x6F\x6D\x56\x61\x72\x69\x61\x62\x6C\x65","\x6E\x61\x6D\x65","\x56\x61\x72\x69\x61\x62\x6C\x65","\x20","\x6A\x6F\x69\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x6B\x65\x79\x56\x61\x6C\x75\x65","\x6B\x65\x79\x54\x79\x70\x65","\x25\x73\x3A\x20\x25\x73","\x6B\x65\x79","\x6B\x65\x79\x43\x6F\x6E\x74\x65\x6E\x74","\x0A","\x46\x69\x65\x6C\x64","\x69\x64\x46\x69\x65\x6C\x64","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x54\x61\x73\x6B\x20\x63\x72\x65\x61\x74\x65\x64\x20","\x74\x61\x73\x6B\x49\x64","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x73\x61\x6C\x65\x73\x66\x6F\x72\x63\x65","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x65\x78\x69\x74\x53\x74\x61\x74\x75\x73","\x74\x69\x63\x6B\x65\x74\x49\x64","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64","\x75\x72\x6C","\x25\x73\x2F\x25\x73\x2F\x65","\x69\x6E\x73\x74\x61\x6E\x63\x65\x55\x72\x6C","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x54\x61\x73\x6B\x20\x25\x73\x20\x64\x69\x73\x70\x6C\x61\x79\x65\x64\x20\x74\x6F\x20\x61\x67\x65\x6E\x74\x20\x25\x73","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x74\x61\x73\x6B\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x6D\x65\x73\x73\x61\x67\x65","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\x66\x61\x69\x6C\x65\x64","\x5B\x53\x61\x6C\x65\x73\x66\x6F\x72\x63\x65\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x52\x65\x70\x6F\x72\x74\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x63\x72\x65\x61\x74\x65","\x73\x75\x62\x73\x74\x72","\x2F","\x65\x78\x70\x6F\x72\x74\x73"];_0x242f[0];var _=require(_0x242f[1]);var util=require(_0x242f[2]);var jsforce=require(_0x242f[3]);var moment=require(_0x242f[4]);var SalesforceIntegration=require(_0x242f[6])[_0x242f[5]];var SalesforceConfiguration=require(_0x242f[6])[_0x242f[7]];var ReportIntegration=require(_0x242f[6])[_0x242f[8]];function Salesforce(){console[_0x242f[10]](_0x242f[9])}Salesforce[_0x242f[12]][_0x242f[11]]=function(_0xa517x9,_0xa517xa,_0xa517xb,_0xa517xc,_0xa517xd){var _0xa517xe={connection:undefined,configuration:undefined,agent:undefined,enduser:undefined,taskId:undefined};if(!_0xa517x9|| !_0xa517xa){console[_0x242f[14]](_0x242f[13]);return};SalesforceConfiguration[_0x242f[17]]({where:{id:_0xa517xa,AccountId:_0xa517x9},include:[{all:true,include:[{all:true}]}]})[_0x242f[16]](handleEntityNotFound())[_0x242f[16]](handleConnection(_0xa517xe))[_0x242f[16]](searchAgent(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](handleAgent(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](searchAdmin(_0xa517xe))[_0x242f[16]](handleAdmin(_0xa517xe))[_0x242f[16]](searchContact(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](handleContact(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](searchLead(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](handleLead(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](leadCreation(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](handleLeadCreation(_0xa517xe,_0xa517xb,_0xa517xc))[_0x242f[16]](taskCreation(_0xa517xe,_0xa517xc,_0xa517xd))[_0x242f[16]](handleTaskDisplay(_0xa517xe))[_0x242f[16]](handleReportIntegration(_0xa517xe,_0xa517xb,_0xa517xc,_0xa517x9))[_0x242f[16]](handleEnd(_0xa517xe))[_0x242f[15]](handleError(_0xa517xe,_0xa517xb,_0xa517xc,_0xa517x9))};function handleEntityNotFound(){return function(_0xa517x10){if(!_0xa517x10){return null};return _0xa517x10}}function handleConnection(_0xa517xe){return function(_0xa517x12){_0xa517xe[_0x242f[18]]= new jsforce.Connection({oauth2:{loginUrl:_0xa517x12[_0x242f[20]][_0x242f[19]]?_0xa517x12[_0x242f[20]][_0x242f[19]]:_0x242f[21],clientId:_0xa517x12[_0x242f[20]][_0x242f[22]],clientSecret:_0xa517x12[_0x242f[20]][_0x242f[23]]}});var _0xa517x13=_0xa517x12[_0x242f[20]][_0x242f[26]][_0x242f[25]](_0xa517x12[_0x242f[20]][_0x242f[24]]);_0xa517xe[_0x242f[27]]=_0xa517x12;return _0xa517xe[_0x242f[18]][_0x242f[29]](_0xa517x12[_0x242f[20]][_0x242f[28]],_0xa517x13)}}function searchAgent(_0xa517xe,_0xa517xb,_0xa517xc){return function(){console[_0x242f[10]](_0x242f[30],getValueFromPropertyName(_0xa517xc,getAgentSearchPropertyFromChannel(_0xa517xb)));return _0xa517xe[_0x242f[18]][_0x242f[33]](_0x242f[32])[_0x242f[17]]({Name:getValueFromPropertyName(_0xa517xc,getAgentSearchPropertyFromChannel(_0xa517xb))},{Id:1,Username:1,Name:1})[_0x242f[31]]()}}function getAgentSearchPropertyFromChannel(_0xa517xb){var _0xa517x16=_0x242f[34];if(_0xa517xb){switch(_0xa517xb){case _0x242f[36]:_0xa517x16=_0x242f[35];break;default:_0xa517x16=_0x242f[35];console[_0x242f[14]](_0x242f[37],_0xa517xb)}};return _0xa517x16}function getValueFromPropertyName(_0xa517xc,_0xa517x16){return _[_0x242f[38]](_0xa517xc,_0xa517x16)}function handleAgent(_0xa517xe,_0xa517xb,_0xa517x19){return function(_0xa517xc){if(_0xa517xc[_0x242f[39]]>0){console[_0x242f[10]](_0x242f[40],getValueFromPropertyName(_0xa517x19,getAgentSearchPropertyFromChannel(_0xa517xb)));_0xa517xe[_0x242f[41]]=getMatchObject(_0xa517xc,_0x242f[42],getValueFromPropertyName(_0xa517x19,getAgentSearchPropertyFromChannel(_0xa517xb)));return _0xa517xe[_0x242f[41]]};return}}function getMatchObject(_0xa517x1b,_0xa517x16,_0xa517x1c){var _0xa517x1d=_[_0x242f[17]](_0xa517x1b,{property:_0xa517x1c});if(_0xa517x1d){return _0xa517x1d};return _[_0x242f[43]](_0xa517x1b)}function searchAdmin(_0xa517xe){return function(_0xa517xc){if(_0xa517xc){return};console[_0x242f[10]](_0x242f[44]);return _0xa517xe[_0x242f[18]][_0x242f[45]]()}}function handleAdmin(_0xa517xe){return function(_0xa517xc){if(!_0xa517xc){return};if(_0xa517xc){console[_0x242f[10]](_0x242f[46]);_0xa517xe[_0x242f[41]]={Id:_0xa517xc[_0x242f[47]],Name:_0xa517xc[_0x242f[48]],Username:_0xa517xc[_0x242f[28]]}};return}}function searchContact(_0xa517xe,_0xa517xb,_0xa517xc){return function(){console[_0x242f[10]](_0x242f[49],getValueFromPropertyName(_0xa517xc,getEndUserSearchPropertyFromChannel(_0xa517xb)));var _0xa517x21={};_0xa517x21[getEndUserSearchQueryFromChannel(_0xa517xb)]=getValueFromPropertyName(_0xa517xc,getEndUserSearchPropertyFromChannel(_0xa517xb));return _0xa517xe[_0x242f[18]][_0x242f[33]](_0x242f[50])[_0x242f[17]](_0xa517x21,{Id:1,Name:1})[_0x242f[31]]()}}function getEndUserSearchQueryFromChannel(_0xa517xb){var _0xa517x16=_0x242f[34];if(_0xa517xb){switch(_0xa517xb){case _0x242f[36]:_0xa517x16=_0x242f[51];break;default:_0xa517x16=_0x242f[51];console[_0x242f[14]](_0x242f[37],_0xa517xb)}};return _0xa517x16}function getEndUserSearchPropertyFromChannel(_0xa517xb){var _0xa517x16=_0x242f[34];if(_0xa517xb){switch(_0xa517xb){case _0x242f[36]:_0xa517x16=_0x242f[52];break;default:_0xa517x16=_0x242f[52];console[_0x242f[14]](_0x242f[37],_0xa517xb)}};return _0xa517x16}function getEndUserNamePropertyFromChannel(_0xa517xb){var _0xa517x16=_0x242f[34];if(_0xa517xb){switch(_0xa517xb){case _0x242f[36]:_0xa517x16=_0x242f[53];break;default:_0xa517x16=_0x242f[53];console[_0x242f[14]](_0x242f[37],_0xa517xb)}};return _0xa517x16}function handleContact(_0xa517xe,_0xa517xb,_0xa517x19){return function(_0xa517xc){if(_0xa517xc[_0x242f[39]]>0){console[_0x242f[10]](_0x242f[54],getValueFromPropertyName(_0xa517x19,getEndUserSearchPropertyFromChannel(_0xa517xb)));_0xa517xe[_0x242f[55]]=_0xa517xc[0];return _0xa517xe[_0x242f[55]]};console[_0x242f[10]](_0x242f[56],getValueFromPropertyName(_0xa517x19,getEndUserSearchPropertyFromChannel(_0xa517xb)));return}}function searchLead(_0xa517xe,_0xa517xb,_0xa517x19){return function(_0xa517xc){if(!_0xa517xc){console[_0x242f[10]](_0x242f[57],getValueFromPropertyName(_0xa517x19,getEndUserSearchPropertyFromChannel(_0xa517xb)));var _0xa517x21={};_0xa517x21[getEndUserSearchQueryFromChannel(_0xa517xb)]=getValueFromPropertyName(_0xa517x19,getEndUserSearchPropertyFromChannel(_0xa517xb));return _0xa517xe[_0x242f[18]][_0x242f[33]](_0x242f[58])[_0x242f[17]](_0xa517x21,{Id:1,Name:1})[_0x242f[31]]()};return}}function handleLead(_0xa517xe,_0xa517xb,_0xa517x19){return function(_0xa517xc){if(_0xa517xc&&_0xa517xc[_0x242f[39]]>0){console[_0x242f[10]](_0x242f[59],getValueFromPropertyName(_0xa517x19,getEndUserSearchPropertyFromChannel(_0xa517xb)));_0xa517xe[_0x242f[55]]=_0xa517xc[0];return _0xa517xe[_0x242f[55]]};return}}function leadCreation(_0xa517xe,_0xa517xb,_0xa517x19){return function(_0xa517xc){if(_0xa517xc||_0xa517xe[_0x242f[55]]){return};console[_0x242f[10]](_0x242f[60],getValueFromPropertyName(_0xa517x19,getEndUserSearchPropertyFromChannel(_0xa517xb)));return _0xa517xe[_0x242f[18]][_0x242f[33]](_0x242f[58])[_0x242f[61]](getJsonForEndUserCreation(_0xa517xb,_0xa517x19))}}function getJsonForEndUserCreation(_0xa517xb,_0xa517xc){var _0xa517x2a={Company:_0x242f[62]};switch(_0xa517xb){case _0x242f[36]:if(_0xa517xc[_0x242f[53]]){_0xa517x2a[_0x242f[63]]=getValueFromPropertyName(_0xa517xc,getEndUserNamePropertyFromChannel(_0xa517xb))}else {_0xa517x2a[_0x242f[63]]=util[_0x242f[65]](_0x242f[64],getValueFromPropertyName(_0xa517xc,getAgentSearchPropertyFromChannel(_0xa517xb)))};_0xa517x2a[_0x242f[51]]=getValueFromPropertyName(_0xa517xc,getEndUserSearchPropertyFromChannel(_0xa517xb));break;default:console[_0x242f[14]](_0x242f[37],_0xa517xb)};return _0xa517x2a}function handleLeadCreation(_0xa517xe,_0xa517xb,_0xa517x19){return function(_0xa517xc){if(!_0xa517xc){return};if(_0xa517xc&&_0xa517xc[_0x242f[66]]){console[_0x242f[10]](_0x242f[67],getValueFromPropertyName(_0xa517x19,getEndUserSearchPropertyFromChannel(_0xa517xb)));_0xa517xe[_0x242f[55]]={Id:_0xa517xc[_0x242f[68]]}};return}}function taskCreation(_0xa517xe,_0xa517x19,_0xa517xd){return function(){var _0xa517x2d={WhoId:_0xa517xe[_0x242f[55]][_0x242f[69]],OwnerId:_0xa517xe[_0x242f[41]][_0x242f[69]],ActivityDate:moment[_0x242f[70]](),IsReminderSet:false,IsRecurrence:false,Subject:createSubjectFromConfiguration(_0xa517xe,_0xa517x19,_0xa517xd),Description:createDescriptionFromConfiguration(_0xa517xe,_0xa517x19,_0xa517xd)};var _0xa517x2e=createCustomFieldsFromConfiguration(_0xa517xe);if(_0xa517x2e[_0x242f[39]]>0){_[_0x242f[72]](_0xa517x2e,function(_0xa517x2f){_0xa517x2d[_0xa517x2f[_0x242f[68]]]=_0xa517x2f[_0x242f[71]]})};return _0xa517xe[_0x242f[18]][_0x242f[33]](_0x242f[73])[_0x242f[61]](_0xa517x2d)}}function createSubjectFromConfiguration(_0xa517xe,_0xa517x19,_0xa517xd){var _0xa517x31=_0x242f[34];var _0xa517x32=[];if(_0xa517xe[_0x242f[27]][_0x242f[74]][_0x242f[39]]>0){var _0xa517x33=_[_0x242f[75]](_0xa517xe[_0x242f[27]].Subject,[_0x242f[68]]);_[_0x242f[72]](_0xa517x33,function(_0xa517x34){if(_0xa517x34[_0x242f[76]]===_0x242f[77]){_0xa517x32[_0x242f[79]](_0xa517x34[_0x242f[78]])}else {if(_0xa517x34[_0x242f[76]]===_0x242f[80]&&_0xa517x34[_0x242f[81]]){var _0xa517x35=getValueFromPropertyName(_0xa517x19,_0xa517x34[_0x242f[81]]);if(_0xa517x35){_0xa517x32[_0x242f[79]](_0xa517x35.toString())}}else {if(_0xa517x34[_0x242f[76]]===_0x242f[82]){var _0xa517x36=_[_0x242f[17]](_0xa517xd,{"\x6E\x61\x6D\x65":_0xa517x34[_0x242f[84]][_0x242f[83]]});if(_0xa517x36){_0xa517x32[_0x242f[79]](_0xa517x36[_0x242f[71]].toString())}}}}});_0xa517x31=_0xa517x32[_0x242f[86]](_0x242f[85])};return _0xa517x31}function createDescriptionFromConfiguration(_0xa517xe,_0xa517x19,_0xa517xd){var _0xa517x38=_0x242f[34];var _0xa517x32=[];if(_0xa517xe[_0x242f[27]][_0x242f[87]][_0x242f[39]]>0){var _0xa517x39=_[_0x242f[75]](_0xa517xe[_0x242f[27]].Description,[_0x242f[68]]);_[_0x242f[72]](_0xa517x39,function(_0xa517x34){if(_0xa517x34[_0x242f[76]]===_0x242f[77]){_0xa517x32[_0x242f[79]](_0xa517x34[_0x242f[78]])}else {if(_0xa517x34[_0x242f[76]]===_0x242f[88]){if(_0xa517x34[_0x242f[89]]===_0x242f[77]){_0xa517x32[_0x242f[79]](util[_0x242f[65]](_0x242f[90],_0xa517x34[_0x242f[91]],_0xa517x34[_0x242f[92]]))}else {if(_0xa517x34[_0x242f[89]]===_0x242f[80]&&_0xa517x34[_0x242f[81]]){var _0xa517x35=getValueFromPropertyName(_0xa517x19,_0xa517x34[_0x242f[81]]);if(_0xa517x35){_0xa517x32[_0x242f[79]](util[_0x242f[65]](_0x242f[90],_0xa517x34[_0x242f[91]],_0xa517x35.toString()))}}else {if(_0xa517x34[_0x242f[89]]===_0x242f[82]){var _0xa517x36=_[_0x242f[17]](_0xa517xd,{"\x6E\x61\x6D\x65":_0xa517x34[_0x242f[84]][_0x242f[83]]});if(_0xa517x36){_0xa517x32[_0x242f[79]](util[_0x242f[65]](_0x242f[90],_0xa517x34[_0x242f[91]],_0xa517x36[_0x242f[71]].toString()))}}}}}}});_0xa517x38=_0xa517x32[_0x242f[86]](_0x242f[93])};return _0xa517x38}function createCustomFieldsFromConfiguration(_0xa517xe,_0xa517x19,_0xa517xd){var _0xa517x3b=[];var _0xa517x3c=[];if(_0xa517xe[_0x242f[27]][_0x242f[94]][_0x242f[39]]>0){_0xa517x3b=_0xa517xe[_0x242f[27]][_0x242f[94]];_[_0x242f[72]](_0xa517x3b,function(_0xa517x2f){if(_0xa517x2f[_0x242f[76]]===_0x242f[77]){_0xa517x3c[_0x242f[79]]({id:_0xa517x2f[_0x242f[95]],value:_0xa517x2f[_0x242f[78]]})}else {if(_0xa517x2f[_0x242f[76]]===_0x242f[80]){var _0xa517x35=getValueFromPropertyName(_0xa517x19,_0xa517x2f[_0x242f[81]]);if(_0xa517x35){_0xa517x3c[_0x242f[79]]({id:_0xa517x2f[_0x242f[95]],value:_0xa517x35.toString()})}}else {if(_0xa517x2f[_0x242f[76]]===_0x242f[82]){var _0xa517x36=_[_0x242f[17]](_0xa517xd,{"\x6E\x61\x6D\x65":_0xa517x2f[_0x242f[84]][_0x242f[83]]});if(_0xa517x36){_0xa517x3c[_0x242f[79]]({id:_0xa517x2f[_0x242f[95]],value:_0xa517x36[_0x242f[71]].toString()})}}}}})};return _0xa517x3c}function handleTaskDisplay(_0xa517xe){return function(_0xa517xc){if(_0xa517xc&&_0xa517xc[_0x242f[66]]){console[_0x242f[10]](_0x242f[96],_0xa517xc[_0x242f[68]]);_0xa517xe[_0x242f[97]]=_0xa517xc[_0x242f[68]];return};return}}function handleReportIntegration(_0xa517xe,_0xa517xb,_0xa517xc,_0xa517x9){return function(){_0xa517xc=_0xa517xc[_0x242f[98]];delete _0xa517xc[_0x242f[68]];_0xa517xc[_0x242f[99]]=_0x242f[100];_0xa517xc[_0x242f[101]]=_0xa517xb;_0xa517xc[_0x242f[102]]=_0x242f[66];_0xa517xc[_0x242f[103]]=_0xa517xe[_0x242f[97]];_0xa517xc[_0x242f[104]]=_0xa517x9;_0xa517xc[_0x242f[105]]=util[_0x242f[65]](_0x242f[106],_0xa517xe[_0x242f[18]][_0x242f[107]],_0xa517xe[_0x242f[97]]);return ReportIntegration[_0x242f[61]](_0xa517xc)}}function handleEnd(_0xa517xe,_0xa517xc,_0xa517xb){return function(){console[_0x242f[10]](util[_0x242f[65]](_0x242f[108],_0xa517xe[_0x242f[97]],_0xa517xe[_0x242f[41]].Id));_0xa517xe=undefined;return}}function handleError(_0xa517xe,_0xa517xb,_0xa517xc,_0xa517x9){return function(_0xa517x41){console[_0x242f[14]](_0x242f[109]);console[_0x242f[14]](_0x242f[110],_0xa517x41[_0x242f[111]]);console[_0x242f[14]](_0x242f[112],_0xa517x41[_0x242f[113]]);_0xa517xe=undefined;delete _0xa517xc[_0x242f[68]];_0xa517xc=_0xa517xc[_0x242f[98]];_0xa517xc[_0x242f[99]]=_0x242f[100];_0xa517xc[_0x242f[101]]=_0xa517xb;_0xa517xc[_0x242f[102]]=_0x242f[114];_0xa517xc[_0x242f[104]]=_0xa517x9;ReportIntegration[_0x242f[61]](_0xa517xc)[_0x242f[16]](function(){return})[_0x242f[15]](function(_0xa517x41){console[_0x242f[14]](_0x242f[115]);return})}}function stripTrailingSlash(_0xa517x43){if(_0xa517x43[_0x242f[116]](-1)===_0x242f[117]){return _0xa517x43[_0x242f[116]](0,_0xa517x43[_0x242f[39]]-1)};return _0xa517x43}module[_0x242f[118]]=Salesforce