(function(){var aa=function(ba){if(!ba){throw new Error("The Signavio Mashup API needs a configuration.");} if("string"==typeof ba.element){ba.element=document.getElementById(ba.element);} if("string"==typeof ba.server){this.server=ba.server;} this.config=ba;this.init();};aa.prototype={server:"http://academic.signavio.com",init:function(){this.writeContent(this.setupIFrame());},onLoaded:function(){this.Ext=this.frame.Ext;this.ORYX=this.frame.ORYX;this.Ajax=this.frame.Ajax;this.$A=this.frame.$A;this.Template=this.frame.Template;this.Ext.data.HttpProxy.prototype.load=function(){};this.setupEditor();},onRendered:function(){var ca=this.editor.getCanvas(),size=this.getShapeSize(),zoom=this.config.zoom,me=this,width=this.document.offsetWidth,height=this.document.offsetHeight;if("undefined"==typeof zoom){zoom=100;if(this.config.overflowX=="fit"){zoom=Math.min(zoom,(width/(size.width()+20))*100);} if(this.config.overflowY=="fit"){zoom=Math.min(zoom,(height/(size.height()+20))*100);}} zoom=Math.max(Math.min(zoom,100),1)/100;ca.node.setAttributeNS(null,"transform","scale("+zoom+")");ca.setSize({width:((size.width()+20)*zoom),height:((size.height()+20)*zoom)});ca.node.setAttribute("transform",me.editor.getCanvas().node.getAttribute("transform")+" translate("+(-1*(size.upperLeft().x-10))+", "+(-1*(size.upperLeft().y-10))+")");var da=function(st){me.frame.SVGElement=SVGElement;var ea=new me.frame.DOMParser();var fa=ea.parseFromString(''+st+'',"text/xml");return fa.childNodes[0].childNodes[0];};var ga=function(ha){if("string"==typeof ha){ha=ca.getChildShapeByResourceId(ha);} if(ha instanceof me.ORYX.Core.Shape){me.editor.handleEvents({type:me.ORYX.CONFIG.EVENT_OVERLAY_SHOW,id:"Overlay_focus"+(ha.id),shapes:me.$A([ha]),node:da([""].join("")),nodePosition:"NW"});return;} if("object"!=typeof ha){return;} if("undefined"===typeof ha.nodes){ha.nodes=ca.getChildNodes(true);} var ia=me.$A([].concat(ha.nodes)).map(function(ja){return ja instanceof me.ORYX.Core.Shape?ja:ca.getChildShapeByResourceId(ja);}).compact();if(ha.properties){var ka=ha.template||"#{0}";var la=ha.templateFn instanceof Function?ha.templateFn:function(){return ka;};var ma=[].concat(ha.properties);for(var i=0,size=ia.length;i ';ca.getScrollNode().appendChild(ta);this.ORYX.Editor.prototype._finishedLoading.apply(this.editor,[]);if(this.config.callback instanceof Function){this.config.callback.call(this.config.callback,this.editor,this);}},setupEditor:function(){var me=this;this.ORYX.availablePlugins=this.getPlugins();this.ORYX.Editor.prototype._loadStencilSetExtensionConfig=function(){};this.ORYX.Editor.prototype._generateGUI=function(){this.layout_regions={center:new me.Ext.Panel({region:'center',cls:'x-panel-editor-center',autoScroll:true,items:{layout:"fit",autoHeight:true,el:this.getCanvas().rootNode.parentNode}}),east:{collapse:function(){}},west:{collapse:function(){}}};this.layout=new me.Ext.Viewport({layout:'border',items:[this.layout_regions.center]});this.getCanvas().rootNode.parentNode.style.border="none";};this.load(function(ua){me.editor=new me.ORYX.Editor({id:'oryx-canvas123',fullscreen:true,stencilset:{url:ua.stencilset.namespace},model:ua});me.editor._finishedLoading=function(){me.beforeFinishedRendered();};});},beforeFinishedRendered:function(){var va=[],count=0,me=this;var wa=function(){if(--count===0){for(var i=0,size=va.length;i=0&&"function"===typeof Da.onSuccess){Da.onSuccess.call(this,{responseText:me.frame.Object.toJSON(Aa)});} else{Ba.apply(this,arguments);}};fn(za);});});},loadModelData:function(fn){var Ea=this.config.url+"/json?",model,me=this;if(this.config.authToken){Ea+="authkey="+(this.config.authToken.split("_")[1]||this.config.authToken);} this.loadData(Ea,fn);},loadStencilData:function(Fa,fn){var Ga=this.config.url.replace(/\/p\/.*$/,"")+"/p/editor_stencilset?";Ga+="embedsvg=true";Ga+="&namespace="+(Fa.stencilset.namespace||Fa.stencilset.url).replace("#","%23");if(this.config.authToken){Ga+="&authkey="+(this.config.authToken.split("_")[2]||"");} this.loadData(Ga,fn);},loadData:function(Ha,fn){Ha=Ha.indexOf("?")>=0?Ha:Ha+"?";Ha=Ha.slice(Ha.length-2)=="?"?Ha:Ha+"&";var Ia="data_"+(Math.round(Math.random()*1000000000));Ha+="_dc="+(Math.round(Math.random()*1000000));Ha+="&jsonp=var "+(Ia)+"=";var Ja=this.frame.document.createElement("script"),me=this;Ja.setAttribute("type","text/javascript");Ja.setAttribute("src",Ha);Ja.addEventListener("load",function(){fn(me.frame[Ia]);delete me.frame[Ia];},true);this.frame.document.getElementsByTagName("head")[0].appendChild(Ja);},setupIFrame:function(){if(!this.config.element){throw new Error("The Mashup api needs an element.");} var Ka=document.createElement("iframe");Ka.style.width=(this.config.width||"100%")+("number"==typeof this.config.width?"px":"");Ka.style.height=(this.config.height||"100%")+("number"==typeof this.config.height?"px":"");Ka.style.border="none";this.config.element.appendChild(Ka);this.document=Ka;return Ka;},writeContent:function(La){var Ma=La.contentWindow,me=this,url=this.server,isDebug=this.config.isDebug===true||this.config.debug===true,script='ORYX.CONFIG.ORYX_NEW_URL = "/";'+'ORYX.CONFIG.PANEL_LEFT_COLLAPSED = true;'+'ORYX._loadPlugins = function(){};'+'ORYX.CONFIG.BACKEND_SWITCH = false;'+'ORYX.CONFIG.EXPLORER_PATH ="'+url+'/explorer";'+'ORYX.CONFIG.BLANK_IMAGE = "'+url+'/libs/ext-2.0.2/resources/images/default/tree/loading.gif";';this.frame=Ma;Ma.document.write(''+'Mashup | Signavio'+''+''+''+''+''+''+''+''+''+''+''+''+''+''+''+''+''+''+script+''+''+'.ORYX_Editor {'+'background:none repeat scroll 0 0 white !important;'+'border:none !important;'+'height:100% !important;'+'margin:0 !important;'+'overflow:auto !important;'+'width:100% !important;'+'}'+''+''+''+''+'');Ma.document.close();Ma.onOryxResourcesLoaded=function(){me.onLoaded();};},getPlugins:function(){var Na=[{"name":"Signavio.Plugins.Loading","source":"signavio.js","properties":[]},{"name":"Signavio.Plugins.GlossaryRename","source":"glossaryRename.js","properties":[]},{"name":"ORYX.Plugins.Toolbar","source":"toolbar.js","properties":[]},{"name":"ORYX.Plugins.Loading","source":"loading.js","properties":[]},{"name":"ORYX.Plugins.ProcessLink","source":"processLink.js","properties":[],"requires":{"namespaces":["http://b3mn.org/stencilset/epc#","http://b3mn.org/stencilset/bpmn1.1#"]}},{"name":"ORYX.Plugins.Overlay","source":"overlay.js","properties":[]},{"name":"ORYX.Plugins.BPMN11","source":"bpmn11.js","properties":[],"requires":{"namespaces":["http://b3mn.org/stencilset/bpmn1.1#","http://b3mn.org/stencilset/timjpdl3#","http://b3mn.org/stencilset/jbpm4#"]}},{"name":"Signavio.Plugins.Linking","source":"linking.js","properties":[]},{"name":"ORYX.Plugins.ProcessmapSupport","source":"processmapSupport.js","properties":[],"requires":{"namespaces":["http://www.signavio.com/stencilsets/processmap#"]}},{"name":"ORYX.Plugins.OrganigramSupport","source":"organigramSupport.js","properties":[],"requires":{"namespaces":["http://www.signavio.com/stencilsets/organigram#"]}},{"name":"ORYX.Plugins.BPMN2_0","source":"bpmn2.0/bpmn2.0.js","properties":[],"requires":{"namespaces":["http://b3mn.org/stencilset/bpmn2.0#","http://www.signavio.com/saperion#","http://www.signavio.com/stencilsets/processmap#","http://b3mn.org/stencilset/bpmn2.0choreography#"]}},{"name":"ORYX.Plugins.BPMN2CONVERSATION","source":"bpmn2.0/bpmn2conversation.js","properties":[],"requires":{"namespaces":["http://b3mn.org/stencilset/bpmn2.0conversation#"]}},{"name":"ORYX.Plugins.Bpmn2_0Choreography","source":"bpmn2.0/bpmn2.0choreography.js","properties":[],"requires":{"namespaces":["http://b3mn.org/stencilset/bpmn2.0choreography#"]}}];for(var i=0,size=Na.length;i