function Vulcan(){}function VulcanMessage(a){this.type=a,this.scope=VulcanMessage.SCOPE_SUITE,this.appId=VulcanMessage.DEFAULT_APP_ID,this.appVersion=VulcanMessage.DEFAULT_APP_VERSION,this.data=VulcanMessage.DEFAULT_DATA}function GetValueByKey(a,b){var c,d,e;if(window.DOMParser){c=new window.DOMParser;try{if(d=c.parseFromString(a,"text/xml"),e=d.getElementsByTagName(b)[0],e&&e.childNodes[0])return e.childNodes[0].nodeValue}catch(f){}}return""}function requiredParamsValid(){var a,b;for(a=0;a<arguments.length;a++)if(b=arguments[a],void 0==b||null==b)return!1;return!0}function strStartsWith(a,b){return"string"!=typeof a?!1:0===a.indexOf(b)}Vulcan.prototype.getTargetSpecifiers=function(){var a={};return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetTargetSpecifiers",JSON.stringify(a)))},Vulcan.prototype.launchApp=function(a,b,c){if(!requiredParamsValid(a))return!1;var d={};return d.targetSpecifier=a,d.focus=b?"true":"false",d.cmdLine=void 0==c||null==c?"":c,JSON.parse(window.__adobe_cep__.invokeSync("vulcanLaunchApp",JSON.stringify(d))).result},Vulcan.prototype.isAppRunning=function(a){if(!requiredParamsValid(a))return!1;var b={};return b.targetSpecifier=a,JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppRunning",JSON.stringify(b))).result},Vulcan.prototype.isAppInstalled=function(a){if(!requiredParamsValid(a))return!1;var b={};return b.targetSpecifier=a,JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppInstalled",JSON.stringify(b))).result},Vulcan.prototype.getAppPath=function(a){if(!requiredParamsValid(a))return"";var b={};return b.targetSpecifier=a,JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetAppPath",JSON.stringify(b))).result},Vulcan.prototype.addMessageListener=function(a,b,c){if(requiredParamsValid(a,b)&&strStartsWith(a,VulcanMessage.TYPE_PREFIX)){var d={};d.type=a,window.__adobe_cep__.invokeAsync("vulcanAddMessageListener",JSON.stringify(d),b,c)}},Vulcan.prototype.removeMessageListener=function(a,b,c){if(requiredParamsValid(a,b)&&strStartsWith(a,VulcanMessage.TYPE_PREFIX)){var d={};d.type=a,window.__adobe_cep__.invokeAsync("vulcanRemoveMessageListener",JSON.stringify(d),b,c)}},Vulcan.prototype.dispatchMessage=function(a){var b,c;requiredParamsValid(a)&&strStartsWith(a.type,VulcanMessage.TYPE_PREFIX)&&(b={},c=new VulcanMessage(a.type),c.initialize(a),b.vulcanMessage=c,window.__adobe_cep__.invokeSync("vulcanDispatchMessage",JSON.stringify(b)))},Vulcan.prototype.getPayload=function(a){if(!requiredParamsValid(a)||!strStartsWith(a.type,VulcanMessage.TYPE_PREFIX))return null;var b=new VulcanMessage(a.type);return b.initialize(a),b.getPayload()};var VulcanInterface=new Vulcan;VulcanMessage.TYPE_PREFIX="vulcan.SuiteMessage.",VulcanMessage.SCOPE_SUITE="GLOBAL",VulcanMessage.DEFAULT_APP_ID="UNKNOWN",VulcanMessage.DEFAULT_APP_VERSION="UNKNOWN",VulcanMessage.DEFAULT_DATA="<data><payload></payload></data>",VulcanMessage.dataTemplate="<data>{0}</data>",VulcanMessage.payloadTemplate="<payload>{0}</payload>",VulcanMessage.prototype.initialize=function(a){this.type=a.type,this.scope=a.scope,this.appId=a.appId,this.appVersion=a.appVersion,this.data=a.data},VulcanMessage.prototype.xmlData=function(){if(void 0==this.data){var a="";a=String.format(VulcanMessage.payloadTemplate,a),this.data=String.format(VulcanMessage.dataTemplate,a)}return this.data},VulcanMessage.prototype.setPayload=function(a){var b=cep.encoding.convertion.utf8_to_b64(a);b=String.format(VulcanMessage.payloadTemplate,b),this.data=String.format(VulcanMessage.dataTemplate,b)},VulcanMessage.prototype.getPayload=function(){var a=GetValueByKey(this.data,"payload");return null!=a?cep.encoding.convertion.b64_to_utf8(a):null},VulcanMessage.prototype.toString=function(){var a="type="+this.type;return a+=", scope="+this.scope,a+=", appId="+this.appId,a+=", appVersion="+this.appVersion,a+=", data="+this.xmlData()},String.format=function(a){if(0==arguments.length)return null;var b=Array.prototype.slice.call(arguments,1);return a.replace(/\{(\d+)\}/g,function(a,c){return b[c]})};