UNPKG

@zklogic/draw.io

Version:

Draw.IO - Graph Editor integration in Angular-cli

1 lines 759 kB
var mxClient={VERSION:"16.1.0",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:"undefined"!=typeof InstallTrigger,IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_LINUX:/\bLinux\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_SVG},link:function(t,e,n,i){var s=(n=n||document).createElement("link");s.setAttribute("rel",t),s.setAttribute("href",e),s.setAttribute("charset","UTF-8"),s.setAttribute("type","text/css"),i&&s.setAttribute("id",i),n.getElementsByTagName("head")[0].appendChild(s)},loadResources:function(t,e){function n(){0==--i&&t()}for(var i=mxClient.defaultBundles.length,s=0;s<mxClient.defaultBundles.length;s++)mxResources.add(mxClient.defaultBundles[s],e,n)},include:function(t){document.write('<script src="'+t+'"><\/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath="images",mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language,mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en",mxLoadStylesheets&&mxClient.link("stylesheet","mxgraph/css/common.css"),"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages);var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var n=document.createElement("tbody"),i=document.createElement("tr"),s=document.createElement("td");if(s.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%",s.appendChild(mxLog.textarea),i.appendChild(s),n.appendChild(i),i=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),i.appendChild(mxLog.td),n.appendChild(i),e.appendChild(n),mxLog.addButton("Info",(function(t){mxLog.info()})),mxLog.addButton("DOM",(function(t){t=mxUtils.getInnerHtml(document.body),mxLog.debug(t)})),mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")})),mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""})),i=n=0,"number"==typeof window.innerWidth?(n=window.innerHeight,i=window.innerWidth):(n=document.documentElement.clientHeight||document.body.clientHeight,i=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,i-320),Math.max(0,n-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var l=mxLog.window.getElement();t=function(t,e){mxLog.textarea.style.height=Math.max(0,l.offsetHeight-70)+"px"},mxLog.window.addListener(mxEvent.RESIZE_END,t),mxLog.window.addListener(mxEvent.MAXIMIZE,t),mxLog.window.addListener(mxEvent.NORMALIZE,t),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var n=document.createElement("button");mxUtils.write(n,t),mxEvent.addListener(n,"click",e),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var n=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=t,null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");mxLog.write(t+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(t){if(null!=t){if(null==t[mxObjectIdentity.FIELD_NAME])if("object"==typeof t){var e=mxUtils.getFunctionName(t.constructor);t[mxObjectIdentity.FIELD_NAME]=e+"#"+mxObjectIdentity.counter++}else"function"==typeof t&&(t[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return t[mxObjectIdentity.FIELD_NAME]}return null},clear:function(t){"object"!=typeof t&&"function"!=typeof t||delete t[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(t){return t=mxObjectIdentity.get(t),this.map[t]},mxDictionary.prototype.put=function(t,e){var n=mxObjectIdentity.get(t),i=this.map[n];return this.map[n]=e,i},mxDictionary.prototype.remove=function(t){t=mxObjectIdentity.get(t);var e=this.map[t];return delete this.map[t],e},mxDictionary.prototype.getKeys=function(){var t,e=[];for(t in this.map)e.push(t);return e},mxDictionary.prototype.getValues=function(){var t,e=[];for(t in this.map)e.push(this.map[t]);return e},mxDictionary.prototype.visit=function(t){for(var e in this.map)t(e,this.map[e])};var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(t){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,t)},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var n=e.indexOf("-");0<n&&(e=e.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,n){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){var i=mxResources.getDefaultBundle(t,e),s=mxResources.getSpecialBundle(t,e),l=function(){if(null!=s)if(n)mxUtils.get(s,(function(t){mxResources.parse(t.getText()),n()}),(function(){n()}));else try{var t=mxUtils.load(s);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=n&&n()};if(null!=i)if(n)mxUtils.get(i,(function(t){mxResources.parse(t.getText()),l()}),(function(){l()}));else try{var r=mxUtils.load(i);r.isReady()&&mxResources.parse(r.getText()),l()}catch(t){}else l()}},parse:function(t){if(null!=t){t=t.split("\n");for(var e=0;e<t.length;e++)if("#"!=t[e].charAt(0)){var n=t[e].indexOf("=");if(0<n){var i=t[e].substring(0,n),s=t[e].length;13==t[e].charCodeAt(s-1)&&s--,n=t[e].substring(n+1,s),this.resourcesEncoded?(n=n.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[i]=unescape(n)):mxResources.resources[i]=n}}}},get:function(t,e,n){return null==(t=mxResources.resources[t])&&(t=n),null!=t&&null!=e&&(t=mxResources.replacePlaceholders(t,e)),t},replacePlaceholders:function(t,e){for(var n=[],i=null,s=0;s<t.length;s++){var l=t.charAt(s);"{"==l?i="":null!=i&&"}"==l?(0<=(i=parseInt(i)-1)&&i<e.length&&n.push(e[i]),i=null):null!=i?i+=l:n.push(l)}return n.join("")},loadResources:function(t){mxResources.add(mxClient.basePath+"/resources/editor",null,(function(){mxResources.add(mxClient.basePath+"/resources/graph",null,t)}))}};function mxPoint(t,e){this.x=null!=t?t:0,this.y=null!=e?e:0}function mxRectangle(t,e,n,i){mxPoint.call(this,t,e),this.width=null!=n?n:0,this.height=null!=i?i:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(t){if(null!=t){var e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width);t=Math.max(this.y+this.height,t.y+t.height),this.x=e,this.y=n,this.width=i-e,this.height=t-n}},mxRectangle.prototype.intersect=function(t){if(null!=t){var e=this.x+this.width,n=t.x+t.width,i=this.y+this.height,s=t.y+t.height;this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.width=Math.min(e,n)-this.x,this.height=Math.min(i,s)-this.y}},mxRectangle.prototype.grow=function(t){return this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t,this},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.rotate90=function(){var t=(this.width-this.height)/2;this.x+=t,this.y-=t,t=this.width,this.width=this.height,this.height=t},mxRectangle.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y&&t.width==this.width&&t.height==this.height},mxRectangle.fromRectangle=function(t){return new mxRectangle(t.x,t.y,t.width,t.height)};var mxEffects={animateChanges:function(t,e,n){var i=0,s=function(){for(var r=!1,o=0;o<e.length;o++){var a=e[o];if(a instanceof mxGeometryChange||a instanceof mxTerminalChange||a instanceof mxValueChange||a instanceof mxChildChange||a instanceof mxStyleChange){var h=t.getView().getState(a.cell||a.child,!1);if(null!=h)if(r=!0,a.constructor!=mxGeometryChange||t.model.isEdge(a.cell))mxUtils.setOpacity(h.shape.node,100*i/10);else{var u=t.getView().scale,p=(a.geometry.x-a.previous.x)*u,d=(a.geometry.y-a.previous.y)*u,m=(a.geometry.width-a.previous.width)*u;u=(a.geometry.height-a.previous.height)*u,0==i?(h.x-=p,h.y-=d,h.width-=m,h.height-=u):(h.x+=p/10,h.y+=d/10,h.width+=m/10,h.height+=u/10),t.cellRenderer.redraw(h),mxEffects.cascadeOpacity(t,a.cell,100*i/10)}}}10>i&&r?(i++,window.setTimeout(s,l)):null!=n&&n()},l=30;s()},cascadeOpacity:function(t,e,n){for(var i=t.model.getChildCount(e),s=0;s<i;s++){var l=t.model.getChildAt(e,s),r=t.getView().getState(l);null!=r&&(mxUtils.setOpacity(r.shape.node,n),mxEffects.cascadeOpacity(t,l,n))}if(null!=(e=t.model.getEdges(e)))for(s=0;s<e.length;s++)null!=(i=t.getView().getState(e[s]))&&mxUtils.setOpacity(i.shape.node,n)},fadeOut:function(t,e,n,i,s,l){i=i||40,s=s||30;var r=e||100;if(mxUtils.setOpacity(t,r),l||null==l){var o=function(){r=Math.max(r-i,0),mxUtils.setOpacity(t,r),0<r?window.setTimeout(o,s):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(o,s)}else t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){if(null!=t.style&&(t.style.cursor=""),null!=(t=t.childNodes))for(var e=t.length,n=0;n<e;n+=1)mxUtils.removeCursors(t[n])},getCurrentStyle:mxClient.IS_IE&&(null==document.documentMode||9>document.documentMode)?function(t){return null!=t?t.currentStyle:null}:function(t){return null!=t?window.getComputedStyle(t,""):null},parseCssNumber:function(t){return"thin"==t?t="2":"medium"==t?t="4":"thick"==t&&(t="6"),t=parseFloat(t),isNaN(t)&&(t=0),t},setPrefixedStyle:function(){var t=null;return mxClient.IS_OT?t="O":mxClient.IS_SF||mxClient.IS_GC?t="Webkit":mxClient.IS_MT?t="Moz":mxClient.IS_IE&&9<=document.documentMode&&10>document.documentMode&&(t="ms"),function(e,n,i){e[n]=i,null!=t&&0<n.length&&(e[n=t+n.substring(0,1).toUpperCase()+n.substring(1)]=i)}}(),hasScrollbars:function(t){return null!=(t=mxUtils.getCurrentStyle(t))&&("scroll"==t.overflow||"auto"==t.overflow)},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+a)}else try{b=eval(a)}catch(t){mxLog.warn(t.message+" while evaluating "+a)}return b},findNode:function(t,e,n){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=t.getAttribute(e);if(null!=i&&i==n)return t}for(t=t.firstChild;null!=t;){if(null!=(i=mxUtils.findNode(t,e,n)))return i;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;return null!=t&&(null!=t.name?e=t.name:(e=mxUtils.trim(t.toString()),/^function\s/.test(e)&&0<(t=(e=mxUtils.ltrim(e.substring(9))).indexOf("("))&&(e=e.substring(0,t)))),e},indexOf:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(t[n]==e)return n;return-1},forEach:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)e(t[n]);return t},remove:function(t,e){var n=null;if("object"==typeof e)for(var i=mxUtils.indexOf(e,t);0<=i;)e.splice(i,1),n=t,i=mxUtils.indexOf(e,t);for(var s in e)e[s]==t&&(delete e[s],n=t);return n},isNode:function(t,e,n,i){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase()||null!=n&&t.getAttribute(n)!=i)},isAncestorNode:function(t,e){for(var n=e;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var n=[],i=t.firstChild;null!=i;)i.nodeType==e&&n.push(i),i=i.nextSibling;return n},importNode:function(t,e,n){return mxClient.IS_IE&&(null==document.documentMode||10>document.documentMode)?mxUtils.importNodeImplementation(t,e,n):t.importNode(e,n)},importNodeImplementation:function(t,e,n){switch(e.nodeType){case 1:var i=t.createElement(e.nodeName);if(e.attributes&&0<e.attributes.length)for(var s=0;s<e.attributes.length;s++)i.setAttribute(e.attributes[s].nodeName,e.getAttribute(e.attributes[s].nodeName));if(n&&e.childNodes&&0<e.childNodes.length)for(s=0;s<e.childNodes.length;s++)i.appendChild(mxUtils.importNodeImplementation(t,e.childNodes[s],n));return i;case 3:case 4:case 8:return t.createTextNode(null!=e.nodeValue?e.nodeValue:e.value)}},createXmlDocument:function(){var t=null;return document.implementation&&document.implementation.createDocument?t=document.implementation.createDocument("","",null):"ActiveXObject"in window&&(t=mxUtils.createMsXmlDocument()),t},createMsXmlDocument:function(){var t=new ActiveXObject("Microsoft.XMLDOM");return t.async=!1,t.validateOnParse=!1,t.resolveExternals=!1,t},parseXml:window.DOMParser?function(t){return(new DOMParser).parseFromString(t,"text/xml")}:function(t){var e=mxUtils.createMsXmlDocument();return e.loadXML(t),e},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){},removeWhitespace:function(t,e){for(var n=e?t.previousSibling:t.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var i=e?n.previousSibling:n.nextSibling,s=mxUtils.getTextContent(n);0==mxUtils.trim(s).length&&n.parentNode.removeChild(n),n=i}},htmlEntities:function(t,e){return t=(t=(t=(t=(t=(t=String(t||"")).replace(/&/g,"&amp;")).replace(/"/g,"&quot;")).replace(/\'/g,"&#39;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),(null==e||e)&&(t=t.replace(/\n/g,"&#xa;")),t},decodeHtml:function(t){var e=document.createElement("textarea");return e.innerHTML=t,e.value},getXml:function(t,e){var n="";return mxClient.IS_IE||mxClient.IS_IE11?n=mxUtils.getPrettyXml(t,"","",""):null!=window.XMLSerializer?n=(new XMLSerializer).serializeToString(t):null!=t.xml&&(n=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")),n.replace(/\n/g,e||"&#xa;")},getPrettyXml:function(t,e,n,i,s){var l=[];if(null!=t)if(e=null!=e?e:" ",n=null!=n?n:"",i=null!=i?i:"\n",null!=t.namespaceURI&&t.namespaceURI!=s&&(s=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)l.push(mxUtils.getPrettyXml(t.documentElement,e,n,i,s));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var r=t.firstChild;if(null!=r)for(;null!=r;)l.push(mxUtils.getPrettyXml(r,e,n,i,s)),r=r.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT)0<(t=mxUtils.getTextContent(t)).length&&l.push(n+"\x3c!--"+t+"--\x3e"+i);else if(t.nodeType==mxConstants.NODETYPE_TEXT)0<(t=mxUtils.trim(mxUtils.getTextContent(t))).length&&l.push(n+mxUtils.htmlEntities(t,!1)+i);else if(t.nodeType==mxConstants.NODETYPE_CDATA)0<(t=mxUtils.getTextContent(t)).length&&l.push(n+"<![CDATA["+t+"]]"+i);else{if(l.push(n+"<"+t.nodeName),null!=(r=t.attributes))for(var o=0;o<r.length;o++){var a=mxUtils.htmlEntities(r[o].value);l.push(" "+r[o].nodeName+'="'+a+'"')}if(null!=(r=t.firstChild)){for(l.push(">"+i);null!=r;)l.push(mxUtils.getPrettyXml(r,e,n+e,i,s)),r=r.nextSibling;l.push(n+"</"+t.nodeName+">"+i)}else l.push(" />"+i)}return l.join("")},extractTextWithWhitespace:function(t){var e="BLOCKQUOTE DIV H1 H2 H3 H4 H5 H6 OL P PRE TABLE UL".split(" "),n=[];return function t(i){if(1!=i.length||"BR"!=i[0].nodeName&&"\n"!=i[0].innerHTML)for(var s=0;s<i.length;s++){var l=i[s];"BR"==l.nodeName||"\n"==l.innerHTML||(1==i.length||0==s)&&"DIV"==l.nodeName&&"<br>"==l.innerHTML.toLowerCase()?n.push("\n"):(3===l.nodeType||4===l.nodeType?0<l.nodeValue.length&&n.push(l.nodeValue):8!==l.nodeType&&0<l.childNodes.length&&t(l.childNodes),s<i.length-1&&0<=mxUtils.indexOf(e,i[s+1].nodeName)&&n.push("\n"))}}(t),n.join("")},replaceTrailingNewlines:function(t,e){for(var n="";0<t.length&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),n+=e;return t+n},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},getOuterHtml:mxClient.IS_IE?function(t){if(null!=t){if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var n=t.attributes;if(null!=n)for(var i=0;i<n.length;i++){var s=n[i].value;null!=s&&0<s.length&&(e.push(" "),e.push(n[i].nodeName),e.push('="'),e.push(s),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("</"+t.nodeName+">")),e.join("")}return""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},write:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(n),n},writeln:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var n=null,i=0;i<e;i++)null!=t&&(n=t.ownerDocument.createElement("br"),t.appendChild(n));return n},button:function(t,e,n){return n=(n=null!=n?n:document).createElement("button"),mxUtils.write(n,t),mxEvent.addListener(n,"click",(function(t){e(t)})),n},para:function(t,e){var n=document.createElement("p");return mxUtils.write(n,e),null!=t&&t.appendChild(n),n},addTransparentBackgroundFilter:function(t){t.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(t,e,n,i,s){return mxUtils.link(t,e,(function(){n.execute(i)}),s)},linkInvoke:function(t,e,n,i,s,l){return mxUtils.link(t,e,(function(){n[i](s)}),l)},link:function(t,e,n,i){var s=document.createElement("span");return s.style.color="blue",s.style.textDecoration="underline",s.style.cursor="pointer",null!=i&&(s.style.paddingLeft=i+"px"),mxEvent.addListener(s,"click",n),mxUtils.write(s,e),null!=t&&t.appendChild(s),s},getDocumentSize:function(){var t=document.body,e=document.documentElement;try{return new mxRectangle(0,0,t.clientWidth||e.clientWidth,Math.max(t.clientHeight||0,e.clientHeight))}catch(t){return new mxRectangle}},fit:function(t){var e=mxUtils.getDocumentSize(),n=parseInt(t.offsetLeft),i=parseInt(t.offsetWidth),s=(l=mxUtils.getDocumentScrollOrigin(t.ownerDocument)).x,l=l.y,r=s+e.width;n+i>r&&(t.style.left=Math.max(s,r-i)+"px"),(n=parseInt(t.offsetTop))+(i=parseInt(t.offsetHeight))>(e=l+e.height)&&(t.style.top=Math.max(l,e-i)+"px")},load:function(t){return(t=new mxXmlRequest(t,null,"GET",!1)).send(),t},get:function(t,e,n,i,s,l,r){var o=(t=new mxXmlRequest(t,null,"GET")).setRequestHeaders;return r&&(t.setRequestHeaders=function(t,e){for(var n in o.apply(this,arguments),r)t.setRequestHeader(n,r[n])}),null!=i&&t.setBinary(i),t.send(e,n,s,l),t},getAll:function(t,e,n){for(var i=t.length,s=[],l=0,r=function(){0==l&&null!=n&&n(),l++},o=0;o<t.length;o++)!function(t,n){mxUtils.get(t,(function(t){var l=t.getStatus();200>l||299<l?r():(s[n]=t,0==--i&&e(s))}),r)}(t[o],o);0==i&&e(s)},post:function(t,e,n,i){return new mxXmlRequest(t,e).send(n,i)},submit:function(t,e,n,i){return new mxXmlRequest(t,e).simulate(n,i)},loadInto:function(t,e,n){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&n()}:e.addEventListener("load",n,!1),e.load(t)},getValue:function(t,e,n){return null==(t=null!=t?t[e]:null)&&(t=n),t},getNumber:function(t,e,n){return null==(t=null!=t?t[e]:null)&&(t=n||0),Number(t)},getColor:function(t,e,n){return null==(t=null!=t?t[e]:null)?t=n:t==mxConstants.NONE&&(t=null),t},clone:function(t,e,n){n=null!=n&&n;var i,s=null;if(null!=t&&"function"==typeof t.constructor)for(i in s=new t.constructor,t)i!=mxObjectIdentity.FIELD_NAME&&(null==e||0>mxUtils.indexOf(e,i))&&(s[i]=n||"object"!=typeof t[i]?t[i]:mxUtils.clone(t[i]));return s},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(null!=t[n]&&null==e[n]||null==t[n]&&null!=e[n]||null!=t[n]&&null!=e[n]&&(t[n].x!=e[n].x||t[n].y!=e[n].y))return!1;return!0},equalEntries:function(t,e){var n=0;if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e){for(var i in e)n++;for(i in t)if(n--,!(mxUtils.isNaN(t[i])&&mxUtils.isNaN(e[i])||t[i]==e[i]))return!1}return 0==n},removeDuplicates:function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.get(t[i])||(n.push(t[i]),e.put(t[i],!0));return n},isNaN:function(t){return"number"==typeof t&&isNaN(t)},extend:function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},toString:function(t){var e,n="";for(e in t)try{null==t[e]?n+=e+" = [null]\n":"function"==typeof t[e]?n+=e+" => [Function]\n":"object"==typeof t[e]?n=n+(e+" => [")+mxUtils.getFunctionName(t[e].constructor)+"]\n":n+=e+" = "+t[e]+"\n"}catch(t){n+=e+"="+t.message}return n},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,n,i,s,l,r,o,a){if(o-=t,a-=e,0===n||0===i)return g;n=Math.abs(n),i=Math.abs(i);var h=-o/2,u=-a/2,p=Math.cos(s*Math.PI/180);s=p*h+(g=Math.sin(s*Math.PI/180))*u,h=-1*g*h+p*u,1<(C=(u=s*s)/(c=n*n)+(m=h*h)/(f=i*i))?(n*=Math.sqrt(C),i*=Math.sqrt(C),l=0):(C=1,l===r&&(C=-1),l=C*Math.sqrt((c*f-c*m-f*u)/(c*m+f*u))),o=p*(u=l*n*h/i)-g*(m=-1*l*i*s/n)+o/2,a=g*u+p*m+a/2,l=0<=(c=Math.atan2((h-m)/i,(s-u)/n)-Math.atan2(0,1))?c:2*Math.PI+c,s=0<=(c=Math.atan2((-h-m)/i,(-s-u)/n)-Math.atan2((h-m)/i,(s-u)/n))?c:2*Math.PI+c,0==r&&0<s?s-=2*Math.PI:0!=r&&0>s&&(s+=2*Math.PI),r=2*s/Math.PI,s/=r=Math.ceil(0>r?-1*r:r),h=8/3*Math.sin(s/4)*Math.sin(s/4)/Math.sin(s/2),u=p*n,p*=i,n*=g,i*=g;for(var d=Math.cos(l),m=-h*(u*(y=Math.sin(l))+i*d),c=-h*(n*y-p*d),g=[],x=0;x<r;++x){l+=s;var y,f=u*(d=Math.cos(l))-i*(y=Math.sin(l))+o,C=n*d+p*y+a,v=-h*(u*y+i*d);d=-h*(n*y-p*d),g[y=6*x]=Number(m+t),g[y+1]=Number(c+e),g[y+2]=Number(f-v+t),g[y+3]=Number(C-d+e),g[y+4]=Number(f+t),g[y+5]=Number(C+e),m=f+v,c=C+d}return g},getBoundingBox:function(t,e,n){var i=null;if(null!=t&&null!=e&&0!=e){e=mxUtils.toRadians(e),i=Math.cos(e);var s=Math.sin(e);n=null!=n?n:new mxPoint(t.x+t.width/2,t.y+t.height/2);var l=new mxPoint(t.x,t.y);e=new mxPoint(t.x+t.width,t.y);var r=new mxPoint(e.x,t.y+t.height);t=new mxPoint(t.x,r.y),l=mxUtils.getRotatedPoint(l,i,s,n),e=mxUtils.getRotatedPoint(e,i,s,n),r=mxUtils.getRotatedPoint(r,i,s,n),t=mxUtils.getRotatedPoint(t,i,s,n),(i=new mxRectangle(l.x,l.y,0,0)).add(new mxRectangle(e.x,e.y,0,0)),i.add(new mxRectangle(r.x,r.y,0,0)),i.add(new mxRectangle(t.x,t.y,0,0))}return i},getRotatedPoint:function(t,e,n,i){i=null!=i?i:new mxPoint;var s=t.x-i.x;return new mxPoint(s*e-(t=t.y-i.y)*n+i.x,t*e+s*n+i.y)},getPortConstraints:function(t,e,n,i){if(null==(e=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null))))return i;if(i=e.toString(),e=mxConstants.DIRECTION_MASK_NONE,n=0,1==mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(n=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0)),t=0,45<n?(t=1,135<=n&&(t=2)):-45>n&&(t=3,-135>=n&&(t=2)),0<=i.indexOf(mxConstants.DIRECTION_NORTH))switch(t){case 0:e|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:e|=mxConstants.DIRECTION_MASK_EAST;break;case 2:e|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:e|=mxConstants.DIRECTION_MASK_WEST}if(0<=i.indexOf(mxConstants.DIRECTION_WEST))switch(t){case 0:e|=mxConstants.DIRECTION_MASK_WEST;break;case 1:e|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:e|=mxConstants.DIRECTION_MASK_EAST;break;case 3:e|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=i.indexOf(mxConstants.DIRECTION_SOUTH))switch(t){case 0:e|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:e|=mxConstants.DIRECTION_MASK_WEST;break;case 2:e|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:e|=mxConstants.DIRECTION_MASK_EAST}if(0<=i.indexOf(mxConstants.DIRECTION_EAST))switch(t){case 0:e|=mxConstants.DIRECTION_MASK_EAST;break;case 1:e|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:e|=mxConstants.DIRECTION_MASK_WEST;break;case 3:e|=mxConstants.DIRECTION_MASK_NORTH}return e},reversePortConstraints:function(t){var e;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,(e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1)|(t&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(t,e,n){var i=-1;if(0<t.absolutePoints.length)for(var s=t.absolutePoints[0],l=null,r=1;r<t.absolutePoints.length;r++){var o=t.absolutePoints[r];s=mxUtils.ptSegDistSq(s.x,s.y,o.x,o.y,e,n),(null==l||s<l)&&(l=s,i=r-1),s=o}return i},getDirectedBounds:function(t,e,n,i,s){var l=mxUtils.getValue(n,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);return i=null!=i?i:mxUtils.getValue(n,mxConstants.STYLE_FLIPH,!1),s=null!=s?s:mxUtils.getValue(n,mxConstants.STYLE_FLIPV,!1),e.x=Math.round(Math.max(0,Math.min(t.width,e.x))),e.y=Math.round(Math.max(0,Math.min(t.height,e.y))),e.width=Math.round(Math.max(0,Math.min(t.width,e.width))),e.height=Math.round(Math.max(0,Math.min(t.height,e.height))),(s&&(l==mxConstants.DIRECTION_SOUTH||l==mxConstants.DIRECTION_NORTH)||i&&(l==mxConstants.DIRECTION_EAST||l==mxConstants.DIRECTION_WEST))&&(n=e.x,e.x=e.width,e.width=n),(i&&(l==mxConstants.DIRECTION_SOUTH||l==mxConstants.DIRECTION_NORTH)||s&&(l==mxConstants.DIRECTION_EAST||l==mxConstants.DIRECTION_WEST))&&(n=e.y,e.y=e.height,e.height=n),i=mxRectangle.fromRectangle(e),l==mxConstants.DIRECTION_SOUTH?(i.y=e.x,i.x=e.height,i.width=e.y,i.height=e.width):l==mxConstants.DIRECTION_WEST?(i.y=e.height,i.x=e.width,i.width=e.x,i.height=e.y):l==mxConstants.DIRECTION_NORTH&&(i.y=e.width,i.x=e.y,i.width=e.height,i.height=e.x),new mxRectangle(t.x+i.x,t.y+i.y,t.width-i.width-i.x,t.height-i.height-i.y)},getPerimeterPoint:function(t,e,n){for(var i=null,s=0;s<t.length-1;s++)if(null!=(l=mxUtils.intersection(t[s].x,t[s].y,t[s+1].x,t[s+1].y,e.x,e.y,n.x,n.y))){var l,r=n.x-l.x,o=n.y-l.y;null!=(l={p:l,distSq:o*o+r*r})&&(null==i||i.distSq>l.distSq)&&(i=l)}return null!=i?i.p:null},intersectsPoints:function(t,e){for(var n=0;n<e.length-1;n++)if(mxUtils.rectangleIntersectsSegment(t,e[n],e[n+1]))return!0;return!1},rectangleIntersectsSegment:function(t,e,n){var i=t.y,s=t.x,l=i+t.height,r=s+t.width;t=e.x;var o=n.x;if(e.x>n.x&&(t=n.x,o=e.x),o>r&&(o=r),t<s&&(t=s),t>o)return!1;s=e.y,r=n.y;var a=n.x-e.x;return 1e-7<Math.abs(a)&&(s=(n=(n.y-e.y)/a)*t+(e=e.y-n*e.x),r=n*o+e),s>r&&(e=r,r=s,s=e),r>l&&(r=l),s<i&&(s=i),!(s>r)},contains:function(t,e,n){return t.x<=e&&t.x+t.width>=e&&t.y<=n&&t.y+t.height>=n},intersects:function(t,e){var n=t.width,i=t.height,s=e.width,l=e.height;if(0>=s||0>=l||0>=n||0>=i)return!1;var r=t.x,o=t.y,a=e.x,h=e.y;return l+=h,n+=r,i+=o,((s+=a)<a||s>r)&&(l<h||l>o)&&(n<r||n>a)&&(i<o||i>h)},intersectsHotspot:function(t,e,n,i,s,l){if(s=null!=s?s:0,l=null!=l?l:0,0<(i=null!=i?i:1)){var r=t.getCenterX(),o=t.getCenterY(),a=t.width,h=t.height,u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;return 0<u&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(o=t.y+u/2,h=u):(r=t.x+u/2,a=u)),a=Math.max(s,a*i),h=Math.max(s,h*i),0<l&&(a=Math.min(a,l),h=Math.min(h,l)),i=new mxRectangle(r-a/2,o-h/2,a,h),0!=(r=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0))&&(s=Math.cos(-r),l=Math.sin(-r),r=new mxPoint(t.getCenterX(),t.getCenterY()),e=(t=mxUtils.getRotatedPoint(new mxPoint(e,n),s,l,r)).x,n=t.y),mxUtils.contains(i,e,n)}return!0},getOffset:function(t,e){for(var n=0,i=0,s=!1,l=t,r=document.body,o=document.documentElement;null!=l&&l!=r&&l!=o&&!s;){var a=mxUtils.getCurrentStyle(l);null!=a&&(s=s||"fixed"==a.position),l=l.parentNode}return e||s||(n+=(s=mxUtils.getDocumentScrollOrigin(t.ownerDocument)).x,i+=s.y),null!=(s=t.getBoundingClientRect())&&(n+=s.left,i+=s.top),new mxPoint(n,i)},getDocumentScrollOrigin:function(t){return new mxPoint(null!=(t=t.defaultView||t.parentWindow)&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=t&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,n){e=null!=e&&e,n=null==n||n;for(var i=null!=t?t.ownerDocument:document,s=i.body,l=i.documentElement,r=new mxPoint,o=!1;null!=t&&t!=s&&t!=l;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(r.x+=t.scrollLeft,r.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(o=o||"fixed"==a.position),t=e?t.parentNode:null}return!o&&n&&(t=mxUtils.getDocumentScrollOrigin(i),r.x+=t.x,r.y+=t.y),r},convertPoint:function(t,e,n){var i=mxUtils.getScrollOrigin(t,!1);return(t=mxUtils.getOffset(t)).x-=i.x,t.y-=i.y,new mxPoint(e-t.x,n-t.y)},ltrim:function(t,e){return null!=t?t.replace(new RegExp("^["+(e||"\\s")+"]+","g"),""):null},rtrim:function(t,e){return null!=t?t.replace(new RegExp("["+(e||"\\s")+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&("string"!=typeof t||0>t.toLowerCase().indexOf("0x"))},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,n,i,s,l,r,o){var a=(o-l)*(n-t)-(r-s)*(i-e);return r=((r-s)*(e-l)-(o-l)*(t-s))/a,s=((n-t)*(e-l)-(i-e)*(t-s))/a,0<=r&&1>=r&&0<=s&&1>=s?new mxPoint(t+r*(n-t),e+r*(i-e)):null},ptSegDistSq:function(t,e,n,i,s,l){return n=0>=(s-=t)*(n-=t)+(l-=e)*(i-=e)||0>=(t=(s=n-s)*n+(l=i-l)*i)?0:t*t/(n*n+i*i),0>(s=s*s+l*l-n)&&(s=0),s},ptLineDist:function(t,e,n,i,s,l){return Math.abs((i-e)*s-(n-t)*l+n*e-i*t)/Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))},relativeCcw:function(t,e,n,i,s,l){return 0==(t=(s-=t)*(i-=e)-(l-=e)*(n-=t))&&0<(t=s*n+l*i)&&0>(t=(s-n)*n+(l-i)*i)&&(t=0),0>t?-1:0<t?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,n,i,s,l){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxClient.IS_IE&&(void 0===document.documentMode||9>document.documentMode)?t.style.filter=100<=e?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e;return(e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0"),e},sortCells:function(t,e){e=null==e||e;var n=new mxDictionary;return t.sort((function(t,i){var s=n.get(t);null==s&&(s=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),n.put(t,s));var l=n.get(i);return null==l&&(l=mxCellPath.create(i).split(mxCellPath.PATH_SEPARATOR),n.put(i,l)),0==(s=mxCellPath.compare(s,l))?0:0<s==e?1:-1})),t},getStylename:function(t){return null!=t&&0>(t=t.split(";")[0]).indexOf("=")?t:""},getStylenames:function(t){var e=[];if(null!=t){t=t.split(";");for(var n=0;n<t.length;n++)0>t[n].indexOf("=")&&e.push(t[n])}return e},indexOfStylename:function(t,e){if(null!=t&&null!=e)for(var n=t.split(";"),i=0,s=0;s<n.length;s++){if(n[s]==e)return i;i+=n[s].length+1}return-1},addStylename:function(t,e){return 0>mxUtils.indexOfStylename(t,e)&&(null==t?t="":0<t.length&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var n=[];if(null!=t)for(var i=t.split(";"),s=0;s<i.length;s++)i[s]!=e&&n.push(i[s]);return n.join(";")},removeAllStylenames:function(t){var e=[];if(null!=t){t=t.split(";");for(var n=0;n<t.length;n++)0<=t[n].indexOf("=")&&e.push(t[n])}return e.join(";")},setCellStyles:function(t,e,n,i){if(null!=e&&0<e.length){t.beginUpdate();try{for(var s=0;s<e.length;s++)if(null!=e[s]){var l=mxUtils.setStyle(t.getStyle(e[s]),n,i);t.setStyle(e[s],l)}}finally{t.endUpdate()}}},hex2rgb:function(t){if(null!=t&&7==t.length&&"#"==t.charAt(0)){var e=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16);t="rgb("+e+", "+n+", "+(t=parseInt(t.substring(5,7),16))+")"}return t},hex2rgba:function(t){if(null!=t&&7<=t.length&&"#"==t.charAt(0)){var e=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16),i=parseInt(t.substring(5,7),16),s=1;7<t.length&&(s=parseInt(t.substring(7,9),16)/255),t="rgba("+e+", "+n+", "+i+", "+s+")"}return t},rgba2hex:function(t){return(rgb=t&&t.match?t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i):t)&&4===rgb.length?"#"+("0"+parseInt(rgb[1],10).toString(16)).slice(-2)+("0"+parseInt(rgb[2],10).toString(16)).slice(-2)+("0"+parseInt(rgb[3],10).toString(16)).slice(-2):t},setCssText:function(t,e){if(null!=t&&null!=e)for(var n=e.split(";"),i=0;i<n.length;i++){var s=n[i].split(":");1<s.length&&(s[0]=mxUtils.trim(s[0].replace(/-([a-z])/gi,(function(t,e){return e.toUpperCase()}))),t[s[0]]=mxUtils.trim(s[1]))}},setStyle:function(t,e,n){var i=null!=n&&(void 0===n.length||0<n.length);if(null==t||0==t.length)i&&(t=e+"="+n+";");else if(t.substring(0,e.length+1)==e+"="){var s=t.indexOf(";");t=i?e+"="+n+(0>s?";":t.substring(s)):0>s||s==t.length-1?"":t.substring(s+1)}else{var l=t.indexOf(";"+e+"=");0>l?i&&(i=";"==t.charAt(t.length-1)?"":";",t=t+i+e+"="+n+";"):(s=t.indexOf(";",l+1),t=i?t.substring(0,l+1)+e+"="+n+(0>s?";":t.substring(s)):t.substring(0,l)+(0>s?";":t.substring(s)))}return t},setCellStyleFlags:function(t,e,n,i,s){if(null!=e&&0<e.length){t.beginUpdate();try{for(var l=0;l<e.length;l++)if(null!=e[l]){var r=mxUtils.setStyleFlag(t.getStyle(e[l]),n,i,s);t.setStyle(e[l],r)}}finally{t.endUpdate()}}},setStyleFlag:function(t,e,n,i){if(null==t||0==t.length)t=i||null==i?e+"="+n:e+"=0";else{var s=t.indexOf(e+"=");if(0>s)s=";"==t.charAt(t.length-1)?"":";",t=i||null==i?t+s+e+"="+n:t+s+e+"=0";else{var l,r=t.indexOf(";",s);l=0>r?t.substring(s+e.length+1):t.substring(s+e.length+1,r),l=null==i?parseInt(l)^n:i?parseInt(l)|n:parseInt(l)&~n,t=t.substring(0,s)+e+"="+l+(0<=r?t.substring(r):"")}}return t},getAlignmentAsPoint:function(t,e){var n=-.5,i=-.5;return t==mxConstants.ALIGN_LEFT?n=0:t==mxConstants.ALIGN_RIGHT&&(n=-1),e==mxConstants.ALIGN_TOP?i=0:e==mxConstants.ALIGN_BOTTOM&&(i=-1),new mxPoint(n,i)},getSizeForString:function(t,e,n,i,s){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var l=document.createElement("div");return l.style.fontFamily=n,l.style.fontSize=Math.round(e)+"px",l.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=s&&((s&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(l.style.fontWeight="bold"),(s&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(l.style.fontStyle="italic"),e=[],(s&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&e.push("underline"),(s&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&e.push("line-through"),0<e.length&&(l.style.textDecoration=e.join(" "))),l.style.position="absolute",l.style.visibility="hidden",l.style.display="inline-block",l.style.zoom="1",null!=i?(l.style.width=i+"px",l.style.whiteSpace="normal"):l.style.whiteSpace="nowrap",l.innerHTML=t,document.body.appendChild(l),t=new mxRectangle(0,0,l.offsetWidth,l.offsetHeight),document.body.removeChild(l),t},getViewXml:function(t,e,n,i,s){i=null!=i?i:0,s=null!=s?s:0,e=null!=e?e:1,null==n&&(n=[t.getModel().getRoot()]);var l=t.getView(),r=null,o=l.isEventsEnabled();l.setEventsEnabled(!1);var a=l.drawPane,h=l.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(l.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),l.canvas.appendChild(l.drawPane),l.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(l.drawPane=l.drawPane.cloneNode(!1),l.canvas.appendChild(l.drawPane),l.overlayPane=l.overlayPane.cloneNode(!1)),l.canvas.appendChild(l.overlayPane);var u=l.getTranslate();l.translate=new mxPoint(i,s),e=new mxTemporaryCellStates(t.getView(),e,n);try{r=(new mxCodec).encode(t.getView())}finally{e.destroy(),l.translate=u,l.canvas.removeChild(l.drawPane),l.canvas.removeChild(l.overlayPane),l.drawPane=a,l.overlayPane=h,l.setEventsEnabled(o)}return r},getScaleForPageCount:function(t,e,n,i){if(1>t)return 1;i=null!=i?i:0;var s=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*i;n=n.height-2*i,i=e.getGraphBounds().clone(),e=e.getView().getScale(),i.width/=e,i.height/=e,e=i.width;var l=Math.sqrt(t);if(n=l*(i=Math.sqrt(e/i.height/(s/n))),i=l/i,1>n&&i>t){var r=i/t;i=t,n/=r}for(1>i&&n>t&&(r=n/t,n=t,i/=r),r=Math.ceil(n)*Math.ceil(i),l=0;r>t;){r=Math.floor(n)/n;var o=Math.floor(i)/i;if(1==r&&(r=Math.floor(n-1)/n),1==o&&(o=Math.floor(i-1)/i),n*=r=r>o?r:o,i*=r,r=Math.ceil(n)*Math.ceil(i),10<++l)break}return s*n/e*.99999},show:function(t,e,n,i,s,l){n=null!=n?n:0,i=null!=i?i:0,null==e?e=window.open().document:e.open(),9==document.documentMode&&e.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var r=t.getGraphBounds(),o=Math.ceil(n-r.x),a=Math.ceil(i-r.y);if(null==s&&(s=Math.ceil(r.width+n)+Math.ceil(Math.ceil(r.x)-r.x)),null==l&&(l=Math.ceil(r.height+i)+Math.ceil(Math.ceil(r.y)-r.y)),mxClient.IS_IE||11==document.documentMode){for(i="<html><head>",r=document.getElementsByTagName("base"),n=0;n<r.length;n++)i+=r[n].outerHTML;for(i+="<style>",n=0;n<document.styleSheets.length;n++)try{i+=document.styleSheets[n].cssText}catch(t){}i=i+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+s+"px;height:"+l+'px;"><div style="position:relative;left:'+o+"px;top:"+a+'px;">'+t.container.innerHTML,e.writeln(i+"</div></div></body><html>"),e.close()}else{for(e.writeln("<html><head>"),r=document.getElementsByTagName("base"),n=0;n<r.length;n++)e.writeln(mxUtils.getOuterHtml(r[n]));for(i=document.getElementsByTagName("link"),n=0;n<i.length;n++)e.writeln(mxUtils.getOuterHtml(i[n]));for(i=document.getElementsByTagName("style"),n=0;n<i.length;n++)e.writeln(mxUtils.getOuterHtml(i[n]));for(e.writeln('</head><body style="margin:0px;"></body></html>'),e.close(),(n=e.createElement("div")).position="absolute",n.overflow="hidden",n.style.width=s+"px",n.style.height=l+"px",(s=e.createElement("div")).style.position="absolute",s.style.left=o+"px",s.style.top=a+"px",l=t.container.firstChild,i=null;null!=l;)r=l.cloneNode(!0),l==t.view.drawPane.ownerSVGElement?(n.appendChild(r),i=r):s.appendChild(r),l=l.nextSibling;e.body.appendChild(n),null!=s.firstChild&&e.body.appendChild(s),null!=i&&(i.style.minWidth="",i.style.minHeight="",i.firstChild.setAttribute("transform","translate("+o+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document),t=function(){e.focus(),e.print(),e.close()},mxClient.IS_GC?e.setTimeout(t,500):t()},popup:function(t,e){if(e){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px";var i=document.createElement("pre");i.innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),n.appendChild(i),(n=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),n.setVisible(!0)}else mxClient.IS_NS?((n=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(t)+"</pre"),n.document.close()):((i=(n=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),n.document.body.appendChild(i))},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,n,i){var s=document.createElement("div");s.style.padding="20px";var l=document.createElement("img");l.setAttribute("src",i||mxUtils.errorImage),l.setAttribute("valign","bottom"),l.style.verticalAlign="middle",s.appendChild(l),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),mxUtils.write(s,t),t=document.body.clientWidth,i=document.body.clientHeight||document.documentElement.clientHeight;var r=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,s,(t-e)/2,i/4,e,null,!1,!0);return n&&(mxUtils.br(s),e=document.createElement("p"),n=document.createElement("button"),mxClient.IS_IE?n.style.cssText="float:right":n.setAttribute("style","float:right"),mxEvent.addListener(n,"click",(function(t){r.destroy()})),mxUtils.write(n,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),e.appendChild(n),s.appendChild(e),mxUtils.br(s),r.setClosable(!0)),r.setVisible(!0),r},makeDraggable:function(t,e,n,i,s,l,r,o,a,h){return(t=new mxDragSource(t,n)).dragOffset=new mxPoint(null!=s?s:0,null!=l?l:mxConstants.TOOLTIP_VERTICAL_OFFSET),t.autoscroll=r,t.setGuidesEnabled(!1),null!=a&&(t.highlightDropTargets=a),null!=h&&(t.getDropTarget=h),t.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=i&&(t.createDragElement=function(){return i.cloneNode(!0)},o&&(t.createPreviewElement=function(t){var e=i.cloneNode(!0),n=parseInt(e.style.width),s=parseInt(e.style.height);return e.style.width=Math.round(n*t.view.scale)+"px",e.style.height=Math.round(s*t.view.scale)+"px",e})),t}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GR