@genexus/diagram-editors 18.2.27 → 18.4.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/{editor-386996a2.js → editor-39f75f41.js} +79 -6
  2. package/dist/cjs/gx-bpmn-editor.cjs.entry.js +203 -82
  3. package/dist/cjs/gx-report-layout-editor.cjs.entry.js +1 -1
  4. package/dist/collection/components/bpmn/bpmn-editor.js +88 -8
  5. package/dist/collection/components/bpmn/bpmn-graph.js +19 -3
  6. package/dist/collection/components/bpmn/cell-types.js +2 -1
  7. package/dist/collection/components/bpmn/properties.js +8 -0
  8. package/dist/collection/components/bpmn/shapes/text-annotation-shape.js +26 -0
  9. package/dist/collection/components/bpmn/style-tokens.js +4 -0
  10. package/dist/collection/components/bpmn/style-types.js +6 -0
  11. package/dist/collection/components/common/cell-descriptor.js +4 -0
  12. package/dist/collection/components/common/connection-handler.js +18 -1
  13. package/dist/collection/components/common/graph.js +30 -1
  14. package/dist/collection/components/common/mx.js +6 -1
  15. package/dist/collection/components/common/vertex-tool-handler.js +6 -3
  16. package/dist/diagram-editors/diagram-editors.esm.js +1 -1
  17. package/dist/diagram-editors/{p-80e1f1a5.system.js → p-0dea64d7.system.js} +1 -1
  18. package/dist/diagram-editors/p-36601737.system.entry.js +1 -0
  19. package/dist/diagram-editors/{p-f022f8f7.entry.js → p-3a040373.entry.js} +1 -1
  20. package/dist/diagram-editors/{p-009a6590.system.entry.js → p-54b997ae.system.entry.js} +1 -1
  21. package/dist/diagram-editors/{p-52c75d65.js → p-690fb19a.js} +1 -1
  22. package/dist/diagram-editors/{p-0cbf75ed.entry.js → p-d6be927a.entry.js} +1 -1
  23. package/dist/diagram-editors/p-e435d3dc.system.js +1 -1
  24. package/dist/esm/{editor-4d1ececd.js → editor-61f535ce.js} +79 -7
  25. package/dist/esm/gx-bpmn-editor.entry.js +147 -26
  26. package/dist/esm/gx-report-layout-editor.entry.js +1 -1
  27. package/dist/esm-es5/{editor-4d1ececd.js → editor-61f535ce.js} +132 -55
  28. package/dist/esm-es5/gx-bpmn-editor.entry.js +157 -31
  29. package/dist/esm-es5/gx-report-layout-editor.entry.js +1 -1
  30. package/dist/types/components/bpmn/cell-types.d.ts +1 -0
  31. package/dist/types/components/bpmn/properties.d.ts +8 -1
  32. package/dist/types/components/bpmn/shapes/text-annotation-shape.d.ts +7 -0
  33. package/dist/types/components/bpmn/style-tokens.d.ts +4 -0
  34. package/dist/types/components/bpmn/style-types.d.ts +6 -0
  35. package/dist/types/components/common/cell-descriptor.d.ts +8 -0
  36. package/dist/types/components/common/connection-handler.d.ts +1 -0
  37. package/dist/types/components/common/graph.d.ts +2 -0
  38. package/package.json +2 -2
  39. package/dist/diagram-editors/p-60b39e5b.system.entry.js +0 -1
@@ -1 +1 @@
1
- var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i]};return t(e,i)};return function(e,i){t(e,i);function n(){this.constructor=e}e.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function l(t){try{o(n.next(t))}catch(e){s(e)}}function a(t){try{o(n["throw"](t))}catch(e){s(e)}}function o(t){t.done?i(t.value):r(t.value).then(l,a)}o((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(t){return function(e){return o([t,e])}}function o(l){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(s=l[0]&2?r["return"]:l[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;if(r=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;r=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){i.label=l[1];break}if(l[0]===6&&i.label<s[1]){i.label=s[1];s=l;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(l);break}if(s[2])i.ops.pop();i.trys.pop();continue}l=e.call(t,i)}catch(a){l=[6,a];r=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var n=Array(t),r=0,e=0;e<i;e++)for(var s=arguments[e],l=0,a=s.length;l<a;l++,r++)n[r]=s[l];return n};System.register(["./p-cf51be4b.system.js"],(function(exports){"use strict";var getAssetPath;return{setters:[function(t){getAssetPath=t.g}],execute:function(){var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function createCommonjsModule(t,e,i){return i={path:e,exports:{},require:function(t,e){return commonjsRequire()}},t(i,i.exports),i.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var rng;var crypto=typeof commonjsGlobal!=="undefined"&&(commonjsGlobal.crypto||commonjsGlobal.msCrypto);if(crypto&&crypto.getRandomValues){var rnds8=new Uint8Array(16);rng=function t(){crypto.getRandomValues(rnds8);return rnds8}}if(!rng){var rnds=new Array(16);rng=function(){for(var t=0,e;t<16;t++){if((t&3)===0)e=Math.random()*4294967296;rnds[t]=e>>>((t&3)<<3)&255}return rnds}}var rngBrowser=rng;var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+256).toString(16).substr(1)}function bytesToUuid(t,e){var i=e||0;var n=byteToHex;return n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]}var bytesToUuid_1=bytesToUuid;var _seedBytes=rngBrowser();var _nodeId=[_seedBytes[0]|1,_seedBytes[1],_seedBytes[2],_seedBytes[3],_seedBytes[4],_seedBytes[5]];var _clockseq=(_seedBytes[6]<<8|_seedBytes[7])&16383;var _lastMSecs=0,_lastNSecs=0;function v1(t,e,i){var n=e&&i||0;var r=e||[];t=t||{};var s=t.clockseq!==undefined?t.clockseq:_clockseq;var l=t.msecs!==undefined?t.msecs:(new Date).getTime();var a=t.nsecs!==undefined?t.nsecs:_lastNSecs+1;var o=l-_lastMSecs+(a-_lastNSecs)/1e4;if(o<0&&t.clockseq===undefined){s=s+1&16383}if((o<0||l>_lastMSecs)&&t.nsecs===undefined){a=0}if(a>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=l;_lastNSecs=a;_clockseq=s;l+=122192928e5;var h=((l&268435455)*1e4+a)%4294967296;r[n++]=h>>>24&255;r[n++]=h>>>16&255;r[n++]=h>>>8&255;r[n++]=h&255;var u=l/4294967296*1e4&268435455;r[n++]=u>>>8&255;r[n++]=u&255;r[n++]=u>>>24&15|16;r[n++]=u>>>16&255;r[n++]=s>>>8|128;r[n++]=s&255;var d=t.node||_nodeId;for(var p=0;p<6;++p){r[n+p]=d[p]}return e?e:bytesToUuid_1(r)}var v1_1=v1;function v4(t,e,i){var n=e&&i||0;if(typeof t=="string"){e=t=="binary"?new Array(16):null;t=null}t=t||{};var r=t.random||(t.rng||rngBrowser)();r[6]=r[6]&15|64;r[8]=r[8]&63|128;if(e){for(var s=0;s<16;++s){e[n+s]=r[s]}}return e||bytesToUuid_1(r)}var v4_1=v4;var uuid=v4_1;uuid.v1=v1_1;uuid.v4=v4_1;var uuidBrowser=uuid;var _EMPTY="00000000-0000-0000-0000-000000000000";var Guid=function(){function t(t){this._value=t}t.prototype.equals=function(e){if(!(e instanceof t))return false;return this.toString()===e.toString()};t.prototype.toString=function(){if(this._value){return this._value.toUpperCase()}};t.newInstance=function(){return new t(uuidBrowser.v4())};Object.defineProperty(t,"EMPTY",{get:function(){return new t(_EMPTY)},enumerable:false,configurable:true});t.equals=function(e,i){if(!(e instanceof t)||!(i instanceof t)){return!e&&!i}return e.equals(i)};return t}();var build=createCommonjsModule((function(module){(function(t,e){if(module.exports){module.exports=e()}else{t.mxgraph=e()}})(commonjsGlobal,(function(){return function(opts){for(var name in opts){this[name]=opts[name]}var __mxOutput={};var mxClient={VERSION:"4.2.2",IS_IE:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:navigator.userAgent!=null&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:navigator.userAgent!=null&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0&&(document.documentMode==null||document.documentMode==5),IS_EM:"spellcheck"in document.createElement("textarea")&&document.documentMode==8,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent!=null&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent!=null&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:navigator.userAgent!=null&&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.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:window.chrome!=null&&chrome.app!=null&&chrome.app.runtime!=null,IS_FF:typeof InstallTrigger!=="undefined",IS_MT: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.")<0,IS_VML:navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER",IS_SVG:navigator.appName.toUpperCase()!="MICROSOFT INTERNET EXPLORER",NO_FO:!document.createElementNS||document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:window.PointerEvent!=null&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){i=i||document;if(mxClient.IS_IE6){i.write('<link rel="'+t+'" href="'+e+'" charset="UTF-8" type="text/css"/>')}else{var r=i.createElement("link");r.setAttribute("rel",t);r.setAttribute("href",e);r.setAttribute("charset","UTF-8");r.setAttribute("type","text/css");if(n){r.setAttribute("id",n)}var s=i.getElementsByTagName("head")[0];s.appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){if(--i==0){t()}}for(var r=0;r<mxClient.defaultBundles.length;r++){mxResources.add(mxClient.defaultBundles[r],e,n)}},include:function(t){document.write('<script src="'+t+'"><\/script>')}};if(typeof mxLoadResources=="undefined"){mxLoadResources=true}if(typeof mxForceIncludes=="undefined"){mxForceIncludes=false}if(typeof mxResourceExtension=="undefined"){mxResourceExtension=".txt"}if(typeof mxLoadStylesheets=="undefined"){mxLoadStylesheets=true}if(typeof mxBasePath!="undefined"&&mxBasePath.length>0){if(mxBasePath.substring(mxBasePath.length-1)=="/"){mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)}mxClient.basePath=mxBasePath}else{mxClient.basePath="."}if(typeof mxImageBasePath!="undefined"&&mxImageBasePath.length>0){if(mxImageBasePath.substring(mxImageBasePath.length-1)=="/"){mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)}mxClient.imageBasePath=mxImageBasePath}else{mxClient.imageBasePath=mxClient.basePath+"/images"}if(typeof mxLanguage!="undefined"&&mxLanguage!=null){mxClient.language=mxLanguage}else{mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language}if(typeof mxDefaultLanguage!="undefined"&&mxDefaultLanguage!=null){mxClient.defaultLanguage=mxDefaultLanguage}else{mxClient.defaultLanguage="en"}if(mxLoadStylesheets){mxClient.link("stylesheet",mxClient.basePath+"/css/common.css")}if(typeof mxLanguages!="undefined"&&mxLanguages!=null){mxClient.languages=mxLanguages}if(mxClient.IS_VML){if(mxClient.IS_SVG){mxClient.IS_VML=false}else{if(document.namespaces!=null){if(document.documentMode==8){document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML");document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")}else{document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml");document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office")}}if(mxClient.IS_QUIRKS&&document.styleSheets.length>=30){(function(){var t=document.createElement("style");t.type="text/css";t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}";document.getElementsByTagName("head")[0].appendChild(t)})()}else{document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}"}if(mxLoadStylesheets){mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}}}if(mxForceIncludes||!(module.exports!=null)){mxClient.include(mxClient.basePath+"/js/util/mxLog.js");mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js");mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js");mxClient.include(mxClient.basePath+"/js/util/mxResources.js");mxClient.include(mxClient.basePath+"/js/util/mxPoint.js");mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js");mxClient.include(mxClient.basePath+"/js/util/mxEffects.js");mxClient.include(mxClient.basePath+"/js/util/mxUtils.js");mxClient.include(mxClient.basePath+"/js/util/mxConstants.js");mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js");mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js");mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js");mxClient.include(mxClient.basePath+"/js/util/mxEvent.js");mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js");mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js");mxClient.include(mxClient.basePath+"/js/util/mxWindow.js");mxClient.include(mxClient.basePath+"/js/util/mxForm.js");mxClient.include(mxClient.basePath+"/js/util/mxImage.js");mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js");mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js");mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js");mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js");mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js");mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js");mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js");mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js");mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js");mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js");mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js");mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js");mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js");mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxGuide.js");mxClient.include(mxClient.basePath+"/js/shape/mxShape.js");mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js");mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js");mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js");mxClient.include(mxClient.basePath+"/js/shape/mxActor.js");mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js");mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js");mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js");mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js");mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js");mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js");mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js");mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js");mxClient.include(mxClient.basePath+"/js/shape/mxText.js");mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js");mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js");mxClient.include(mxClient.basePath+"/js/shape/mxLine.js");mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js");mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js");mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js");mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js");mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js");mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js");mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js");mxClient.include(mxClient.basePath+"/js/model/mxCell.js");mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js");mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js");mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js");mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js");mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js");mxClient.include(mxClient.basePath+"/js/view/mxCellState.js");mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js");mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js");mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js");mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js");mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js");mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js");mxClient.include(mxClient.basePath+"/js/view/mxGraph.js");mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js");mxClient.include(mxClient.basePath+"/js/view/mxOutline.js");mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js");mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js");mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js");mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js");mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js");mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js");mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js");mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js");mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js");mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js");mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js");mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js");mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js");mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js");mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js");mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js");mxClient.include(mxClient.basePath+"/js/io/mxCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")}__mxOutput.mxClient=typeof mxClient!=="undefined"?mxClient:undefined;var mxLog={consoleName:"Console",TRACE:false,DEBUG:true,WARN:true,buffer:"",init:function(){if(mxLog.window==null&&document.body!=null){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION;var e=document.createElement("table");e.setAttribute("width","100%");e.setAttribute("height","100%");var i=document.createElement("tbody");var n=document.createElement("tr");var r=document.createElement("td");r.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;if(mxClient.IS_NS&&document.compatMode!="BackCompat"){mxLog.textarea.style.width="99%"}else{mxLog.textarea.style.width="100%"}r.appendChild(mxLog.textarea);n.appendChild(r);i.appendChild(n);n=document.createElement("tr");mxLog.td=document.createElement("td");mxLog.td.style.verticalAlign="top";mxLog.td.setAttribute("height","30px");n.appendChild(mxLog.td);i.appendChild(n);e.appendChild(i);mxLog.addButton("Info",(function(t){mxLog.info()}));mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)}));mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE;if(mxLog.TRACE){mxLog.debug("Tracing enabled")}else{mxLog.debug("Tracing disabled")}}));mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}));mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}));mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var s=0;var l=0;if(typeof window.innerWidth==="number"){s=window.innerHeight;l=window.innerWidth}else{s=document.documentElement.clientHeight||document.body.clientHeight;l=document.body.clientWidth}mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-210),300,160);mxLog.window.setMaximizable(true);mxLog.window.setScrollable(false);mxLog.window.setResizable(true);mxLog.window.setClosable(true);mxLog.window.destroyOnClose=false;if((mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&document.compatMode!="BackCompat"||document.documentMode==11){var a=mxLog.window.getElement();var o=function(t,e){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,o);mxLog.window.addListener(mxEvent.MAXIMIZE,o);mxLog.window.addListener(mxEvent.NORMALIZE,o);mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t);mxEvent.addListener(i,"click",e);mxLog.td.appendChild(i)},isVisible:function(){if(mxLog.window!=null){return mxLog.window.isVisible()}return false},show:function(){mxLog.setVisible(true)},setVisible:function(t){if(mxLog.window==null){mxLog.init()}if(mxLog.window!=null){mxLog.window.setVisible(t)}},enter:function(t){if(mxLog.TRACE){mxLog.writeln("Entering "+t);return(new Date).getTime()}},leave:function(t,e){if(mxLog.TRACE){var i=e!=0?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){if(mxLog.DEBUG){mxLog.writeln.apply(this,arguments)}},warn:function(){if(mxLog.WARN){mxLog.writeln.apply(this,arguments)}},write:function(){var t="";for(var e=0;e<arguments.length;e++){t+=arguments[e];if(e<arguments.length-1){t+=" "}}if(mxLog.textarea!=null){mxLog.textarea.value=mxLog.textarea.value+t;if(navigator.userAgent!=null&&navigator.userAgent.indexOf("Presto/2.5")>=0){mxLog.textarea.style.visibility="hidden";mxLog.textarea.style.visibility="visible"}mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight}else{mxLog.buffer+=t}},writeln:function(){var t="";for(var e=0;e<arguments.length;e++){t+=arguments[e];if(e<arguments.length-1){t+=" "}}mxLog.write(t+"\n")}};__mxOutput.mxLog=typeof mxLog!=="undefined"?mxLog:undefined;var mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(t){if(t!=null){if(t[mxObjectIdentity.FIELD_NAME]==null){if(typeof t==="object"){var e=mxUtils.getFunctionName(t.constructor);t[mxObjectIdentity.FIELD_NAME]=e+"#"+mxObjectIdentity.counter++}else if(typeof t==="function"){t[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++}}return t[mxObjectIdentity.FIELD_NAME]}return null},clear:function(t){if(typeof t==="object"||typeof t==="function"){delete t[mxObjectIdentity.FIELD_NAME]}}};__mxOutput.mxObjectIdentity=typeof mxObjectIdentity!=="undefined"?mxObjectIdentity:undefined;function mxDictionary(){this.clear()}mxDictionary.prototype.map=null;mxDictionary.prototype.clear=function(){this.map={}};mxDictionary.prototype.get=function(t){var e=mxObjectIdentity.get(t);return this.map[e]};mxDictionary.prototype.put=function(t,e){var i=mxObjectIdentity.get(t);var n=this.map[i];this.map[i]=e;return n};mxDictionary.prototype.remove=function(t){var e=mxObjectIdentity.get(t);var i=this.map[e];delete this.map[e];return i};mxDictionary.prototype.getKeys=function(){var t=[];for(var e in this.map){t.push(e)}return t};mxDictionary.prototype.getValues=function(){var t=[];for(var e in this.map){t.push(this.map[e])}return t};mxDictionary.prototype.visit=function(t){for(var e in this.map){t(e,this.map[e])}};__mxOutput.mxDictionary=typeof mxDictionary!=="undefined"?mxDictionary:undefined;var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:false,loadDefaultBundle:true,loadSpecialBundle:true,isLanguageSupported:function(t){if(mxClient.languages!=null){return mxUtils.indexOf(mxClient.languages,t)>=0}return true},getDefaultBundle:function(t,e){if(mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)){return t+mxResources.extension}else{return null}},getSpecialBundle:function(t,e){if(mxClient.languages==null||!this.isLanguageSupported(e)){var i=e.indexOf("-");if(i>0){e=e.substring(0,i)}}if(mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage){return t+"_"+e+mxResources.extension}else{return null}},add:function(t,e,i){e=e!=null?e:mxClient.language!=null?mxClient.language.toLowerCase():mxConstants.NONE;if(e!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e);var r=mxResources.getSpecialBundle(t,e);var s=function(){if(r!=null){if(i){mxUtils.get(r,(function(t){mxResources.parse(t.getText());i()}),(function(){i()}))}else{try{var t=mxUtils.load(r);if(t.isReady()){mxResources.parse(t.getText())}}catch(e){}}}else if(i!=null){i()}};if(n!=null){if(i){mxUtils.get(n,(function(t){mxResources.parse(t.getText());s()}),(function(){s()}))}else{try{var l=mxUtils.load(n);if(l.isReady()){mxResources.parse(l.getText())}s()}catch(a){}}}else{s()}}},parse:function(t){if(t!=null){var e=t.split("\n");for(var i=0;i<e.length;i++){if(e[i].charAt(0)!="#"){var n=e[i].indexOf("=");if(n>0){var r=e[i].substring(0,n);var s=e[i].length;if(e[i].charCodeAt(s-1)==13){s--}var l=e[i].substring(n+1,s);if(this.resourcesEncoded){l=l.replace(/\\(?=u[a-fA-F\d]{4})/g,"%");mxResources.resources[r]=unescape(l)}else{mxResources.resources[r]=l}}}}}},get:function(t,e,i){var n=mxResources.resources[t];if(n==null){n=i}if(n!=null&&e!=null){n=mxResources.replacePlaceholders(n,e)}return n},replacePlaceholders:function(t,e){var i=[];var n=null;for(var r=0;r<t.length;r++){var s=t.charAt(r);if(s=="{"){n=""}else if(n!=null&&s=="}"){n=parseInt(n)-1;if(n>=0&&n<e.length){i.push(e[n])}n=null}else if(n!=null){n+=s}else{i.push(s)}}return i.join("")},loadResources:function(t){mxResources.add(mxClient.basePath+"/resources/editor",null,(function(){mxResources.add(mxClient.basePath+"/resources/graph",null,t)}))}};__mxOutput.mxResources=typeof mxResources!=="undefined"?mxResources:undefined;function mxPoint(t,e){this.x=t!=null?t:0;this.y=e!=null?e:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(t){return t!=null&&t.x==this.x&&t.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};__mxOutput.mxPoint=typeof mxPoint!=="undefined"?mxPoint:undefined;function mxRectangle(t,e,i,n){mxPoint.call(this,t,e);this.width=i!=null?i:0;this.height=n!=null?n:0}mxRectangle.prototype=new mxPoint;mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(t,e,i,n){this.x=t;this.y=e;this.width=i;this.height=n};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(t!=null){var e=Math.min(this.x,t.x);var i=Math.min(this.y,t.y);var n=Math.max(this.x+this.width,t.x+t.width);var r=Math.max(this.y+this.height,t.y+t.height);this.x=e;this.y=i;this.width=n-e;this.height=r-i}};mxRectangle.prototype.intersect=function(t){if(t!=null){var e=this.x+this.width;var i=t.x+t.width;var n=this.y+this.height;var r=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,i)-this.x;this.height=Math.min(n,r)-this.y}};mxRectangle.prototype.grow=function(t){this.x-=t;this.y-=t;this.width+=2*t;this.height+=2*t;return 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;var e=this.width;this.width=this.height;this.height=e};mxRectangle.prototype.equals=function(t){return t!=null&&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)};__mxOutput.mxRectangle=typeof mxRectangle!=="undefined"?mxRectangle:undefined;var mxEffects={animateChanges:function(t,e,i){var n=10;var r=0;var s=function(){var a=false;for(var o=0;o<e.length;o++){var h=e[o];if(h instanceof mxGeometryChange||h instanceof mxTerminalChange||h instanceof mxValueChange||h instanceof mxChildChange||h instanceof mxStyleChange){var u=t.getView().getState(h.cell||h.child,false);if(u!=null){a=true;if(h.constructor!=mxGeometryChange||t.model.isEdge(h.cell)){mxUtils.setOpacity(u.shape.node,100*r/n)}else{var d=t.getView().scale;var p=(h.geometry.x-h.previous.x)*d;var m=(h.geometry.y-h.previous.y)*d;var c=(h.geometry.width-h.previous.width)*d;var x=(h.geometry.height-h.previous.height)*d;if(r==0){u.x-=p;u.y-=m;u.width-=c;u.height-=x}else{u.x+=p/n;u.y+=m/n;u.width+=c/n;u.height+=x/n}t.cellRenderer.redraw(u);mxEffects.cascadeOpacity(t,h.cell,100*r/n)}}}}if(r<n&&a){r++;window.setTimeout(s,l)}else if(i!=null){i()}};var l=30;s()},cascadeOpacity:function(t,e,i){var n=t.model.getChildCount(e);for(var r=0;r<n;r++){var s=t.model.getChildAt(e,r);var l=t.getView().getState(s);if(l!=null){mxUtils.setOpacity(l.shape.node,i);mxEffects.cascadeOpacity(t,s,i)}}var a=t.model.getEdges(e);if(a!=null){for(var r=0;r<a.length;r++){var o=t.getView().getState(a[r]);if(o!=null){mxUtils.setOpacity(o.shape.node,i)}}}},fadeOut:function(t,e,i,n,r,s){n=n||40;r=r||30;var l=e||100;mxUtils.setOpacity(t,l);if(s||s==null){var a=function(){l=Math.max(l-n,0);mxUtils.setOpacity(t,l);if(l>0){window.setTimeout(a,r)}else{t.style.visibility="hidden";if(i&&t.parentNode){t.parentNode.removeChild(t)}}};window.setTimeout(a,r)}else{t.style.visibility="hidden";if(i&&t.parentNode){t.parentNode.removeChild(t)}}}};__mxOutput.mxEffects=typeof mxEffects!=="undefined"?mxEffects:undefined;var mxUtils={errorResource:mxClient.language!="none"?"error":"",closeResource:mxClient.language!="none"?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){if(t.style!=null){t.style.cursor=""}var e=t.childNodes;if(e!=null){var i=e.length;for(var n=0;n<i;n+=1){mxUtils.removeCursors(e[n])}}},getCurrentStyle:function(){if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<9)){return function(t){return t!=null?t.currentStyle:null}}else{return function(t){return t!=null?window.getComputedStyle(t,""):null}}}(),parseCssNumber:function(t){if(t=="thin"){t="2"}else if(t=="medium"){t="4"}else if(t=="thick"){t="6"}t=parseFloat(t);if(isNaN(t)){t=0}return t},setPrefixedStyle:function(){var t=null;if(mxClient.IS_OT){t="O"}else if(mxClient.IS_SF||mxClient.IS_GC){t="Webkit"}else if(mxClient.IS_MT){t="Moz"}else if(mxClient.IS_IE&&document.documentMode>=9&&document.documentMode<10){t="ms"}return function(e,i,n){e[i]=n;if(t!=null&&i.length>0){i=t+i.substring(0,1).toUpperCase()+i.substring(1);e[i]=n}}}(),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return e!=null&&(e.overflow=="scroll"||e.overflow=="auto")},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0){try{eval("var _mxJavaScriptExpression="+expr);result=_mxJavaScriptExpression;_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+expr)}}else{try{result=eval(expr)}catch(e){mxLog.warn(e.message+" while evaluating "+expr)}}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(n!=null&&n==i){return t}}t=t.firstChild;while(t!=null){var r=mxUtils.findNode(t,e,i);if(r!=null){return r}t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(t!=null){if(t.name!=null){e=t.name}else{e=mxUtils.trim(t.toString());if(/^function\s/.test(e)){e=mxUtils.ltrim(e.substring(9));var i=e.indexOf("(");if(i>0){e=e.substring(0,i)}}}}return e},indexOf:function(t,e){if(t!=null&&e!=null){for(var i=0;i<t.length;i++){if(t[i]==e){return i}}}return-1},forEach:function(t,e){if(t!=null&&e!=null){for(var i=0;i<t.length;i++){e(t[i])}}return t},remove:function(t,e){var i=null;if(typeof e=="object"){var n=mxUtils.indexOf(e,t);while(n>=0){e.splice(n,1);i=t;n=mxUtils.indexOf(e,t)}}for(var r in e){if(e[r]==t){delete e[r];i=t}}return i},isNode:function(t,e,i,n){if(t!=null&&!isNaN(t.nodeType)&&(e==null||t.nodeName.toLowerCase()==e.toLowerCase())){return i==null||t.getAttribute(i)==n}return false},isAncestorNode:function(t,e){var i=e;while(i!=null){if(i==t){return true}i=i.parentNode}return false},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;var i=[];var n=t.firstChild;while(n!=null){if(n.nodeType==e){i.push(n)}n=n.nextSibling}return i},importNode:function(t,e,i){if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<10)){return mxUtils.importNodeImplementation(t,e,i)}else{return t.importNode(e,i)}},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:{var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0){for(var r=0;r<e.attributes.length;r++){n.setAttribute(e.attributes[r].nodeName,e.getAttribute(e.attributes[r].nodeName))}}if(i&&e.childNodes&&e.childNodes.length>0){for(var r=0;r<e.childNodes.length;r++){n.appendChild(mxUtils.importNodeImplementation(t,e.childNodes[r],i))}}return n}case 3:case 4:case 8:{return t.createTextNode(e.nodeValue!=null?e.nodeValue:e.value)}}},createXmlDocument:function(){var t=null;if(document.implementation&&document.implementation.createDocument){t=document.implementation.createDocument("","",null)}else if("ActiveXObject"in window){t=mxUtils.createMsXmlDocument()}return t},createMsXmlDocument:function(){var t=new ActiveXObject("Microsoft.XMLDOM");t.async=false;t.validateOnParse=false;t.resolveExternals=false;return t},parseXml:function(){if(window.DOMParser){return function(t){var e=new DOMParser;return e.parseFromString(t,"text/xml")}}else{return function(t){var e=mxUtils.createMsXmlDocument();e.loadXML(t);return e}}}(),clearSelection:function(){if(document.selection){return function(){document.selection.empty()}}else if(window.getSelection){return function(){if(window.getSelection().empty){window.getSelection().empty()}else if(window.getSelection().removeAllRanges){window.getSelection().removeAllRanges()}}}else{return function(){}}}(),removeWhitespace:function(t,e){var i=e?t.previousSibling:t.nextSibling;while(i!=null&&i.nodeType==mxConstants.NODETYPE_TEXT){var n=e?i.previousSibling:i.nextSibling;var r=mxUtils.getTextContent(i);if(mxUtils.trim(r).length==0){i.parentNode.removeChild(i)}i=n}},htmlEntities:function(t,e){t=String(t||"");t=t.replace(/&/g,"&amp;");t=t.replace(/"/g,"&quot;");t=t.replace(/\'/g,"&#39;");t=t.replace(/</g,"&lt;");t=t.replace(/>/g,"&gt;");if(e==null||e){t=t.replace(/\n/g,"&#xa;")}return t},isVml:function(t){return t!=null&&t.tagUrn=="urn:schemas-microsoft-com:vml"},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11){i=mxUtils.getPrettyXml(t,"","","")}else if(window.XMLSerializer!=null){var n=new XMLSerializer;i=n.serializeToString(t)}else if(t.xml!=null){i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")}e=e||"&#xa;";i=i.replace(/\n/g,e);return i},getPrettyXml:function(t,e,i,n,r){var s=[];if(t!=null){e=e!=null?e:" ";i=i!=null?i:"";n=n!=null?n:"\n";if(t.namespaceURI!=null&&t.namespaceURI!=r){r=t.namespaceURI;if(t.getAttribute("xmlns")==null){t.setAttribute("xmlns",t.namespaceURI)}}if(t.nodeType==mxConstants.NODETYPE_DOCUMENT){s.push(mxUtils.getPrettyXml(t.documentElement,e,i,n,r))}else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var l=t.firstChild;if(l!=null){while(l!=null){s.push(mxUtils.getPrettyXml(l,e,i,n,r));l=l.nextSibling}}}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){var a=mxUtils.getTextContent(t);if(a.length>0){s.push(i+"\x3c!--"+a+"--\x3e"+n)}}else if(t.nodeType==mxConstants.NODETYPE_TEXT){var a=mxUtils.trim(mxUtils.getTextContent(t));if(a.length>0){s.push(i+mxUtils.htmlEntities(a,false)+n)}}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var a=mxUtils.getTextContent(t);if(a.length>0){s.push(i+"<![CDATA["+a+"]]"+n)}}else{s.push(i+"<"+t.nodeName);var o=t.attributes;if(o!=null){for(var h=0;h<o.length;h++){var u=mxUtils.htmlEntities(o[h].value);s.push(" "+o[h].nodeName+'="'+u+'"')}}var l=t.firstChild;if(l!=null){s.push(">"+n);while(l!=null){s.push(mxUtils.getPrettyXml(l,e,i+e,n,r));l=l.nextSibling}s.push(i+"</"+t.nodeName+">"+n)}else{s.push(" />"+n)}}}return s.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"];var i=[];function n(t){if(t.length==1&&(t[0].nodeName=="BR"||t[0].innerHTML=="\n")){return}for(var r=0;r<t.length;r++){var s=t[r];if(s.nodeName=="BR"||s.innerHTML=="\n"||(t.length==1||r==0)&&(s.nodeName=="DIV"&&s.innerHTML.toLowerCase()=="<br>")){i.push("\n")}else{if(s.nodeType===3||s.nodeType===4){if(s.nodeValue.length>0){i.push(s.nodeValue)}}else if(s.nodeType!==8&&s.childNodes.length>0){n(s.childNodes)}if(r<t.length-1&&mxUtils.indexOf(e,t[r+1].nodeName)>=0){i.push("\n")}}}}n(t);return i.join("")},replaceTrailingNewlines:function(t,e){var i="";while(t.length>0&&t.charAt(t.length-1)=="\n"){t=t.substring(0,t.length-1);i+=e}return t+i},getTextContent:function(t){if(mxClient.IS_IE&&t.innerText!==undefined){return t.innerText}else{return t!=null?t[t.textContent===undefined?"text":"textContent"]:""}},setTextContent:function(t,e){if(t.innerText!==undefined){t.innerText=e}else{t[t.textContent===undefined?"text":"textContent"]=e}},getInnerHtml:function(){if(mxClient.IS_IE){return function(t){if(t!=null){return t.innerHTML}return""}}else{return function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}}(),getOuterHtml:function(){if(mxClient.IS_IE){return function(t){if(t!=null){if(t.outerHTML!=null){return t.outerHTML}else{var e=[];e.push("<"+t.nodeName);var i=t.attributes;if(i!=null){for(var n=0;n<i.length;n++){var r=i[n].value;if(r!=null&&r.length>0){e.push(" ");e.push(i[n].nodeName);e.push('="');e.push(r);e.push('"')}}}if(t.innerHTML.length==0){e.push("/>")}else{e.push(">");e.push(t.innerHTML);e.push("</"+t.nodeName+">")}return e.join("")}}return""}}else{return function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}}(),write:function(t,e){var i=t.ownerDocument;var n=i.createTextNode(e);if(t!=null){t.appendChild(n)}return n},writeln:function(t,e){var i=t.ownerDocument;var n=i.createTextNode(e);if(t!=null){t.appendChild(n);t.appendChild(document.createElement("br"))}return n},br:function(t,e){e=e||1;var i=null;for(var n=0;n<e;n++){if(t!=null){i=t.ownerDocument.createElement("br");t.appendChild(i)}}return i},button:function(t,e,i){i=i!=null?i:document;var n=i.createElement("button");mxUtils.write(n,t);mxEvent.addListener(n,"click",(function(t){e(t)}));return n},para:function(t,e){var i=document.createElement("p");mxUtils.write(i,e);if(t!=null){t.appendChild(i)}return i},addTransparentBackgroundFilter:function(t){t.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(t,e,i,n,r){return mxUtils.link(t,e,(function(){i.execute(n)}),r)},linkInvoke:function(t,e,i,n,r,s){return mxUtils.link(t,e,(function(){i[n](r)}),s)},link:function(t,e,i,n){var r=document.createElement("span");r.style.color="blue";r.style.textDecoration="underline";r.style.cursor="pointer";if(n!=null){r.style.paddingLeft=n+"px"}mxEvent.addListener(r,"click",i);mxUtils.write(r,e);if(t!=null){t.appendChild(r)}return r},getDocumentSize:function(){var t=document.body;var e=document.documentElement;try{return new mxRectangle(0,0,t.clientWidth||e.clientWidth,Math.max(t.clientHeight||0,e.clientHeight))}catch(i){return new mxRectangle}},fit:function(t){var e=mxUtils.getDocumentSize();var i=parseInt(t.offsetLeft);var n=parseInt(t.offsetWidth);var r=mxUtils.getDocumentScrollOrigin(t.ownerDocument);var s=r.x;var l=r.y;var a=s+e.width;if(i+n>a){t.style.left=Math.max(s,a-n)+"px"}var o=parseInt(t.offsetTop);var h=parseInt(t.offsetHeight);var u=l+e.height;if(o+h>u){t.style.top=Math.max(l,u-h)+"px"}},load:function(t){var e=new mxXmlRequest(t,null,"GET",false);e.send();return e},get:function(t,e,i,n,r,s,l){var a=new mxXmlRequest(t,null,"GET");var o=a.setRequestHeaders;if(l){a.setRequestHeaders=function(t,e){o.apply(this,arguments);for(var i in l){t.setRequestHeader(i,l[i])}}}if(n!=null){a.setBinary(n)}a.send(e,i,r,s);return a},getAll:function(t,e,i){var n=t.length;var r=[];var s=0;var l=function(){if(s==0&&i!=null){i()}s++};for(var a=0;a<t.length;a++){(function(t,i){mxUtils.get(t,(function(t){var s=t.getStatus();if(s<200||s>299){l()}else{r[i]=t;n--;if(n==0){e(r)}}}),l)})(t[a],a)}if(n==0){e(r)}},post:function(t,e,i,n){return new mxXmlRequest(t,e).send(i,n)},submit:function(t,e,i,n){return new mxXmlRequest(t,e).simulate(i,n)},loadInto:function(t,e,i){if(mxClient.IS_IE){e.onreadystatechange=function(){if(e.readyState==4){i()}}}else{e.addEventListener("load",i,false)}e.load(t)},getValue:function(t,e,i){var n=t!=null?t[e]:null;if(n==null){n=i}return n},getNumber:function(t,e,i){var n=t!=null?t[e]:null;if(n==null){n=i||0}return Number(n)},getColor:function(t,e,i){var n=t!=null?t[e]:null;if(n==null){n=i}else if(n==mxConstants.NONE){n=null}return n},clone:function(t,e,i){i=i!=null?i:false;var n=null;if(t!=null&&typeof t.constructor=="function"){n=new t.constructor;for(var r in t){if(r!=mxObjectIdentity.FIELD_NAME&&(e==null||mxUtils.indexOf(e,r)<0)){if(!i&&typeof t[r]=="object"){n[r]=mxUtils.clone(t[r])}else{n[r]=t[r]}}}}return n},equalPoints:function(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!=e.length){return false}else if(t!=null&&e!=null){for(var i=0;i<t.length;i++){if(t[i]!=null&&e[i]==null||t[i]==null&&e[i]!=null||t[i]!=null&&e[i]!=null&&(t[i].x!=e[i].x||t[i].y!=e[i].y)){return false}}}return true},equalEntries:function(t,e){var i=0;if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!=e.length){return false}else if(t!=null&&e!=null){for(var n in e){i++}for(var n in t){i--;if((!mxUtils.isNaN(t[n])||!mxUtils.isNaN(e[n]))&&t[n]!=e[n]){return false}}}return i==0},removeDuplicates:function(t){var e=new mxDictionary;var i=[];for(var n=0;n<t.length;n++){if(!e.get(t[n])){i.push(t[n]);e.put(t[n],true)}}return i},isNaN:function(t){return typeof t=="number"&&isNaN(t)},extend:function(t,e){var i=function(){};i.prototype=e.prototype;t.prototype=new i;t.prototype.constructor=t},toString:function(t){var e="";for(var i in t){try{if(t[i]==null){e+=i+" = [null]\n"}else if(typeof t[i]=="function"){e+=i+" => [Function]\n"}else if(typeof t[i]=="object"){var n=mxUtils.getFunctionName(t[i].constructor);e+=i+" => ["+n+"]\n"}else{e+=i+" = "+t[i]+"\n"}}catch(r){e+=i+"="+r.message}}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return t*180/Math.PI},arcToCurves:function(t,e,i,n,r,s,l,a,o){a-=t;o-=e;if(i===0||n===0){return j}var h=l;var u=r;i=Math.abs(i);n=Math.abs(n);var d=-a/2;var p=-o/2;var m=Math.cos(u*Math.PI/180);var c=Math.sin(u*Math.PI/180);var x=m*d+c*p;var f=-1*c*d+m*p;var g=x*x;var v=f*f;var y=i*i;var C=n*n;var E=g/y+v/C;var S;if(E>1){i=Math.sqrt(E)*i;n=Math.sqrt(E)*n;S=0}else{var b=1;if(s===h){b=-1}S=b*Math.sqrt((y*C-y*v-C*g)/(y*v+C*g))}var w=S*i*f/n;var T=-1*S*n*x/i;var L=m*w-c*T+a/2;var A=c*w+m*T+o/2;var M=Math.atan2((f-T)/n,(x-w)/i)-Math.atan2(0,1);var _=M>=0?M:2*Math.PI+M;M=Math.atan2((-f-T)/n,(-x-w)/i)-Math.atan2((f-T)/n,(x-w)/i);var I=M>=0?M:2*Math.PI+M;if(h==0&&I>0){I-=2*Math.PI}else if(h!=0&&I<0){I+=2*Math.PI}var O=I*2/Math.PI;var P=Math.ceil(O<0?-1*O:O);var R=I/P;var H=8/3*Math.sin(R/4)*Math.sin(R/4)/Math.sin(R/2);var N=m*i;var G=m*n;var D=c*i;var U=c*n;var V=Math.cos(_);var k=Math.sin(_);var F=-H*(N*k+U*V);var B=-H*(D*k-G*V);var Y=0;var z=0;var j=[];for(var X=0;X<P;++X){_+=R;V=Math.cos(_);k=Math.sin(_);Y=N*V-U*k+L;z=D*V+G*k+A;var W=-H*(N*k+U*V);var K=-H*(D*k-G*V);var Z=X*6;j[Z]=Number(F+t);j[Z+1]=Number(B+e);j[Z+2]=Number(Y-W+t);j[Z+3]=Number(z-K+e);j[Z+4]=Number(Y+t);j[Z+5]=Number(z+e);F=Y+W;B=z+K}return j},getBoundingBox:function(t,e,i){var n=null;if(t!=null&&e!=null&&e!=0){var r=mxUtils.toRadians(e);var s=Math.cos(r);var l=Math.sin(r);i=i!=null?i:new mxPoint(t.x+t.width/2,t.y+t.height/2);var a=new mxPoint(t.x,t.y);var o=new mxPoint(t.x+t.width,t.y);var h=new mxPoint(o.x,t.y+t.height);var u=new mxPoint(t.x,h.y);a=mxUtils.getRotatedPoint(a,s,l,i);o=mxUtils.getRotatedPoint(o,s,l,i);h=mxUtils.getRotatedPoint(h,s,l,i);u=mxUtils.getRotatedPoint(u,s,l,i);n=new mxRectangle(a.x,a.y,0,0);n.add(new mxRectangle(o.x,o.y,0,0));n.add(new mxRectangle(h.x,h.y,0,0));n.add(new mxRectangle(u.x,u.y,0,0))}return n},getRotatedPoint:function(t,e,i,n){n=n!=null?n:new mxPoint;var r=t.x-n.x;var s=t.y-n.y;var l=r*e-s*i;var a=s*e+r*i;return new mxPoint(l+n.x,a+n.y)},getPortConstraints:function(t,e,i,n){var r=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(e.style,i?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(r==null){return n}else{var s=r.toString();var l=mxConstants.DIRECTION_MASK_NONE;var a=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0);var o=0;if(a==1){o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0)}var h=0;if(o>45){h=1;if(o>=135){h=2}}else if(o<-45){h=3;if(o<=-135){h=2}}if(s.indexOf(mxConstants.DIRECTION_NORTH)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:l|=mxConstants.DIRECTION_MASK_EAST;break;case 2:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:l|=mxConstants.DIRECTION_MASK_WEST;break}}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_WEST;break;case 1:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:l|=mxConstants.DIRECTION_MASK_EAST;break;case 3:l|=mxConstants.DIRECTION_MASK_SOUTH;break}}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:l|=mxConstants.DIRECTION_MASK_WEST;break;case 2:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:l|=mxConstants.DIRECTION_MASK_EAST;break}}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_EAST;break;case 1:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:l|=mxConstants.DIRECTION_MASK_WEST;break;case 3:l|=mxConstants.DIRECTION_MASK_NORTH;break}}return l}},reversePortConstraints:function(t){var e=0;e=(t&mxConstants.DIRECTION_MASK_WEST)<<3;e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1;e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1;e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3;return e},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0){var r=t.absolutePoints[0];var s=null;for(var l=1;l<t.absolutePoints.length;l++){var a=t.absolutePoints[l];var o=mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,i);if(s==null||o<s){s=o;n=l-1}r=a}}return n},getDirectedBounds:function(t,e,i,n,r){var s=mxUtils.getValue(i,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);n=n!=null?n:mxUtils.getValue(i,mxConstants.STYLE_FLIPH,false);r=r!=null?r:mxUtils.getValue(i,mxConstants.STYLE_FLIPV,false);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)));if(r&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||n&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST)){var l=e.x;e.x=e.width;e.width=l}if(n&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||r&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST)){var l=e.y;e.y=e.height;e.height=l}var a=mxRectangle.fromRectangle(e);if(s==mxConstants.DIRECTION_SOUTH){a.y=e.x;a.x=e.height;a.width=e.y;a.height=e.width}else if(s==mxConstants.DIRECTION_WEST){a.y=e.height;a.x=e.width;a.width=e.x;a.height=e.y}else if(s==mxConstants.DIRECTION_NORTH){a.y=e.width;a.x=e.y;a.width=e.height;a.height=e.x}return new mxRectangle(t.x+a.x,t.y+a.y,t.width-a.width-a.x,t.height-a.height-a.y)},getPerimeterPoint:function(t,e,i){var n=null;for(var r=0;r<t.length-1;r++){var s=mxUtils.intersection(t[r].x,t[r].y,t[r+1].x,t[r+1].y,e.x,e.y,i.x,i.y);if(s!=null){var l=i.x-s.x;var a=i.y-s.y;var o={p:s,distSq:a*a+l*l};if(o!=null&&(n==null||n.distSq>o.distSq)){n=o}}}return n!=null?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y;var r=t.x;var s=n+t.height;var l=r+t.width;var a=e.x;var o=i.x;if(e.x>i.x){a=i.x;o=e.x}if(o>l){o=l}if(a<r){a=r}if(a>o){return false}var h=e.y;var u=i.y;var d=i.x-e.x;if(Math.abs(d)>1e-7){var p=(i.y-e.y)/d;var m=e.y-p*e.x;h=p*a+m;u=p*o+m}if(h>u){var c=u;u=h;h=c}if(u>s){u=s}if(h<n){h=n}if(h>u){return false}return true},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width;var n=t.height;var r=e.width;var s=e.height;if(r<=0||s<=0||i<=0||n<=0){return false}var l=t.x;var a=t.y;var o=e.x;var h=e.y;r+=o;s+=h;i+=l;n+=a;return(r<o||r>l)&&(s<h||s>a)&&(i<l||i>o)&&(n<a||n>h)},intersectsHotspot:function(t,e,i,n,r,s){n=n!=null?n:1;r=r!=null?r:0;s=s!=null?s:0;if(n>0){var l=t.getCenterX();var a=t.getCenterY();var o=t.width;var h=t.height;var u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;if(u>0){if(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,true)){a=t.y+u/2;h=u}else{l=t.x+u/2;o=u}}o=Math.max(r,o*n);h=Math.max(r,h*n);if(s>0){o=Math.min(o,s);h=Math.min(h,s)}var d=new mxRectangle(l-o/2,a-h/2,o,h);var p=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(p!=0){var m=Math.cos(-p);var c=Math.sin(-p);var l=new mxPoint(t.getCenterX(),t.getCenterY());var x=mxUtils.getRotatedPoint(new mxPoint(e,i),m,c,l);e=x.x;i=x.y}return mxUtils.contains(d,e,i)}return true},getOffset:function(t,e){var i=0;var n=0;var r=false;var s=t;var l=document.body;var a=document.documentElement;while(s!=null&&s!=l&&s!=a&&!r){var o=mxUtils.getCurrentStyle(s);if(o!=null){r=r||o.position=="fixed"}s=s.parentNode}if(!e&&!r){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=h.x;n+=h.y}var u=t.getBoundingClientRect();if(u!=null){i+=u.left;n+=u.top}return new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS){return new mxPoint(t.body.scrollLeft,t.body.scrollTop)}else{var e=t.defaultView||t.parentWindow;var i=e!=null&&window.pageXOffset!==undefined?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft;var n=e!=null&&window.pageYOffset!==undefined?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return new mxPoint(i,n)}},getScrollOrigin:function(t,e,i){e=e!=null?e:false;i=i!=null?i:true;var n=t!=null?t.ownerDocument:document;var r=n.body;var s=n.documentElement;var l=new mxPoint;var a=false;while(t!=null&&t!=r&&t!=s){if(!isNaN(t.scrollLeft)&&!isNaN(t.scrollTop)){l.x+=t.scrollLeft;l.y+=t.scrollTop}var o=mxUtils.getCurrentStyle(t);if(o!=null){a=a||o.position=="fixed"}t=e?t.parentNode:null}if(!a&&i){var h=mxUtils.getDocumentScrollOrigin(n);l.x+=h.x;l.y+=h.y}return l},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,false);var r=mxUtils.getOffset(t);r.x-=n.x;r.y-=n.y;return new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){e=e||"\\s";return t!=null?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){e=e||"\\s";return t!=null?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&(typeof t!="string"||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,i,n,r,s,l,a){var o=(a-s)*(i-t)-(l-r)*(n-e);var h=(l-r)*(e-s)-(a-s)*(t-r);var u=(i-t)*(e-s)-(n-e)*(t-r);var d=h/o;var p=u/o;if(d>=0&&d<=1&&p>=0&&p<=1){var m=t+d*(i-t);var c=e+d*(n-e);return new mxPoint(m,c)}return null},ptSegDistSq:function(t,e,i,n,r,s){i-=t;n-=e;r-=t;s-=e;var l=r*i+s*n;var a;if(l<=0){a=0}else{r=i-r;s=n-s;l=r*i+s*n;if(l<=0){a=0}else{a=l*l/(i*i+n*n)}}var o=r*r+s*s-a;if(o<0){o=0}return o},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){i-=t;n-=e;r-=t;s-=e;var l=r*n-s*i;if(l==0){l=r*i+s*n;if(l>0){r-=i;s-=n;l=r*i+s*n;if(l<0){l=0}}}return l<0?-1:l>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){if(mxUtils.isVml(t)){if(e>=100){t.style.filter=""}else{t.style.filter="alpha(opacity="+e/5+")"}}else if(mxClient.IS_IE&&(typeof document.documentMode==="undefined"||document.documentMode<9)){if(e>=100){t.style.filter=""}else{t.style.filter="alpha(opacity="+e+")"}}else{t.style.opacity=e/100}},createImage:function(t){var e=null;if(mxClient.IS_IE6&&document.compatMode!="CSS1Compat"){e=document.createElement(mxClient.VML_PREFIX+":image");e.setAttribute("src",t);e.style.borderStyle="none"}else{e=document.createElement("img");e.setAttribute("src",t);e.setAttribute("border","0")}return e},sortCells:function(t,e){e=e!=null?e:true;var i=new mxDictionary;t.sort((function(t,n){var r=i.get(t);if(r==null){r=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR);i.put(t,r)}var s=i.get(n);if(s==null){s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR);i.put(n,s)}var l=mxCellPath.compare(r,s);return l==0?0:l>0==e?1:-1}));return t},getStylename:function(t){if(t!=null){var e=t.split(";");var i=e[0];if(i.indexOf("=")<0){return i}}return""},getStylenames:function(t){var e=[];if(t!=null){var i=t.split(";");for(var n=0;n<i.length;n++){if(i[n].indexOf("=")<0){e.push(i[n])}}}return e},indexOfStylename:function(t,e){if(t!=null&&e!=null){var i=t.split(";");var n=0;for(var r=0;r<i.length;r++){if(i[r]==e){return n}n+=i[r].length+1}}return-1},addStylename:function(t,e){if(mxUtils.indexOfStylename(t,e)<0){if(t==null){t=""}else if(t.length>0&&t.charAt(t.length-1)!=";"){t+=";"}t+=e}return t},removeStylename:function(t,e){var i=[];if(t!=null){var n=t.split(";");for(var r=0;r<n.length;r++){if(n[r]!=e){i.push(n[r])}}}return i.join(";")},removeAllStylenames:function(t){var e=[];if(t!=null){var i=t.split(";");for(var n=0;n<i.length;n++){if(i[n].indexOf("=")>=0){e.push(i[n])}}}return e.join(";")},setCellStyles:function(t,e,i,n){if(e!=null&&e.length>0){t.beginUpdate();try{for(var r=0;r<e.length;r++){if(e[r]!=null){var s=mxUtils.setStyle(t.getStyle(e[r]),i,n);t.setStyle(e[r],s)}}}finally{t.endUpdate()}}},setStyle:function(t,e,i){var n=i!=null&&(typeof i.length=="undefined"||i.length>0);if(t==null||t.length==0){if(n){t=e+"="+i+";"}}else{if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");if(n){t=e+"="+i+(r<0?";":t.substring(r))}else{t=r<0||r==t.length-1?"":t.substring(r+1)}}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var l=t.charAt(t.length-1)==";"?"":";";t=t+l+e+"="+i+";"}}else{var r=t.indexOf(";",s+1);if(n){t=t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r))}else{t=t.substring(0,s)+(r<0?";":t.substring(r))}}}}return t},setCellStyleFlags:function(t,e,i,n,r){if(e!=null&&e.length>0){t.beginUpdate();try{for(var s=0;s<e.length;s++){if(e[s]!=null){var l=mxUtils.setStyleFlag(t.getStyle(e[s]),i,n,r);t.setStyle(e[s],l)}}}finally{t.endUpdate()}}},setStyleFlag:function(t,e,i,n){if(t==null||t.length==0){if(n||n==null){t=e+"="+i}else{t=e+"=0"}}else{var r=t.indexOf(e+"=");if(r<0){var s=t.charAt(t.length-1)==";"?"":";";if(n||n==null){t=t+s+e+"="+i}else{t=t+s+e+"=0"}}else{var l=t.indexOf(";",r);var a="";if(l<0){a=t.substring(r+e.length+1)}else{a=t.substring(r+e.length+1,l)}if(n==null){a=parseInt(a)^i}else if(n){a=parseInt(a)|i}else{a=parseInt(a)&~i}t=t.substring(0,r)+e+"="+a+(l>=0?t.substring(l):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5;var n=-.5;if(t==mxConstants.ALIGN_LEFT){i=0}else if(t==mxConstants.ALIGN_RIGHT){i=-1}if(e==mxConstants.ALIGN_TOP){n=0}else if(e==mxConstants.ALIGN_BOTTOM){n=-1}return new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=e!=null?e:mxConstants.DEFAULT_FONTSIZE;i=i!=null?i:mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");s.style.fontFamily=i;s.style.fontSize=Math.round(e)+"px";s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px";if(r!=null){if((r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){s.style.fontWeight="bold"}if((r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){s.style.fontStyle="italic"}var l=[];if((r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){l.push("underline")}if((r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){l.push("line-through")}if(l.length>0){s.style.textDecoration=l.join(" ")}}s.style.position="absolute";s.style.visibility="hidden";s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";s.style.zoom="1";if(n!=null){s.style.width=n+"px";s.style.whiteSpace="normal"}else{s.style.whiteSpace="nowrap"}s.innerHTML=t;document.body.appendChild(s);var a=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);document.body.removeChild(s);return a},getViewXml:function(t,e,i,n,r){n=n!=null?n:0;r=r!=null?r:0;e=e!=null?e:1;if(i==null){var s=t.getModel();i=[s.getRoot()]}var l=t.getView();var a=null;var o=l.isEventsEnabled();l.setEventsEnabled(false);var h=l.drawPane;var u=l.overlayPane;if(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.canvas.appendChild(l.overlayPane)}else{l.drawPane=l.drawPane.cloneNode(false);l.canvas.appendChild(l.drawPane);l.overlayPane=l.overlayPane.cloneNode(false);l.canvas.appendChild(l.overlayPane)}var d=l.getTranslate();l.translate=new mxPoint(n,r);var p=new mxTemporaryCellStates(t.getView(),e,i);try{var m=new mxCodec;a=m.encode(t.getView())}finally{p.destroy();l.translate=d;l.canvas.removeChild(l.drawPane);l.canvas.removeChild(l.overlayPane);l.drawPane=h;l.overlayPane=u;l.setEventsEnabled(o)}return a},getScaleForPageCount:function(t,e,i,n){if(t<1){return 1}i=i!=null?i:mxConstants.PAGE_FORMAT_A4_PORTRAIT;n=n!=null?n:0;var r=i.width-n*2;var s=i.height-n*2;var l=e.getGraphBounds().clone();var a=e.getView().getScale();l.width/=a;l.height/=a;var o=l.width;var h=l.height;var u=1;var d=r/s;var p=o/h;var m=p/d;var c=Math.sqrt(t);var x=Math.sqrt(m);var f=c*x;var g=c/x;if(f<1&&g>t){var v=g/t;g=t;f/=v}if(g<1&&f>t){var v=f/t;f=t;g/=v}var y=Math.ceil(f)*Math.ceil(g);var C=0;while(y>t){var E=Math.floor(f)/f;var S=Math.floor(g)/g;if(E==1){E=Math.floor(f-1)/f}if(S==1){S=Math.floor(g-1)/g}var v=1;if(E>S){v=E}else{v=S}f=f*v;g=g*v;y=Math.ceil(f)*Math.ceil(g);C++;if(C>10){break}}var b=r*f;u=b/o;return u*.99999},show:function(t,e,i,n,r,s){i=i!=null?i:0;n=n!=null?n:0;if(e==null){var l=window.open();e=l.document}else{e.open()}if(document.documentMode==9){e.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e')}var a=t.getGraphBounds();var o=Math.ceil(i-a.x);var h=Math.ceil(n-a.y);if(r==null){r=Math.ceil(a.width+i)+Math.ceil(Math.ceil(a.x)-a.x)}if(s==null){s=Math.ceil(a.height+n)+Math.ceil(Math.ceil(a.y)-a.y)}if(mxClient.IS_IE||document.documentMode==11){var u="<html><head>";var d=document.getElementsByTagName("base");for(var p=0;p<d.length;p++){u+=d[p].outerHTML}u+="<style>";for(var p=0;p<document.styleSheets.length;p++){try{u+=document.styleSheets[p].cssText}catch(C){}}u+='</style></head><body style="margin:0px;">';u+='<div style="position:absolute;overflow:hidden;width:'+r+"px;height:"+s+'px;"><div style="position:relative;left:'+o+"px;top:"+h+'px;">';u+=t.container.innerHTML;u+="</div></div></body><html>";e.writeln(u);e.close()}else{e.writeln("<html><head>");var d=document.getElementsByTagName("base");for(var p=0;p<d.length;p++){e.writeln(mxUtils.getOuterHtml(d[p]))}var m=document.getElementsByTagName("link");for(var p=0;p<m.length;p++){e.writeln(mxUtils.getOuterHtml(m[p]))}var c=document.getElementsByTagName("style");for(var p=0;p<c.length;p++){e.writeln(mxUtils.getOuterHtml(c[p]))}e.writeln('</head><body style="margin:0px;"></body></html>');e.close();var x=e.createElement("div");x.position="absolute";x.overflow="hidden";x.style.width=r+"px";x.style.height=s+"px";var f=e.createElement("div");f.style.position="absolute";f.style.left=o+"px";f.style.top=h+"px";var g=t.container.firstChild;var v=null;while(g!=null){var y=g.cloneNode(true);if(g==t.view.drawPane.ownerSVGElement){x.appendChild(y);v=y}else{f.appendChild(y)}g=g.nextSibling}e.body.appendChild(x);if(f.firstChild!=null){e.body.appendChild(f)}if(v!=null){v.style.minWidth="";v.style.minHeight="";v.firstChild.setAttribute("transform","translate("+o+","+h+")")}}mxUtils.removeCursors(e.body);return e},printScreen:function(t){var e=window.open();var i=t.getGraphBounds();mxUtils.show(t,e.document);var n=function(){e.focus();e.print();e.close()};if(mxClient.IS_GC){e.setTimeout(n,500)}else{n()}},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll";i.style.width="636px";i.style.height="460px";var n=document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,false).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");i.appendChild(n);var r=document.body.clientWidth;var s=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight);var l=new mxWindow("Popup Window",i,r/2-320,s/2-240,640,480,false,true);l.setClosable(true);l.setVisible(true)}else{if(mxClient.IS_NS){var l=window.open();l.document.writeln("<pre>"+mxUtils.htmlEntities(t)+"</pre");l.document.close()}else{var l=window.open();var n=l.document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,false).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");l.document.body.appendChild(n)}}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,e!=null?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage);s.setAttribute("valign","bottom");s.style.verticalAlign="middle";r.appendChild(s);r.appendChild(document.createTextNode(" "));r.appendChild(document.createTextNode(" "));r.appendChild(document.createTextNode(" "));mxUtils.write(r,t);var l=document.body.clientWidth;var a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(l-e)/2,a/4,e,null,false,true);if(i){mxUtils.br(r);var h=document.createElement("p");var u=document.createElement("button");if(mxClient.IS_IE){u.style.cssText="float:right"}else{u.setAttribute("style","float:right")}mxEvent.addListener(u,"click",(function(t){o.destroy()}));mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource);h.appendChild(u);r.appendChild(h);mxUtils.br(r);o.setClosable(true)}o.setVisible(true);return o},makeDraggable:function(t,e,i,n,r,s,l,a,o,h){var u=new mxDragSource(t,i);u.dragOffset=new mxPoint(r!=null?r:0,s!=null?s:mxConstants.TOOLTIP_VERTICAL_OFFSET);u.autoscroll=l;u.setGuidesEnabled(false);if(o!=null){u.highlightDropTargets=o}if(h!=null){u.getDropTarget=h}u.getGraphForEvent=function(t){return typeof e=="function"?e(t):e};if(n!=null){u.createDragElement=function(){return n.cloneNode(true)};if(a){u.createPreviewElement=function(t){var e=n.cloneNode(true);var i=parseInt(e.style.width);var r=parseInt(e.style.height);e.style.width=Math.round(i*t.view.scale)+"px";e.style.height=Math.round(r*t.view.scale)+"px";return e}}}return u}};__mxOutput.mxUtils=typeof mxUtils!=="undefined"?mxUtils:undefined;var 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_VML:"vml",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:true,EDGE_SELECTION_DASHED:true,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:false,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_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_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};__mxOutput.mxConstants=typeof mxConstants!=="undefined"?mxConstants:undefined;function mxEventObject(t){this.name=t;this.properties=[];for(var e=1;e<arguments.length;e+=2){if(arguments[e+1]!=null){this.properties[arguments[e]]=arguments[e+1]}}}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=false;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(t){return this.properties[t]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=true};__mxOutput.mxEventObject=typeof mxEventObject!=="undefined"?mxEventObject:undefined;function mxMouseEvent(t,e){this.evt=t;this.state=e;this.sourceState=e}mxMouseEvent.prototype.consumed=false;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(t){if(t!=null){return mxUtils.isAncestorNode(t.node,this.getSource())}return false};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};mxMouseEvent.prototype.getState=function(){return this.state};mxMouseEvent.prototype.getCell=function(){var t=this.getState();if(t!=null){return t.cell}return null};mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())};mxMouseEvent.prototype.isConsumed=function(){return this.consumed};mxMouseEvent.prototype.consume=function(t){t=t!=null?t:this.evt.touches!=null||mxEvent.isMouseEvent(this.evt);if(t&&this.evt.preventDefault){this.evt.preventDefault()}if(mxClient.IS_IE){this.evt.returnValue=true}this.consumed=true};__mxOutput.mxMouseEvent=typeof mxMouseEvent!=="undefined"?mxMouseEvent:undefined;function mxEventSource(t){this.setEventSource(t)}mxEventSource.prototype.eventListeners=null;mxEventSource.prototype.eventsEnabled=true;mxEventSource.prototype.eventSource=null;mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled};mxEventSource.prototype.setEventsEnabled=function(t){this.eventsEnabled=t};mxEventSource.prototype.getEventSource=function(){return this.eventSource};mxEventSource.prototype.setEventSource=function(t){this.eventSource=t};mxEventSource.prototype.addListener=function(t,e){if(this.eventListeners==null){this.eventListeners=[]}this.eventListeners.push(t);this.eventListeners.push(e)};mxEventSource.prototype.removeListener=function(t){if(this.eventListeners!=null){var e=0;while(e<this.eventListeners.length){if(this.eventListeners[e+1]==t){this.eventListeners.splice(e,2)}else{e+=2}}}};mxEventSource.prototype.fireEvent=function(t,e){if(this.eventListeners!=null&&this.isEventsEnabled()){if(t==null){t=new mxEventObject}if(e==null){e=this.getEventSource()}if(e==null){e=this}var i=[e,t];for(var n=0;n<this.eventListeners.length;n+=2){var r=this.eventListeners[n];if(r==null||r==t.getName()){this.eventListeners[n+1].apply(this,i)}}}};__mxOutput.mxEventSource=typeof mxEventSource!=="undefined"?mxEventSource:undefined;var mxEvent={addListener:function(){var t=function(t,e,i){if(t.mxListenerList==null){t.mxListenerList=[]}var n={name:e,f:i};t.mxListenerList.push(n)};if(window.addEventListener){return function(e,i,n){e.addEventListener(i,n,false);t(e,i,n)}}else{return function(e,i,n){e.attachEvent("on"+i,n);t(e,i,n)}}}(),removeListener:function(){var t=function(t,e,i){if(t.mxListenerList!=null){var n=t.mxListenerList.length;for(var r=0;r<n;r++){var s=t.mxListenerList[r];if(s.f==i){t.mxListenerList.splice(r,1);break}}if(t.mxListenerList.length==0){t.mxListenerList=null}}};if(window.removeEventListener){return function(e,i,n){e.removeEventListener(i,n,false);t(e,i,n)}}else{return function(e,i,n){e.detachEvent("on"+i,n);t(e,i,n)}}}(),removeAllListeners:function(t){var e=t.mxListenerList;if(e!=null){while(e.length>0){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}}},addGestureListeners:function(t,e,i,n){if(e!=null){mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e)}if(i!=null){mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i)}if(n!=null){mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n)}if(!mxClient.IS_POINTER&&mxClient.IS_TOUCH){if(e!=null){mxEvent.addListener(t,"touchstart",e)}if(i!=null){mxEvent.addListener(t,"touchmove",i)}if(n!=null){mxEvent.addListener(t,"touchend",n)}}},removeGestureListeners:function(t,e,i,n){if(e!=null){mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e)}if(i!=null){mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i)}if(n!=null){mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n)}if(!mxClient.IS_POINTER&&mxClient.IS_TOUCH){if(e!=null){mxEvent.removeListener(t,"touchstart",e)}if(i!=null){mxEvent.removeListener(t,"touchmove",i)}if(n!=null){mxEvent.removeListener(t,"touchend",n)}}},redirectMouseEvents:function(t,e,i,n,r,s,l){var a=function(t){return typeof i=="function"?i(t):i};mxEvent.addGestureListeners(t,(function(t){if(n!=null){n(t)}else if(!mxEvent.isConsumed(t)){e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,a(t)))}}),(function(t){if(r!=null){r(t)}else if(!mxEvent.isConsumed(t)){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,a(t)))}}),(function(t){if(s!=null){s(t)}else if(!mxEvent.isConsumed(t)){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,a(t)))}}));mxEvent.addListener(t,"dblclick",(function(t){if(l!=null){l(t)}else if(!mxEvent.isConsumed(t)){var i=a(t);e.dblClick(t,i!=null?i.cell:null)}}))},release:function(t){try{if(t!=null){mxEvent.removeAllListeners(t);var e=t.childNodes;if(e!=null){var i=e.length;for(var n=0;n<i;n+=1){mxEvent.release(e[n])}}}}catch(r){}},addMouseWheelListener:function(t,e){if(t!=null){var i=function(e){if(e==null){e=window.event}if(e.ctrlKey){e.preventDefault()}if(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5){t(e,e.deltaY==0?-e.deltaX>0:-e.deltaY>0)}};e=e!=null?e:window;if(mxClient.IS_SF&&!mxClient.IS_TOUCH){var n=1;mxEvent.addListener(e,"gesturestart",(function(t){mxEvent.consume(t);n=1}));mxEvent.addListener(e,"gesturechange",(function(e){mxEvent.consume(e);var i=n-e.scale;if(Math.abs(i)>.2){t(e,i<0,true);n=e.scale}}));mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}else{var r=[];var s=0;var l=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(t){if(!mxEvent.isMouseEvent(t)&&t.pointerId!=null){r.push(t)}})),mxUtils.bind(this,(function(e){if(!mxEvent.isMouseEvent(e)&&r.length==2){for(var i=0;i<r.length;i++){if(e.pointerId==r[i].pointerId){r[i]=e;break}}var n=Math.abs(r[0].clientX-r[1].clientX);var a=Math.abs(r[0].clientY-r[1].clientY);var o=Math.abs(n-s);var h=Math.abs(a-l);if(o>mxEvent.PINCH_THRESHOLD||h>mxEvent.PINCH_THRESHOLD){var u=r[0].clientX+(r[1].clientX-r[0].clientX)/2;var d=r[0].clientY+(r[1].clientY-r[0].clientY)/2;t(r[0],o>h?n>s:a>l,true,u,d);s=n;l=a}}})),mxUtils.bind(this,(function(t){r=[];s=0;l=0})))}mxEvent.addListener(e,"wheel",i)}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){if(t.preventDefault){t.preventDefault()}return false}))},getSource:function(t){return t.srcElement!=null?t.srcElement:t.target},isConsumed:function(t){return t.isConsumed!=null&&t.isConsumed},isTouchEvent:function(t){return t.pointerType!=null?t.pointerType=="touch"||t.pointerType===t.MSPOINTER_TYPE_TOUCH:t.mozInputSource!=null?t.mozInputSource==5:t.type.indexOf("touch")==0},isPenEvent:function(t){return t.pointerType!=null?t.pointerType=="pen"||t.pointerType===t.MSPOINTER_TYPE_PEN:t.mozInputSource!=null?t.mozInputSource==2:t.type.indexOf("pen")==0},isMultiTouchEvent:function(t){return t.type!=null&&t.type.indexOf("touch")==0&&t.touches!=null&&t.touches.length>1},isMouseEvent:function(t){return t.pointerType!=null?t.pointerType=="mouse"||t.pointerType===t.MSPOINTER_TYPE_MOUSE:t.mozInputSource!=null?t.mozInputSource==1:t.type.indexOf("mouse")==0},isLeftMouseButton:function(t){if("buttons"in t&&(t.type=="mousedown"||t.type=="mousemove")){return t.buttons==1}else if("which"in t){return t.which===1}else{return t.button===1}},isMiddleMouseButton:function(t){if("which"in t){return t.which===2}else{return t.button===4}},isRightMouseButton:function(t){if("which"in t){return t.which===3}else{return t.button===2}},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return t!=null?t.shiftKey:false},isAltDown:function(t){return t!=null?t.altKey:false},isControlDown:function(t){return t!=null?t.ctrlKey:false},isMetaDown:function(t){return t!=null?t.metaKey:false},getMainEvent:function(t){if((t.type=="touchstart"||t.type=="touchmove")&&t.touches!=null&&t.touches[0]!=null){t=t.touches[0]}else if(t.type=="touchend"&&t.changedTouches!=null&&t.changedTouches[0]!=null){t=t.changedTouches[0]}return t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){e=e!=null?e:true;i=i!=null?i:true;if(e){if(t.preventDefault){if(i){t.stopPropagation()}t.preventDefault()}else if(i){t.cancelBubble=true}}t.isConsumed=true;if(!t.preventDefault){t.returnValue=false}},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10};__mxOutput.mxEvent=typeof mxEvent!=="undefined"?mxEvent:undefined;function mxXmlRequest(t,e,i,n,r,s){this.url=t;this.params=e;this.method=i||"POST";this.async=n!=null?n:true;this.username=r;this.password=s}mxXmlRequest.prototype.url=null;mxXmlRequest.prototype.params=null;mxXmlRequest.prototype.method=null;mxXmlRequest.prototype.async=null;mxXmlRequest.prototype.binary=false;mxXmlRequest.prototype.withCredentials=false;mxXmlRequest.prototype.username=null;mxXmlRequest.prototype.password=null;mxXmlRequest.prototype.request=null;mxXmlRequest.prototype.decodeSimulateValues=false;mxXmlRequest.prototype.isBinary=function(){return this.binary};mxXmlRequest.prototype.setBinary=function(t){this.binary=t};mxXmlRequest.prototype.getText=function(){return this.request.responseText};mxXmlRequest.prototype.isReady=function(){return this.request.readyState==4};mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();if(t!=null){return t.documentElement}return null};mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;if(document.documentMode>=9||t==null||t.documentElement==null){t=mxUtils.parseXml(this.request.responseText)}return t};mxXmlRequest.prototype.getStatus=function(){return this.request!=null?this.request.status:null};mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest){return function(){var t=new XMLHttpRequest;if(this.isBinary()&&t.overrideMimeType){t.overrideMimeType("text/plain; charset=x-user-defined")}return t}}else if(typeof ActiveXObject!="undefined"){return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}}();mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create();if(this.request!=null){if(t!=null){this.request.onreadystatechange=mxUtils.bind(this,(function(){if(this.isReady()){t(this);this.request.onreadystatechange=null}}))}this.request.open(this.method,this.url,this.async,this.username,this.password);this.setRequestHeaders(this.request,this.params);if(window.XMLHttpRequest&&this.withCredentials){this.request.withCredentials="true"}if(!mxClient.IS_QUIRKS&&(document.documentMode==null||document.documentMode>9)&&window.XMLHttpRequest&&i!=null&&n!=null){this.request.timeout=i;this.request.ontimeout=n}this.request.send(this.params)}};mxXmlRequest.prototype.setRequestHeaders=function(t,e){if(e!=null){t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}};mxXmlRequest.prototype.simulate=function(t,e){t=t||document;var i=null;if(t==document){i=window.onbeforeunload;window.onbeforeunload=null}var n=t.createElement("form");n.setAttribute("method",this.method);n.setAttribute("action",this.url);if(e!=null){n.setAttribute("target",e)}n.style.display="none";n.style.visibility="hidden";var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split();for(var s=0;s<r.length;s++){var l=r[s].indexOf("=");if(l>0){var a=r[s].substring(0,l);var o=r[s].substring(l+1);if(this.decodeSimulateValues){o=decodeURIComponent(o)}var h=t.createElement("textarea");h.setAttribute("wrap","off");h.setAttribute("name",a);mxUtils.write(h,o);n.appendChild(h)}}t.body.appendChild(n);n.submit();if(n.parentNode!=null){n.parentNode.removeChild(n)}if(i!=null){window.onbeforeunload=i}};__mxOutput.mxXmlRequest=typeof mxXmlRequest!=="undefined"?mxXmlRequest:undefined;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return mxClipboard.getCells()==null},cut:function(t,e){e=mxClipboard.copy(t,e);mxClipboard.insertCount=0;mxClipboard.removeCells(t,e);return e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var i=t.getExportableCells(t.model.getTopmostCells(e));mxClipboard.insertCount=1;mxClipboard.setCells(t.cloneCells(i));return i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE;var n=t.getDefaultParent();e=t.importCells(e,i,i,n);mxClipboard.insertCount++;t.setSelectionCells(e)}return e}};__mxOutput.mxClipboard=typeof mxClipboard!=="undefined"?mxClipboard:undefined;function mxWindow(t,e,i,n,r,s,l,a,o,h){if(e!=null){l=l!=null?l:true;this.content=e;this.init(i,n,r,s,h);this.installMaximizeHandler();this.installMinimizeHandler();this.installCloseHandler();this.setMinimizable(l);this.setTitle(t);if(a==null||a){this.installMoveHandler()}if(o!=null&&o.parentNode!=null){o.parentNode.replaceChild(this.div,o)}else{document.body.appendChild(this.div)}}}mxWindow.prototype=new mxEventSource;mxWindow.prototype.constructor=mxWindow;mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif";mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif";mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif";mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif";mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif";mxWindow.prototype.visible=false;mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40);mxWindow.prototype.destroyOnClose=true;mxWindow.prototype.contentHeightCorrection=document.documentMode==8||document.documentMode==7?6:2;mxWindow.prototype.title=null;mxWindow.prototype.content=null;mxWindow.prototype.init=function(t,e,i,n,r){r=r!=null?r:"mxWindow";this.div=document.createElement("div");this.div.className=r;this.div.style.left=t+"px";this.div.style.top=e+"px";this.table=document.createElement("table");this.table.className=r;if(mxClient.IS_POINTER){this.div.style.touchAction="none"}if(i!=null){if(!mxClient.IS_QUIRKS){this.div.style.width=i+"px"}this.table.style.width=i+"px"}if(n!=null){if(!mxClient.IS_QUIRKS){this.div.style.height=n+"px"}this.table.style.height=n+"px"}var s=document.createElement("tbody");var l=document.createElement("tr");this.title=document.createElement("td");this.title.className=r+"Title";this.buttons=document.createElement("div");this.buttons.style.position="absolute";this.buttons.style.display="inline-block";this.buttons.style.right="4px";this.buttons.style.top="5px";this.title.appendChild(this.buttons);l.appendChild(this.title);s.appendChild(l);l=document.createElement("tr");this.td=document.createElement("td");this.td.className=r+"Pane";if(document.documentMode==7){this.td.style.height="100%"}this.contentWrapper=document.createElement("div");this.contentWrapper.className=r+"Pane";this.contentWrapper.style.width="100%";this.contentWrapper.appendChild(this.content);if(mxClient.IS_QUIRKS||this.content.nodeName.toUpperCase()!="DIV"){this.contentWrapper.style.height="100%"}this.td.appendChild(this.contentWrapper);l.appendChild(this.td);s.appendChild(l);this.table.appendChild(s);this.div.appendChild(this.table);var a=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,a);mxEvent.addGestureListeners(this.table,a);this.hide()};mxWindow.prototype.setTitle=function(t){var e=this.title.firstChild;while(e!=null){var i=e.nextSibling;if(e.nodeType==mxConstants.NODETYPE_TEXT){e.parentNode.removeChild(e)}e=i}mxUtils.write(this.title,t||"");this.title.appendChild(this.buttons)};mxWindow.prototype.setScrollable=function(t){if(navigator.userAgent==null||navigator.userAgent.indexOf("Presto/2.5")<0){if(t){this.contentWrapper.style.overflow="auto"}else{this.contentWrapper.style.overflow="hidden"}}};mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement());var e=t!=null?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();if(i!=null&&i.style!=null){i.style.zIndex=e}}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1;mxWindow.activeWindow=this;this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}};mxWindow.prototype.getElement=function(){return this.div};mxWindow.prototype.fit=function(){mxUtils.fit(this.div)};mxWindow.prototype.isResizable=function(){if(this.resize!=null){return this.resize.style.display!="none"}return false};mxWindow.prototype.setResizable=function(t){if(t){if(this.resize==null){this.resize=document.createElement("img");this.resize.style.position="absolute";this.resize.style.bottom="2px";this.resize.style.right="2px";this.resize.setAttribute("src",this.resizeImage);this.resize.style.cursor="nw-resize";var e=null;var i=null;var n=null;var r=null;var s=mxUtils.bind(this,(function(t){this.activate();e=mxEvent.getClientX(t);i=mxEvent.getClientY(t);n=this.div.offsetWidth;r=this.div.offsetHeight;mxEvent.addGestureListeners(document,null,l,a);this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t));mxEvent.consume(t)}));var l=mxUtils.bind(this,(function(t){if(e!=null&&i!=null){var s=mxEvent.getClientX(t)-e;var l=mxEvent.getClientY(t)-i;this.setSize(n+s,r+l);this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t));mxEvent.consume(t)}}));var a=mxUtils.bind(this,(function(t){if(e!=null&&i!=null){e=null;i=null;mxEvent.removeGestureListeners(document,null,l,a);this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t));mxEvent.consume(t)}}));mxEvent.addGestureListeners(this.resize,s,l,a);this.div.appendChild(this.resize)}else{this.resize.style.display="inline"}}else if(this.resize!=null){this.resize.style.display="none"}};mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t);e=Math.max(this.minimumSize.height,e);if(!mxClient.IS_QUIRKS){this.div.style.width=t+"px";this.div.style.height=e+"px"}this.table.style.width=t+"px";this.table.style.height=e+"px";if(!mxClient.IS_QUIRKS){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}};mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"};mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)};mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img");this.minimize.setAttribute("src",this.minimizeImage);this.minimize.setAttribute("title","Minimize");this.minimize.style.cursor="pointer";this.minimize.style.marginLeft="2px";this.minimize.style.display="none";this.buttons.appendChild(this.minimize);var t=false;var e=null;var i=null;var n=mxUtils.bind(this,(function(n){this.activate();if(!t){t=true;this.minimize.setAttribute("src",this.normalizeImage);this.minimize.setAttribute("title","Normalize");this.contentWrapper.style.display="none";e=this.maximize.style.display;this.maximize.style.display="none";i=this.table.style.height;var r=this.getMinimumSize();if(r.height>0){if(!mxClient.IS_QUIRKS){this.div.style.height=r.height+"px"}this.table.style.height=r.height+"px"}if(r.width>0){if(!mxClient.IS_QUIRKS){this.div.style.width=r.width+"px"}this.table.style.width=r.width+"px"}if(this.resize!=null){this.resize.style.visibility="hidden"}this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",n))}else{t=false;this.minimize.setAttribute("src",this.minimizeImage);this.minimize.setAttribute("title","Minimize");this.contentWrapper.style.display="";this.maximize.style.display=e;if(!mxClient.IS_QUIRKS){this.div.style.height=i}this.table.style.height=i;if(this.resize!=null){this.resize.style.visibility=""}this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",n))}mxEvent.consume(n)}));mxEvent.addGestureListeners(this.minimize,n)};mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"};mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img");this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title","Maximize");this.maximize.style.cursor="default";this.maximize.style.marginLeft="2px";this.maximize.style.cursor="pointer";this.maximize.style.display="none";this.buttons.appendChild(this.maximize);var t=false;var e=null;var i=null;var n=null;var r=null;var s=null;var l=mxUtils.bind(this,(function(l){this.activate();if(this.maximize.style.display!="none"){if(!t){t=true;this.maximize.setAttribute("src",this.normalizeImage);this.maximize.setAttribute("title","Normalize");this.contentWrapper.style.display="";s=this.minimize.style.display;this.minimize.style.display="none";e=parseInt(this.div.style.left);i=parseInt(this.div.style.top);n=this.table.style.height;r=this.table.style.width;this.div.style.left="0px";this.div.style.top="0px";var a=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(!mxClient.IS_QUIRKS){this.div.style.width=document.body.clientWidth-2+"px";this.div.style.height=a-2+"px"}this.table.style.width=document.body.clientWidth-2+"px";this.table.style.height=a-2+"px";if(this.resize!=null){this.resize.style.visibility="hidden"}if(!mxClient.IS_QUIRKS){var o=mxUtils.getCurrentStyle(this.contentWrapper);if(o.overflow=="auto"||this.resize!=null){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",l))}else{t=false;this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title","Maximize");this.contentWrapper.style.display="";this.minimize.style.display=s;this.div.style.left=e+"px";this.div.style.top=i+"px";if(!mxClient.IS_QUIRKS){this.div.style.height=n;this.div.style.width=r;var o=mxUtils.getCurrentStyle(this.contentWrapper);if(o.overflow=="auto"||this.resize!=null){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}}this.table.style.height=n;this.table.style.width=r;if(this.resize!=null){this.resize.style.visibility=""}this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",l))}mxEvent.consume(l)}}));mxEvent.addGestureListeners(this.maximize,l);mxEvent.addListener(this.title,"dblclick",l)};mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move";mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t);var i=mxEvent.getClientY(t);var n=this.getX();var r=this.getY();var s=mxUtils.bind(this,(function(t){var s=mxEvent.getClientX(t)-e;var l=mxEvent.getClientY(t)-i;this.setLocation(n+s,r+l);this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t));mxEvent.consume(t)}));var l=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,s,l);this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t));mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,s,l);this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t));mxEvent.consume(t)})));if(mxClient.IS_POINTER){this.title.style.touchAction="none"}};mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px";this.div.style.top=e+"px"};mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)};mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)};mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img");this.closeImg.setAttribute("src",this.closeImage);this.closeImg.setAttribute("title","Close");this.closeImg.style.marginLeft="2px";this.closeImg.style.cursor="pointer";this.closeImg.style.display="none";this.buttons.appendChild(this.closeImg);mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t));if(this.destroyOnClose){this.destroy()}else{this.setVisible(false)}mxEvent.consume(t)})))};mxWindow.prototype.setImage=function(t){this.image=document.createElement("img");this.image.setAttribute("src",t);this.image.setAttribute("align","left");this.image.style.marginRight="4px";this.image.style.marginLeft="0px";this.image.style.marginTop="-2px";this.title.insertBefore(this.image,this.title.firstChild)};mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"};mxWindow.prototype.isVisible=function(){if(this.div!=null){return this.div.style.display!="none"}return false};mxWindow.prototype.setVisible=function(t){if(this.div!=null&&this.isVisible()!=t){if(t){this.show()}else{this.hide()}}};mxWindow.prototype.show=function(){this.div.style.display="";this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);if(!mxClient.IS_QUIRKS&&(t.overflow=="auto"||this.resize!=null)&&this.contentWrapper.style.display!="none"){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}this.fireEvent(new mxEventObject(mxEvent.SHOW))};mxWindow.prototype.hide=function(){this.div.style.display="none";this.fireEvent(new mxEventObject(mxEvent.HIDE))};mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY));if(this.div!=null){mxEvent.release(this.div);this.div.parentNode.removeChild(this.div);this.div=null}this.title=null;this.content=null;this.contentWrapper=null};__mxOutput.mxWindow=typeof mxWindow!=="undefined"?mxWindow:undefined;function mxForm(t){this.table=document.createElement("table");this.table.className=t;this.body=document.createElement("tbody");this.table.appendChild(this.body)}mxForm.prototype.table=null;mxForm.prototype.body=false;mxForm.prototype.getTable=function(){return this.table};mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr");var n=document.createElement("td");i.appendChild(n);n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK");n.appendChild(r);mxEvent.addListener(r,"click",(function(){t()}));r=document.createElement("button");mxUtils.write(r,mxResources.get("cancel")||"Cancel");n.appendChild(r);mxEvent.addListener(r,"click",(function(){e()}));i.appendChild(n);this.body.appendChild(i)};mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");n.setAttribute("type",i||"text");n.value=e;return this.addField(t,n)};mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");i.setAttribute("type","checkbox");this.addField(t,i);if(e){i.checked=true}return i};mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");if(mxClient.IS_NS){i--}n.setAttribute("rows",i||2);n.value=e;return this.addField(t,n)};mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");if(i!=null){n.setAttribute("size",i)}if(e){n.setAttribute("multiple","true")}return this.addField(t,n)};mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e);r.setAttribute("value",i);if(n){r.setAttribute("selected",n)}t.appendChild(r)};mxForm.prototype.addField=function(t,e){var i=document.createElement("tr");var n=document.createElement("td");mxUtils.write(n,t);i.appendChild(n);n=document.createElement("td");n.appendChild(e);i.appendChild(n);this.body.appendChild(i);return e};__mxOutput.mxForm=typeof mxForm!=="undefined"?mxForm:undefined;function mxImage(t,e,i){this.src=t;this.width=e;this.height=i}mxImage.prototype.src=null;mxImage.prototype.width=null;mxImage.prototype.height=null;__mxOutput.mxImage=typeof mxImage!=="undefined"?mxImage:undefined;function mxDivResizer(t,e){if(t.nodeName.toLowerCase()=="div"){if(e==null){e=window}this.div=t;var i=mxUtils.getCurrentStyle(t);if(i!=null){this.resizeWidth=i.width=="auto";this.resizeHeight=i.height=="auto"}mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){if(!this.handlingResize){this.handlingResize=true;this.resize();this.handlingResize=false}})));this.resize()}}mxDivResizer.prototype.resizeWidth=true;mxDivResizer.prototype.resizeHeight=true;mxDivResizer.prototype.handlingResize=false;mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth();var e=this.getDocumentHeight();var i=parseInt(this.div.style.left);var n=parseInt(this.div.style.right);var r=parseInt(this.div.style.top);var s=parseInt(this.div.style.bottom);if(this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0){this.div.style.width=t-n-i+"px"}if(this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0){this.div.style.height=e-r-s+"px"}};mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth};mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight};__mxOutput.mxDivResizer=typeof mxDivResizer!=="undefined"?mxDivResizer:undefined;function mxDragSource(t,e){this.element=t;this.dropHandler=e;mxEvent.addGestureListeners(t,mxUtils.bind(this,(function(t){this.mouseDown(t)})));mxEvent.addListener(t,"dragstart",(function(t){mxEvent.consume(t)}));this.eventConsumer=function(t,e){var i=e.getProperty("eventName");var n=e.getProperty("event");if(i!=mxEvent.MOUSE_DOWN){n.consume()}}}mxDragSource.prototype.element=null;mxDragSource.prototype.dropHandler=null;mxDragSource.prototype.dragOffset=null;mxDragSource.prototype.dragElement=null;mxDragSource.prototype.previewElement=null;mxDragSource.prototype.previewOffset=null;mxDragSource.prototype.enabled=true;mxDragSource.prototype.currentGraph=null;mxDragSource.prototype.currentDropTarget=null;mxDragSource.prototype.currentPoint=null;mxDragSource.prototype.currentGuide=null;mxDragSource.prototype.currentHighlight=null;mxDragSource.prototype.autoscroll=true;mxDragSource.prototype.guidesEnabled=true;mxDragSource.prototype.gridEnabled=true;mxDragSource.prototype.highlightDropTargets=true;mxDragSource.prototype.dragElementZIndex=100;mxDragSource.prototype.dragElementOpacity=70;mxDragSource.prototype.checkEventSource=true;mxDragSource.prototype.isEnabled=function(){return this.enabled};mxDragSource.prototype.setEnabled=function(t){this.enabled=t};mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled};mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t};mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled};mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t};mxDragSource.prototype.getGraphForEvent=function(t){return null};mxDragSource.prototype.getDropTarget=function(t,e,i,n){return t.getCellAt(e,i)};mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(true)};mxDragSource.prototype.createPreviewElement=function(t){return null};mxDragSource.prototype.isActive=function(){return this.mouseMoveHandler!=null};mxDragSource.prototype.reset=function(){if(this.currentGraph!=null){this.dragExit(this.currentGraph);this.currentGraph=null}this.removeDragElement();this.removeListeners();this.stopDrag()};mxDragSource.prototype.mouseDown=function(t){if(this.enabled&&!mxEvent.isConsumed(t)&&this.mouseMoveHandler==null){this.startDrag(t);this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove);this.mouseUpHandler=mxUtils.bind(this,this.mouseUp);mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);if(mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)){this.eventSource=mxEvent.getSource(t);mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)}}};mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t);this.dragElement.style.position="absolute";this.dragElement.style.zIndex=this.dragElementZIndex;mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);if(this.checkEventSource&&mxClient.IS_SVG){this.dragElement.style.pointerEvents="none"}};mxDragSource.prototype.stopDrag=function(){this.removeDragElement()};mxDragSource.prototype.removeDragElement=function(){if(this.dragElement!=null){if(this.dragElement.parentNode!=null){this.dragElement.parentNode.removeChild(this.dragElement)}this.dragElement=null}};mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)};mxDragSource.prototype.graphContainsEvent=function(t,e){var i=mxEvent.getClientX(e);var n=mxEvent.getClientY(e);var r=mxUtils.getOffset(t.container);var s=mxUtils.getScrollOrigin();var l=this.getElementForEvent(e);if(this.checkEventSource){while(l!=null&&l!=t.container){l=l.parentNode}}return l!=null&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight};mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(e!=null&&!this.graphContainsEvent(e,t)){e=null}if(e!=this.currentGraph){if(this.currentGraph!=null){this.dragExit(this.currentGraph,t)}this.currentGraph=e;if(this.currentGraph!=null){this.dragEnter(this.currentGraph,t)}}if(this.currentGraph!=null){this.dragOver(this.currentGraph,t)}if(this.dragElement!=null&&(this.previewElement==null||this.previewElement.style.visibility!="visible")){var i=mxEvent.getClientX(t);var n=mxEvent.getClientY(t);if(this.dragElement.parentNode==null){document.body.appendChild(this.dragElement)}this.dragElement.style.visibility="visible";if(this.dragOffset!=null){i+=this.dragOffset.x;n+=this.dragOffset.y}var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px";this.dragElement.style.top=n+r.y+"px"}else if(this.dragElement!=null){this.dragElement.style.visibility="hidden"}mxEvent.consume(t)};mxDragSource.prototype.mouseUp=function(t){if(this.currentGraph!=null){if(this.currentPoint!=null&&(this.previewElement==null||this.previewElement.style.visibility!="hidden")){var e=this.currentGraph.view.scale;var i=this.currentGraph.view.translate;var n=this.currentPoint.x/e-i.x;var r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph);this.currentGraph=null}this.stopDrag();this.removeListeners();mxEvent.consume(t)};mxDragSource.prototype.removeListeners=function(){if(this.eventSource!=null){mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler);this.eventSource=null}mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);this.mouseMoveHandler=null;this.mouseUpHandler=null};mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=true;t.isMouseTrigger=mxEvent.isMouseEvent(e);this.previewElement=this.createPreviewElement(t);if(this.previewElement!=null&&this.checkEventSource&&mxClient.IS_SVG){this.previewElement.style.pointerEvents="none"}if(this.isGuidesEnabled()&&this.previewElement!=null){this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())}if(this.highlightDropTargets){this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)}t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)};mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null;this.currentPoint=null;t.isMouseDown=false;t.removeListener(this.eventConsumer);if(this.previewElement!=null){if(this.previewElement.parentNode!=null){this.previewElement.parentNode.removeChild(this.previewElement)}this.previewElement=null}if(this.currentGuide!=null){this.currentGuide.destroy();this.currentGuide=null}if(this.currentHighlight!=null){this.currentHighlight.destroy();this.currentHighlight=null}};mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container);var n=mxUtils.getScrollOrigin(t.container);var r=mxEvent.getClientX(e)-i.x+n.x-t.panDx;var s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(this.autoscroll==null||this.autoscroll)){t.scrollPointToVisible(r,s,t.autoExtend)}if(this.currentHighlight!=null&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var l=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(l)}if(this.previewElement!=null){if(this.previewElement.parentNode==null){t.container.appendChild(this.previewElement);this.previewElement.style.zIndex="3";this.previewElement.style.position="absolute"}var a=this.isGridEnabled()&&t.isGridEnabledEvent(e);var o=true;if(this.currentGuide!=null&&this.currentGuide.isEnabledForEvent(e)){var h=parseInt(this.previewElement.style.width);var u=parseInt(this.previewElement.style.height);var d=new mxRectangle(0,0,h,u);var p=new mxPoint(r,s);p=this.currentGuide.move(d,p,a,true);o=false;r=p.x;s=p.y}else if(a){var m=t.view.scale;var c=t.view.translate;var x=t.gridSize/2;r=(t.snap(r/m-c.x-x)+c.x)*m;s=(t.snap(s/m-c.y-x)+c.y)*m}if(this.currentGuide!=null&&o){this.currentGuide.hide()}if(this.previewOffset!=null){r+=this.previewOffset.x;s+=this.previewOffset.y}this.previewElement.style.left=Math.round(r)+"px";this.previewElement.style.top=Math.round(s)+"px";this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(r,s)};mxDragSource.prototype.drop=function(t,e,i,n,r){this.dropHandler.apply(this,arguments);if(t.container.style.visibility!="hidden"){t.container.focus()}};__mxOutput.mxDragSource=typeof mxDragSource!=="undefined"?mxDragSource:undefined;function mxToolbar(t){this.container=t}mxToolbar.prototype=new mxEventSource;mxToolbar.prototype.constructor=mxToolbar;mxToolbar.prototype.container=null;mxToolbar.prototype.enabled=true;mxToolbar.prototype.noReset=false;mxToolbar.prototype.updateDefaultMode=true;mxToolbar.prototype.addItem=function(t,e,i,n,r,s){var l=document.createElement(e!=null?"img":"button");var a=r||(s!=null?"mxToolbarMode":"mxToolbarItem");l.className=a;l.setAttribute("src",e);if(t!=null){if(e!=null){l.setAttribute("title",t)}else{mxUtils.write(l,t)}}this.container.appendChild(l);if(i!=null){mxEvent.addListener(l,"click",i);if(mxClient.IS_TOUCH){mxEvent.addListener(l,"touchend",i)}}var o=mxUtils.bind(this,(function(t){if(n!=null){l.setAttribute("src",e)}else{l.style.backgroundColor=""}}));mxEvent.addGestureListeners(l,mxUtils.bind(this,(function(t){if(n!=null){l.setAttribute("src",n)}else{l.style.backgroundColor="gray"}if(s!=null){if(this.menu==null){this.menu=new mxPopupMenu;this.menu.init()}var e=this.currentImg;if(this.menu.isMenuShowing()){this.menu.hideMenu()}if(e!=l){this.currentImg=l;this.menu.factoryMethod=s;var i=new mxPoint(l.offsetLeft,l.offsetTop+l.offsetHeight);this.menu.popup(i.x,i.y,null,t);if(this.menu.isMenuShowing()){l.className=a+"Selected";this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this);l.className=a;this.currentImg=null}}}}})),null,o);mxEvent.addListener(l,"mouseout",o);return l};mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline";e.className="mxToolbarComboContainer";var i=document.createElement("select");i.className=t||"mxToolbarCombo";e.appendChild(i);this.container.appendChild(e);return i};mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");i.className=e||"mxToolbarCombo";this.addOption(i,t,null);mxEvent.addListener(i,"change",(function(t){var e=i.options[i.selectedIndex];i.selectedIndex=0;if(e.funct!=null){e.funct(t)}}));this.container.appendChild(i);return i};mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");mxUtils.writeln(n,e);if(typeof i=="function"){n.funct=i}else{n.setAttribute("value",i)}t.appendChild(n);return n};mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");s.initialClassName=r||"mxToolbarMode";s.className=s.initialClassName;s.setAttribute("src",e);s.altIcon=n;if(t!=null){s.setAttribute("title",t)}mxEvent.addListener(s,"click",mxUtils.bind(this,(function(t){var e=this.selectedMode.altIcon;if(e!=null){this.selectedMode.altIcon=this.selectedMode.getAttribute("src");this.selectedMode.setAttribute("src",e)}else{this.selectedMode.className=this.selectedMode.initialClassName}if(this.updateDefaultMode){this.defaultMode=s}this.selectedMode=s;var e=s.altIcon;if(e!=null){s.altIcon=s.getAttribute("src");s.setAttribute("src",e)}else{s.className=s.initialClassName+"Selected"}this.fireEvent(new mxEventObject(mxEvent.SELECT));i()})));this.container.appendChild(s);if(this.defaultMode==null){this.defaultMode=s;this.selectMode(s);i()}return s};mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=s!=null?s:true;var l=document.createElement(e!=null?"img":"button");l.initialClassName=r||"mxToolbarMode";l.className=l.initialClassName;l.setAttribute("src",e);l.altIcon=n;if(t!=null){l.setAttribute("title",t)}if(this.enabled&&s){mxEvent.addListener(l,"click",mxUtils.bind(this,(function(t){this.selectMode(l,i);this.noReset=false})));mxEvent.addListener(l,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(l,i);this.noReset=true})));if(this.defaultMode==null){this.defaultMode=l;this.defaultFunction=i;this.selectMode(l,i)}}this.container.appendChild(l);return l};mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){if(this.selectedMode!=null){var i=this.selectedMode.altIcon;if(i!=null){this.selectedMode.altIcon=this.selectedMode.getAttribute("src");this.selectedMode.setAttribute("src",i)}else{this.selectedMode.className=this.selectedMode.initialClassName}}this.selectedMode=t;var i=this.selectedMode.altIcon;if(i!=null){this.selectedMode.altIcon=this.selectedMode.getAttribute("src");this.selectedMode.setAttribute("src",i)}else{this.selectedMode.className=this.selectedMode.initialClassName+"Selected"}this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}};mxToolbar.prototype.resetMode=function(t){if((t||!this.noReset)&&this.selectedMode!=this.defaultMode){this.selectMode(this.defaultMode,this.defaultFunction)}};mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)};mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)};mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px";t.setAttribute("size","1");this.container.appendChild(t)};mxToolbar.prototype.destroy=function(){mxEvent.release(this.container);this.container=null;this.defaultMode=null;this.defaultFunction=null;this.selectedMode=null;if(this.menu!=null){this.menu.destroy()}};__mxOutput.mxToolbar=typeof mxToolbar!=="undefined"?mxToolbar:undefined;function mxUndoableEdit(t,e){this.source=t;this.changes=[];this.significant=e!=null?e:true}mxUndoableEdit.prototype.source=null;mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=false;mxUndoableEdit.prototype.redone=false;mxUndoableEdit.prototype.isEmpty=function(){return this.changes.length==0};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(t){this.changes.push(t)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){};mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));var t=this.changes.length;for(var e=t-1;e>=0;e--){var i=this.changes[e];if(i.execute!=null){i.execute()}else if(i.undo!=null){i.undo()}this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}this.undone=true;this.redone=false;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));var t=this.changes.length;for(var e=0;e<t;e++){var i=this.changes[e];if(i.execute!=null){i.execute()}else if(i.redo!=null){i.redo()}this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}this.undone=false;this.redone=true;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};__mxOutput.mxUndoableEdit=typeof mxUndoableEdit!=="undefined"?mxUndoableEdit:undefined;function mxUndoManager(t){this.size=t!=null?t:100;this.clear()}mxUndoManager.prototype=new mxEventSource;mxUndoManager.prototype.constructor=mxUndoManager;mxUndoManager.prototype.size=null;mxUndoManager.prototype.history=null;mxUndoManager.prototype.indexOfNextAdd=0;mxUndoManager.prototype.isEmpty=function(){return this.history.length==0};mxUndoManager.prototype.clear=function(){this.history=[];this.indexOfNextAdd=0;this.fireEvent(new mxEventObject(mxEvent.CLEAR))};mxUndoManager.prototype.canUndo=function(){return this.indexOfNextAdd>0};mxUndoManager.prototype.undo=function(){while(this.indexOfNextAdd>0){var t=this.history[--this.indexOfNextAdd];t.undo();if(t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}};mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length};mxUndoManager.prototype.redo=function(){var t=this.history.length;while(this.indexOfNextAdd<t){var e=this.history[this.indexOfNextAdd++];e.redo();if(e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",e));break}}};mxUndoManager.prototype.undoableEditHappened=function(t){this.trim();if(this.size>0&&this.size==this.history.length){this.history.shift()}this.history.push(t);this.indexOfNextAdd=this.history.length;this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))};mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd){var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd);for(var e=0;e<t.length;e++){t[e].die()}}};__mxOutput.mxUndoManager=typeof mxUndoManager!=="undefined"?mxUndoManager:undefined;var mxUrlConverter=function(){};mxUrlConverter.prototype.enabled=true;mxUrlConverter.prototype.baseUrl=null;mxUrlConverter.prototype.baseDomain=null;mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host;this.baseUrl=this.baseDomain+location.pathname;var t=this.baseUrl.lastIndexOf("/");if(t>0){this.baseUrl=this.baseUrl.substring(0,t+1)}};mxUrlConverter.prototype.isEnabled=function(){return this.enabled};mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t};mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl};mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t};mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain};mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t};mxUrlConverter.prototype.isRelativeUrl=function(t){return t!=null&&t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"};mxUrlConverter.prototype.convert=function(t){if(this.isEnabled()&&this.isRelativeUrl(t)){if(this.getBaseUrl()==null){this.updateBaseUrl()}if(t.charAt(0)=="/"){t=this.getBaseDomain()+t}else{t=this.getBaseUrl()+t}}return t};__mxOutput.mxUrlConverter=typeof mxUrlConverter!=="undefined"?mxUrlConverter:undefined;function mxPanningManager(t){this.thread=null;this.active=false;this.tdx=0;this.tdy=0;this.t0x=0;this.t0y=0;this.dx=0;this.dy=0;this.scrollbars=false;this.scrollLeft=0;this.scrollTop=0;this.mouseListener={mouseDown:function(t,e){},mouseMove:function(t,e){},mouseUp:mxUtils.bind(this,(function(t,e){if(this.active){this.stop()}}))};t.addMouseListener(this.mouseListener);this.mouseUpListener=mxUtils.bind(this,(function(){if(this.active){this.stop()}}));mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,(function(){this.scrollbars=mxUtils.hasScrollbars(t.container);this.scrollLeft=t.container.scrollLeft;this.scrollTop=t.container.scrollTop;return window.setInterval(mxUtils.bind(this,(function(){this.tdx-=this.dx;this.tdy-=this.dy;if(this.scrollbars){var e=-t.container.scrollLeft-Math.ceil(this.dx);var i=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(e,i);t.panDx=this.scrollLeft-t.container.scrollLeft;t.panDy=this.scrollTop-t.container.scrollTop;t.fireEvent(new mxEventObject(mxEvent.PAN))}else{t.panGraph(this.getDx(),this.getDy())}})),this.delay)}));this.isActive=function(){return active};this.getDx=function(){return Math.round(this.tdx)};this.getDy=function(){return Math.round(this.tdy)};this.start=function(){this.t0x=t.view.translate.x;this.t0y=t.view.translate.y;this.active=true};this.panTo=function(i,n,r,s){if(!this.active){this.start()}this.scrollLeft=t.container.scrollLeft;this.scrollTop=t.container.scrollTop;r=r!=null?r:0;s=s!=null?s:0;var l=t.container;this.dx=i+r-l.scrollLeft-l.clientWidth;if(this.dx<0&&Math.abs(this.dx)<this.border){this.dx=this.border+this.dx}else if(this.handleMouseOut){this.dx=Math.max(this.dx,0)}else{this.dx=0}if(this.dx==0){this.dx=i-l.scrollLeft;if(this.dx>0&&this.dx<this.border){this.dx=this.dx-this.border}else if(this.handleMouseOut){this.dx=Math.min(0,this.dx)}else{this.dx=0}}this.dy=n+s-l.scrollTop-l.clientHeight;if(this.dy<0&&Math.abs(this.dy)<this.border){this.dy=this.border+this.dy}else if(this.handleMouseOut){this.dy=Math.max(this.dy,0)}else{this.dy=0}if(this.dy==0){this.dy=n-l.scrollTop;if(this.dy>0&&this.dy<this.border){this.dy=this.dy-this.border}else if(this.handleMouseOut){this.dy=Math.min(0,this.dy)}else{this.dy=0}}if(this.dx!=0||this.dy!=0){this.dx*=this.damper;this.dy*=this.damper;if(this.thread==null){this.thread=e()}}else if(this.thread!=null){window.clearInterval(this.thread);this.thread=null}};this.stop=function(){if(this.active){this.active=false;if(this.thread!=null){window.clearInterval(this.thread);this.thread=null}this.tdx=0;this.tdy=0;if(!this.scrollbars){var e=t.panDx;var i=t.panDy;if(e!=0||i!=0){t.panGraph(0,0);t.view.setTranslate(this.t0x+e/t.view.scale,this.t0y+i/t.view.scale)}}else{t.panDx=0;t.panDy=0;t.fireEvent(new mxEventObject(mxEvent.PAN))}}};this.destroy=function(){t.removeMouseListener(this.mouseListener);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}mxPanningManager.prototype.damper=1/6;mxPanningManager.prototype.delay=10;mxPanningManager.prototype.handleMouseOut=true;mxPanningManager.prototype.border=0;__mxOutput.mxPanningManager=typeof mxPanningManager!=="undefined"?mxPanningManager:undefined;function mxPopupMenu(t){this.factoryMethod=t;if(t!=null){this.init()}}mxPopupMenu.prototype=new mxEventSource;mxPopupMenu.prototype.constructor=mxPopupMenu;mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif";mxPopupMenu.prototype.zIndex=10006;mxPopupMenu.prototype.factoryMethod=null;mxPopupMenu.prototype.useLeftButtonForPopup=false;mxPopupMenu.prototype.enabled=true;mxPopupMenu.prototype.itemCount=0;mxPopupMenu.prototype.autoExpand=false;mxPopupMenu.prototype.smartSeparators=false;mxPopupMenu.prototype.labels=true;mxPopupMenu.prototype.init=function(){this.table=document.createElement("table");this.table.className="mxPopupMenu";this.tbody=document.createElement("tbody");this.table.appendChild(this.tbody);this.div=document.createElement("div");this.div.className="mxPopupMenu";this.div.style.display="inline";this.div.style.zIndex=this.zIndex;this.div.appendChild(this.table);mxEvent.disableContextMenu(this.div)};mxPopupMenu.prototype.isEnabled=function(){return this.enabled};mxPopupMenu.prototype.setEnabled=function(t){this.enabled=t};mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())};mxPopupMenu.prototype.addItem=function(t,e,i,n,r,s,l,a){n=n||this;this.itemCount++;if(n.willAddSeparator){if(n.containsItems){this.addSeparator(n,true)}n.willAddSeparator=false}n.containsItems=true;var o=document.createElement("tr");o.className="mxPopupMenuItem";var h=document.createElement("td");h.className="mxPopupMenuIcon";if(e!=null){var u=document.createElement("img");u.src=e;h.appendChild(u)}else if(r!=null){var d=document.createElement("div");d.className=r;h.appendChild(d)}o.appendChild(h);if(this.labels){var p=document.createElement("td");p.className="mxPopupMenuItem"+(s!=null&&!s?" mxDisabled":"");mxUtils.write(p,t);p.align="left";o.appendChild(p);var m=document.createElement("td");m.className="mxPopupMenuItem"+(s!=null&&!s?" mxDisabled":"");m.style.paddingRight="6px";m.style.textAlign="right";o.appendChild(m);if(n.div==null){this.createSubmenu(n)}}n.tbody.appendChild(o);if(l!=false&&s!=false){var c=null;mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){this.eventReceiver=o;if(n.activeRow!=o&&n.activeRow!=n){if(n.activeRow!=null&&n.activeRow.div.parentNode!=null){this.hideSubmenu(n)}if(o.div!=null){this.showSubmenu(n,o);n.activeRow=o}}if(document.selection!=null&&(mxClient.IS_QUIRKS||document.documentMode==8)){c=document.selection.createRange()}mxEvent.consume(t)})),mxUtils.bind(this,(function(t){if(n.activeRow!=o&&n.activeRow!=n){if(n.activeRow!=null&&n.activeRow.div.parentNode!=null){this.hideSubmenu(n)}if(this.autoExpand&&o.div!=null){this.showSubmenu(n,o);n.activeRow=o}}if(!a){o.className="mxPopupMenuItemHover"}})),mxUtils.bind(this,(function(t){if(this.eventReceiver==o){if(n.activeRow!=o){this.hideMenu()}if(c!=null){try{c.select()}catch(e){}c=null}if(i!=null){i(t)}}this.eventReceiver=null;mxEvent.consume(t)})));if(!a){mxEvent.addListener(o,"mouseout",mxUtils.bind(this,(function(t){o.className="mxPopupMenuItem"})))}}return o};mxPopupMenu.prototype.addCheckmark=function(t,e){var i=t.firstChild.nextSibling;i.style.backgroundImage="url('"+e+"')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="2px 50%"};mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table");t.table.className="mxPopupMenu";t.tbody=document.createElement("tbody");t.table.appendChild(t.tbody);t.div=document.createElement("div");t.div.className="mxPopupMenu";t.div.style.position="absolute";t.div.style.display="inline";t.div.style.zIndex=this.zIndex;t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage);td=t.firstChild.nextSibling.nextSibling;td.appendChild(e)};mxPopupMenu.prototype.showSubmenu=function(t,e){if(e.div!=null){e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px";e.div.style.top=t.div.offsetTop+e.offsetTop+"px";document.body.appendChild(e.div);var i=parseInt(e.div.offsetLeft);var n=parseInt(e.div.offsetWidth);var r=mxUtils.getDocumentScrollOrigin(document);var s=document.body;var l=document.documentElement;var a=r.x+(s.clientWidth||l.clientWidth);if(i+n>a){e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"}mxUtils.fit(e.div)}};mxPopupMenu.prototype.addSeparator=function(t,e){t=t||this;if(this.smartSeparators&&!e){t.willAddSeparator=true}else if(t.tbody!=null){t.willAddSeparator=false;var i=document.createElement("tr");var n=document.createElement("td");n.className="mxPopupMenuIcon";n.style.padding="0 0 0 0px";i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px";r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1");r.appendChild(s);i.appendChild(r);t.tbody.appendChild(i)}};mxPopupMenu.prototype.popup=function(t,e,i,n){if(this.div!=null&&this.tbody!=null&&this.factoryMethod!=null){this.div.style.left=t+"px";this.div.style.top=e+"px";while(this.tbody.firstChild!=null){mxEvent.release(this.tbody.firstChild);this.tbody.removeChild(this.tbody.firstChild)}this.itemCount=0;this.factoryMethod(this,i,n);if(this.itemCount>0){this.showMenu();this.fireEvent(new mxEventObject(mxEvent.SHOW))}}};mxPopupMenu.prototype.isMenuShowing=function(){return this.div!=null&&this.div.parentNode==document.body};mxPopupMenu.prototype.showMenu=function(){if(document.documentMode>=9){this.div.style.filter="none"}document.body.appendChild(this.div);mxUtils.fit(this.div)};mxPopupMenu.prototype.hideMenu=function(){if(this.div!=null){if(this.div.parentNode!=null){this.div.parentNode.removeChild(this.div)}this.hideSubmenu(this);this.containsItems=false;this.fireEvent(new mxEventObject(mxEvent.HIDE))}};mxPopupMenu.prototype.hideSubmenu=function(t){if(t.activeRow!=null){this.hideSubmenu(t.activeRow);if(t.activeRow.div.parentNode!=null){t.activeRow.div.parentNode.removeChild(t.activeRow.div)}t.activeRow=null}};mxPopupMenu.prototype.destroy=function(){if(this.div!=null){mxEvent.release(this.div);if(this.div.parentNode!=null){this.div.parentNode.removeChild(this.div)}this.div=null}};__mxOutput.mxPopupMenu=typeof mxPopupMenu!=="undefined"?mxPopupMenu:undefined;function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.graphModelChanged(e.getProperty("edit").changes)}}));this.setGraph(t)}mxAutoSaveManager.prototype=new mxEventSource;mxAutoSaveManager.prototype.constructor=mxAutoSaveManager;mxAutoSaveManager.prototype.graph=null;mxAutoSaveManager.prototype.autoSaveDelay=10;mxAutoSaveManager.prototype.autoSaveThrottle=2;mxAutoSaveManager.prototype.autoSaveThreshold=5;mxAutoSaveManager.prototype.ignoredChanges=0;mxAutoSaveManager.prototype.lastSnapshot=0;mxAutoSaveManager.prototype.enabled=true;mxAutoSaveManager.prototype.changeHandler=null;mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled};mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t};mxAutoSaveManager.prototype.setGraph=function(t){if(this.graph!=null){this.graph.getModel().removeListener(this.changeHandler)}this.graph=t;if(this.graph!=null){this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}};mxAutoSaveManager.prototype.save=function(){};mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=(new Date).getTime();var i=(e-this.lastSnapshot)/1e3;if(i>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&i>this.autoSaveThrottle){this.save();this.reset()}else{this.ignoredChanges++}};mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime();this.ignoredChanges=0};mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)};__mxOutput.mxAutoSaveManager=typeof mxAutoSaveManager!=="undefined"?mxAutoSaveManager:undefined;function mxAnimation(t){this.delay=t!=null?t:20}mxAnimation.prototype=new mxEventSource;mxAnimation.prototype.constructor=mxAnimation;mxAnimation.prototype.delay=null;mxAnimation.prototype.thread=null;mxAnimation.prototype.isRunning=function(){return this.thread!=null};mxAnimation.prototype.startAnimation=function(){if(this.thread==null){this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay)}};mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))};mxAnimation.prototype.stopAnimation=function(){if(this.thread!=null){window.clearInterval(this.thread);this.thread=null;this.fireEvent(new mxEventObject(mxEvent.DONE))}};__mxOutput.mxAnimation=typeof mxAnimation!=="undefined"?mxAnimation:undefined;function mxMorphing(t,e,i,n){mxAnimation.call(this,n);this.graph=t;this.steps=e!=null?e:6;this.ease=i!=null?i:1.5}mxMorphing.prototype=new mxAnimation;mxMorphing.prototype.constructor=mxMorphing;mxMorphing.prototype.graph=null;mxMorphing.prototype.steps=null;mxMorphing.prototype.step=0;mxMorphing.prototype.ease=null;mxMorphing.prototype.cells=null;mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(this.cells!=null){for(var e=0;e<this.cells.length;e++){this.animateCell(this.cells[e],t,false)}}else{this.animateCell(this.graph.getModel().getRoot(),t,true)}this.show(t);if(t.isEmpty()||this.step++>=this.steps){this.stopAnimation()}};mxMorphing.prototype.show=function(t){t.show()};mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t);var r=null;if(n!=null){r=this.getDelta(n);if(this.graph.getModel().isVertex(t)&&(r.x!=0||r.y!=0)){var s=this.graph.view.getTranslate();var l=this.graph.view.getScale();r.x+=s.x*l;r.y+=s.y*l;e.moveState(n,-r.x/this.ease,-r.y/this.ease)}}if(i&&!this.stopRecursion(n,r)){var a=this.graph.getModel().getChildCount(t);for(var o=0;o<a;o++){this.animateCell(this.graph.getModel().getChildAt(t,o),e,i)}}};mxMorphing.prototype.stopRecursion=function(t,e){return e!=null&&(e.x!=0||e.y!=0)};mxMorphing.prototype.getDelta=function(t){var e=this.getOriginForCell(t.cell);var i=this.graph.getView().getTranslate();var n=this.graph.getView().getScale();var r=t.x/n-i.x;var s=t.y/n-i.y;return new mxPoint((e.x-r)*n,(e.y-s)*n)};mxMorphing.prototype.getOriginForCell=function(t){var e=null;if(t!=null){var i=this.graph.getModel().getParent(t);var n=this.graph.getCellGeometry(t);e=this.getOriginForCell(i);if(n!=null){if(n.relative){var r=this.graph.getCellGeometry(i);if(r!=null){e.x+=n.x*r.width;e.y+=n.y*r.height}}else{e.x+=n.x;e.y+=n.y}}}if(e==null){var s=this.graph.view.getTranslate();e=new mxPoint(-s.x,-s.y)}return e};__mxOutput.mxMorphing=typeof mxMorphing!=="undefined"?mxMorphing:undefined;function mxImageBundle(t){this.images=[];this.alt=t!=null?t:false}mxImageBundle.prototype.images=null;mxImageBundle.prototype.alt=null;mxImageBundle.prototype.putImage=function(t,e,i){this.images[t]={value:e,fallback:i}};mxImageBundle.prototype.getImage=function(t){var e=null;if(t!=null){var i=this.images[t];if(i!=null){e=this.alt?i.fallback:i.value}}return e};__mxOutput.mxImageBundle=typeof mxImageBundle!=="undefined"?mxImageBundle:undefined;function mxImageExport(){}mxImageExport.prototype.includeOverlays=false;mxImageExport.prototype.drawState=function(t,e){if(t!=null){this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawCellState.apply(this,arguments)})));if(this.includeOverlays){this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawOverlays.apply(this,arguments)})))}}};mxImageExport.prototype.visitStatesRecursive=function(t,e,i){if(t!=null){i(t,e);var n=t.view.graph;var r=n.model.getChildCount(t.cell);for(var s=0;s<r;s++){var l=n.view.getState(n.model.getChildAt(t.cell,s));this.visitStatesRecursive(l,e,i)}}};mxImageExport.prototype.getLinkForCellState=function(t,e){return null};mxImageExport.prototype.drawCellState=function(t,e){var i=this.getLinkForCellState(t,e);if(i!=null){e.setLink(i)}this.drawShape(t,e);this.drawText(t,e);if(i!=null){e.setLink(null)}};mxImageExport.prototype.drawShape=function(t,e){if(t.shape instanceof mxShape&&t.shape.checkBounds()){e.save();t.shape.beforePaint(e);t.shape.paint(e);t.shape.afterPaint(e);e.restore()}};mxImageExport.prototype.drawText=function(t,e){if(t.text!=null&&t.text.checkBounds()){e.save();t.text.beforePaint(e);t.text.paint(e);t.text.afterPaint(e);e.restore()}};mxImageExport.prototype.drawOverlays=function(t,e){if(t.overlays!=null){t.overlays.visit((function(t,i){if(i instanceof mxShape){i.paint(e)}}))}};__mxOutput.mxImageExport=typeof mxImageExport!=="undefined"?mxImageExport:undefined;function mxAbstractCanvas2D(){this.converter=this.createUrlConverter();this.reset()}mxAbstractCanvas2D.prototype.state=null;mxAbstractCanvas2D.prototype.states=null;mxAbstractCanvas2D.prototype.path=null;mxAbstractCanvas2D.prototype.rotateHtml=true;mxAbstractCanvas2D.prototype.lastX=0;mxAbstractCanvas2D.prototype.lastY=0;mxAbstractCanvas2D.prototype.moveOp="M";mxAbstractCanvas2D.prototype.lineOp="L";mxAbstractCanvas2D.prototype.quadOp="Q";mxAbstractCanvas2D.prototype.curveOp="C";mxAbstractCanvas2D.prototype.closeOp="Z";mxAbstractCanvas2D.prototype.pointerEvents=false;mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter};mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState();this.states=[]};mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:false,dashPattern:"3 3",fixDash:false,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:false,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}};mxAbstractCanvas2D.prototype.format=function(t){return Math.round(parseFloat(t))};mxAbstractCanvas2D.prototype.addOp=function(){if(this.path!=null){this.path.push(arguments[0]);if(arguments.length>2){var t=this.state;for(var e=2;e<arguments.length;e+=2){this.lastX=arguments[e-1];this.lastY=arguments[e];this.path.push(this.format((this.lastX+t.dx)*t.scale));this.path.push(this.format((this.lastY+t.dy)*t.scale))}}}};mxAbstractCanvas2D.prototype.rotatePoint=function(t,e,i,n,r){var s=i*(Math.PI/180);return mxUtils.getRotatedPoint(new mxPoint(t,e),Math.cos(s),Math.sin(s),new mxPoint(n,r))};mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state)};mxAbstractCanvas2D.prototype.restore=function(){if(this.states.length>0){this.state=this.states.pop()}};mxAbstractCanvas2D.prototype.setLink=function(t){};mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t;this.state.strokeWidth*=t};mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t;this.state.dy+=e};mxAbstractCanvas2D.prototype.rotate=function(t,e,i,n,r){};mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t};mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t};mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t};mxAbstractCanvas2D.prototype.setFillColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fillColor=t;this.state.gradientColor=null};mxAbstractCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,l,a,o){var h=this.state;h.fillColor=t;h.gradientFillAlpha=a!=null?a:1;h.gradientColor=e;h.gradientAlpha=o!=null?o:1;h.gradientDirection=l};mxAbstractCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE){t=null}this.state.strokeColor=t};mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t};mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t;this.state.fixDash=e};mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t};mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t};mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t};mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t};mxAbstractCanvas2D.prototype.setFontColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fontColor=t};mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fontBackgroundColor=t};mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fontBorderColor=t};mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)};mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t};mxAbstractCanvas2D.prototype.setFontStyle=function(t){if(t==null){t=0}this.state.fontStyle=t};mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t};mxAbstractCanvas2D.prototype.setShadowColor=function(t){if(t==mxConstants.NONE){t=null}this.state.shadowColor=t};mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t};mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t;this.state.shadowDy=e};mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0;this.lastY=0;this.path=[]};mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)};mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)};mxAbstractCanvas2D.prototype.quadTo=function(t,e,i,n){this.addOp(this.quadOp,t,e,i,n)};mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)};mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,l){var a=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,l);if(a!=null){for(var o=0;o<a.length;o+=6){this.curveTo(a[o],a[o+1],a[o+2],a[o+3],a[o+4],a[o+5])}}};mxAbstractCanvas2D.prototype.close=function(t,e,i,n,r,s){this.addOp(this.closeOp)};mxAbstractCanvas2D.prototype.end=function(){};__mxOutput.mxAbstractCanvas2D=typeof mxAbstractCanvas2D!=="undefined"?mxAbstractCanvas2D:undefined;function mxXmlCanvas2D(t){mxAbstractCanvas2D.call(this);this.root=t;this.writeDefaults()}mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D);mxXmlCanvas2D.prototype.textEnabled=true;mxXmlCanvas2D.prototype.compressed=true;mxXmlCanvas2D.prototype.writeDefaults=function(){var t;t=this.createElement("fontfamily");t.setAttribute("family",mxConstants.DEFAULT_FONTFAMILY);this.root.appendChild(t);t=this.createElement("fontsize");t.setAttribute("size",mxConstants.DEFAULT_FONTSIZE);this.root.appendChild(t);t=this.createElement("shadowcolor");t.setAttribute("color",mxConstants.SHADOWCOLOR);this.root.appendChild(t);t=this.createElement("shadowalpha");t.setAttribute("alpha",mxConstants.SHADOW_OPACITY);this.root.appendChild(t);t=this.createElement("shadowoffset");t.setAttribute("dx",mxConstants.SHADOW_OFFSET_X);t.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y);this.root.appendChild(t)};mxXmlCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))};mxXmlCanvas2D.prototype.createElement=function(t){return this.root.ownerDocument.createElement(t)};mxXmlCanvas2D.prototype.save=function(){if(this.compressed){mxAbstractCanvas2D.prototype.save.apply(this,arguments)}this.root.appendChild(this.createElement("save"))};mxXmlCanvas2D.prototype.restore=function(){if(this.compressed){mxAbstractCanvas2D.prototype.restore.apply(this,arguments)}this.root.appendChild(this.createElement("restore"))};mxXmlCanvas2D.prototype.scale=function(t){var e=this.createElement("scale");e.setAttribute("scale",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.translate=function(t,e){var i=this.createElement("translate");i.setAttribute("dx",this.format(t));i.setAttribute("dy",this.format(e));this.root.appendChild(i)};mxXmlCanvas2D.prototype.rotate=function(t,e,i,n,r){var s=this.createElement("rotate");if(t!=0||e||i){s.setAttribute("theta",this.format(t));s.setAttribute("flipH",e?"1":"0");s.setAttribute("flipV",i?"1":"0");s.setAttribute("cx",this.format(n));s.setAttribute("cy",this.format(r));this.root.appendChild(s)}};mxXmlCanvas2D.prototype.setAlpha=function(t){if(this.compressed){if(this.state.alpha==t){return}mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var e=this.createElement("alpha");e.setAttribute("alpha",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setFillAlpha=function(t){if(this.compressed){if(this.state.fillAlpha==t){return}mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var e=this.createElement("fillalpha");e.setAttribute("alpha",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setStrokeAlpha=function(t){if(this.compressed){if(this.state.strokeAlpha==t){return}mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var e=this.createElement("strokealpha");e.setAttribute("alpha",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setFillColor=function(t){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fillColor==t){return}mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var e=this.createElement("fillcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,l,a,o){if(t!=null&&e!=null){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var h=this.createElement("gradient");h.setAttribute("c1",t);h.setAttribute("c2",e);h.setAttribute("x",this.format(i));h.setAttribute("y",this.format(n));h.setAttribute("w",this.format(r));h.setAttribute("h",this.format(s));if(l!=null){h.setAttribute("direction",l)}if(a!=null){h.setAttribute("alpha1",a)}if(o!=null){h.setAttribute("alpha2",o)}this.root.appendChild(h)}};mxXmlCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.strokeColor==t){return}mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var e=this.createElement("strokecolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setStrokeWidth=function(t){if(this.compressed){if(this.state.strokeWidth==t){return}mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var e=this.createElement("strokewidth");e.setAttribute("width",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setDashed=function(t,e){if(this.compressed){if(this.state.dashed==t){return}mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var i=this.createElement("dashed");i.setAttribute("dashed",t?"1":"0");if(e!=null){i.setAttribute("fixDash",e?"1":"0")}this.root.appendChild(i)};mxXmlCanvas2D.prototype.setDashPattern=function(t){if(this.compressed){if(this.state.dashPattern==t){return}mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var e=this.createElement("dashpattern");e.setAttribute("pattern",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setLineCap=function(t){if(this.compressed){if(this.state.lineCap==t){return}mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var e=this.createElement("linecap");e.setAttribute("cap",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setLineJoin=function(t){if(this.compressed){if(this.state.lineJoin==t){return}mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var e=this.createElement("linejoin");e.setAttribute("join",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setMiterLimit=function(t){if(this.compressed){if(this.state.miterLimit==t){return}mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var e=this.createElement("miterlimit");e.setAttribute("limit",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setFontColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fontColor==t){return}mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var e=this.createElement("fontcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontBackgroundColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fontBackgroundColor==t){return}mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var e=this.createElement("fontbackgroundcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontBorderColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fontBorderColor==t){return}mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var e=this.createElement("fontbordercolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontSize=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==t){return}mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var e=this.createElement("fontsize");e.setAttribute("size",t);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontFamily=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==t){return}mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var e=this.createElement("fontfamily");e.setAttribute("family",t);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontStyle=function(t){if(this.textEnabled){if(t==null){t=0}if(this.compressed){if(this.state.fontStyle==t){return}mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var e=this.createElement("fontstyle");e.setAttribute("style",t);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setShadow=function(t){if(this.compressed){if(this.state.shadow==t){return}mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var e=this.createElement("shadow");e.setAttribute("enabled",t?"1":"0");this.root.appendChild(e)};mxXmlCanvas2D.prototype.setShadowColor=function(t){if(this.compressed){if(t==mxConstants.NONE){t=null}if(this.state.shadowColor==t){return}mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var e=this.createElement("shadowcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setShadowAlpha=function(t){if(this.compressed){if(this.state.shadowAlpha==t){return}mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var e=this.createElement("shadowalpha");e.setAttribute("alpha",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setShadowOffset=function(t,e){if(this.compressed){if(this.state.shadowDx==t&&this.state.shadowDy==e){return}mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var i=this.createElement("shadowoffset");i.setAttribute("dx",t);i.setAttribute("dy",e);this.root.appendChild(i)};mxXmlCanvas2D.prototype.rect=function(t,e,i,n){var r=this.createElement("rect");r.setAttribute("x",this.format(t));r.setAttribute("y",this.format(e));r.setAttribute("w",this.format(i));r.setAttribute("h",this.format(n));this.root.appendChild(r)};mxXmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){var l=this.createElement("roundrect");l.setAttribute("x",this.format(t));l.setAttribute("y",this.format(e));l.setAttribute("w",this.format(i));l.setAttribute("h",this.format(n));l.setAttribute("dx",this.format(r));l.setAttribute("dy",this.format(s));this.root.appendChild(l)};mxXmlCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.createElement("ellipse");r.setAttribute("x",this.format(t));r.setAttribute("y",this.format(e));r.setAttribute("w",this.format(i));r.setAttribute("h",this.format(n));this.root.appendChild(r)};mxXmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r);var o=this.createElement("image");o.setAttribute("x",this.format(t));o.setAttribute("y",this.format(e));o.setAttribute("w",this.format(i));o.setAttribute("h",this.format(n));o.setAttribute("src",r);o.setAttribute("aspect",s?"1":"0");o.setAttribute("flipH",l?"1":"0");o.setAttribute("flipV",a?"1":"0");this.root.appendChild(o)};mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastX=0;this.lastY=0};mxXmlCanvas2D.prototype.moveTo=function(t,e){var i=this.createElement("move");i.setAttribute("x",this.format(t));i.setAttribute("y",this.format(e));this.root.appendChild(i);this.lastX=t;this.lastY=e};mxXmlCanvas2D.prototype.lineTo=function(t,e){var i=this.createElement("line");i.setAttribute("x",this.format(t));i.setAttribute("y",this.format(e));this.root.appendChild(i);this.lastX=t;this.lastY=e};mxXmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.createElement("quad");r.setAttribute("x1",this.format(t));r.setAttribute("y1",this.format(e));r.setAttribute("x2",this.format(i));r.setAttribute("y2",this.format(n));this.root.appendChild(r);this.lastX=i;this.lastY=n};mxXmlCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){var l=this.createElement("curve");l.setAttribute("x1",this.format(t));l.setAttribute("y1",this.format(e));l.setAttribute("x2",this.format(i));l.setAttribute("y2",this.format(n));l.setAttribute("x3",this.format(r));l.setAttribute("y3",this.format(s));this.root.appendChild(l);this.lastX=r;this.lastY=s};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};mxXmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,h,u,d,p){if(this.textEnabled&&r!=null){if(mxUtils.isNode(r)){r=mxUtils.getOuterHtml(r)}var m=this.createElement("text");m.setAttribute("x",this.format(t));m.setAttribute("y",this.format(e));m.setAttribute("w",this.format(i));m.setAttribute("h",this.format(n));m.setAttribute("str",r);if(s!=null){m.setAttribute("align",s)}if(l!=null){m.setAttribute("valign",l)}m.setAttribute("wrap",a?"1":"0");if(o==null){o=""}m.setAttribute("format",o);if(h!=null){m.setAttribute("overflow",h)}if(u!=null){m.setAttribute("clip",u?"1":"0")}if(d!=null){m.setAttribute("rotation",d)}if(p!=null){m.setAttribute("dir",p)}this.root.appendChild(m)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};__mxOutput.mxXmlCanvas2D=typeof mxXmlCanvas2D!=="undefined"?mxXmlCanvas2D:undefined;function mxSvgCanvas2D(t,e){mxAbstractCanvas2D.call(this);this.root=t;this.gradients=[];this.defs=null;this.styleEnabled=e!=null?e:false;var i=null;if(t.ownerDocument!=document){var n=t;while(n!=null&&n.nodeName!="svg"){n=n.parentNode}i=n}if(i!=null){var r=i.getElementsByTagName("defs");if(r.length>0){this.defs=i.getElementsByTagName("defs")[0]}if(this.defs==null){this.defs=this.createElement("defs");if(i.firstChild!=null){i.insertBefore(this.defs,i.firstChild)}else{i.appendChild(this.defs)}}if(this.styleEnabled){this.defs.appendChild(this.createStyle())}}}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&typeof DOMParser==="function"&&typeof XMLSerializer==="function";if(mxSvgCanvas2D.prototype.useDomParser){try{var t=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=t!=null}catch(e){mxSvgCanvas2D.prototype.useDomParser=false}}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&document.getElementsByTagName("base").length>0})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=true;mxSvgCanvas2D.prototype.textEnabled=true;mxSvgCanvas2D.prototype.foEnabled=true;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.cacheOffsetSize=true;mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))};mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href;var e=t.lastIndexOf("#");if(e>0){t=t.substring(0,e)}return t};mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments);this.gradients=[]};mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");e.setAttribute("type","text/css");mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}");return e};mxSvgCanvas2D.prototype.createElement=function(t,e){if(this.root.ownerDocument.createElementNS!=null){return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t)}else{var i=this.root.ownerDocument.createElement(t);if(e!=null){i.setAttribute("xmlns",e)}return i}};mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,l,a,o,h,u,d,p){return s!=null?this.foAltText:null};mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,l,a,o,h,u,d,p){var m=this.getAlternateText(t,e,i,n,r,s,l,a,o,h,u,d,p);var c=this.state;if(m!=null&&c.fontSize>0){var x=a==mxConstants.ALIGN_TOP?1:a==mxConstants.ALIGN_BOTTOM?0:.3;var f=l==mxConstants.ALIGN_RIGHT?"end":l==mxConstants.ALIGN_LEFT?"start":"middle";var g=this.createElement("text");g.setAttribute("x",Math.round(e+c.dx));g.setAttribute("y",Math.round(i+c.dy+x*c.fontSize));g.setAttribute("fill",c.fontColor||"black");g.setAttribute("font-family",c.fontFamily);g.setAttribute("font-size",Math.round(c.fontSize)+"px");if(f!="start"){g.setAttribute("text-anchor",f)}if((c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){g.setAttribute("font-weight","bold")}if((c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){g.setAttribute("font-style","italic")}var v=[];if((c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){v.push("underline")}if((c.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){v.push("line-through")}if(v.length>0){g.setAttribute("text-decoration",v.join(" "))}mxUtils.write(g,m);return g}else{return null}};mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){if(t.charAt(0)=="#"){t=t.substring(1)}if(e.charAt(0)=="#"){e=e.substring(1)}t=t.toLowerCase()+"-"+i;e=e.toLowerCase()+"-"+n;var s=null;if(r==null||r==mxConstants.DIRECTION_SOUTH){s="s"}else if(r==mxConstants.DIRECTION_EAST){s="e"}else{var l=t;t=e;e=l;if(r==mxConstants.DIRECTION_NORTH){s="s"}else if(r==mxConstants.DIRECTION_WEST){s="e"}}return"mx-gradient-"+t+"-"+e+"-"+s};mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r);var l=this.gradients[s];if(l==null){var a=this.root.ownerSVGElement;var o=0;var h=s+"-"+o;if(a!=null){l=a.ownerDocument.getElementById(h);while(l!=null&&l.ownerSVGElement!=a){h=s+"-"+o++;l=a.ownerDocument.getElementById(h)}}else{h="id"+ ++this.refCount}if(l==null){l=this.createSvgGradient(t,e,i,n,r);l.setAttribute("id",h);if(this.defs!=null){this.defs.appendChild(l)}else{a.appendChild(l)}}this.gradients[s]=l}return l.getAttribute("id")};mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%");s.setAttribute("y1","0%");s.setAttribute("x2","0%");s.setAttribute("y2","0%");if(r==null||r==mxConstants.DIRECTION_SOUTH){s.setAttribute("y2","100%")}else if(r==mxConstants.DIRECTION_EAST){s.setAttribute("x2","100%")}else if(r==mxConstants.DIRECTION_NORTH){s.setAttribute("y1","100%")}else if(r==mxConstants.DIRECTION_WEST){s.setAttribute("x1","100%")}var l=i<1?";stop-opacity:"+i:"";var a=this.createElement("stop");a.setAttribute("offset","0%");a.setAttribute("style","stop-color:"+t+l);s.appendChild(a);l=n<1?";stop-opacity:"+n:"";a=this.createElement("stop");a.setAttribute("offset","100%");a.setAttribute("style","stop-color:"+e+l);s.appendChild(a);return s};mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node;var n=this.state;if(i!=null){if(i.nodeName=="path"){if(this.path!=null&&this.path.length>0){i.setAttribute("d",this.path.join(" "))}else{return}}if(t&&n.fillColor!=null){this.updateFill()}else if(!this.styleEnabled){if(i.nodeName=="ellipse"&&mxClient.IS_FF){i.setAttribute("fill","transparent")}else{i.setAttribute("fill","none")}t=false}if(e&&n.strokeColor!=null){this.updateStroke()}else if(!this.styleEnabled){i.setAttribute("stroke","none")}if(n.transform!=null&&n.transform.length>0){i.setAttribute("transform",n.transform)}if(n.shadow){this.root.appendChild(this.createShadow(i))}if(this.strokeTolerance>0&&!t){this.root.appendChild(this.createTolerance(i))}if(this.pointerEvents){i.setAttribute("pointer-events",this.pointerEventsValue)}else if(!this.pointerEvents&&this.originalRoot==null){i.setAttribute("pointer-events","none")}if(i.nodeName!="rect"&&i.nodeName!="path"&&i.nodeName!="ellipse"||i.getAttribute("fill")!="none"&&i.getAttribute("fill")!="transparent"||i.getAttribute("stroke")!="none"||i.getAttribute("pointer-events")!="none"){this.root.appendChild(i)}this.node=null}};mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if(t.alpha<1||t.fillAlpha<1){this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha)}if(t.fillColor!=null){if(t.gradientColor!=null){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}else{this.node.setAttribute("fill","url(#"+e+")")}}else{this.node.setAttribute("fill",String(t.fillColor).toLowerCase())}}};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase());if(t.alpha<1||t.strokeAlpha<1){this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha)}var e=this.getCurrentStrokeWidth();if(e!=1){this.node.setAttribute("stroke-width",e)}if(this.node.nodeName=="path"){this.updateStrokeAttributes()}if(t.dashed){this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))}};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(t.lineJoin!=null&&t.lineJoin!="miter"){this.node.setAttribute("stroke-linejoin",t.lineJoin)}if(t.lineCap!=null){var e=t.lineCap;if(e=="flat"){e="butt"}if(e!="butt"){this.node.setAttribute("stroke-linecap",e)}}if(t.miterLimit!=null&&(!this.styleEnabled||t.miterLimit!=10)){this.node.setAttribute("stroke-miterlimit",t.miterLimit)}};mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if(typeof this.state.dashPattern==="string"){var i=this.state.dashPattern.split(" ");if(i.length>0){for(var n=0;n<i.length;n++){e[n]=Number(i[n])*t}}}return e.join(" ")};mxSvgCanvas2D.prototype.createTolerance=function(t){var e=t.cloneNode(true);var i=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;e.setAttribute("pointer-events","stroke");e.setAttribute("visibility","hidden");e.removeAttribute("stroke-dasharray");e.setAttribute("stroke-width",i);e.setAttribute("fill","none");e.setAttribute("stroke",mxClient.IS_OT?"none":"white");return e};mxSvgCanvas2D.prototype.createShadow=function(t){var e=t.cloneNode(true);var i=this.state;if(e.getAttribute("fill")!="none"&&(!mxClient.IS_FF||e.getAttribute("fill")!="transparent")){e.setAttribute("fill",i.shadowColor)}if(e.getAttribute("stroke")!="none"){e.setAttribute("stroke",i.shadowColor)}e.setAttribute("transform","translate("+this.format(i.shadowDx*i.scale)+","+this.format(i.shadowDy*i.scale)+")"+(i.transform||""));e.setAttribute("opacity",i.shadowAlpha);return e};mxSvgCanvas2D.prototype.setLink=function(t){if(t==null){this.root=this.originalRoot}else{this.originalRoot=this.root;var e=this.createElement("a");if(e.setAttributeNS==null||this.root.ownerDocument!=document&&document.documentMode==null){e.setAttribute("xlink:href",t)}else{e.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",t)}this.root.appendChild(e);this.root=e}};mxSvgCanvas2D.prototype.rotate=function(t,e,i,n,r){if(t!=0||e||i){var s=this.state;n+=s.dx;r+=s.dy;n*=s.scale;r*=s.scale;s.transform=s.transform||"";if(e&&i){t+=180}else if(e!=i){var l=e?n:0;var a=e?-1:1;var o=i?r:0;var h=i?-1:1;s.transform+="translate("+this.format(l)+","+this.format(o)+")"+"scale("+this.format(a)+","+this.format(h)+")"+"translate("+this.format(-l)+","+this.format(-o)+")"}if(e?!i:i){t*=-1}if(t!=0){s.transform+="rotate("+this.format(t)+","+this.format(n)+","+this.format(r)+")"}s.rotation=s.rotation+t;s.rotationCx=n;s.rotationCy=r}};mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createElement("path")};mxSvgCanvas2D.prototype.rect=function(t,e,i,n){var r=this.state;var s=this.createElement("rect");s.setAttribute("x",this.format((t+r.dx)*r.scale));s.setAttribute("y",this.format((e+r.dy)*r.scale));s.setAttribute("width",this.format(i*r.scale));s.setAttribute("height",this.format(n*r.scale));this.node=s};mxSvgCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.rect(t,e,i,n);if(r>0){this.node.setAttribute("rx",this.format(r*this.state.scale))}if(s>0){this.node.setAttribute("ry",this.format(s*this.state.scale))}};mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state;var s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale));s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale));s.setAttribute("rx",i/2*r.scale);s.setAttribute("ry",n/2*r.scale);this.node=s};mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r);s=s!=null?s:true;l=l!=null?l:false;a=a!=null?a:false;var o=this.state;t+=o.dx;e+=o.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*o.scale)+this.imageOffset);h.setAttribute("y",this.format(e*o.scale)+this.imageOffset);h.setAttribute("width",this.format(i*o.scale));h.setAttribute("height",this.format(n*o.scale));if(h.setAttributeNS==null){h.setAttribute("xlink:href",r)}else{h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r)}if(!s){h.setAttribute("preserveAspectRatio","none")}if(o.alpha<1||o.fillAlpha<1){h.setAttribute("opacity",o.alpha*o.fillAlpha)}var u=this.state.transform||"";if(l||a){var d=1;var p=1;var m=0;var c=0;if(l){d=-1;m=-i-2*t}if(a){p=-1;c=-n-2*e}u+="scale("+d+","+p+")translate("+m*o.scale+","+c*o.scale+")"}if(u.length>0){h.setAttribute("transform",u)}if(!this.pointerEvents){h.setAttribute("pointer-events","none")}this.root.appendChild(h)};mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");if(e!=null){t=(new XMLSerializer).serializeToString(e.body);if(t.substring(0,5)=="<body"){t=t.substring(t.indexOf(">",5)+1)}if(t.substring(t.length-7,t.length)=="</body>"){t=t.substring(0,t.length-7)}}}else if(document.implementation!=null&&document.implementation.createDocument!=null){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);var n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;var s=r.firstChild;while(s!=null){var l=s.nextSibling;n.appendChild(i.adoptNode(s));s=l}return n.innerHTML}else{var a=document.createElement("textarea");a.innerHTML=t.replace(/&amp;/g,"&amp;amp;").replace(/&#60;/g,"&amp;lt;").replace(/&#62;/g,"&amp;gt;").replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;");t=a.value.replace(/&/g,"&amp;").replace(/&amp;lt;/g,"&lt;").replace(/&amp;gt;/g,"&gt;").replace(/&amp;amp;/g,"&amp;").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return t};mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(!mxUtils.isNode(e)){e="<div><div>"+this.convertHtml(e)+"</div></div>"}if(!mxClient.IS_IE&&!mxClient.IS_IE11&&document.createElementNS){var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div");var r=n.cloneNode(false);if(this.root.ownerDocument!=document){n.appendChild(e.cloneNode(true))}else{n.appendChild(e)}r.appendChild(n);i.appendChild(r)}else{i.innerHTML=e}return i}else{if(mxUtils.isNode(e)){e="<div><div>"+mxUtils.getXml(e)+"</div></div>"}e='<div xmlns="http://www.w3.org/1999/xhtml">'+e+"</div>";return mxUtils.parseXml(e).documentElement}};mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,l,a,o,h,u){if(u!=null&&u.firstChild!=null&&u.firstChild.firstChild!=null){this.updateTextNodes(t,e,i,n,r,s,l,a,o,h,u.firstChild)}};mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,l,a,o,h,u,d,p,m,c){var x=this.createElement("g");var f=this.createElement("foreignObject");f.setAttribute("style","overflow: visible; text-align: left;");f.setAttribute("pointer-events","none");if(m.ownerDocument!=document){m=mxUtils.importNodeImplementation(f.ownerDocument,m,true)}f.appendChild(m);x.appendChild(f);this.updateTextNodes(t,e,i,n,s,l,a,h,u,d,x);if(this.root.ownerDocument!=document){var g=this.createAlternateContent(f,t,e,i,n,r,s,l,a,o,h,u,d);if(g!=null){f.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var v=this.createElement("switch");v.appendChild(f);v.appendChild(g);x.appendChild(v)}}c.appendChild(x)};mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,l,a,o,h,u){var d=this.state.scale;mxSvgCanvas2D.createCss(i+2,n,r,s,l,a,o,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; "+"justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),d,mxUtils.bind(this,(function(i,n,r,s,l){t+=this.state.dx;e+=this.state.dy;var a=u.firstChild;var o=a.firstChild;var p=o.firstChild;var m=p.firstChild;var c=(this.rotateHtml?this.state.rotation:0)+(h!=null?h:0);var x=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(d!=1?"scale("+d+")":"");m.setAttribute("style",l);p.setAttribute("style",s);a.setAttribute("width",Math.ceil(1/Math.min(1,d)*100)+"%");a.setAttribute("height",Math.ceil(1/Math.min(1,d)*100)+"%");var f=Math.round(e+n);if(f<0){a.setAttribute("y",f)}else{a.removeAttribute("y");r+="padding-top: "+f+"px; "}o.setAttribute("style",r+"margin-left: "+Math.round(t+i)+"px;");x+=c!=0?"rotate("+c+" "+t+" "+e+")":"";if(x!=""){u.setAttribute("transform",x)}else{u.removeAttribute("transform")}if(this.state.alpha!=1){u.setAttribute("opacity",this.state.alpha)}else{u.removeAttribute("opacity")}})))};mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,l,a,o,h,u,d,p){var m="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ";var c=mxUtils.getAlignmentAsPoint(i,n);var x="overflow: hidden; ";var f="width: 1px; ";var g="height: 1px; ";var v=c.x*t;var y=c.y*e;if(l){f="width: "+Math.round(t)+"px; ";m+="max-height: "+Math.round(e)+"px; ";y=0}else if(s=="fill"){f="width: "+Math.round(t)+"px; ";g="height: "+Math.round(e)+"px; ";u+="width: 100%; height: 100%; ";m+=f+g}else if(s=="width"){f="width: "+Math.round(t)+"px; ";u+="width: 100%; ";m+=f;y=0;if(e>0){m+="max-height: "+Math.round(e)+"px; "}}else{x="";y=0}var C="";if(a!=null){C+="background-color: "+a+"; "}if(o!=null){C+="border: 1px solid "+o+"; "}if(x==""||l){u+=C}else{m+=C}if(r&&t>0){u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ";f="width: "+Math.round(t)+"px; ";if(x!=""&&s!="fill"){y=0}}else{u+="white-space: nowrap; ";if(x==""){v=0}}p(v,y,h+f+g,m+x,u,x)};mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state;var e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection;var i="display: inline-block; font-size: "+t.fontSize+"px; "+"font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";if((t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){i+="font-weight: bold; "}if((t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){i+="font-style: italic; "}var n=[];if((t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){n.push("underline")}if((t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){n.push("line-through")}if(n.length>0){i+="text-decoration: "+n.join(" ")+"; "}return i};mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,h,u,d,p){if(this.textEnabled&&r!=null){d=d!=null?d:0;if(this.foEnabled&&o=="html"){var m=this.createDiv(r);if(m!=null){if(p!=null){m.setAttribute("dir",p)}this.addForeignObject(t,e,i,n,r,s,l,a,o,h,u,d,p,m,this.root)}}else{this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,l,a,h,u,d,p)}}};mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){t=Math.round(t);e=Math.round(e);i=Math.round(i);n=Math.round(n);var r="mx-clip-"+t+"-"+e+"-"+i+"-"+n;var s=0;var l=r+"-"+s;while(document.getElementById(l)!=null){l=r+"-"+ ++s}clip=this.createElement("clipPath");clip.setAttribute("id",l);var a=this.createElement("rect");a.setAttribute("x",t);a.setAttribute("y",e);a.setAttribute("width",i);a.setAttribute("height",n);clip.appendChild(a);return clip};mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,h,u,d){u=u!=null?u:0;var p=this.state;var m=p.fontSize;var c=this.createElement("g");var x=p.transform||"";this.updateFont(c);if(!this.pointerEvents&&this.originalRoot==null){c.setAttribute("pointer-events","none")}if(u!=0){x+="rotate("+u+","+this.format(t*p.scale)+","+this.format(e*p.scale)+")"}if(d!=null){c.setAttribute("direction",d)}if(h&&i>0&&n>0){var f=t;var g=e;if(s==mxConstants.ALIGN_CENTER){f-=i/2}else if(s==mxConstants.ALIGN_RIGHT){f-=i}if(o!="fill"){if(l==mxConstants.ALIGN_MIDDLE){g-=n/2}else if(l==mxConstants.ALIGN_BOTTOM){g-=n}}var v=this.createClip(f*p.scale-2,g*p.scale-2,i*p.scale+4,n*p.scale+4);if(this.defs!=null){this.defs.appendChild(v)}else{this.root.appendChild(v)}if(!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var y=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c.setAttribute("clip-path","url("+y+"#"+v.getAttribute("id")+")")}else{c.setAttribute("clip-path","url(#"+v.getAttribute("id")+")")}}var C=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";if(C!="start"){c.setAttribute("text-anchor",C)}if(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE){c.setAttribute("font-size",m*p.scale+"px")}if(x.length>0){c.setAttribute("transform",x)}if(p.alpha<1){c.setAttribute("opacity",p.alpha)}var E=r.split("\n");var S=Math.round(m*mxConstants.LINE_HEIGHT);var b=m+(E.length-1)*S;var g=e+m-1;if(l==mxConstants.ALIGN_MIDDLE){if(o=="fill"){g-=n/2}else{var w=(this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b)/2;g-=w}}else if(l==mxConstants.ALIGN_BOTTOM){if(o=="fill"){g-=n}else{var w=this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b;g-=w+1}}for(var T=0;T<E.length;T++){if(E[T].length>0&&mxUtils.trim(E[T]).length>0){var L=this.createElement("text");L.setAttribute("x",this.format(t*p.scale)+this.textOffset);L.setAttribute("y",this.format(g*p.scale)+this.textOffset);mxUtils.write(L,E[T]);c.appendChild(L)}g+=S}this.root.appendChild(c);this.addTextBackground(c,r,t,e,i,o=="fill"?n:b,s,l,o)};mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor);if(!this.styleEnabled||e.fontFamily!=mxConstants.DEFAULT_FONTFAMILY){t.setAttribute("font-family",e.fontFamily)}if((e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){t.setAttribute("font-weight","bold")}if((e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){t.setAttribute("font-style","italic")}var i=[];if((e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){i.push("underline")}if((e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){i.push("line-through")}if(i.length>0){t.setAttribute("text-decoration",i.join(" "))}};mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,l,a,o){var h=this.state;if(h.fontBackgroundColor!=null||h.fontBorderColor!=null){var u=null;if(o=="fill"||o=="width"){if(l==mxConstants.ALIGN_CENTER){i-=r/2}else if(l==mxConstants.ALIGN_RIGHT){i-=r}if(a==mxConstants.ALIGN_MIDDLE){n-=s/2}else if(a==mxConstants.ALIGN_BOTTOM){n-=s}u=new mxRectangle((i+1)*h.scale,n*h.scale,(r-2)*h.scale,(s+2)*h.scale)}else if(t.getBBox!=null&&this.root.ownerDocument==document){try{u=t.getBBox();var d=mxClient.IS_IE&&mxClient.IS_SVG;u=new mxRectangle(u.x,u.y+(d?0:1),u.width,u.height+(d?1:0))}catch(x){}}if(u==null||u.width==0||u.height==0){var p=document.createElement("div");p.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;p.style.fontSize=h.fontSize+"px";p.style.fontFamily=h.fontFamily;p.style.whiteSpace="nowrap";p.style.position="absolute";p.style.visibility="hidden";p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";p.style.zoom="1";if((h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){p.style.fontWeight="bold"}if((h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){p.style.fontStyle="italic"}e=mxUtils.htmlEntities(e,false);p.innerHTML=e.replace(/\n/g,"<br/>");document.body.appendChild(p);var r=p.offsetWidth;var s=p.offsetHeight;p.parentNode.removeChild(p);if(l==mxConstants.ALIGN_CENTER){i-=r/2}else if(l==mxConstants.ALIGN_RIGHT){i-=r}if(a==mxConstants.ALIGN_MIDDLE){n-=s/2}else if(a==mxConstants.ALIGN_BOTTOM){n-=s}u=new mxRectangle((i+1)*h.scale,(n+2)*h.scale,r*h.scale,(s+1)*h.scale)}if(u!=null){var m=this.createElement("rect");m.setAttribute("fill",h.fontBackgroundColor||"none");m.setAttribute("stroke",h.fontBorderColor||"none");m.setAttribute("x",Math.floor(u.x-1));m.setAttribute("y",Math.floor(u.y-1));m.setAttribute("width",Math.ceil(u.width+2));m.setAttribute("height",Math.ceil(u.height));var c=h.fontBorderColor!=null?Math.max(1,this.format(h.scale)):0;m.setAttribute("stroke-width",c);if(this.root.ownerDocument==document&&mxUtils.mod(c,2)==1){m.setAttribute("transform","translate(0.5, 0.5)")}t.insertBefore(m,t.firstChild)}}};mxSvgCanvas2D.prototype.stroke=function(){this.addNode(false,true)};mxSvgCanvas2D.prototype.fill=function(){this.addNode(true,false)};mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(true,true)};__mxOutput.mxSvgCanvas2D=typeof mxSvgCanvas2D!=="undefined"?mxSvgCanvas2D:undefined;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this);this.root=t};mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D);mxVmlCanvas2D.prototype.node=null;mxVmlCanvas2D.prototype.textEnabled=true;mxVmlCanvas2D.prototype.moveOp="m";mxVmlCanvas2D.prototype.lineOp="l";mxVmlCanvas2D.prototype.curveOp="c";mxVmlCanvas2D.prototype.closeOp="x";mxVmlCanvas2D.prototype.rotatedHtmlBackground="";mxVmlCanvas2D.prototype.vmlScale=1;mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)};mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)};mxVmlCanvas2D.prototype.addNode=function(t,e){var i=this.node;var n=this.state;if(i!=null){if(i.nodeName=="shape"){if(this.path!=null&&this.path.length>0){i.path=this.path.join(" ")+" e";i.style.width=this.root.style.width;i.style.height=this.root.style.height;i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height)}else{return}}i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px";if(n.shadow){this.root.appendChild(this.createShadow(i,t&&n.fillColor!=null,e&&n.strokeColor!=null))}if(e&&n.strokeColor!=null){i.stroked="true";i.strokecolor=n.strokeColor}else{i.stroked="false"}i.appendChild(this.createStroke());if(t&&n.fillColor!=null){i.appendChild(this.createFill())}else if(this.pointerEvents&&(i.nodeName!="shape"||this.path[this.path.length-1]==this.closeOp)){i.appendChild(this.createTransparentFill())}else{i.filled="false"}this.root.appendChild(i)}};mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");t.src=mxClient.imageBasePath+"/transparent.gif";t.type="tile";return t};mxVmlCanvas2D.prototype.createFill=function(){var t=this.state;var e=this.createVmlElement("fill");e.color=t.fillColor;if(t.gradientColor!=null){e.type="gradient";e.method="none";e.color2=t.gradientColor;var i=180-t.rotation;if(t.gradientDirection==mxConstants.DIRECTION_WEST){i-=90+(this.root.style.flip=="x"?180:0)}else if(t.gradientDirection==mxConstants.DIRECTION_EAST){i+=90+(this.root.style.flip=="x"?180:0)}else if(t.gradientDirection==mxConstants.DIRECTION_NORTH){i-=180+(this.root.style.flip=="y"?-180:0)}else{i+=this.root.style.flip=="y"?-180:0}if(this.root.style.flip=="x"||this.root.style.flip=="y"){i*=-1}e.angle=mxUtils.mod(i,360);e.opacity=t.alpha*t.gradientFillAlpha*100+"%";e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else if(t.alpha<1||t.fillAlpha<1){e.opacity=t.alpha*t.fillAlpha*100+"%"}return e};mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state;var e=this.createVmlElement("stroke");e.endcap=t.lineCap||"flat";e.joinstyle=t.lineJoin||"miter";e.miterlimit=t.miterLimit||"10";if(t.alpha<1||t.strokeAlpha<1){e.opacity=t.alpha*t.strokeAlpha*100+"%"}if(t.dashed){e.dashstyle=this.getVmlDashStyle()}return e};mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if(typeof this.state.dashPattern==="string"){var e=this.state.dashPattern.split(" ");if(e.length>0&&e[0]==1){t="0 2"}}return t};mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state;var r=-n.rotation*(Math.PI/180);var s=Math.cos(r);var l=Math.sin(r);var a=n.shadowDx*n.scale;var o=n.shadowDy*n.scale;if(this.root.style.flip=="x"){a*=-1}else if(this.root.style.flip=="y"){o*=-1}var h=t.cloneNode(true);h.style.marginLeft=Math.round(a*s-o*l)+"px";h.style.marginTop=Math.round(a*l+o*s)+"px";if(document.documentMode==8){h.strokeweight=t.strokeweight;if(t.nodeName=="shape"){h.path=this.path.join(" ")+" e";h.style.width=this.root.style.width;h.style.height=this.root.style.height;h.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height)}}if(i){h.strokecolor=n.shadowColor;h.appendChild(this.createShadowStroke())}else{h.stroked="false"}if(e){h.appendChild(this.createShadowFill())}else{h.filled="false"}return h};mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");t.color=this.state.shadowColor;t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%";return t};mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%";return t};mxVmlCanvas2D.prototype.rotate=function(t,e,i,n,r){if(e&&i){t+=180}else if(e){this.root.style.flip="x"}else if(i){this.root.style.flip="y"}if(e?!i:i){t*=-1}this.root.style.rotation=t;this.state.rotation=this.state.rotation+t;this.state.rotationCx=n;this.state.rotationCy=r};mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createVmlElement("shape");this.node.style.position="absolute"};mxVmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.state;var s=(this.lastX+r.dx)*r.scale;var l=(this.lastY+r.dy)*r.scale;var a=(t+r.dx)*r.scale;var o=(e+r.dy)*r.scale;var h=(i+r.dx)*r.scale;var u=(n+r.dy)*r.scale;var d=s+2/3*(a-s);var p=l+2/3*(o-l);var m=h+2/3*(a-h);var c=u+2/3*(o-u);this.path.push("c "+this.format(d)+" "+this.format(p)+" "+this.format(m)+" "+this.format(c)+" "+this.format(h)+" "+this.format(u));this.lastX=h/r.scale-r.dx;this.lastY=u/r.scale-r.dy};mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state;var l=this.createVmlElement(t);l.style.position="absolute";l.style.left=this.format((e+s.dx)*s.scale)+"px";l.style.top=this.format((i+s.dy)*s.scale)+"px";l.style.width=this.format(n*s.scale)+"px";l.style.height=this.format(r*s.scale)+"px";return l};mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)};mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n);this.node.setAttribute("arcsize",Math.max(r*100/i,s*100/n)+"%")};mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)};mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){var o=null;if(!s){o=this.createRect("image",t,e,i,n);o.src=r}else{o=this.createRect("rect",t,e,i,n);o.stroked="false";var h=this.createVmlElement("fill");h.aspect=s?"atmost":"ignore";h.rotate="true";h.type="frame";h.src=r;o.appendChild(h)}if(l&&a){o.style.rotation="180"}else if(l){o.style.flip="x"}else if(a){o.style.flip="y"}if(this.state.alpha<1||this.state.fillAlpha<1){o.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"}this.root.appendChild(o)};mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div");var s=this.state;var l="";if(s.fontBackgroundColor!=null){l+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"}if(s.fontBorderColor!=null){l+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"}if(mxUtils.isNode(t)){r.appendChild(t)}else{if(n!="fill"&&n!="width"){var a=this.createElement("div");a.style.cssText=l;a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a.style.zoom="1";a.style.textDecoration="inherit";a.innerHTML=t;r.appendChild(a)}else{r.style.cssText=l;r.innerHTML=t}}var o=r.style;o.fontSize=s.fontSize/this.vmlScale+"px";o.fontFamily=s.fontFamily;o.color=s.fontColor;o.verticalAlign="top";o.textAlign=e||"left";o.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT;if((s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){o.fontWeight="bold"}if((s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){o.fontStyle="italic"}if((s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){o.textDecoration="underline"}return r};mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,h,u,d,p){if(this.textEnabled&&r!=null){var m=this.state;if(o=="html"){if(m.rotation!=null){var c=this.rotatePoint(t,e,m.rotation,m.rotationCx,m.rotationCy);t=c.x;e=c.y}if(document.documentMode==8&&!mxClient.IS_EM){t+=m.dx;e+=m.dy;if(h!="fill"&&l==mxConstants.ALIGN_TOP){e-=1}}else{t*=m.scale;e*=m.scale}var x=document.documentMode==8&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");x.style.position="absolute";x.style.display="inline";x.style.left=this.format(t)+"px";x.style.top=this.format(e)+"px";x.style.zoom=m.scale;var f=this.createElement("div");f.style.position="relative";f.style.display="inline";var g=mxUtils.getAlignmentAsPoint(s,l);var v=g.x;var y=g.y;var C=this.createDiv(r,s,l,h);var E=this.createElement("div");if(p!=null){C.setAttribute("dir",p)}if(a&&i>0){if(!u){C.style.width=Math.round(i)+"px"}C.style.wordWrap=mxConstants.WORD_WRAP;C.style.whiteSpace="normal";if(C.style.wordWrap=="break-word"){var S=C;if(S.firstChild!=null&&S.firstChild.nodeName=="DIV"){S.firstChild.style.width="100%"}}}else{C.style.whiteSpace="nowrap"}var b=m.rotation+(d||0);if(this.rotateHtml&&b!=0){E.style.display="inline";E.style.zoom="1";E.appendChild(C);if(document.documentMode==8&&!mxClient.IS_EM&&this.root.nodeName!="DIV"){f.appendChild(E);x.appendChild(f)}else{x.appendChild(E)}}else if(document.documentMode==8&&!mxClient.IS_EM){f.appendChild(C);x.appendChild(f)}else{C.style.display="inline";x.appendChild(C)}if(this.root.nodeName!="DIV"){var w=this.createVmlElement("rect");w.stroked="false";w.filled="false";w.appendChild(x);this.root.appendChild(w)}else{this.root.appendChild(x)}if(u){C.style.overflow="hidden";C.style.width=Math.round(i)+"px";if(!mxClient.IS_QUIRKS){C.style.maxHeight=Math.round(n)+"px"}}else if(h=="fill"){C.style.overflow="hidden";C.style.width=Math.max(0,i)+1+"px";C.style.height=Math.max(0,n)+1+"px"}else if(h=="width"){C.style.overflow="hidden";C.style.width=Math.max(0,i)+1+"px";C.style.maxHeight=Math.max(0,n)+1+"px"}if(this.rotateHtml&&b!=0){var T=b*(Math.PI/180);var L=parseFloat(parseFloat(Math.cos(T)).toFixed(8));var A=parseFloat(parseFloat(Math.sin(-T)).toFixed(8));T%=2*Math.PI;if(T<0)T+=2*Math.PI;T%=Math.PI;if(T>Math.PI/2)T=Math.PI-T;var M=Math.cos(T);var _=Math.sin(T);if(document.documentMode==8&&!mxClient.IS_EM){C.style.display="inline-block";E.style.display="inline-block";f.style.display="inline-block"}C.style.visibility="hidden";C.style.position="absolute";document.body.appendChild(C);var I=C;if(I.firstChild!=null&&I.firstChild.nodeName=="DIV"){I=I.firstChild}var S=I.offsetWidth+3;var O=I.offsetHeight;if(u){i=Math.min(i,S);O=Math.min(O,n)}else{i=S}if(a){C.style.width=i+"px"}if(mxClient.IS_QUIRKS&&(u||h=="width")&&O>n){O=n;C.style.height=O+"px"}n=O;var P=(n-n*M+i*-_)/2-A*i*(v+.5)+L*n*(y+.5);var R=(i-i*M+n*-_)/2+L*i*(v+.5)+A*n*(y+.5);if(x.nodeName=="group"&&this.root.nodeName=="DIV"){var H=this.createElement("div");H.style.display="inline-block";H.style.position="absolute";H.style.left=this.format(t+(R-i/2)*m.scale)+"px";H.style.top=this.format(e+(P-n/2)*m.scale)+"px";x.parentNode.appendChild(H);H.appendChild(x)}else{var N=document.documentMode==8&&!mxClient.IS_EM?1:m.scale;x.style.left=this.format(t+(R-i/2)*N)+"px";x.style.top=this.format(e+(P-n/2)*N)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+L+", M12="+A+", M21="+-A+", M22="+L+", sizingMethod='auto expand')";E.style.backgroundColor=this.rotatedHtmlBackground;if(this.state.alpha<1){E.style.filter+="alpha(opacity="+this.state.alpha*100+")"}E.appendChild(C);C.style.position="";C.style.visibility=""}else if(document.documentMode!=8||mxClient.IS_EM){C.style.verticalAlign="top";if(this.state.alpha<1){x.style.filter="alpha(opacity="+this.state.alpha*100+")"}var G=C.parentNode;C.style.visibility="hidden";document.body.appendChild(C);i=C.offsetWidth;var O=C.offsetHeight;if(mxClient.IS_QUIRKS&&u&&O>n){O=n;C.style.height=O+"px"}n=O;C.style.visibility="";G.appendChild(C);x.style.left=this.format(t+i*v*this.state.scale)+"px";x.style.top=this.format(e+n*y*this.state.scale)+"px"}else{if(this.state.alpha<1){C.style.filter="alpha(opacity="+this.state.alpha*100+")"}f.style.left=v*100+"%";f.style.top=y*100+"%"}}else{this.plainText(t,e,i,n,mxUtils.htmlEntities(r,false),s,l,a,o,h,u,d,p)}}};mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,h,u,d,p){var m=this.state;t=(t+m.dx)*m.scale;e=(e+m.dy)*m.scale;var c=this.createVmlElement("shape");c.style.width="1px";c.style.height="1px";c.stroked="false";var x=this.createVmlElement("fill");x.color=m.fontColor;x.opacity=m.alpha*100+"%";c.appendChild(x);var f=this.createVmlElement("path");f.textpathok="true";f.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0);c.appendChild(f);var g=this.createVmlElement("textpath");g.style.cssText="v-text-align:"+s;g.style.align=s;g.style.fontFamily=m.fontFamily;g.string=r;g.on="true";var v=m.fontSize*m.scale/this.vmlScale;g.style.fontSize=v+"px";if((m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){g.style.fontWeight="bold"}if((m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){g.style.fontStyle="italic"}if((m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){g.style.textDecoration="underline"}var y=r.split("\n");var C=v+(y.length-1)*v*mxConstants.LINE_HEIGHT;var E=0;var S=0;if(l==mxConstants.ALIGN_BOTTOM){S=-C/2}else if(l!=mxConstants.ALIGN_MIDDLE){S=C/2}if(d!=null){c.style.rotation=d;var b=d*(Math.PI/180);E=Math.sin(b)*S;S=Math.cos(b)*S}c.appendChild(g);c.style.left=this.format(t-E)+"px";c.style.top=this.format(e+S)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(false,true)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(true,false)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(true,true)};__mxOutput.mxVmlCanvas2D=typeof mxVmlCanvas2D!=="undefined"?mxVmlCanvas2D:undefined;function mxGuide(t,e){this.graph=t;this.setStates(e)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=true;mxGuide.prototype.vertical=true;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null;mxGuide.prototype.rounded=false;mxGuide.prototype.tolerance=2;mxGuide.prototype.setStates=function(t){this.states=t};mxGuide.prototype.isEnabledForEvent=function(t){return true};mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance};mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);e.isDashed=true;return e};mxGuide.prototype.isStateIgnored=function(t){return false};mxGuide.prototype.move=function(t,e,i,n){if(this.states!=null&&(this.horizontal||this.vertical)&&t!=null&&e!=null){var r=this.graph.getView().scale;var s=this.getGuideTolerance(i)*r;var l=t.clone();l.x+=e.x;l.y+=e.y;var a=false;var o=null;var h=null;var u=false;var d=null;var p=null;var m=s;var c=s;var x=l.x;var f=l.x+l.width;var g=l.getCenterX();var v=l.y;var y=l.y+l.height;var C=l.getCenterY();function E(i,n,r){var s=false;if(r&&Math.abs(i-g)<m){e.x=i-t.getCenterX();m=Math.abs(i-g);s=true}else if(!r){if(Math.abs(i-x)<m){e.x=i-t.x;m=Math.abs(i-x);s=true}else if(Math.abs(i-f)<m){e.x=i-t.x-t.width;m=Math.abs(i-f);s=true}}if(s){o=n;h=i;if(this.guideX==null){this.guideX=this.createGuideShape(true);this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.guideX.pointerEvents=false;this.guideX.init(this.graph.getView().getOverlayPane())}}a=a||s}function S(i,n,r){var s=false;if(r&&Math.abs(i-C)<c){e.y=i-t.getCenterY();c=Math.abs(i-C);s=true}else if(!r){if(Math.abs(i-v)<c){e.y=i-t.y;c=Math.abs(i-v);s=true}else if(Math.abs(i-y)<c){e.y=i-t.y-t.height;c=Math.abs(i-y);s=true}}if(s){d=n;p=i;if(this.guideY==null){this.guideY=this.createGuideShape(false);this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.guideY.pointerEvents=false;this.guideY.init(this.graph.getView().getOverlayPane())}}u=u||s}for(var b=0;b<this.states.length;b++){var w=this.states[b];if(w!=null&&!this.isStateIgnored(w)){if(this.horizontal){E.call(this,w.getCenterX(),w,true);E.call(this,w.x,w,false);E.call(this,w.x+w.width,w,false);if(w.cell==null){E.call(this,w.getCenterX(),w,false)}}if(this.vertical){S.call(this,w.getCenterY(),w,true);S.call(this,w.y,w,false);S.call(this,w.y+w.height,w,false);if(w.cell==null){S.call(this,w.getCenterY(),w,false)}}}}this.graph.snapDelta(e,t,!i,a,u);e=this.getDelta(t,o,e.x,d,e.y);var T=this.graph.container;if(!a&&this.guideX!=null){this.guideX.node.style.visibility="hidden"}else if(this.guideX!=null){var L=null;var A=null;if(o!=null&&t!=null){L=Math.min(t.y+e.y-this.graph.panDy,o.y);A=Math.max(t.y+t.height+e.y-this.graph.panDy,o.y+o.height)}if(L!=null&&A!=null){this.guideX.points=[new mxPoint(h,L),new mxPoint(h,A)]}else{this.guideX.points=[new mxPoint(h,-this.graph.panDy),new mxPoint(h,T.scrollHeight-3-this.graph.panDy)]}this.guideX.stroke=this.getGuideColor(o,true);this.guideX.node.style.visibility="visible";this.guideX.redraw()}if(!u&&this.guideY!=null){this.guideY.node.style.visibility="hidden"}else if(this.guideY!=null){var M=null;var _=null;if(d!=null&&t!=null){M=Math.min(t.x+e.x-this.graph.panDx,d.x);_=Math.max(t.x+t.width+e.x-this.graph.panDx,d.x+d.width)}if(M!=null&&_!=null){this.guideY.points=[new mxPoint(M,p),new mxPoint(_,p)]}else{this.guideY.points=[new mxPoint(-this.graph.panDx,p),new mxPoint(T.scrollWidth-3-this.graph.panDx,p)]}this.guideY.stroke=this.getGuideColor(d,false);this.guideY.node.style.visibility="visible";this.guideY.redraw()}}return e};mxGuide.prototype.getDelta=function(t,e,i,n,r){var s=this.graph.view.scale;if(this.rounded||e!=null&&e.cell==null){i=Math.round((t.x+i)/s)*s-t.x}if(this.rounded||n!=null&&n.cell==null){r=Math.round((t.y+r)/s)*s-t.y}return new mxPoint(i,r)};mxGuide.prototype.getGuideColor=function(t,e){return mxConstants.GUIDE_COLOR};mxGuide.prototype.hide=function(){this.setVisible(false)};mxGuide.prototype.setVisible=function(t){if(this.guideX!=null){this.guideX.node.style.visibility=t?"visible":"hidden"}if(this.guideY!=null){this.guideY.node.style.visibility=t?"visible":"hidden"}};mxGuide.prototype.destroy=function(){if(this.guideX!=null){this.guideX.destroy();this.guideX=null}if(this.guideY!=null){this.guideY.destroy();this.guideY=null}};__mxOutput.mxGuide=typeof mxGuide!=="undefined"?mxGuide:undefined;function mxShape(t){this.stencil=t;this.initStyles()}mxShape.prototype.dialect=null;mxShape.prototype.scale=1;mxShape.prototype.antiAlias=true;mxShape.prototype.minSvgStrokeWidth=1;mxShape.prototype.bounds=null;mxShape.prototype.points=null;mxShape.prototype.node=null;mxShape.prototype.state=null;mxShape.prototype.style=null;mxShape.prototype.boundingBox=null;mxShape.prototype.stencil=null;mxShape.prototype.svgStrokeTolerance=8;mxShape.prototype.pointerEvents=true;mxShape.prototype.svgPointerEvents="all";mxShape.prototype.shapePointerEvents=false;mxShape.prototype.stencilPointerEvents=false;mxShape.prototype.vmlScale=1;mxShape.prototype.outline=false;mxShape.prototype.visible=true;mxShape.prototype.useSvgBoundingBox=false;mxShape.prototype.init=function(t){if(this.node==null){this.node=this.create(t);if(t!=null){t.appendChild(this.node)}}};mxShape.prototype.initStyles=function(t){this.strokewidth=1;this.rotation=0;this.opacity=100;this.fillOpacity=100;this.strokeOpacity=100;this.flipH=false;this.flipV=false};mxShape.prototype.isParseVml=function(){return true};mxShape.prototype.isHtmlAllowed=function(){return false};mxShape.prototype.getSvgScreenOffset=function(){var t=this.stencil&&this.stencil.strokewidth!="inherit"?Number(this.stencil.strokewidth):this.strokewidth;return mxUtils.mod(Math.max(1,Math.round(t*this.scale)),2)==1?.5:0};mxShape.prototype.create=function(t){var e=null;if(t!=null&&t.ownerSVGElement!=null){e=this.createSvg(t)}else if(document.documentMode==8||!mxClient.IS_VML||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()){e=this.createHtml(t)}else{e=this.createVml(t)}return e};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createVml=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");t.style.position="absolute";return t};mxShape.prototype.createHtml=function(){var t=document.createElement("div");t.style.position="absolute";return t};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();if(this.visible&&this.checkBounds()){this.node.style.visibility="visible";this.clear();if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML)){this.redrawHtmlShape()}else{this.redrawShape()}this.updateBoundingBox()}else{this.node.style.visibility="hidden";this.boundingBox=null}};mxShape.prototype.clear=function(){if(this.node.ownerSVGElement!=null){while(this.node.lastChild!=null){this.node.removeChild(this.node.lastChild)}}else{this.node.style.cssText="position:absolute;"+(this.cursor!=null?"cursor:"+this.cursor+";":"");this.node.innerHTML=""}};mxShape.prototype.updateBoundsFromPoints=function(){var t=this.points;if(t!=null&&t.length>0&&t[0]!=null){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e<this.points.length;e++){if(t[e]!=null){this.bounds.add(new mxRectangle(Number(t[e].x),Number(t[e].y),1,1))}}}};mxShape.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var i=t;if(e!=mxConstants.DIRECTION_SOUTH&&e!=mxConstants.DIRECTION_NORTH&&this.state!=null&&this.state.text!=null&&this.state.text.isPaintBoundsInverted()){i=i.clone();var n=i.width;i.width=i.height;i.height=n}var r=this.getLabelMargins(i);if(r!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,false)=="1";var l=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,false)=="1";if(this.state!=null&&this.state.text!=null&&this.state.text.isPaintBoundsInverted()){var n=r.x;r.x=r.height;r.height=r.width;r.width=r.y;r.y=n;n=s;s=l;l=n}return mxUtils.getDirectedBounds(t,r,this.style,s,l)}return t};mxShape.prototype.getLabelMargins=function(t){return null};mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0};mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");t.style.position="absolute";t.style.width=this.node.style.width;t.style.height=this.node.style.height;return t};mxShape.prototype.redrawShape=function(){var t=this.createCanvas();if(t!=null){t.pointerEvents=this.pointerEvents;this.beforePaint(t);this.paint(t);this.afterPaint(t);if(this.node!=t.root){this.node.insertAdjacentHTML("beforeend",t.root.outerHTML)}if(this.node.nodeName=="DIV"&&document.documentMode==8){this.node.style.filter="";mxUtils.addTransparentBackgroundFilter(this.node)}this.destroyCanvas(t)}};mxShape.prototype.createCanvas=function(){var t=null;if(this.node.ownerSVGElement!=null){t=this.createSvgCanvas()}else if(mxClient.IS_VML){this.updateVmlContainer();t=this.createVmlCanvas()}if(t!=null&&this.outline){t.setStrokeWidth(this.strokewidth);t.setStrokeColor(this.stroke);if(this.isDashed!=null){t.setDashed(this.isDashed)}t.setStrokeWidth=function(){};t.setStrokeColor=function(){};t.setFillColor=function(){};t.setGradient=function(){};t.setDashed=function(){};t.text=function(){}}return t};mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,false);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0;t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();if(e!=0){this.node.setAttribute("transform","translate("+e+","+e+")")}else{this.node.removeAttribute("transform")}t.minStrokeWidth=this.minSvgStrokeWidth;if(!this.antiAlias){t.format=function(t){return Math.round(parseFloat(t))}}return t};mxShape.prototype.createVmlCanvas=function(){var t=document.documentMode==8&&this.isParseVml()?this.createVmlGroup():this.node;var e=new mxVmlCanvas2D(t,false);if(t.tagUrn!=""){var i=Math.max(1,Math.round(this.bounds.width));var n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale;e.scale(this.vmlScale);e.vmlScale=this.vmlScale}var r=this.scale;e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r));return e};mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width));var e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px";this.node.style.height=e+"px";this.node.style.overflow="visible"};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100){e+="alpha(opacity="+this.opacity+")"}if(this.isShadow){e+="progid:DXImageTransform.Microsoft.dropShadow ("+"OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', "+"OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', "+"Color='"+mxConstants.VML_SHADOWCOLOR+"')"}if(this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill;var n=this.gradient;var r="0";var s={east:0,south:1,west:2,north:3};var l=this.direction!=null?s[this.direction]:0;if(this.gradientDirection!=null){l=mxUtils.mod(l+s[this.gradientDirection]-1,4)}if(l==1){r="1";var a=i;i=n;n=a}else if(l==2){var a=i;i=n;n=a}else if(l==3){r="1"}e+="progid:DXImageTransform.Microsoft.gradient("+"startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e};mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;if(e!=null&&e!=mxConstants.NONE){t.style.borderColor=e;if(this.isDashed){t.style.borderStyle="dashed"}else if(this.strokewidth>0){t.style.borderStyle="solid"}t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"}else{t.style.borderWidth="0px"}e=this.outline?null:this.fill;if(e!=null&&e!=mxConstants.NONE){t.style.backgroundColor=e;t.style.backgroundImage="none"}else if(this.pointerEvents){t.style.backgroundColor="transparent"}else if(document.documentMode==8){mxUtils.addTransparentBackgroundFilter(t)}else{this.setTransparentBackgroundImage(t)}};mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px";t.style.overflow="hidden";t.style.left=Math.round(this.bounds.x-e/2)+"px";t.style.top=Math.round(this.bounds.y-e/2)+"px";if(document.compatMode=="CSS1Compat"){e=-e}t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px";t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"};mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];if(i!=null){i.mxRefCount=(i.mxRefCount||0)+1}}this.releaseSvgGradients(this.oldGradients);this.oldGradients=t.gradients}};mxShape.prototype.beforePaint=function(t){};mxShape.prototype.afterPaint=function(t){};mxShape.prototype.paint=function(t){var e=false;if(t!=null&&this.outline){var i=t.stroke;t.stroke=function(){e=true;i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=true;n.apply(this,arguments)}}var r=this.scale;var s=this.bounds.x/r;var l=this.bounds.y/r;var a=this.bounds.width/r;var o=this.bounds.height/r;if(this.isPaintBoundsInverted()){var h=(a-o)/2;s+=h;l-=h;var u=a;a=o;o=u}this.updateTransform(t,s,l,a,o);this.configureCanvas(t,s,l,a,o);var d=null;if(this.stencil==null&&this.points==null&&this.shapePointerEvents||this.stencil!=null&&this.stencilPointerEvents){var p=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG){d=this.createTransparentSvgRectangle(p.x,p.y,p.width,p.height);this.node.appendChild(d)}else{var m=t.createRect("rect",p.x/r,p.y/r,p.width/r,p.height/r);m.appendChild(t.createTransparentFill());m.stroked="false";t.root.appendChild(m)}}if(this.stencil!=null){this.stencil.drawShape(t,this,s,l,a,o)}else{t.setStrokeWidth(this.strokewidth);if(this.points!=null){var c=[];for(var x=0;x<this.points.length;x++){if(this.points[x]!=null){c.push(new mxPoint(this.points[x].x/r,this.points[x].y/r))}}this.paintEdgeShape(t,c)}else{this.paintVertexShape(t,s,l,a,o)}}if(d!=null&&t.state!=null&&t.state.transform!=null){d.setAttribute("transform",t.state.transform)}if(t!=null&&this.outline&&!e){t.rect(s,l,a,o);t.stroke()}};mxShape.prototype.configureCanvas=function(t,e,i,n,r){var s=null;if(this.style!=null){s=this.style["dashPattern"]}t.setAlpha(this.opacity/100);t.setFillAlpha(this.fillOpacity/100);t.setStrokeAlpha(this.strokeOpacity/100);if(this.isShadow!=null){t.setShadow(this.isShadow)}if(this.isDashed!=null){t.setDashed(this.isDashed,this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,false)==1:false)}if(s!=null){t.setDashPattern(s)}if(this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var l=this.getGradientBounds(t,e,i,n,r);t.setGradient(this.fill,this.gradient,l.x,l.y,l.width,l.height,this.gradientDirection)}else{t.setFillColor(this.fill)}t.setStrokeColor(this.stroke)};mxShape.prototype.getGradientBounds=function(t,e,i,n,r){return new mxRectangle(e,i,n,r)};mxShape.prototype.updateTransform=function(t,e,i,n,r){t.scale(this.scale);t.rotate(this.getShapeRotation(),this.flipH,this.flipV,e+n/2,i+r/2)};mxShape.prototype.paintVertexShape=function(t,e,i,n,r){this.paintBackground(t,e,i,n,r);if(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0){t.setShadow(false);this.paintForeground(t,e,i,n,r)}};mxShape.prototype.paintBackground=function(t,e,i,n,r){};mxShape.prototype.paintForeground=function(t,e,i,n,r){};mxShape.prototype.paintEdgeShape=function(t,e){};mxShape.prototype.getArcSize=function(t,e){var i=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1"){i=Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2))}else{var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;i=Math.min(t*n,e*n)}return i};mxShape.prototype.paintGlassEffect=function(t,e,i,n,r,s){var l=Math.ceil(this.strokewidth/2);var a=.4;t.setGradient("#ffffff","#ffffff",e,i,n,r*.6,"south",.9,.1);t.begin();s+=2*l;if(this.isRounded){t.moveTo(e-l+s,i-l);t.quadTo(e-l,i-l,e-l,i-l+s);t.lineTo(e-l,i+r*a);t.quadTo(e+n*.5,i+r*.7,e+n+l,i+r*a);t.lineTo(e+n+l,i-l+s);t.quadTo(e+n+l,i-l,e+n+l-s,i-l)}else{t.moveTo(e-l,i-l);t.lineTo(e-l,i+r*a);t.quadTo(e+n*.5,i+r*.7,e+n+l,i+r*a);t.lineTo(e+n+l,i-l)}t.close();t.fill()};mxShape.prototype.addPoints=function(t,e,i,n,r,s,l){if(e!=null&&e.length>0){l=l!=null?l:true;var a=e[e.length-1];if(r&&i){e=e.slice();var o=e[0];var h=new mxPoint(a.x+(o.x-a.x)/2,a.y+(o.y-a.y)/2);e.splice(0,0,h)}var u=e[0];var d=1;if(l){t.moveTo(u.x,u.y)}else{t.lineTo(u.x,u.y)}while(d<(r?e.length:e.length-1)){var p=e[mxUtils.mod(d,e.length)];var m=u.x-p.x;var c=u.y-p.y;if(i&&(m!=0||c!=0)&&(s==null||mxUtils.indexOf(s,d-1)<0)){var x=Math.sqrt(m*m+c*c);var f=m*Math.min(n,x/2)/x;var g=c*Math.min(n,x/2)/x;var v=p.x+f;var y=p.y+g;t.lineTo(v,y);var C=e[mxUtils.mod(d+1,e.length)];while(d<e.length-2&&Math.round(C.x-p.x)==0&&Math.round(C.y-p.y)==0){C=e[mxUtils.mod(d+2,e.length)];d++}m=C.x-p.x;c=C.y-p.y;x=Math.max(1,Math.sqrt(m*m+c*c));var E=m*Math.min(n,x/2)/x;var S=c*Math.min(n,x/2)/x;var b=p.x+E;var w=p.y+S;t.quadTo(p.x,p.y,b,w);p=new mxPoint(b,w)}else{t.lineTo(p.x,p.y)}u=p;d++}if(r){t.close()}else{t.lineTo(a.x,a.y)}}};mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};mxShape.prototype.apply=function(t){this.state=t;this.style=t.style;if(this.style!=null){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,this.fillOpacity);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0)==1;this.flipV=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0)==1;if(this.stencil!=null){this.flipH=mxUtils.getValue(this.style,"stencilFlipH",0)==1||this.flipH;this.flipV=mxUtils.getValue(this.style,"stencilFlipV",0)==1||this.flipV}if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var e=this.flipH;this.flipH=this.flipV;this.flipV=e}this.isShadow=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow)==1;this.isDashed=mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed)==1;this.isRounded=mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded)==1;this.glass=mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass)==1;if(this.fill==mxConstants.NONE){this.fill=null}if(this.gradient==mxConstants.NONE){this.gradient=null}if(this.stroke==mxConstants.NONE){this.stroke=null}}};mxShape.prototype.setCursor=function(t){if(t==null){t=""}this.cursor=t;if(this.node!=null){this.node.style.cursor=t}};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return false};mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&this.node!=null&&this.node.ownerSVGElement!=null){try{var t=this.node.getBBox();if(t.width>0&&t.height>0){this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height);this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch(n){}}if(this.bounds!=null){var e=this.createBoundingBox();if(e!=null){this.augmentBoundingBox(e);var i=this.getShapeRotation();if(i!=0){e=mxUtils.getBoundingBox(e,i)}}this.boundingBox=e}};mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();if(this.stencil!=null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted()){t.rotate90()}return t};mxShape.prototype.augmentBoundingBox=function(t){if(this.isShadow){t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale);t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)}t.grow(this.strokewidth*this.scale/2)};mxShape.prototype.isPaintBoundsInverted=function(){return this.stencil==null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)};mxShape.prototype.getRotation=function(){return this.rotation!=null?this.rotation:0};mxShape.prototype.getTextRotation=function(){var t=this.getRotation();if(mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)!=1){t+=mxText.prototype.verticalTextRotation}return t};mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();if(this.direction!=null){if(this.direction==mxConstants.DIRECTION_NORTH){t+=270}else if(this.direction==mxConstants.DIRECTION_WEST){t+=180}else if(this.direction==mxConstants.DIRECTION_SOUTH){t+=90}}return t};mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");r.setAttribute("x",t);r.setAttribute("y",e);r.setAttribute("width",i);r.setAttribute("height",n);r.setAttribute("fill","none");r.setAttribute("stroke","none");r.setAttribute("pointer-events","all");return r};mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"};mxShape.prototype.releaseSvgGradients=function(t){if(t!=null){for(var e in t){var i=t[e];if(i!=null){i.mxRefCount=(i.mxRefCount||0)-1;if(i.mxRefCount==0&&i.parentNode!=null){i.parentNode.removeChild(i)}}}}};mxShape.prototype.destroy=function(){if(this.node!=null){mxEvent.release(this.node);if(this.node.parentNode!=null){this.node.parentNode.removeChild(this.node)}this.node=null}this.releaseSvgGradients(this.oldGradients);this.oldGradients=null};__mxOutput.mxShape=typeof mxShape!=="undefined"?mxShape:undefined;function mxStencil(t){this.desc=t;this.parseDescription();this.parseConstraints()}mxUtils.extend(mxStencil,mxShape);mxStencil.defaultLocalized=false;mxStencil.allowEval=false;mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.prototype.aspect=null;mxStencil.prototype.w0=null;mxStencil.prototype.h0=null;mxStencil.prototype.bgNode=null;mxStencil.prototype.fgNode=null;mxStencil.prototype.strokewidth=null;mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=t!=null?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=e!=null?e:"1"};mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(t!=null){var e=mxUtils.getChildNodes(t);if(e!=null&&e.length>0){this.constraints=[];for(var i=0;i<e.length;i++){this.constraints.push(this.parseConstraint(e[i]))}}}};mxStencil.prototype.parseConstraint=function(t){var e=Number(t.getAttribute("x"));var i=Number(t.getAttribute("y"));var n=t.getAttribute("perimeter")=="1";var r=t.getAttribute("name");return new mxConnectionConstraint(new mxPoint(e,i),n,r)};mxStencil.prototype.evaluateTextAttribute=function(t,e,i){var n=this.evaluateAttribute(t,e,i);var r=t.getAttribute("localized");if(mxStencil.defaultLocalized&&r==null||r=="1"){n=mxResources.get(n)}return n};mxStencil.prototype.evaluateAttribute=function(t,e,i){var n=t.getAttribute(e);if(n==null){var r=mxUtils.getTextContent(t);if(r!=null&&mxStencil.allowEval){var s=mxUtils.eval(r);if(typeof s=="function"){n=s(i)}}}return n};mxStencil.prototype.drawShape=function(t,e,i,n,r,s){var l=t.states.slice();var a=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,null);var o=this.computeAspect(e.style,i,n,r,s,a);var h=Math.min(o.width,o.height);var u=this.strokewidth=="inherit"?Number(mxUtils.getNumber(e.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*h;t.setStrokeWidth(u);if(e.style!=null&&mxUtils.getValue(e.style,mxConstants.STYLE_POINTER_EVENTS,"0")=="1"){t.setStrokeColor(mxConstants.NONE);t.rect(i,n,r,s);t.stroke();t.setStrokeColor(e.stroke)}this.drawChildren(t,e,i,n,r,s,this.bgNode,o,false,true);this.drawChildren(t,e,i,n,r,s,this.fgNode,o,true,!e.outline||e.style==null||mxUtils.getValue(e.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0);if(t.states.length!=l.length){t.states=l}};mxStencil.prototype.drawChildren=function(t,e,i,n,r,s,l,a,o,h){if(l!=null&&r>0&&s>0){var u=l.firstChild;while(u!=null){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){this.drawNode(t,e,u,a,o,h)}u=u.nextSibling}}};mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var l=e;var a=i;var o=n/this.w0;var h=r/this.h0;var u=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(u){h=n/this.h0;o=r/this.w0;var d=(n-r)/2;l+=d;a-=d}if(this.aspect=="fixed"){h=Math.min(o,h);o=h;if(u){l+=(r-this.w0*o)/2;a+=(n-this.h0*h)/2}else{l+=(n-this.w0*o)/2;a+=(r-this.h0*h)/2}}return new mxRectangle(l,a,o,h)};mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var l=i.nodeName;var a=n.x;var o=n.y;var h=n.width;var u=n.height;var d=Math.min(h,u);if(l=="save"){t.save()}else if(l=="restore"){t.restore()}else if(s){if(l=="path"){t.begin();var p=true;if(i.getAttribute("rounded")=="1"){p=false;var m=Number(i.getAttribute("arcSize"));var c=0;var x=[];var f=i.firstChild;while(f!=null){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var g=f.nodeName;if(g=="move"||g=="line"){if(g=="move"||x.length==0){x.push([])}x[x.length-1].push(new mxPoint(a+Number(f.getAttribute("x"))*h,o+Number(f.getAttribute("y"))*u));c++}else{p=true;break}}f=f.nextSibling}if(!p&&c>0){for(var v=0;v<x.length;v++){var y=false,C=x[v][0],E=x[v][x[v].length-1];if(C.x==E.x&&C.y==E.y){x[v].pop();y=true}this.addPoints(t,x[v],true,m,y)}}else{p=true}}if(p){var f=i.firstChild;while(f!=null){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){this.drawNode(t,e,f,n,r,s)}f=f.nextSibling}}}else if(l=="close"){t.close()}else if(l=="move"){t.moveTo(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u)}else if(l=="line"){t.lineTo(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u)}else if(l=="quad"){t.quadTo(a+Number(i.getAttribute("x1"))*h,o+Number(i.getAttribute("y1"))*u,a+Number(i.getAttribute("x2"))*h,o+Number(i.getAttribute("y2"))*u)}else if(l=="curve"){t.curveTo(a+Number(i.getAttribute("x1"))*h,o+Number(i.getAttribute("y1"))*u,a+Number(i.getAttribute("x2"))*h,o+Number(i.getAttribute("y2"))*u,a+Number(i.getAttribute("x3"))*h,o+Number(i.getAttribute("y3"))*u)}else if(l=="arc"){t.arcTo(Number(i.getAttribute("rx"))*h,Number(i.getAttribute("ry"))*u,Number(i.getAttribute("x-axis-rotation")),Number(i.getAttribute("large-arc-flag")),Number(i.getAttribute("sweep-flag")),a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u)}else if(l=="rect"){t.rect(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,Number(i.getAttribute("w"))*h,Number(i.getAttribute("h"))*u)}else if(l=="roundrect"){var S=Number(i.getAttribute("arcsize"));if(S==0){S=mxConstants.RECTANGLE_ROUNDING_FACTOR*100}var b=Number(i.getAttribute("w"))*h;var w=Number(i.getAttribute("h"))*u;var T=Number(S)/100;var L=Math.min(b*T,w*T);t.roundrect(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,b,w,L,L)}else if(l=="ellipse"){t.ellipse(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,Number(i.getAttribute("w"))*h,Number(i.getAttribute("h"))*u)}else if(l=="image"){if(!e.outline){var A=this.evaluateAttribute(i,"src",e);t.image(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,Number(i.getAttribute("w"))*h,Number(i.getAttribute("h"))*u,A,false,i.getAttribute("flipH")=="1",i.getAttribute("flipV")=="1")}}else if(l=="text"){if(!e.outline){var M=this.evaluateTextAttribute(i,"str",e);var _=i.getAttribute("vertical")=="1"?-90:0;if(i.getAttribute("align-shape")=="0"){var I=e.rotation;var O=mxUtils.getValue(e.style,mxConstants.STYLE_FLIPH,0)==1;var P=mxUtils.getValue(e.style,mxConstants.STYLE_FLIPV,0)==1;if(O&&P){_-=I}else if(O||P){_+=I}else{_-=I}}_-=i.getAttribute("rotation");t.text(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,0,0,M,i.getAttribute("align")||"left",i.getAttribute("valign")||"top",false,"",null,false,_)}}else if(l=="include-shape"){var R=mxStencilRegistry.getStencil(i.getAttribute("name"));if(R!=null){var H=a+Number(i.getAttribute("x"))*h;var N=o+Number(i.getAttribute("y"))*u;var b=Number(i.getAttribute("w"))*h;var w=Number(i.getAttribute("h"))*u;R.drawShape(t,e,H,N,b,w)}}else if(l=="fillstroke"){t.fillAndStroke()}else if(l=="fill"){t.fill()}else if(l=="stroke"){t.stroke()}else if(l=="strokewidth"){var G=i.getAttribute("fixed")=="1"?1:d;t.setStrokeWidth(Number(i.getAttribute("width"))*G)}else if(l=="dashed"){t.setDashed(i.getAttribute("dashed")=="1")}else if(l=="dashpattern"){var D=i.getAttribute("pattern");if(D!=null){var U=D.split(" ");var V=[];for(var v=0;v<U.length;v++){if(U[v].length>0){V.push(Number(U[v])*d)}}D=V.join(" ");t.setDashPattern(D)}}else if(l=="strokecolor"){t.setStrokeColor(i.getAttribute("color"))}else if(l=="linecap"){t.setLineCap(i.getAttribute("cap"))}else if(l=="linejoin"){t.setLineJoin(i.getAttribute("join"))}else if(l=="miterlimit"){t.setMiterLimit(Number(i.getAttribute("limit")))}else if(l=="fillcolor"){t.setFillColor(i.getAttribute("color"))}else if(l=="alpha"){t.setAlpha(i.getAttribute("alpha"))}else if(l=="fillalpha"){t.setAlpha(i.getAttribute("alpha"))}else if(l=="strokealpha"){t.setAlpha(i.getAttribute("alpha"))}else if(l=="fontcolor"){t.setFontColor(i.getAttribute("color"))}else if(l=="fontstyle"){t.setFontStyle(i.getAttribute("style"))}else if(l=="fontfamily"){t.setFontFamily(i.getAttribute("family"))}else if(l=="fontsize"){t.setFontSize(Number(i.getAttribute("size"))*d)}if(r&&(l=="fillstroke"||l=="fill"||l=="stroke")){r=false;t.setShadow(false)}}};__mxOutput.mxStencil=typeof mxStencil!=="undefined"?mxStencil:undefined;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=typeof mxStencilRegistry!=="undefined"?mxStencilRegistry:undefined;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,l,a,o,h){var u=mxMarker.markers[i];return u!=null?u(t,e,i,n,r,s,l,a,o,h):null}};(function(){function t(t){t=t!=null?t:2;return function(e,i,n,r,s,l,a,o,h,u){var d=s*h*1.118;var p=l*h*1.118;s=s*(a+h);l=l*(a+h);var m=r.clone();m.x-=d;m.y-=p;var c=n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;r.x+=-s*c-d;r.y+=-l*c-p;return function(){e.begin();e.moveTo(m.x,m.y);e.lineTo(m.x-s-l/t,m.y-l+s/t);if(n==mxConstants.ARROW_CLASSIC||n==mxConstants.ARROW_CLASSIC_THIN){e.lineTo(m.x-s*3/4,m.y-l*3/4)}e.lineTo(m.x+l/t-s,m.y-l-s/t);e.close();if(u){e.fillAndStroke()}else{e.stroke()}}}}mxMarker.addMarker("classic",t(2));mxMarker.addMarker("classicThin",t(3));mxMarker.addMarker("block",t(2));mxMarker.addMarker("blockThin",t(3));function e(t){t=t!=null?t:2;return function(e,i,n,r,s,l,a,o,h,u){var d=s*h*1.118;var p=l*h*1.118;s=s*(a+h);l=l*(a+h);var m=r.clone();m.x-=d;m.y-=p;r.x+=-d*2;r.y+=-p*2;return function(){e.begin();e.moveTo(m.x-s-l/t,m.y-l+s/t);e.lineTo(m.x,m.y);e.lineTo(m.x+l/t-s,m.y-l-s/t);e.stroke()}}}mxMarker.addMarker("open",e(2));mxMarker.addMarker("openThin",e(3));mxMarker.addMarker("oval",(function(t,e,i,n,r,s,l,a,o,h){var u=l/2;var d=n.clone();n.x-=r*u;n.y-=s*u;return function(){t.ellipse(d.x-u,d.y-u,l,l);if(h){t.fillAndStroke()}else{t.stroke()}}}));function i(t,e,i,n,r,s,l,a,o,h){var u=i==mxConstants.ARROW_DIAMOND?.7071:.9862;var d=r*o*u;var p=s*o*u;r=r*(l+o);s=s*(l+o);var m=n.clone();m.x-=d;m.y-=p;n.x+=-r-d;n.y+=-s-p;var c=i==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin();t.moveTo(m.x,m.y);t.lineTo(m.x-r/2-s/c,m.y+r/c-s/2);t.lineTo(m.x-r,m.y-s);t.lineTo(m.x-r/2+s/c,m.y-s/2-r/c);t.close();if(h){t.fillAndStroke()}else{t.stroke()}}}mxMarker.addMarker("diamond",i);mxMarker.addMarker("diamondThin",i)})();__mxOutput.mxMarker=typeof mxMarker!=="undefined"?mxMarker:undefined;function mxActor(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxActor,mxShape);mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i);t.begin();this.redrawPath(t,e,i,n,r);t.fillAndStroke()};mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r);t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5);t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0);t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5);t.curveTo(n,2*r/5,n,3*r/5,n,r);t.close()};__mxOutput.mxActor=typeof mxActor!=="undefined"?mxActor:undefined;function mxCloud(t,e,i,n){mxActor.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxCloud,mxActor);mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r);t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r);t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r);t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r);t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r);t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r);t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r);t.close()};__mxOutput.mxCloud=typeof mxCloud!=="undefined"?mxCloud:undefined;function mxRectangleShape(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxRectangleShape,mxShape);mxRectangleShape.prototype.isHtmlAllowed=function(){var t=true;if(this.style!=null){t=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}return!this.isRounded&&!this.glass&&this.rotation==0&&(t||this.fill!=null&&this.fill!=mxConstants.NONE)};mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=true;if(this.style!=null){s=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}if(s||this.fill!=null&&this.fill!=mxConstants.NONE||this.stroke!=null&&this.stroke!=mxConstants.NONE){if(!s&&(this.fill==null||this.fill==mxConstants.NONE)){t.pointerEvents=false}if(this.isRounded){var l=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1"){l=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2))}else{var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;l=Math.min(n*a,r*a)}t.roundrect(e,i,n,r,l,l)}else{t.rect(e,i,n,r)}t.fillAndStroke()}};mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return true};mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){if(this.glass&&!this.outline&&this.fill!=null&&this.fill!=mxConstants.NONE){this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))}};__mxOutput.mxRectangleShape=typeof mxRectangleShape!=="undefined"?mxRectangleShape:undefined;function mxEllipse(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxEllipse,mxShape);mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r);t.fillAndStroke()};__mxOutput.mxEllipse=typeof mxEllipse!=="undefined"?mxEllipse:undefined;function mxDoubleEllipse(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxDoubleEllipse,mxShape);mxDoubleEllipse.prototype.vmlScale=10;mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r);t.fillAndStroke()};mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s;i+=s;n-=2*s;r-=2*s;if(n>0&&r>0){t.ellipse(e,i,n,r)}t.stroke()}};mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)};__mxOutput.mxDoubleEllipse=typeof mxDoubleEllipse!=="undefined"?mxDoubleEllipse:undefined;function mxRhombus(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxRhombus,mxShape);mxRhombus.prototype.isRoundable=function(){return true};mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2;var l=r/2;var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin();this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+l),new mxPoint(e+s,i+r),new mxPoint(e,i+l)],this.isRounded,a,true);t.fillAndStroke()};__mxOutput.mxRhombus=typeof mxRhombus!=="undefined"?mxRhombus:undefined;function mxPolyline(t,e,i){mxShape.call(this);this.points=t;this.stroke=e;this.strokewidth=i!=null?i:1}mxUtils.extend(mxPolyline,mxShape);mxPolyline.prototype.getRotation=function(){return 0};mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return false};mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke";if(this.style==null||this.style[mxConstants.STYLE_CURVED]!=1){this.paintLine(t,e,this.isRounded)}else{this.paintCurvedLine(t,e)}t.pointerEventsValue=i};mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin();this.addPoints(t,e,i,n,false);t.stroke()};mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0];var n=e.length;t.moveTo(i.x,i.y);for(var r=1;r<n-2;r++){var s=e[r];var l=e[r+1];var a=(s.x+l.x)/2;var o=(s.y+l.y)/2;t.quadTo(s.x,s.y,a,o)}var s=e[n-2];var l=e[n-1];t.quadTo(s.x,s.y,l.x,l.y);t.stroke()};__mxOutput.mxPolyline=typeof mxPolyline!=="undefined"?mxPolyline:undefined;function mxArrow(t,e,i,n,r,s,l){mxShape.call(this);this.points=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1;this.arrowWidth=r!=null?r:mxConstants.ARROW_WIDTH;this.spacing=s!=null?s:mxConstants.ARROW_SPACING;this.endSize=l!=null?l:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=Math.max(this.arrowWidth,this.endSize);t.grow((e/2+this.strokewidth)*this.scale)};mxArrow.prototype.paintEdgeShape=function(t,e){var i=mxConstants.ARROW_SPACING;var n=mxConstants.ARROW_WIDTH;var r=mxConstants.ARROW_SIZE;var s=e[0];var l=e[e.length-1];var a=l.x-s.x;var o=l.y-s.y;var h=Math.sqrt(a*a+o*o);var u=h-2*i-r;var d=a/h;var p=o/h;var m=u*d;var c=u*p;var x=n*p/3;var f=-n*d/3;var g=s.x-x/2+i*d;var v=s.y-f/2+i*p;var y=g+x;var C=v+f;var E=y+m;var S=C+c;var b=E+x;var w=S+f;var T=b-3*x;var L=w-3*f;t.begin();t.moveTo(g,v);t.lineTo(y,C);t.lineTo(E,S);t.lineTo(b,w);t.lineTo(l.x-i*d,l.y-i*p);t.lineTo(T,L);t.lineTo(T+x,L+f);t.close();t.fillAndStroke()};__mxOutput.mxArrow=typeof mxArrow!=="undefined"?mxArrow:undefined;function mxArrowConnector(t,e,i,n,r,s,l){mxShape.call(this);this.points=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1;this.arrowWidth=r!=null?r:mxConstants.ARROW_WIDTH;this.arrowSpacing=s!=null?s:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=true;mxArrowConnector.prototype.isRoundable=function(){return true};mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments);if(this.style!=null){this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*3;this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*3}};mxArrowConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=this.getEdgeWidth();if(this.isMarkerStart()){e=Math.max(e,this.getStartArrowWidth())}if(this.isMarkerEnd()){e=Math.max(e,this.getEndArrowWidth())}t.grow((e/2+this.strokewidth)*this.scale)};mxArrowConnector.prototype.paintEdgeShape=function(t,e){var i=this.strokewidth;if(this.outline){i=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth))}var n=this.getStartArrowWidth()+i;var r=this.getEndArrowWidth()+i;var s=this.outline?this.getEdgeWidth()+i:this.getEdgeWidth();var l=this.isOpenEnded();var a=this.isMarkerStart();var o=this.isMarkerEnd();var h=l?0:this.arrowSpacing+i/2;var u=this.startSize+i;var d=this.endSize+i;var p=this.isArrowRounded();var m=e[e.length-1];var c=1;while(c<e.length-1&&e[c].x==e[0].x&&e[c].y==e[0].y){c++}var x=e[c].x-e[0].x;var f=e[c].y-e[0].y;var g=Math.sqrt(x*x+f*f);if(g==0){return}var v=x/g;var y,C=v;var E=f/g;var S,b=E;var w=s*E;var T=-s*v;var L=[];if(p){t.setLineJoin("round")}else if(e.length>2){t.setMiterLimit(1.42)}t.begin();var A=v;var M=E;if(a&&!l){this.paintMarker(t,e[0].x,e[0].y,v,E,u,n,s,h,true)}else{var _=e[0].x+w/2+h*v;var I=e[0].y+T/2+h*E;var O=e[0].x-w/2+h*v;var P=e[0].y-T/2+h*E;if(l){t.moveTo(_,I);L.push((function(){t.lineTo(O,P)}))}else{t.moveTo(O,P);t.lineTo(_,I)}}var R=0;var H=0;var N=0;for(var G=0;G<e.length-2;G++){var D=mxUtils.relativeCcw(e[G].x,e[G].y,e[G+1].x,e[G+1].y,e[G+2].x,e[G+2].y);R=e[G+2].x-e[G+1].x;H=e[G+2].y-e[G+1].y;N=Math.sqrt(R*R+H*H);if(N!=0){C=R/N;b=H/N;var U=v*C+E*b;var V=Math.max(Math.sqrt((U+1)/2),.04);y=v+C;S=E+b;var k=Math.sqrt(y*y+S*S);if(k!=0){y=y/k;S=S/k;var F=Math.max(V,Math.min(this.strokewidth/200+.04,.35));var B=D!=0&&p?Math.max(.1,F):Math.max(V,.06);var Y=e[G+1].x+S*s/2/B;var z=e[G+1].y-y*s/2/B;var j=e[G+1].x-S*s/2/B;var X=e[G+1].y+y*s/2/B;if(D==0||!p){t.lineTo(Y,z);(function(e,i){L.push((function(){t.lineTo(e,i)}))})(j,X)}else if(D==-1){var W=j+E*s;var K=X-v*s;var Z=j+b*s;var q=X-C*s;t.lineTo(W,K);t.quadTo(Y,z,Z,q);(function(e,i){L.push((function(){t.lineTo(e,i)}))})(j,X)}else{t.lineTo(Y,z);(function(e,i){var n=Y-E*s;var r=z+v*s;var l=Y-b*s;var a=z+C*s;L.push((function(){t.quadTo(e,i,n,r)}));L.push((function(){t.lineTo(l,a)}))})(j,X)}v=C;E=b}}}w=s*b;T=-s*C;if(o&&!l){this.paintMarker(t,m.x,m.y,-v,-E,d,r,s,h,false)}else{t.lineTo(m.x-h*C+w/2,m.y-h*b+T/2);var Q=m.x-h*C-w/2;var J=m.y-h*b-T/2;if(!l){t.lineTo(Q,J)}else{t.moveTo(Q,J);L.splice(0,0,(function(){t.moveTo(Q,J)}))}}for(var G=L.length-1;G>=0;G--){L[G]()}if(l){t.end();t.stroke()}else{t.close();t.fillAndStroke()}t.setShadow(false);t.setMiterLimit(4);if(p){t.setLineJoin("flat")}if(e.length>2){t.setMiterLimit(4);if(a&&!l){t.begin();this.paintMarker(t,e[0].x,e[0].y,A,M,u,n,s,h,true);t.stroke();t.end()}if(o&&!l){t.begin();this.paintMarker(t,m.x,m.y,-v,-E,d,r,s,h,true);t.stroke();t.end()}}};mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,l,a,o,h){var u=a/l;var d=a*r/2;var p=-a*n/2;var m=(o+s)*n;var c=(o+s)*r;if(h){t.moveTo(e-d+m,i-p+c)}else{t.lineTo(e-d+m,i-p+c)}t.lineTo(e-d/u+m,i-p/u+c);t.lineTo(e+o*n,i+o*r);t.lineTo(e+d/u+m,i+p/u+c);t.lineTo(e+d+m,i+p+c)};mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return false};mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE};__mxOutput.mxArrowConnector=typeof mxArrowConnector!=="undefined"?mxArrowConnector:undefined;function mxText(t,e,i,n,r,s,l,a,o,h,u,d,p,m,c,x,f,g,v,y,C){mxShape.call(this);this.value=t;this.bounds=e;this.color=r!=null?r:"black";this.align=i!=null?i:mxConstants.ALIGN_CENTER;this.valign=n!=null?n:mxConstants.ALIGN_MIDDLE;this.family=s!=null?s:mxConstants.DEFAULT_FONTFAMILY;this.size=l!=null?l:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=a!=null?a:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(o||2);this.spacingTop=this.spacing+parseInt(h||0);this.spacingRight=this.spacing+parseInt(u||0);this.spacingBottom=this.spacing+parseInt(d||0);this.spacingLeft=this.spacing+parseInt(p||0);this.horizontal=m!=null?m:true;this.background=c;this.border=x;this.wrap=f!=null?f:false;this.clipped=g!=null?g:false;this.overflow=v!=null?v:"visible";this.labelPadding=y!=null?y:0;this.textDirection=C;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0;mxText.prototype.replaceLinefeeds=true;mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=true;mxText.prototype.ignoreStringSize=false;mxText.prototype.textWidthPadding=document.documentMode==8&&!mxClient.IS_EM?4:3;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=true;mxText.prototype.isParseVml=function(){return false};mxText.prototype.isHtmlAllowed=function(){return document.documentMode!=8||mxClient.IS_EM};mxText.prototype.getSvgScreenOffset=function(){return 0};mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)};mxText.prototype.paint=function(t,e){var i=this.scale;var n=this.bounds.x/i;var r=this.bounds.y/i;var s=this.bounds.width/i;var l=this.bounds.height/i;this.updateTransform(t,n,r,s,l);this.configureCanvas(t,n,r,s,l);if(e){t.updateText(n,r,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node)}else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML;var o=a||t instanceof mxVmlCanvas2D?"html":"";var h=this.value;if(!a&&o=="html"){h=mxUtils.htmlEntities(h,false)}if(o=="html"&&!mxUtils.isNode(this.value)){h=mxUtils.replaceTrailingNewlines(h,"<div><br></div>")}h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&o=="html"?h.replace(/\n/g,"<br/>"):h;var u=this.textDirection;if(u==mxConstants.TEXT_DIRECTION_AUTO&&!a){u=this.getAutoDirection()}if(u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL){u=null}t.text(n,r,s,l,h,this.align,this.valign,this.wrap,o,this.overflow,this.clipped,this.getTextRotation(),u)}};mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)){if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML)){if(mxClient.IS_SVG){this.redrawHtmlShapeWithCss3()}else{this.updateSize(this.node,this.state==null||this.state.view.textDiv==null);if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)){this.updateHtmlFilter()}else{this.updateHtmlTransform()}}this.updateBoundingBox()}else{var t=this.createCanvas();if(t!=null&&t.updateText!=null){t.pointerEvents=this.pointerEvents;this.paint(t,true);this.destroyCanvas(t);this.updateBoundingBox()}else{mxShape.prototype.redraw.apply(this,arguments)}}}else{mxShape.prototype.redraw.apply(this,arguments);if(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML){this.lastValue=this.value}else{this.lastValue=null}}};mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.color="black";this.align=mxConstants.ALIGN_CENTER;this.valign=mxConstants.ALIGN_MIDDLE;this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacing=2;this.spacingTop=2;this.spacingRight=2;this.spacingBottom=2;this.spacingLeft=2;this.horizontal=true;delete this.background;delete this.border;this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION;delete this.margin};mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments);if(this.style!=null){this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle);this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family);this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size);this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color);this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align);this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign);this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing));this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing;this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing;this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing;this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing;this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal);this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background);this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border);this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100);this.updateMargin()}this.flipV=null;this.flipH=null};mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return t!=null&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR};mxText.prototype.getContentNode=function(){var t=this.node;if(t!=null){if(t.ownerSVGElement==null){t=this.node.firstChild.firstChild}else{t=t.firstChild.firstChild.firstChild.firstChild.firstChild}}return t};mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation();var i=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null;var n=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&t!=null&&this.overflow!="fill"&&(!this.clipped||!this.ignoreClippedStringSize||i!=mxConstants.ALIGN_CENTER||n!=mxConstants.ALIGN_MIDDLE)){var r=null;var s=null;if(t.ownerSVGElement!=null){if(t.firstChild!=null&&t.firstChild.firstChild!=null&&t.firstChild.firstChild.nodeName=="foreignObject"){t=t.firstChild.firstChild.firstChild.firstChild;s=t.offsetHeight*this.scale;if(this.overflow=="width"){r=this.boundingBox.width}else{r=t.offsetWidth*this.scale}}else{try{var l=t.getBBox();if(typeof this.value=="string"&&mxUtils.trim(this.value)==0){this.boundingBox=null}else if(l.width==0&&l.height==0){this.boundingBox=null}else{this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height)}return}catch(p){}}}else{var a=this.state!=null?this.state.view.textDiv:null;if(this.offsetWidth!=null&&this.offsetHeight!=null){r=this.offsetWidth*this.scale;s=this.offsetHeight*this.scale}else{if(a!=null){this.updateFont(a);this.updateSize(a,false);this.updateInnerHtml(a);t=a}var o=t;if(document.documentMode==8&&!mxClient.IS_EM){var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){t.style.wordWrap=mxConstants.WORD_WRAP;t.style.whiteSpace="normal";if(t.style.wordWrap!="break-word"){var u=o.getElementsByTagName("div");if(u.length>0){o=u[u.length-1]}r=o.offsetWidth+2;u=this.node.getElementsByTagName("div");if(this.clipped){r=Math.min(h,r)}if(u.length>1){u[u.length-2].style.width=r+"px"}}}else{t.style.whiteSpace="nowrap"}}else if(o.firstChild!=null&&o.firstChild.nodeName=="DIV"){o=o.firstChild}this.offsetWidth=o.offsetWidth+this.textWidthPadding;this.offsetHeight=o.offsetHeight;r=this.offsetWidth*this.scale;s=this.offsetHeight*this.scale}}if(r!=null&&s!=null){this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s)}}if(this.boundingBox!=null){if(e!=0){var d=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox);this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width;this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height;this.boundingBox.x+=d.x;this.boundingBox.y+=d.y;this.boundingBox.width=d.width;this.boundingBox.height=d.height}else{this.boundingBox.x+=this.margin.x*this.boundingBox.width;this.boundingBox.y+=this.margin.y*this.boundingBox.height;this.unrotatedBoundingBox=null}}};mxText.prototype.getShapeRotation=function(){return 0};mxText.prototype.getTextRotation=function(){return this.state!=null&&this.state.shape!=null?this.state.shape.getTextRotation():0};mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&this.state!=null&&this.state.view.graph.model.isVertex(this.state.cell)};mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments);t.setFontColor(this.color);t.setFontBackgroundColor(this.background);t.setFontBorderColor(this.border);t.setFontFamily(this.family);t.setFontSize(this.size);t.setFontStyle(this.fontStyle)};mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width="1px";this.node.style.height="1px";this.node.style.overflow="visible"};mxText.prototype.getHtmlValue=function(){var t=this.value;if(this.dialect!=mxConstants.DIALECT_STRICTHTML){t=mxUtils.htmlEntities(t,false)}t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>");t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t;return t};mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;var e="display: inline-block; font-size: "+this.size+"px; "+"font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";if((this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){e+="font-weight: bold; "}if((this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){e+="font-style: italic; "}var i=[];if((this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){i.push("underline")}if((this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){i.push("line-through")}if(i.length>0){e+="text-decoration: "+i.join(" ")+"; "}return e};mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG){this.redrawHtmlShapeWithCss3()}else{var t=this.node.style;t.whiteSpace="normal";t.overflow="";t.width="";t.height="";this.updateValue();this.updateFont(this.node);this.updateSize(this.node,this.state==null||this.state.view.textDiv==null);this.offsetWidth=null;this.offsetHeight=null;if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)){this.updateHtmlFilter()}else{this.updateHtmlTransform()}}};mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale));var e=Math.max(0,Math.round(this.bounds.height/this.scale));var i="position: absolute; left: "+Math.round(this.bounds.x)+"px; "+"top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ";var n=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.background!=null?mxUtils.htmlEntities(this.background):null,this.border!=null?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,(function(t,e,i,n,r,s){var l=this.getTextRotation();var a=(this.scale!=1?"scale("+this.scale+") ":"")+(l!=0?"rotate("+l+"deg) ":"")+(this.margin.x!=0||this.margin.y!=0?"translate("+this.margin.x*100+"%,"+this.margin.y*100+"%)":"");if(a!=""){a="transform-origin: 0 0; transform: "+a+"; "}if(s==""){i+=n;n="display:inline-block; min-width: 100%; "+a}else{n+=a;if(mxClient.IS_SF){n+="-webkit-clip-path: content-box;"}}if(this.opacity<100){r+="opacity: "+this.opacity/100+"; "}this.node.setAttribute("style",i);var o=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();if(this.node.firstChild==null){this.node.innerHTML="<div><div>"+o+"</div></div>"}this.node.firstChild.firstChild.setAttribute("style",r);this.node.firstChild.setAttribute("style",n)})))};mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation();var e=this.node.style;var i=this.margin.x;var n=this.margin.y;if(t!=0){mxUtils.setPrefixedStyle(e,"transformOrigin",-i*100+"%"+" "+-n*100+"%");mxUtils.setPrefixedStyle(e,"transform","translate("+i*100+"%"+","+n*100+"%) "+"scale("+this.scale+") rotate("+t+"deg)")}else{mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%");mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") "+"translate("+i*100+"%"+","+n*100+"%)")}e.left=Math.round(this.bounds.x-Math.ceil(i*(this.overflow!="fill"&&this.overflow!="width"?3:1)))+"px";e.top=Math.round(this.bounds.y-n*(this.overflow!="fill"?3:1))+"px";if(this.opacity<100){e.opacity=this.opacity/100}else{e.opacity=""}};mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value)){t.innerHTML=this.value.outerHTML}else{var e=this.value;if(this.dialect!=mxConstants.DIALECT_STRICTHTML){e=mxUtils.htmlEntities(e,false)}e=mxUtils.replaceTrailingNewlines(e,"<div>&nbsp;</div>");e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;e='<div style="display:inline-block;_display:inline;">'+e+"</div>";t.innerHTML=e}};mxText.prototype.updateHtmlFilter=function(){var t=this.node.style;var e=this.margin.x;var i=this.margin.y;var n=this.scale;mxUtils.setOpacity(this.node,this.opacity);var r=0;var s=0;var l=this.state!=null?this.state.view.textDiv:null;var a=this.node;if(l!=null){l.style.overflow="";l.style.height="";l.style.width="";this.updateFont(l);this.updateSize(l,false);this.updateInnerHtml(l);var o=Math.round(this.bounds.width/this.scale);if(this.wrap&&o>0){l.style.whiteSpace="normal";l.style.wordWrap=mxConstants.WORD_WRAP;r=o;if(this.clipped){r=Math.min(r,this.bounds.width)}l.style.width=r+"px"}else{l.style.whiteSpace="nowrap"}a=l;if(a.firstChild!=null&&a.firstChild.nodeName=="DIV"){a=a.firstChild;if(this.wrap&&l.style.wordWrap=="break-word"){a.style.width="100%"}}if(!this.clipped&&this.wrap&&o>0){r=a.offsetWidth+this.textWidthPadding;l.style.width=r+"px"}s=a.offsetHeight+2;if(mxClient.IS_QUIRKS&&this.border!=null&&this.border!=mxConstants.NONE){s+=3}}else if(a.firstChild!=null&&a.firstChild.nodeName=="DIV"){a=a.firstChild;s=a.offsetHeight}r=a.offsetWidth+this.textWidthPadding;if(this.clipped){s=Math.min(s,this.bounds.height)}var o=this.bounds.width/n;var h=this.bounds.height/n;if(this.overflow=="fill"){s=h;r=o}else if(this.overflow=="width"){s=a.scrollHeight;r=o}this.offsetWidth=r;this.offsetHeight=s;if(mxClient.IS_QUIRKS&&(this.clipped||this.overflow=="width"&&h>0)){h=Math.min(h,s);t.height=Math.round(h)+"px"}else{h=s}if(this.overflow!="fill"&&this.overflow!="width"){if(this.clipped){r=Math.min(o,r)}o=r;if(mxClient.IS_QUIRKS&&this.clipped||this.wrap){t.width=Math.round(o)+"px"}}h*=n;o*=n;var u=this.getTextRotation()*(Math.PI/180);var d=parseFloat(parseFloat(Math.cos(u)).toFixed(8));var p=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));u%=2*Math.PI;if(u<0){u+=2*Math.PI}u%=Math.PI;if(u>Math.PI/2){u=Math.PI-u}var m=Math.cos(u);var c=Math.sin(-u);var x=o*-(e+.5);var f=h*-(i+.5);var g=(h-h*m+o*c)/2+p*x-d*f;var v=(o-o*m+h*c)/2-d*x-p*f;if(u!=0){var y="progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12="+p+", M21="+-p+", M22="+d+", sizingMethod='auto expand')";if(t.filter!=null&&t.filter.length>0){t.filter+=" "+y}else{t.filter=y}}var i=0;if(this.overflow!="fill"&&mxClient.IS_QUIRKS){if(this.valign==mxConstants.ALIGN_TOP){i-=1}else if(this.valign==mxConstants.ALIGN_BOTTOM){i+=2}else{i+=1}}t.zoom=n;t.left=Math.round(this.bounds.x+v-o/2)+"px";t.top=Math.round(this.bounds.y+g-h/2+i)+"px"};mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value)){this.node.innerHTML="";this.node.appendChild(this.value)}else{var t=this.value;if(this.dialect!=mxConstants.DIALECT_STRICTHTML){t=mxUtils.htmlEntities(t,false)}t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>");t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t;var e=this.background!=null&&this.background!=mxConstants.NONE?this.background:null;var i=this.border!=null&&this.border!=mxConstants.NONE?this.border:null;if(this.overflow=="fill"||this.overflow=="width"){if(e!=null){this.node.style.backgroundColor=e}if(i!=null){this.node.style.border="1px solid "+i}}else{var n="";if(e!=null){n+="background-color:"+mxUtils.htmlEntities(e)+";"}if(i!=null){n+="border:1px solid "+mxUtils.htmlEntities(i)+";"}var r=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t='<div style="zoom:1;'+n+"display:inline-block;_display:inline;text-decoration:inherit;"+"padding-bottom:1px;padding-right:1px;line-height:"+r+'">'+t+"</div>"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var l=this.textDirection;if(l==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML){l=this.getAutoDirection()}if(l==mxConstants.TEXT_DIRECTION_LTR||l==mxConstants.TEXT_DIRECTION_RTL){s[s.length-1].setAttribute("dir",l)}else{s[s.length-1].removeAttribute("dir")}}}};mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;e.fontSize=this.size+"px";e.fontFamily=this.family;e.verticalAlign="top";e.color=this.color;if((this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){e.fontWeight="bold"}else{e.fontWeight=""}if((this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){e.fontStyle="italic"}else{e.fontStyle=""}var i=[];if((this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){i.push("underline")}if((this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){i.push("line-through")}e.textDecoration=i.join(" ");if(this.align==mxConstants.ALIGN_CENTER){e.textAlign="center"}else if(this.align==mxConstants.ALIGN_RIGHT){e.textAlign="right"}else{e.textAlign="left"}};mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale));var n=Math.max(0,Math.round(this.bounds.height/this.scale));var r=t.style;if(this.clipped){r.overflow="hidden";if(!mxClient.IS_QUIRKS){r.maxHeight=n+"px";r.maxWidth=i+"px"}else{r.width=i+"px"}}else if(this.overflow=="fill"){r.width=i+1+"px";r.height=n+1+"px";r.overflow="hidden"}else if(this.overflow=="width"){r.width=i+1+"px";r.maxHeight=n+1+"px";r.overflow="hidden"}if(this.wrap&&i>0){r.wordWrap=mxConstants.WORD_WRAP;r.whiteSpace="normal";r.width=i+"px";if(e&&this.overflow!="fill"&&this.overflow!="width"){var s=t;if(s.firstChild!=null&&s.firstChild.nodeName=="DIV"){s=s.firstChild;if(t.style.wordWrap=="break-word"){s.style.width="100%"}}var l=s.offsetWidth;if(l==0){var a=t.parentNode;t.style.visibility="hidden";document.body.appendChild(t);l=s.offsetWidth;t.style.visibility="";a.appendChild(t)}l+=3;if(this.clipped){l=Math.min(l,i)}r.width=l+"px"}}else{r.whiteSpace="nowrap"}};mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)};mxText.prototype.getSpacing=function(){var t=0;var e=0;if(this.align==mxConstants.ALIGN_CENTER){t=(this.spacingLeft-this.spacingRight)/2}else if(this.align==mxConstants.ALIGN_RIGHT){t=-this.spacingRight-this.baseSpacingRight}else{t=this.spacingLeft+this.baseSpacingLeft}if(this.valign==mxConstants.ALIGN_MIDDLE){e=(this.spacingTop-this.spacingBottom)/2}else if(this.valign==mxConstants.ALIGN_BOTTOM){e=-this.spacingBottom-this.baseSpacingBottom}else{e=this.spacingTop+this.baseSpacingTop}return new mxPoint(t,e)};__mxOutput.mxText=typeof mxText!=="undefined"?mxText:undefined;function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor);mxTriangle.prototype.isRoundable=function(){return true};mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,true)};__mxOutput.mxTriangle=typeof mxTriangle!=="undefined"?mxTriangle:undefined;function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor);mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,true)};__mxOutput.mxHexagon=typeof mxHexagon!=="undefined"?mxHexagon:undefined;function mxLine(t,e,i,n){mxShape.call(this);this.bounds=t;this.stroke=e;this.strokewidth=i!=null?i:1;this.vertical=n!=null?n:this.vertical}mxUtils.extend(mxLine,mxShape);mxLine.prototype.vertical=false;mxLine.prototype.paintVertexShape=function(t,e,i,n,r){t.begin();if(this.vertical){var s=e+n/2;t.moveTo(s,i);t.lineTo(s,i+r)}else{var s=i+r/2;t.moveTo(e,s);t.lineTo(e+n,s)}t.stroke()};__mxOutput.mxLine=typeof mxLine!=="undefined"?mxLine:undefined;function mxImageShape(t,e,i,n,r){mxShape.call(this);this.bounds=t;this.image=e;this.fill=i;this.stroke=n;this.strokewidth=r!=null?r:1;this.shadow=false}mxUtils.extend(mxImageShape,mxRectangleShape);mxImageShape.prototype.preserveImageAspect=true;mxImageShape.prototype.getSvgScreenOffset=function(){return 0};mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments);this.fill=null;this.stroke=null;this.gradient=null;if(this.style!=null){this.preserveImageAspect=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1)==1;this.flipH=this.flipH||mxUtils.getValue(this.style,"imageFlipH",0)==1;this.flipV=this.flipV||mxUtils.getValue(this.style,"imageFlipV",0)==1}};mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect};mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");t.style.position="absolute";return t};mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return false};mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(this.image!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);if(s!=null){t.setFillColor(s);t.setStrokeColor(l);t.rect(e,i,n,r);t.fillAndStroke()}t.image(e,i,n,r,this.image,this.preserveImageAspect,false,false);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);if(l!=null){t.setShadow(false);t.setStrokeColor(l);t.rect(e,i,n,r);t.stroke()}}else{mxRectangleShape.prototype.paintBackground.apply(this,arguments)}};mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerHTML="";if(this.image!=null){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,"");var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t;this.node.style.borderColor=e;var i=mxClient.IS_IE6||(document.documentMode==null||document.documentMode<=8)&&this.rotation!=0;var n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0");n.style.position="absolute";n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r;if(this.flipH&&this.flipV){r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"}else if(this.flipH){r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)"}else if(this.flipV){r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}if(n.style.filter!=r){n.style.filter=r}if(n.nodeName=="image"){n.style.rotation=this.rotation}else if(this.rotation!=0){mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)")}else{mxUtils.setPrefixedStyle(n.style,"transform","")}n.style.width=this.node.style.width;n.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(n)}else{this.setTransparentBackgroundImage(this.node)}};__mxOutput.mxImageShape=typeof mxImageShape!=="undefined"?mxImageShape:undefined;function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}mxUtils.extend(mxLabel,mxRectangleShape);mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments);if(this.indicatorShape!=null){this.indicator=new this.indicatorShape;this.indicator.dialect=this.dialect;this.indicator.init(this.node)}};mxLabel.prototype.redraw=function(){if(this.indicator!=null){this.indicator.fill=this.indicatorColor;this.indicator.stroke=this.indicatorStrokeColor;this.indicator.gradient=this.indicatorGradientColor;this.indicator.direction=this.indicatorDirection;this.indicator.redraw()}mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&this.indicatorColor==null&&this.indicatorShape==null};mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r);this.paintIndicator(t,e,i,n,r);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(t,e,i,n,r){if(this.image!=null){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,false,false,false)}};mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT);var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);var l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE);var a=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE);var o=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;if(r==mxConstants.ALIGN_CENTER){t+=(i-l)/2}else if(r==mxConstants.ALIGN_RIGHT){t+=i-l-o}else{t+=o}if(s==mxConstants.ALIGN_TOP){e+=o}else if(s==mxConstants.ALIGN_BOTTOM){e+=n-a-o}else{e+=(n-a)/2}return new mxRectangle(t,e,l,a)};mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(this.indicator!=null){this.indicator.bounds=this.getIndicatorBounds(e,i,n,r);this.indicator.paint(t)}else if(this.indicatorImage!=null){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,false,false,false)}};mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT);var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);var l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize);var a=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize);var o=this.spacing+5;if(r==mxConstants.ALIGN_RIGHT){t+=i-l-o}else if(r==mxConstants.ALIGN_CENTER){t+=(i-l)/2}else{t+=o}if(s==mxConstants.ALIGN_BOTTOM){e+=n-a-o}else if(s==mxConstants.ALIGN_TOP){e+=o}else{e+=(n-a)/2}return new mxRectangle(t,e,l,a)};mxLabel.prototype.redrawHtmlShape=function(){mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);while(this.node.hasChildNodes()){this.node.removeChild(this.node.lastChild)}if(this.image!=null){var t=document.createElement("img");t.style.position="relative";t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x;e.y-=this.bounds.y;t.style.left=Math.round(e.x)+"px";t.style.top=Math.round(e.y)+"px";t.style.width=Math.round(e.width)+"px";t.style.height=Math.round(e.height)+"px";t.src=this.image;this.node.appendChild(t)}};__mxOutput.mxLabel=typeof mxLabel!=="undefined"?mxLabel:undefined;function mxCylinder(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxCylinder,mxShape);mxCylinder.prototype.maxHeight=40;mxCylinder.prototype.svgStrokeTolerance=0;mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i);t.begin();this.redrawPath(t,e,i,n,r,false);t.fillAndStroke();if(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0){t.setShadow(false);t.begin();this.redrawPath(t,e,i,n,r,true);t.stroke()}};mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))};mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var l=this.getCylinderSize(e,i,n,r);if(s&&this.fill!=null||!s&&this.fill==null){t.moveTo(0,l);t.curveTo(0,2*l,n,2*l,n,l);if(!s){t.stroke();t.begin()}}if(!s){t.moveTo(0,l);t.curveTo(0,-l/3,n,-l/3,n,l);t.lineTo(n,r-l);t.curveTo(n,r+l/3,0,r+l/3,0,r-l);t.close()}};__mxOutput.mxCylinder=typeof mxCylinder!=="undefined"?mxCylinder:undefined;function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}mxUtils.extend(mxConnector,mxPolyline);mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=this.style!=null&&this.style[mxConstants.STYLE_CURVED]==1;mxShape.prototype.updateBoundingBox.apply(this,arguments)};mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,true);var n=this.createMarker(t,e,false);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);t.setFillColor(this.stroke);t.setShadow(false);t.setDashed(false);if(i!=null){i()}if(n!=null){n()}};mxConnector.prototype.createMarker=function(t,e,i){var n=null;var r=e.length;var s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW);var l=i?e[1]:e[r-2];var a=i?e[0]:e[r-1];if(s!=null&&l!=null&&a!=null){var o=1;while(o<r-1&&Math.round(l.x-a.x)==0&&Math.round(l.y-a.y)==0){l=i?e[1+o]:e[r-2-o];o++}var h=a.x-l.x;var u=a.y-l.y;var d=Math.max(1,Math.sqrt(h*h+u*u));var p=h/d;var m=u/d;var c=mxUtils.getNumber(this.style,i?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);var x=this.style[i?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL]!=0;n=mxMarker.createMarker(t,this,s,a,p,m,c,i,this.strokewidth,x)}return n};mxConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE){e=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1}if(mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE){e=Math.max(e,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1}t.grow(e*this.scale)};__mxOutput.mxConnector=typeof mxConnector!=="undefined"?mxConnector:undefined;function mxSwimlane(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxSwimlane,mxShape);mxSwimlane.prototype.imageSize=16;mxSwimlane.prototype.isRoundable=function(t,e,i,n,r){return true};mxSwimlane.prototype.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))};mxSwimlane.prototype.getLabelBounds=function(t){var e=this.getTitleSize();var i=new mxRectangle(t.x,t.y,t.width,t.height);var n=this.isHorizontal();var r=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0)==1;var s=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0)==1;var l=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH;var a=n==!l;var o=!a&&r!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);var h=a&&s!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(!l){var u=Math.min(i.height,e*this.scale);if(o||h){i.y+=i.height-u}i.height=u}else{var u=Math.min(i.width,e*this.scale);if(o||h){i.x+=i.width-u}i.width=u}return i};mxSwimlane.prototype.getGradientBounds=function(t,e,i,n,r){var s=this.getTitleSize();if(this.isHorizontal()){s=Math.min(s,r);return new mxRectangle(e,i,n,s)}else{s=Math.min(s,n);return new mxRectangle(e,i,s,r)}};mxSwimlane.prototype.getSwimlaneArcSize=function(t,e,i){if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1"){return Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2))}else{var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;return i*n*3}};mxSwimlane.prototype.isHorizontal=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)==1};mxSwimlane.prototype.paintVertexShape=function(t,e,i,n,r){var s=this.getTitleSize();var l=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);var a=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1)==1;var o=0;if(this.isHorizontal()){s=Math.min(s,r)}else{s=Math.min(s,n)}t.translate(e,i);if(!this.isRounded){this.paintSwimlane(t,e,i,n,r,s,l,a)}else{o=this.getSwimlaneArcSize(n,r,s);o=Math.min((this.isHorizontal()?r:n)-s,Math.min(s,o));this.paintRoundedSwimlane(t,e,i,n,r,s,o,l,a)}var h=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(t,e,i,n,r,s,h);if(this.image!=null){var u=this.getImageBounds(e,i,n,r);t.image(u.x-e,u.y-i,u.width,u.height,this.image,false,false,false)}if(this.glass){t.setShadow(false);this.paintGlassEffect(t,0,0,n,s,o)}};mxSwimlane.prototype.paintSwimlane=function(t,e,i,n,r,s,l,a){t.begin();var o=true;if(this.style!=null){o=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}if(!o&&(this.fill==null||this.fill==mxConstants.NONE)){t.pointerEvents=false}if(this.isHorizontal()){t.moveTo(0,s);t.lineTo(0,0);t.lineTo(n,0);t.lineTo(n,s);t.fillAndStroke();if(s<r){if(l==mxConstants.NONE||!o){t.pointerEvents=false}if(l!=mxConstants.NONE){t.setFillColor(l)}t.begin();t.moveTo(0,s);t.lineTo(0,r);t.lineTo(n,r);t.lineTo(n,s);if(l==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}else{t.moveTo(s,0);t.lineTo(0,0);t.lineTo(0,r);t.lineTo(s,r);t.fillAndStroke();if(s<n){if(l==mxConstants.NONE||!o){t.pointerEvents=false}if(l!=mxConstants.NONE){t.setFillColor(l)}t.begin();t.moveTo(s,0);t.lineTo(n,0);t.lineTo(n,r);t.lineTo(s,r);if(l==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}if(a){this.paintDivider(t,e,i,n,r,s,l==mxConstants.NONE)}};mxSwimlane.prototype.paintRoundedSwimlane=function(t,e,i,n,r,s,l,a,o){t.begin();var h=true;if(this.style!=null){h=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}if(!h&&(this.fill==null||this.fill==mxConstants.NONE)){t.pointerEvents=false}if(this.isHorizontal()){t.moveTo(n,s);t.lineTo(n,l);t.quadTo(n,0,n-Math.min(n/2,l),0);t.lineTo(Math.min(n/2,l),0);t.quadTo(0,0,0,l);t.lineTo(0,s);t.fillAndStroke();if(s<r){if(a==mxConstants.NONE||!h){t.pointerEvents=false}if(a!=mxConstants.NONE){t.setFillColor(a)}t.begin();t.moveTo(0,s);t.lineTo(0,r-l);t.quadTo(0,r,Math.min(n/2,l),r);t.lineTo(n-Math.min(n/2,l),r);t.quadTo(n,r,n,r-l);t.lineTo(n,s);if(a==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}else{t.moveTo(s,0);t.lineTo(l,0);t.quadTo(0,0,0,Math.min(r/2,l));t.lineTo(0,r-Math.min(r/2,l));t.quadTo(0,r,l,r);t.lineTo(s,r);t.fillAndStroke();if(s<n){if(a==mxConstants.NONE||!h){t.pointerEvents=false}if(a!=mxConstants.NONE){t.setFillColor(a)}t.begin();t.moveTo(s,r);t.lineTo(n-l,r);t.quadTo(n,r,n,r-Math.min(r/2,l));t.lineTo(n,Math.min(r/2,l));t.quadTo(n,0,n-l,0);t.lineTo(s,0);if(a==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}if(o){this.paintDivider(t,e,i,n,r,s,a==mxConstants.NONE)}};mxSwimlane.prototype.paintDivider=function(t,e,i,n,r,s,l){if(!l){t.setShadow(false)}t.begin();if(this.isHorizontal()){t.moveTo(0,s);t.lineTo(n,s)}else{t.moveTo(s,0);t.lineTo(s,r)}t.stroke()};mxSwimlane.prototype.paintSeparator=function(t,e,i,n,r,s,l){if(l!=mxConstants.NONE){t.setStrokeColor(l);t.setDashed(true);t.begin();if(this.isHorizontal()){t.moveTo(n,s);t.lineTo(n,r)}else{t.moveTo(s,0);t.lineTo(n,0)}t.stroke();t.setDashed(false)}};mxSwimlane.prototype.getImageBounds=function(t,e,i,n){if(this.isHorizontal()){return new mxRectangle(t+i-this.imageSize,e,this.imageSize,this.imageSize)}else{return new mxRectangle(t,e,this.imageSize,this.imageSize)}};__mxOutput.mxSwimlane=typeof mxSwimlane!=="undefined"?mxSwimlane:undefined;function mxGraphLayout(t){this.graph=t}mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=true;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(t,e,i){};mxGraphLayout.prototype.resizeCell=function(t,e){};mxGraphLayout.prototype.execute=function(t){};mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(t,e,i,n){return this.graph.getCurrentCellStyle(e)[t]};mxGraphLayout.traverse=function(t,e,i,n,r){if(i!=null&&t!=null){e=e!=null?e:true;r=r||new mxDictionary;if(!r.get(t)){r.put(t,true);var s=i(t,n);if(s==null||s){var l=this.graph.model.getEdgeCount(t);if(l>0){for(var a=0;a<l;a++){var o=this.graph.model.getEdgeAt(t,a);var h=this.graph.model.getTerminal(o,true)==t;if(!e||h){var u=this.graph.view.getVisibleTerminal(o,!h);this.traverse(u,e,i,o,r)}}}}}}};mxGraphLayout.prototype.isAncestor=function(t,e,i){if(!i){return this.graph.model.getParent(e)==t}if(e==t){return false}while(e!=null&&e!=t){e=this.graph.model.getParent(e)}return e==t};mxGraphLayout.prototype.isVertexMovable=function(t){return this.graph.isCellMovable(t)};mxGraphLayout.prototype.isVertexIgnored=function(t){return!this.graph.getModel().isVertex(t)||!this.graph.isCellVisible(t)};mxGraphLayout.prototype.isEdgeIgnored=function(t){var e=this.graph.getModel();return!e.isEdge(t)||!this.graph.isCellVisible(t)||e.getTerminal(t,true)==null||e.getTerminal(t,false)==null};mxGraphLayout.prototype.setEdgeStyleEnabled=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,e?"0":"1",[t])};mxGraphLayout.prototype.setOrthogonalEdge=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,e?"1":"0",[t])};mxGraphLayout.prototype.getParentOffset=function(t){var e=new mxPoint;if(t!=null&&t!=this.parent){var i=this.graph.getModel();if(i.isAncestor(this.parent,t)){var n=i.getGeometry(t);while(t!=this.parent){e.x=e.x+n.x;e.y=e.y+n.y;t=i.getParent(t);n=i.getGeometry(t)}}}return e};mxGraphLayout.prototype.setEdgePoints=function(t,e){if(t!=null){var i=this.graph.model;var n=i.getGeometry(t);if(n==null){n=new mxGeometry;n.setRelative(true)}else{n=n.clone()}if(this.parent!=null&&e!=null){var r=i.getParent(t);var s=this.getParentOffset(r);for(var l=0;l<e.length;l++){e[l].x=e[l].x-s.x;e[l].y=e[l].y-s.y}}n.points=e;i.setGeometry(t,n)}};mxGraphLayout.prototype.setVertexLocation=function(t,e,i){var n=this.graph.getModel();var r=n.getGeometry(t);var s=null;if(r!=null){s=new mxRectangle(e,i,r.width,r.height);if(this.useBoundingBox){var l=this.graph.getView().getState(t);if(l!=null&&l.text!=null&&l.text.boundingBox!=null){var a=this.graph.getView().scale;var o=l.text.boundingBox;if(l.text.boundingBox.x<l.x){e+=(l.x-o.x)/a;s.width=o.width}if(l.text.boundingBox.y<l.y){i+=(l.y-o.y)/a;s.height=o.height}}}if(this.parent!=null){var h=n.getParent(t);if(h!=null&&h!=this.parent){var u=this.getParentOffset(h);e=e-u.x;i=i-u.y}}if(r.x!=e||r.y!=i){r=r.clone();r.x=e;r.y=i;n.setGeometry(t,r)}}return s};mxGraphLayout.prototype.getVertexBounds=function(t){var e=this.graph.getModel().getGeometry(t);if(this.useBoundingBox){var i=this.graph.getView().getState(t);if(i!=null&&i.text!=null&&i.text.boundingBox!=null){var n=this.graph.getView().scale;var r=i.text.boundingBox;var s=Math.max(i.x-r.x,0)/n;var l=Math.max(i.y-r.y,0)/n;var a=Math.max(r.x+r.width-(i.x+i.width),0)/n;var o=Math.max(r.y+r.height-(i.y+i.height),0)/n;e=new mxRectangle(e.x-s,e.y-l,e.width+s+a,e.height+l+o)}}if(this.parent!=null){var h=this.graph.getModel().getParent(t);e=e.clone();if(h!=null&&h!=this.parent){var u=this.getParentOffset(h);e.x=e.x+u.x;e.y=e.y+u.y}}return new mxRectangle(e.x,e.y,e.width,e.height)};mxGraphLayout.prototype.arrangeGroups=function(t,e,i,n,r,s){return this.graph.updateGroupBounds(t,e,true,i,n,r,s)};function WeightedCellSorter(t,e){this.cell=t;this.weightedValue=e}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=false;WeightedCellSorter.prototype.visited=false;WeightedCellSorter.prototype.rankIndex=null;WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(t,e){if(t!=null&&e!=null){if(e.weightedValue>t.weightedValue){return-1}else if(e.weightedValue<t.weightedValue){return 1}else{if(e.nudge){return-1}else{return 1}}}else{return 0}};__mxOutput.mxGraphLayout=typeof mxGraphLayout!=="undefined"?mxGraphLayout:undefined;function mxStackLayout(t,e,i,n,r,s){mxGraphLayout.call(this,t);this.horizontal=e!=null?e:true;this.spacing=i!=null?i:0;this.x0=n!=null?n:0;this.y0=r!=null?r:0;this.border=s!=null?s:0}mxStackLayout.prototype=new mxGraphLayout;mxStackLayout.prototype.constructor=mxStackLayout;mxStackLayout.prototype.horizontal=null;mxStackLayout.prototype.spacing=null;mxStackLayout.prototype.x0=null;mxStackLayout.prototype.y0=null;mxStackLayout.prototype.border=0;mxStackLayout.prototype.marginTop=0;mxStackLayout.prototype.marginLeft=0;mxStackLayout.prototype.marginRight=0;mxStackLayout.prototype.marginBottom=0;mxStackLayout.prototype.keepFirstLocation=false;mxStackLayout.prototype.fill=false;mxStackLayout.prototype.resizeParent=false;mxStackLayout.prototype.resizeParentMax=false;mxStackLayout.prototype.resizeLast=false;mxStackLayout.prototype.wrap=null;mxStackLayout.prototype.borderCollapse=true;mxStackLayout.prototype.allowGaps=false;mxStackLayout.prototype.gridSize=0;mxStackLayout.prototype.isHorizontal=function(){return this.horizontal};mxStackLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel();var r=n.getParent(t);var s=this.isHorizontal();if(t!=null&&r!=null){var l=0;var a=0;var o=n.getChildCount(r);var h=s?e:i;var u=this.graph.getView().getState(r);if(u!=null){h-=s?u.x:u.y}h/=this.graph.view.scale;for(l=0;l<o;l++){var d=n.getChildAt(r,l);if(d!=t){var p=n.getGeometry(d);if(p!=null){var m=s?p.x+p.width/2:p.y+p.height/2;if(a<=h&&m>h){break}a=m}}}var c=r.getIndex(t);c=Math.max(0,l-(l>c?1:0));n.add(r,t,c)}};mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel();var i=e.getGeometry(t);if(this.graph.container!=null&&(i==null&&e.isLayer(t)||t==this.graph.getView().currentRoot)){var n=this.graph.container.offsetWidth-1;var r=this.graph.container.offsetHeight-1;i=new mxRectangle(0,0,n,r)}return i};mxStackLayout.prototype.getLayoutCells=function(t){var e=this.graph.getModel();var i=e.getChildCount(t);var n=[];for(var r=0;r<i;r++){var s=e.getChildAt(t,r);if(!this.isVertexIgnored(s)&&this.isVertexMovable(s)){n.push(s)}}if(this.allowGaps){n.sort(mxUtils.bind(this,(function(t,e){var i=this.graph.getCellGeometry(t);var n=this.graph.getCellGeometry(e);return this.horizontal?i.x==n.x?0:i.x>n.x>0?1:-1:i.y==n.y?0:i.y>n.y>0?1:-1})))}return n};mxStackLayout.prototype.snap=function(t){if(this.gridSize!=null&&this.gridSize>0){t=Math.max(t,this.gridSize);if(t/this.gridSize>1){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}}return t};mxStackLayout.prototype.execute=function(t){if(t!=null){var e=this.getParentSize(t);var i=this.isHorizontal();var n=this.graph.getModel();var r=null;if(e!=null){r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight}r-=2*this.border;var s=this.x0+this.border+this.marginLeft;var l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var a=this.graph.getCellStyle(t);var o=mxUtils.getNumber(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);var h=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,true)==1;if(e!=null){if(h){o=Math.min(o,e.height)}else{o=Math.min(o,e.width)}}if(i==h){r-=o}if(h){l+=o}else{s+=o}}n.beginUpdate();try{var u=0;var d=null;var p=0;var m=null;var c=this.getLayoutCells(t);for(var x=0;x<c.length;x++){var f=c[x];var g=n.getGeometry(f);if(g!=null){g=g.clone();if(this.wrap!=null&&d!=null){if(i&&d.x+d.width+g.width+2*this.spacing>this.wrap||!i&&d.y+d.height+g.height+2*this.spacing>this.wrap){d=null;if(i){l+=u+this.spacing}else{s+=u+this.spacing}u=0}}u=Math.max(u,i?g.height:g.width);var v=0;if(!this.borderCollapse){var y=this.graph.getCellStyle(f);v=mxUtils.getNumber(y,mxConstants.STYLE_STROKEWIDTH,1)}if(d!=null){var C=p+this.spacing+Math.floor(v/2);if(i){g.x=this.snap((this.allowGaps?Math.max(C,g.x):C)-this.marginLeft)+this.marginLeft}else{g.y=this.snap((this.allowGaps?Math.max(C,g.y):C)-this.marginTop)+this.marginTop}}else if(!this.keepFirstLocation){if(i){g.x=this.allowGaps&&g.x>s?Math.max(this.snap(g.x-this.marginLeft)+this.marginLeft,s):s}else{g.y=this.allowGaps&&g.y>l?Math.max(this.snap(g.y-this.marginTop)+this.marginTop,l):l}}if(i){g.y=l}else{g.x=s}if(this.fill&&r!=null){if(i){g.height=r}else{g.width=r}}if(i){g.width=this.snap(g.width)}else{g.height=this.snap(g.height)}this.setChildGeometry(f,g);m=f;d=g;if(i){p=d.x+d.width+Math.floor(v/2)}else{p=d.y+d.height+Math.floor(v/2)}}}if(this.resizeParent&&e!=null&&d!=null&&!this.graph.isCellCollapsed(t)){this.updateParentGeometry(t,e,d)}else if(this.resizeLast&&e!=null&&d!=null&&m!=null){if(i){d.width=e.width-d.x-this.spacing-this.marginRight-this.marginLeft}else{d.height=e.height-d.y-this.spacing-this.marginBottom}this.setChildGeometry(m,d)}}finally{n.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);if(i==null||e.x!=i.x||e.y!=i.y||e.width!=i.width||e.height!=i.height){this.graph.getModel().setGeometry(t,e)}};mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal();var r=this.graph.getModel();var s=e.clone();if(n){var l=i.x+i.width+this.marginRight+this.border;if(this.resizeParentMax){s.width=Math.max(s.width,l)}else{s.width=l}}else{var l=i.y+i.height+this.marginBottom+this.border;if(this.resizeParentMax){s.height=Math.max(s.height,l)}else{s.height=l}}if(e.x!=s.x||e.y!=s.y||e.width!=s.width||e.height!=s.height){r.setGeometry(t,s)}};__mxOutput.mxStackLayout=typeof mxStackLayout!=="undefined"?mxStackLayout:undefined;function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t);this.horizontal=e!=null?e:true;this.spacing=i||0;this.border=n||0}mxPartitionLayout.prototype=new mxGraphLayout;mxPartitionLayout.prototype.constructor=mxPartitionLayout;mxPartitionLayout.prototype.horizontal=null;mxPartitionLayout.prototype.spacing=null;mxPartitionLayout.prototype.border=null;mxPartitionLayout.prototype.resizeVertices=true;mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal};mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel();var r=n.getParent(t);if(t!=null&&r!=null){var s=0;var l=0;var a=n.getChildCount(r);for(s=0;s<a;s++){var o=n.getChildAt(r,s);var h=this.getVertexBounds(o);if(h!=null){var u=h.x+h.width/2;if(l<e&&u>e){break}l=u}}var d=r.getIndex(t);d=Math.max(0,s-(s>d?1:0));n.add(r,t,d)}};mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal();var i=this.graph.getModel();var n=i.getGeometry(t);if(this.graph.container!=null&&(n==null&&i.isLayer(t)||t==this.graph.getView().currentRoot)){var r=this.graph.container.offsetWidth-1;var s=this.graph.container.offsetHeight-1;n=new mxRectangle(0,0,r,s)}if(n!=null){var l=[];var a=i.getChildCount(t);for(var o=0;o<a;o++){var h=i.getChildAt(t,o);if(!this.isVertexIgnored(h)&&this.isVertexMovable(h)){l.push(h)}}var u=l.length;if(u>0){var d=this.border;var p=this.border;var m=e?n.height:n.width;m-=2*this.border;var c=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;m-=e?c.height:c.width;d=d+c.width;p=p+c.height;var x=this.border+(u-1)*this.spacing;var f=e?(n.width-d-x)/u:(n.height-p-x)/u;if(f>0){i.beginUpdate();try{for(var o=0;o<u;o++){var h=l[o];var g=i.getGeometry(h);if(g!=null){g=g.clone();g.x=d;g.y=p;if(e){if(this.resizeVertices){g.width=f;g.height=m}d+=f+this.spacing}else{if(this.resizeVertices){g.height=f;g.width=m}p+=f+this.spacing}i.setGeometry(h,g)}}}finally{i.endUpdate()}}}}};__mxOutput.mxPartitionLayout=typeof mxPartitionLayout!=="undefined"?mxPartitionLayout:undefined;function mxCompactTreeLayout(t,e,i){mxGraphLayout.call(this,t);this.horizontal=e!=null?e:true;this.invert=i!=null?i:false}mxCompactTreeLayout.prototype=new mxGraphLayout;mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout;mxCompactTreeLayout.prototype.horizontal=null;mxCompactTreeLayout.prototype.invert=null;mxCompactTreeLayout.prototype.resizeParent=true;mxCompactTreeLayout.prototype.maintainParentLocation=false;mxCompactTreeLayout.prototype.groupPadding=10;mxCompactTreeLayout.prototype.groupPaddingTop=0;mxCompactTreeLayout.prototype.groupPaddingRight=0;mxCompactTreeLayout.prototype.groupPaddingBottom=0;mxCompactTreeLayout.prototype.groupPaddingLeft=0;mxCompactTreeLayout.prototype.parentsChanged=null;mxCompactTreeLayout.prototype.moveTree=false;mxCompactTreeLayout.prototype.visited=null;mxCompactTreeLayout.prototype.levelDistance=10;mxCompactTreeLayout.prototype.nodeDistance=20;mxCompactTreeLayout.prototype.resetEdges=true;mxCompactTreeLayout.prototype.prefHozEdgeSep=5;mxCompactTreeLayout.prototype.prefVertEdgeOff=4;mxCompactTreeLayout.prototype.minEdgeJetty=8;mxCompactTreeLayout.prototype.channelBuffer=4;mxCompactTreeLayout.prototype.edgeRouting=true;mxCompactTreeLayout.prototype.sortEdges=false;mxCompactTreeLayout.prototype.alignRanks=false;mxCompactTreeLayout.prototype.maxRankHeight=null;mxCompactTreeLayout.prototype.root=null;mxCompactTreeLayout.prototype.node=null;mxCompactTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0};mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal};mxCompactTreeLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.getModel();if(e==null){if(this.graph.getEdges(t,i.getParent(t),this.invert,!this.invert,false).length>0){this.root=t}else{var n=this.graph.findTreeRoots(t,true,this.invert);if(n.length>0){for(var r=0;r<n.length;r++){if(!this.isVertexIgnored(n[r])&&this.graph.getEdges(n[r],null,this.invert,!this.invert,false).length>0){this.root=n[r];break}}}}}else{this.root=e}if(this.root!=null){if(this.resizeParent){this.parentsChanged=new Object}else{this.parentsChanged=null}this.parentX=null;this.parentY=null;if(t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var s=this.graph.getCellGeometry(t);if(s!=null){this.parentX=s.x;this.parentY=s.y}}i.beginUpdate();try{this.visited=new Object;this.node=this.dfs(this.root,t);if(this.alignRanks){this.maxRankHeight=[];this.findRankHeights(this.node,0);this.setCellHeights(this.node,0)}if(this.node!=null){this.layout(this.node);var l=this.graph.gridSize;var a=l;if(!this.moveTree){var o=this.getVertexBounds(this.root);if(o!=null){l=o.x;a=o.y}}var h=null;if(this.isHorizontal()){h=this.horizontalLayout(this.node,l,a)}else{h=this.verticalLayout(this.node,null,l,a)}if(h!=null){var u=0;var d=0;if(h.x<0){u=Math.abs(l-h.x)}if(h.y<0){d=Math.abs(a-h.y)}if(u!=0||d!=0){this.moveNode(this.node,u,d)}if(this.resizeParent){this.adjustParents()}if(this.edgeRouting){this.localEdgeProcessing(this.node)}}if(this.parentX!=null&&this.parentY!=null){var s=this.graph.getCellGeometry(t);if(s!=null){s=s.clone();s.x=this.parentX;s.y=this.parentY;i.setGeometry(t,s)}}}}finally{i.endUpdate()}}};mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e;t.y+=i;this.apply(t);var n=t.child;while(n!=null){this.moveNode(n,e,i);n=n.next}};mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort((function(e,n){var r=e.getTerminal(e.getTerminal(false)==t);var s=i.get(r);if(s==null){s=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR);i.put(r,s)}var l=n.getTerminal(n.getTerminal(false)==t);var a=i.get(l);if(a==null){a=mxCellPath.create(l).split(mxCellPath.PATH_SEPARATOR);i.put(l,a)}return mxCellPath.compare(s,a)}))};mxCompactTreeLayout.prototype.findRankHeights=function(t,e){if(this.maxRankHeight[e]==null||this.maxRankHeight[e]<t.height){this.maxRankHeight[e]=t.height}var i=t.child;while(i!=null){this.findRankHeights(i,e+1);i=i.next}};mxCompactTreeLayout.prototype.setCellHeights=function(t,e){if(this.maxRankHeight[e]!=null&&this.maxRankHeight[e]>t.height){t.height=this.maxRankHeight[e]}var i=t.child;while(i!=null){this.setCellHeights(i,e+1);i=i.next}};mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t);var n=null;if(t!=null&&this.visited[i]==null&&!this.isVertexIgnored(t)){this.visited[i]=t;n=this.createNode(t);var r=this.graph.getModel();var s=null;var l=this.graph.getEdges(t,e,this.invert,!this.invert,false,true);var a=this.graph.getView();if(this.sortEdges){this.sortOutgoingEdges(t,l)}for(var o=0;o<l.length;o++){var h=l[o];if(!this.isEdgeIgnored(h)){if(this.resetEdges){this.setEdgePoints(h,null)}if(this.edgeRouting){this.setEdgeStyleEnabled(h,false);this.setEdgePoints(h,null)}var u=a.getState(h);var d=u!=null?u.getVisibleTerminal(this.invert):a.getVisibleTerminal(h,this.invert);var p=this.dfs(d,e);if(p!=null&&r.getGeometry(d)!=null){if(s==null){n.child=p}else{s.next=p}s=p}}}}return n};mxCompactTreeLayout.prototype.layout=function(t){if(t!=null){var e=t.child;while(e!=null){this.layout(e);e=e.next}if(t.child!=null){this.attachParent(t,this.join(t))}else{this.layoutLeaf(t)}}};mxCompactTreeLayout.prototype.horizontalLayout=function(t,e,i,n){t.x+=e+t.offsetX;t.y+=i+t.offsetY;n=this.apply(t,n);var r=t.child;if(r!=null){n=this.horizontalLayout(r,t.x,t.y,n);var s=t.y+r.offsetY;var l=r.next;while(l!=null){n=this.horizontalLayout(l,t.x+r.offsetX,s,n);s+=l.offsetY;l=l.next}}return n};mxCompactTreeLayout.prototype.verticalLayout=function(t,e,i,n,r){t.x+=i+t.offsetY;t.y+=n+t.offsetX;r=this.apply(t,r);var s=t.child;if(s!=null){r=this.verticalLayout(s,t,t.x,t.y,r);var l=t.x+s.offsetY;var a=s.next;while(a!=null){r=this.verticalLayout(a,t,l,t.y+s.offsetX,r);l+=a.offsetY;a=a.next}}return r};mxCompactTreeLayout.prototype.attachParent=function(t,e){var i=this.nodeDistance+this.levelDistance;var n=(e-t.width)/2-this.nodeDistance;var r=n+t.width+2*this.nodeDistance-e;t.child.offsetX=i+t.height;t.child.offsetY=r;t.contour.upperHead=this.createLine(t.height,0,this.createLine(i,r,t.contour.upperHead));t.contour.lowerHead=this.createLine(t.height,0,this.createLine(i,n,t.contour.lowerHead))};mxCompactTreeLayout.prototype.layoutLeaf=function(t){var e=2*this.nodeDistance;t.contour.upperTail=this.createLine(t.height+e,0);t.contour.upperHead=t.contour.upperTail;t.contour.lowerTail=this.createLine(0,-t.width-e);t.contour.lowerHead=this.createLine(t.height+e,0,t.contour.lowerTail)};mxCompactTreeLayout.prototype.join=function(t){var e=2*this.nodeDistance;var i=t.child;t.contour=i.contour;var n=i.width+e;var r=n;i=i.next;while(i!=null){var s=this.merge(t.contour,i.contour);i.offsetY=s+n;i.offsetX=0;n=i.width+e;r+=s+n;i=i.next}return r};mxCompactTreeLayout.prototype.merge=function(t,e){var i=0;var n=0;var r=0;var s=t.lowerHead;var l=e.upperHead;while(l!=null&&s!=null){var a=this.offset(i,n,l.dx,l.dy,s.dx,s.dy);n+=a;r+=a;if(i+l.dx<=s.dx){i+=l.dx;n+=l.dy;l=l.next}else{i-=s.dx;n-=s.dy;s=s.next}}if(l!=null){var o=this.bridge(t.upperTail,0,0,l,i,n);t.upperTail=o.next!=null?e.upperTail:o;t.lowerTail=e.lowerTail}else{var o=this.bridge(e.lowerTail,i,n,s,0,0);if(o.next==null){t.lowerTail=o}}t.lowerHead=e.lowerHead;return r};mxCompactTreeLayout.prototype.offset=function(t,e,i,n,r,s){var l=0;if(r<=t||t+i<=0){return 0}var a=r*n-i*s;if(a>0){if(t<0){var o=t*n;l=o/i-e}else if(t>0){var o=t*s;l=o/r-e}else{l=-e}}else if(r<t+i){var o=(r-t)*n;l=s-(e+o/i)}else if(r>t+i){var o=(i+t)*s;l=o/r-(e+n)}else{l=s-(e+n)}if(l>0){return l}else{return 0}};mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var l=r+n.dx-e;var a=0;var o=0;if(n.dx==0){a=n.dy}else{o=l*n.dy;a=o/n.dx}var h=this.createLine(l,a,n.next);t.next=this.createLine(0,s+n.dy-a-i,h);return h};mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t;e.x=0;e.y=0;e.width=0;e.height=0;var i=this.getVertexBounds(t);if(i!=null){if(this.isHorizontal()){e.width=i.height;e.height=i.width}else{e.width=i.width;e.height=i.height}}e.offsetX=0;e.offsetY=0;e.contour=new Object;return e};mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel();var n=t.cell;var r=i.getGeometry(n);if(n!=null&&r!=null){if(this.isVertexMovable(n)){r=this.setVertexLocation(n,t.x,t.y);if(this.resizeParent){var s=i.getParent(n);var l=mxCellPath.create(s);if(this.parentsChanged[l]==null){this.parentsChanged[l]=s}}}if(e==null){e=new mxRectangle(r.x,r.y,r.width,r.height)}else{e=new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}}return e};mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;n.dx=t;n.dy=e;n.next=i;return n};mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged){t.push(this.parentsChanged[e])}this.arrangeGroups(mxUtils.sortCells(t,true),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)};mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);var e=t.child;while(e!=null){this.localEdgeProcessing(e);e=e.next}};mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){var e=t.child;var i=t.cell;var n=0;var r=[];while(e!=null){n++;var s=e.x;if(this.horizontal){s=e.y}r.push(new WeightedCellSorter(e,s));e=e.next}r.sort(WeightedCellSorter.prototype.compare);var l=t.width;var a=(n+1)*this.prefHozEdgeSep;if(l>a+2*this.prefHozEdgeSep){l-=2*this.prefHozEdgeSep}var o=l/n;var h=o/2;if(l>a+2*this.prefHozEdgeSep){h+=this.prefHozEdgeSep}var u=this.minEdgeJetty-this.prefVertEdgeOff;var d=this.getVertexBounds(i);e=t.child;for(var p=0;p<r.length;p++){var m=r[p].cell.cell;var c=this.getVertexBounds(m);var x=this.graph.getEdgesBetween(i,m,false);var f=[];var g=0;var v=0;for(var y=0;y<x.length;y++){if(this.horizontal){g=d.x+d.width;v=d.y+h;f.push(new mxPoint(g,v));g=d.x+d.width+u;f.push(new mxPoint(g,v));v=c.y+c.height/2;f.push(new mxPoint(g,v));this.setEdgePoints(x[y],f)}else{g=d.x+h;v=d.y+d.height;f.push(new mxPoint(g,v));v=d.y+d.height+u;f.push(new mxPoint(g,v));g=c.x+c.width/2;f.push(new mxPoint(g,v));this.setEdgePoints(x[y],f)}}if(p<n/2){u+=this.prefVertEdgeOff}else if(p>n/2){u-=this.prefVertEdgeOff}h+=o}};__mxOutput.mxCompactTreeLayout=typeof mxCompactTreeLayout!=="undefined"?mxCompactTreeLayout:undefined;function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,false)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout);mxRadialTreeLayout.prototype.angleOffset=.5;mxRadialTreeLayout.prototype.rootx=0;mxRadialTreeLayout.prototype.rooty=0;mxRadialTreeLayout.prototype.levelDistance=120;mxRadialTreeLayout.prototype.nodeDistance=10;mxRadialTreeLayout.prototype.autoRadius=false;mxRadialTreeLayout.prototype.sortEdges=false;mxRadialTreeLayout.prototype.rowMinX=[];mxRadialTreeLayout.prototype.rowMaxX=[];mxRadialTreeLayout.prototype.rowMinCenX=[];mxRadialTreeLayout.prototype.rowMaxCenX=[];mxRadialTreeLayout.prototype.rowRadi=[];mxRadialTreeLayout.prototype.row=[];mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0};mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t;this.useBoundingBox=false;this.edgeRouting=false;mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null;var n=this.getVertexBounds(this.root);this.centerX=n.x+n.width/2;this.centerY=n.y+n.height/2;for(var r in this.visited){var s=this.getVertexBounds(this.visited[r]);i=i!=null?i:s.clone();i.add(s)}this.calcRowDims([this.node],0);var l=0;var a=0;for(var o=0;o<this.row.length;o++){var h=(this.centerX-this.rowMinX[o]-this.nodeDistance)/this.rowRadi[o];var u=(this.rowMaxX[o]-this.centerX-this.nodeDistance)/this.rowRadi[o];l=Math.max(l,h);a=Math.max(a,u)}for(var o=0;o<this.row.length;o++){var d=this.centerX-this.nodeDistance-l*this.rowRadi[o];var p=this.centerX+this.nodeDistance+a*this.rowRadi[o];var m=p-d;for(var c=0;c<this.row[o].length;c++){var x=this.row[o];var f=x[c];var s=this.getVertexBounds(f.cell);var g=(s.x+s.width/2-d)/m;var v=2*Math.PI*g;f.theta=v}}for(var o=this.row.length-2;o>=0;o--){var x=this.row[o];for(var c=0;c<x.length;c++){var f=x[c];var y=f.child;var C=0;var E=0;while(y!=null){E+=y.theta;C++;y=y.next}if(C>0){var S=E/C;if(S>f.theta&&c<x.length-1){var b=x[c+1].theta;f.theta=Math.min(S,b-Math.PI/10)}else if(S<f.theta&&c>0){var w=x[c-1].theta;f.theta=Math.max(S,w+Math.PI/10)}}}}for(var o=0;o<this.row.length;o++){for(var c=0;c<this.row[o].length;c++){var x=this.row[o];var f=x[c];var s=this.getVertexBounds(f.cell);this.setVertexLocation(f.cell,this.centerX-s.width/2+this.rowRadi[o]*Math.cos(f.theta),this.centerY-s.height/2+this.rowRadi[o]*Math.sin(f.theta))}}};mxRadialTreeLayout.prototype.calcRowDims=function(t,e){if(t==null||t.length==0){return}this.rowMinX[e]=this.centerX;this.rowMaxX[e]=this.centerX;this.rowMinCenX[e]=this.centerX;this.rowMaxCenX[e]=this.centerX;this.row[e]=[];var i=false;for(var n=0;n<t.length;n++){var r=t[n]!=null?t[n].child:null;while(r!=null){var s=r.cell;var l=this.getVertexBounds(s);this.rowMinX[e]=Math.min(l.x,this.rowMinX[e]);this.rowMaxX[e]=Math.max(l.x+l.width,this.rowMaxX[e]);this.rowMinCenX[e]=Math.min(l.x+l.width/2,this.rowMinCenX[e]);this.rowMaxCenX[e]=Math.max(l.x+l.width/2,this.rowMaxCenX[e]);this.rowRadi[e]=l.y-this.getVertexBounds(this.root).y;if(r.child!=null){i=true}this.row[e].push(r);r=r.next}}if(i){this.calcRowDims(this.row[e],e+1)}};__mxOutput.mxRadialTreeLayout=typeof mxRadialTreeLayout!=="undefined"?mxRadialTreeLayout:undefined;function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}mxFastOrganicLayout.prototype=new mxGraphLayout;mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout;mxFastOrganicLayout.prototype.useInputOrigin=true;mxFastOrganicLayout.prototype.resetEdges=true;mxFastOrganicLayout.prototype.disableEdgeStyle=true;mxFastOrganicLayout.prototype.forceConstant=50;mxFastOrganicLayout.prototype.forceConstantSquared=0;mxFastOrganicLayout.prototype.minDistanceLimit=2;mxFastOrganicLayout.prototype.maxDistanceLimit=500;mxFastOrganicLayout.prototype.minDistanceLimitSquared=4;mxFastOrganicLayout.prototype.initialTemp=200;mxFastOrganicLayout.prototype.temperature=0;mxFastOrganicLayout.prototype.maxIterations=0;mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedToRun=true;mxFastOrganicLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0};mxFastOrganicLayout.prototype.execute=function(t){var e=this.graph.getModel();this.vertexArray=[];var i=this.graph.getChildVertices(t);for(var n=0;n<i.length;n++){if(!this.isVertexIgnored(i[n])){this.vertexArray.push(i[n])}}var r=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null;var s=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];if(this.forceConstant<.001){this.forceConstant=.001}this.forceConstantSquared=this.forceConstant*this.forceConstant;for(var n=0;n<this.vertexArray.length;n++){var l=this.vertexArray[n];this.cellLocation[n]=[];var a=mxObjectIdentity.get(l);this.indices[a]=n;var o=this.getVertexBounds(l);var h=o.width;var u=o.height;var d=o.x;var p=o.y;this.cellLocation[n][0]=d+h/2;this.cellLocation[n][1]=p+u/2;this.radius[n]=Math.min(h,u);this.radiusSquared[n]=this.radius[n]*this.radius[n]}e.beginUpdate();try{for(var n=0;n<s;n++){this.dispX[n]=0;this.dispY[n]=0;this.isMoveable[n]=this.isVertexMovable(this.vertexArray[n]);var m=this.graph.getConnections(this.vertexArray[n],t);var i=this.graph.getOpposites(m,this.vertexArray[n]);this.neighbours[n]=[];for(var c=0;c<i.length;c++){if(this.resetEdges){this.graph.resetEdge(m[c])}if(this.disableEdgeStyle){this.setEdgeStyleEnabled(m[c],false)}var a=mxObjectIdentity.get(i[c]);var x=this.indices[a];if(x!=null){this.neighbours[n][c]=x}else{this.neighbours[n][c]=n}}}this.temperature=this.initialTemp;if(this.maxIterations==0){this.maxIterations=20*Math.sqrt(s)}for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun){return}this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}var f=null;var g=null;for(var n=0;n<this.vertexArray.length;n++){var l=this.vertexArray[n];if(this.isVertexMovable(l)){var o=this.getVertexBounds(l);if(o!=null){this.cellLocation[n][0]-=o.width/2;this.cellLocation[n][1]-=o.height/2;var d=this.graph.snap(Math.round(this.cellLocation[n][0]));var p=this.graph.snap(Math.round(this.cellLocation[n][1]));this.setVertexLocation(l,d,p);if(f==null){f=d}else{f=Math.min(f,d)}if(g==null){g=p}else{g=Math.min(g,p)}}}}var v=-(f||0)+1;var y=-(g||0)+1;if(r!=null){v+=r.x;y+=r.y}this.graph.moveCells(this.vertexArray,v,y)}finally{e.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var t=0;t<this.vertexArray.length;t++){if(this.isMoveable[t]){var e=Math.sqrt(this.dispX[t]*this.dispX[t]+this.dispY[t]*this.dispY[t]);if(e<.001){e=.001}var i=this.dispX[t]/e*Math.min(e,this.temperature);var n=this.dispY[t]/e*Math.min(e,this.temperature);this.dispX[t]=0;this.dispY[t]=0;this.cellLocation[t][0]+=i;this.cellLocation[t][1]+=n}}};mxFastOrganicLayout.prototype.calcAttraction=function(){for(var t=0;t<this.vertexArray.length;t++){for(var e=0;e<this.neighbours[t].length;e++){var i=this.neighbours[t][e];if(t!=i&&this.isMoveable[t]&&this.isMoveable[i]){var n=this.cellLocation[t][0]-this.cellLocation[i][0];var r=this.cellLocation[t][1]-this.cellLocation[i][1];var s=n*n+r*r-this.radiusSquared[t]-this.radiusSquared[i];if(s<this.minDistanceLimitSquared){s=this.minDistanceLimitSquared}var l=Math.sqrt(s);var a=s/this.forceConstant;var o=n/l*a;var h=r/l*a;this.dispX[t]-=o;this.dispY[t]-=h;this.dispX[i]+=o;this.dispY[i]+=h}}}};mxFastOrganicLayout.prototype.calcRepulsion=function(){var t=this.vertexArray.length;for(var e=0;e<t;e++){for(var i=e;i<t;i++){if(!this.allowedToRun){return}if(i!=e&&this.isMoveable[e]&&this.isMoveable[i]){var n=this.cellLocation[e][0]-this.cellLocation[i][0];var r=this.cellLocation[e][1]-this.cellLocation[i][1];if(n==0){n=.01+Math.random()}if(r==0){r=.01+Math.random()}var s=Math.sqrt(n*n+r*r);var l=s-this.radius[e]-this.radius[i];if(l>this.maxDistanceLimit){continue}if(l<this.minDistanceLimit){l=this.minDistanceLimit}var a=this.forceConstantSquared/l;var o=n/s*a;var h=r/s*a;this.dispX[e]+=o;this.dispY[e]+=h;this.dispX[i]-=o;this.dispY[i]-=h}}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};__mxOutput.mxFastOrganicLayout=typeof mxFastOrganicLayout!=="undefined"?mxFastOrganicLayout:undefined;function mxCircleLayout(t,e){mxGraphLayout.call(this,t);this.radius=e!=null?e:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=false;mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=true;mxCircleLayout.prototype.disableEdgeStyle=true;mxCircleLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{var i=0;var n=null;var r=null;var s=[];var l=e.getChildCount(t);for(var a=0;a<l;a++){var o=e.getChildAt(t,a);if(!this.isVertexIgnored(o)){s.push(o);var h=this.getVertexBounds(o);if(n==null){n=h.y}else{n=Math.min(n,h.y)}if(r==null){r=h.x}else{r=Math.min(r,h.x)}i=Math.max(i,Math.max(h.width,h.height))}else if(!this.isEdgeIgnored(o)){if(this.resetEdges){this.graph.resetEdge(o)}if(this.disableEdgeStyle){this.setEdgeStyleEnabled(o,false)}}}var u=this.getRadius(s.length,i);if(this.moveCircle){r=this.x0;n=this.y0}this.circle(s,u,r,n)}finally{e.endUpdate()}};mxCircleLayout.prototype.getRadius=function(t,e){return Math.max(t*e/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(t,e,i,n){var r=t.length;var s=2*Math.PI/r;for(var l=0;l<r;l++){if(this.isVertexMovable(t[l])){this.setVertexLocation(t[l],Math.round(i+e+e*Math.sin(l*s)),Math.round(n+e+e*Math.cos(l*s)))}}};__mxOutput.mxCircleLayout=typeof mxCircleLayout!=="undefined"?mxCircleLayout:undefined;function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}mxParallelEdgeLayout.prototype=new mxGraphLayout;mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.checkOverlap=false;mxParallelEdgeLayout.prototype.execute=function(t,e){var i=this.findParallels(t,e);this.graph.model.beginUpdate();try{for(var n in i){var r=i[n];if(r.length>1){this.layout(r)}}}finally{this.graph.model.endUpdate()}};mxParallelEdgeLayout.prototype.findParallels=function(t,e){var i=[];var n=mxUtils.bind(this,(function(t){if(!this.isEdgeIgnored(t)){var e=this.getEdgeId(t);if(e!=null){if(i[e]==null){i[e]=[]}i[e].push(t)}}}));if(e!=null){for(var r=0;r<e.length;r++){n(e[r])}}else{var s=this.graph.getModel();var l=s.getChildCount(t);for(var r=0;r<l;r++){n(s.getChildAt(t,r))}}return i};mxParallelEdgeLayout.prototype.getEdgeId=function(t){var e=this.graph.getView();var i=e.getVisibleTerminal(t,true);var n=e.getVisibleTerminal(t,false);var r="";if(i!=null&&n!=null){i=mxObjectIdentity.get(i);n=mxObjectIdentity.get(n);if(this.checkOverlap){var s=this.graph.view.getState(t);if(s!=null&&s.absolutePoints!=null){var l=[];for(var a=0;a<s.absolutePoints.length;a++){var o=s.absolutePoints[a];if(o!=null){l.push(o.x,o.y)}}r=l.join(",")}}return(i>n?n+"-"+i:i+"-"+n)+r}return null};mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0];var i=this.graph.getView();var n=this.graph.getModel();var r=n.getGeometry(i.getVisibleTerminal(e,true));var s=n.getGeometry(i.getVisibleTerminal(e,false));if(r==s){var l=r.x+r.width+this.spacing;var a=r.y+r.height/2;for(var o=0;o<t.length;o++){this.route(t[o],l,a);l+=this.spacing}}else if(r!=null&&s!=null){var h=r.x+r.width/2;var u=r.y+r.height/2;var d=s.x+s.width/2;var p=s.y+s.height/2;var m=d-h;var c=p-u;var x=Math.sqrt(m*m+c*c);if(x>0){var l=h+m/2;var a=u+c/2;var f=c*this.spacing/x;var g=m*this.spacing/x;l+=f*(t.length-1)/2;a-=g*(t.length-1)/2;for(var o=0;o<t.length;o++){this.route(t[o],l,a);l-=f;a+=g}}}};mxParallelEdgeLayout.prototype.route=function(t,e,i){if(this.graph.isCellMovable(t)){this.setEdgePoints(t,[new mxPoint(e,i)])}};__mxOutput.mxParallelEdgeLayout=typeof mxParallelEdgeLayout!=="undefined"?mxParallelEdgeLayout:undefined;function mxCompositeLayout(t,e,i){mxGraphLayout.call(this,t);this.layouts=e;this.master=i}mxCompositeLayout.prototype=new mxGraphLayout;mxCompositeLayout.prototype.constructor=mxCompositeLayout;mxCompositeLayout.prototype.layouts=null;mxCompositeLayout.prototype.master=null;mxCompositeLayout.prototype.moveCell=function(t,e,i){if(this.master!=null){this.master.moveCell.apply(this.master,arguments)}else{this.layouts[0].moveCell.apply(this.layouts[0],arguments)}};mxCompositeLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var i=0;i<this.layouts.length;i++){this.layouts[i].execute.apply(this.layouts[i],arguments)}}finally{e.endUpdate()}};__mxOutput.mxCompositeLayout=typeof mxCompositeLayout!=="undefined"?mxCompositeLayout:undefined;function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}mxEdgeLabelLayout.prototype=new mxGraphLayout;mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout;mxEdgeLabelLayout.prototype.execute=function(t){var e=this.graph.view;var i=this.graph.getModel();var n=[];var r=[];var s=i.getChildCount(t);for(var l=0;l<s;l++){var a=i.getChildAt(t,l);var o=e.getState(a);if(o!=null){if(!this.isVertexIgnored(a)){r.push(o)}else if(!this.isEdgeIgnored(a)){n.push(o)}}}this.placeLabels(r,n)};mxEdgeLabelLayout.prototype.placeLabels=function(t,e){var i=this.graph.getModel();i.beginUpdate();try{for(var n=0;n<e.length;n++){var r=e[n];if(r!=null&&r.text!=null&&r.text.boundingBox!=null){for(var s=0;s<t.length;s++){var l=t[s];if(l!=null){this.avoid(r,l)}}}}}finally{i.endUpdate()}};mxEdgeLabelLayout.prototype.avoid=function(t,e){var i=this.graph.getModel();var n=t.text.boundingBox;if(mxUtils.intersects(n,e)){var r=-n.y-n.height+e.y;var s=-n.y+e.y+e.height;var l=Math.abs(r)<Math.abs(s)?r:s;var a=-n.x-n.width+e.x;var o=-n.x+e.x+e.width;var h=Math.abs(a)<Math.abs(o)?a:o;if(Math.abs(h)<Math.abs(l)){l=0}else{h=0}var u=i.getGeometry(t.cell);if(u!=null){u=u.clone();if(u.offset!=null){u.offset.x+=h;u.offset.y+=l}else{u.offset=new mxPoint(h,l)}i.setGeometry(t.cell,u)}}};__mxOutput.mxEdgeLabelLayout=typeof mxEdgeLabelLayout!=="undefined"?mxEdgeLabelLayout:undefined;function mxGraphAbstractHierarchyCell(){this.x=[];this.y=[];this.temp=[]}mxGraphAbstractHierarchyCell.prototype.maxRank=-1;mxGraphAbstractHierarchyCell.prototype.minRank=-1;mxGraphAbstractHierarchyCell.prototype.x=null;mxGraphAbstractHierarchyCell.prototype.y=null;mxGraphAbstractHierarchyCell.prototype.width=0;mxGraphAbstractHierarchyCell.prototype.height=0;mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.temp=null;mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(t){return null};mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(t){return null};mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return false};mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return false};mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(t){return null};mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(t,e){return null};mxGraphAbstractHierarchyCell.prototype.setX=function(t,e){if(this.isVertex()){this.x[0]=e}else if(this.isEdge()){this.x[t-this.minRank-1]=e}};mxGraphAbstractHierarchyCell.prototype.getX=function(t){if(this.isVertex()){return this.x[0]}else if(this.isEdge()){return this.x[t-this.minRank-1]}return 0};mxGraphAbstractHierarchyCell.prototype.setY=function(t,e){if(this.isVertex()){this.y[0]=e}else if(this.isEdge()){this.y[t-this.minRank-1]=e}};__mxOutput.mxGraphAbstractHierarchyCell=typeof mxGraphAbstractHierarchyCell!=="undefined"?mxGraphAbstractHierarchyCell:undefined;function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments);this.cell=t;this.id=mxObjectIdentity.get(t);this.connectsAsTarget=[];this.connectsAsSource=[]}mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode;mxGraphHierarchyNode.prototype.cell=null;mxGraphHierarchyNode.prototype.id=null;mxGraphHierarchyNode.prototype.connectsAsTarget=null;mxGraphHierarchyNode.prototype.connectsAsSource=null;mxGraphHierarchyNode.prototype.hashCode=false;mxGraphHierarchyNode.prototype.getRankValue=function(t){return this.maxRank};mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(t){if(this.nextLayerConnectedCells==null){this.nextLayerConnectedCells=[];this.nextLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsTarget.length;e++){var i=this.connectsAsTarget[e];if(i.maxRank==-1||i.maxRank==t+1){this.nextLayerConnectedCells[0].push(i.source)}else{this.nextLayerConnectedCells[0].push(i)}}}return this.nextLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(t){if(this.previousLayerConnectedCells==null){this.previousLayerConnectedCells=[];this.previousLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsSource.length;e++){var i=this.connectsAsSource[e];if(i.minRank==-1||i.minRank==t-1){this.previousLayerConnectedCells[0].push(i.target)}else{this.previousLayerConnectedCells[0].push(i)}}}return this.previousLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.isVertex=function(){return true};mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(t){return this.temp[0]};mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(t,e){this.temp[0]=e};mxGraphHierarchyNode.prototype.isAncestor=function(t){if(t!=null&&this.hashCode!=null&&t.hashCode!=null&&this.hashCode.length<t.hashCode.length){if(this.hashCode==t.hashCode){return true}if(this.hashCode==null||this.hashCode==null){return false}for(var e=0;e<this.hashCode.length;e++){if(this.hashCode[e]!=t.hashCode[e]){return false}}return true}return false};mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell};__mxOutput.mxGraphHierarchyNode=typeof mxGraphHierarchyNode!=="undefined"?mxGraphHierarchyNode:undefined;function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments);this.edges=t;this.ids=[];for(var e=0;e<t.length;e++){this.ids.push(mxObjectIdentity.get(t[e]))}}mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge;mxGraphHierarchyEdge.prototype.edges=null;mxGraphHierarchyEdge.prototype.ids=null;mxGraphHierarchyEdge.prototype.source=null;mxGraphHierarchyEdge.prototype.target=null;mxGraphHierarchyEdge.prototype.isReversed=false;mxGraphHierarchyEdge.prototype.invert=function(t){var e=this.source;this.source=this.target;this.target=e;this.isReversed=!this.isReversed};mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(t){if(this.nextLayerConnectedCells==null){this.nextLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++){this.nextLayerConnectedCells[e]=[];if(e==this.temp.length-1){this.nextLayerConnectedCells[e].push(this.source)}else{this.nextLayerConnectedCells[e].push(this)}}}return this.nextLayerConnectedCells[t-this.minRank-1]};mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(t){if(this.previousLayerConnectedCells==null){this.previousLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++){this.previousLayerConnectedCells[e]=[];if(e==0){this.previousLayerConnectedCells[e].push(this.target)}else{this.previousLayerConnectedCells[e].push(this)}}}return this.previousLayerConnectedCells[t-this.minRank-1]};mxGraphHierarchyEdge.prototype.isEdge=function(){return true};mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(t){return this.temp[t-this.minRank-1]};mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(t,e){this.temp[t-this.minRank-1]=e};mxGraphHierarchyEdge.prototype.getCoreCell=function(){if(this.edges!=null&&this.edges.length>0){return this.edges[0]}return null};__mxOutput.mxGraphHierarchyEdge=typeof mxGraphHierarchyEdge!=="undefined"?mxGraphHierarchyEdge:undefined;function mxGraphHierarchyModel(t,e,i,n,r){var s=t.getGraph();this.tightenToSource=r;this.roots=i;this.parent=n;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;var l=[];if(e==null){e=this.graph.getChildVertices(n)}this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(t,e,l);for(var a=0;a<e.length;a++){var o=l[a].connectsAsSource;for(var h=0;h<o.length;h++){var u=o[h];var d=u.edges;if(d!=null&&d.length>0){var p=d[0];var m=t.getVisibleTerminal(p,false);var c=this.vertexMapper.get(m);if(l[a]==c){m=t.getVisibleTerminal(p,true);c=this.vertexMapper.get(m)}if(c!=null&&l[a]!=c){u.target=c;if(c.connectsAsTarget.length==0){c.connectsAsTarget=[]}if(mxUtils.indexOf(c.connectsAsTarget,u)<0){c.connectsAsTarget.push(u)}}}}l[a].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null;mxGraphHierarchyModel.prototype.vertexMapper=null;mxGraphHierarchyModel.prototype.edgeMapper=null;mxGraphHierarchyModel.prototype.ranks=null;mxGraphHierarchyModel.prototype.roots=null;mxGraphHierarchyModel.prototype.parent=null;mxGraphHierarchyModel.prototype.dfsCount=0;mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8;mxGraphHierarchyModel.prototype.tightenToSource=false;mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){var n=t.getGraph();for(var r=0;r<e.length;r++){i[r]=new mxGraphHierarchyNode(e[r]);this.vertexMapper.put(e[r],i[r]);var s=t.getEdges(e[r]);i[r].connectsAsSource=[];for(var l=0;l<s.length;l++){var a=t.getVisibleTerminal(s[l],false);if(a!=e[r]&&t.graph.model.isVertex(a)&&!t.isVertexIgnored(a)){var o=t.getEdgesBetween(e[r],a,false);var h=t.getEdgesBetween(e[r],a,true);if(o!=null&&o.length>0&&this.edgeMapper.get(o[0])==null&&h.length*2>=o.length){var u=new mxGraphHierarchyEdge(o);for(var d=0;d<o.length;d++){var p=o[d];this.edgeMapper.put(p,u);n.resetEdge(p);if(t.disableEdgeStyle){t.setEdgeStyleEnabled(p,false);t.setOrthogonalEdge(p,true)}}u.source=i[r];if(mxUtils.indexOf(i[r].connectsAsSource,u)<0){i[r].connectsAsSource.push(u)}}}}i[r].temp[0]=0}};mxGraphHierarchyModel.prototype.initialRank=function(){var t=[];if(this.roots!=null){for(var e=0;e<this.roots.length;e++){var i=this.vertexMapper.get(this.roots[e]);if(i!=null){t.push(i)}}}var n=this.vertexMapper.getValues();for(var e=0;e<n.length;e++){n[e].temp[0]=-1}var r=t.slice();while(t.length>0){var i=t[0];var s;var l;s=i.connectsAsTarget;l=i.connectsAsSource;var a=true;var o=this.SOURCESCANSTARTRANK;for(var e=0;e<s.length;e++){var h=s[e];if(h.temp[0]==5270620){var u=h.source;o=Math.min(o,u.temp[0]-1)}else{a=false;break}}if(a){i.temp[0]=o;this.maxRank=Math.min(this.maxRank,o);if(l!=null){for(var e=0;e<l.length;e++){var h=l[e];h.temp[0]=5270620;var u=h.target;if(u.temp[0]==-1){t.push(u);u.temp[0]=-2}}}t.shift()}else{var d=t.shift();t.push(i);if(d==i&&t.length==1){break}}}for(var e=0;e<n.length;e++){n[e].temp[0]-=this.maxRank}for(var e=0;e<r.length;e++){var i=r[e];var p=0;var s=i.connectsAsSource;for(var m=0;m<s.length;m++){var h=s[m];var u=h.target;i.temp[0]=Math.max(p,u.temp[0]+1);p=i.temp[0]}}this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank};mxGraphHierarchyModel.prototype.fixRanks=function(){var t=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++){t[e]=[];this.ranks[e]=t[e]}var i=null;if(this.roots!=null){var n=this.roots;i=[];for(var e=0;e<n.length;e++){var r=n[e];var s=this.vertexMapper.get(r);i[e]=s}}this.visit((function(e,i,n,r,s){if(s==0&&i.maxRank<0&&i.minRank<0){t[i.temp[0]].push(i);i.maxRank=i.temp[0];i.minRank=i.temp[0];i.temp[0]=t[i.maxRank].length-1}if(e!=null&&n!=null){var l=e.maxRank-i.maxRank;if(l>1){n.maxRank=e.maxRank;n.minRank=i.maxRank;n.temp=[];n.x=[];n.y=[];for(var a=n.minRank+1;a<n.maxRank;a++){t[a].push(n);n.setGeneralPurposeVariable(a,t[a].length-1)}}}}),i,false,null)};mxGraphHierarchyModel.prototype.visit=function(t,e,i,n){if(e!=null){for(var r=0;r<e.length;r++){var s=e[r];if(s!=null){if(n==null){n=new Object}if(i){s.hashCode=[];s.hashCode[0]=this.dfsCount;s.hashCode[1]=r;this.extendedDfs(null,s,null,t,n,s.hashCode,r,0)}else{this.dfs(null,s,null,t,n,0)}}}this.dfsCount++}};mxGraphHierarchyModel.prototype.dfs=function(t,e,i,n,r,s){if(e!=null){var l=e.id;if(r[l]==null){r[l]=e;n(t,e,i,s,0);var a=e.connectsAsSource.slice();for(var o=0;o<a.length;o++){var h=a[o];var u=h.target;this.dfs(e,u,h,n,r,s+1)}}else{n(t,e,i,s,1)}}};mxGraphHierarchyModel.prototype.extendedDfs=function(t,e,i,n,r,s,l,a){if(e!=null){if(t!=null){if(e.hashCode==null||e.hashCode[0]!=t.hashCode[0]){var o=t.hashCode.length+1;e.hashCode=t.hashCode.slice();e.hashCode[o-1]=l}}var h=e.id;if(r[h]==null){r[h]=e;n(t,e,i,a,0);var u=e.connectsAsSource.slice();for(var d=0;d<u.length;d++){var p=u[d];var m=p.target;this.extendedDfs(e,m,p,n,r,e.hashCode,d,a+1)}}else{n(t,e,i,a,1)}}};__mxOutput.mxGraphHierarchyModel=typeof mxGraphHierarchyModel!=="undefined"?mxGraphHierarchyModel:undefined;function mxSwimlaneModel(t,e,i,n,r){var s=t.getGraph();this.tightenToSource=r;this.roots=i;this.parent=n;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;var l=[];if(e==null){e=this.graph.getChildVertices(n)}this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(t,e,l);for(var a=0;a<e.length;a++){var o=l[a].connectsAsSource;for(var h=0;h<o.length;h++){var u=o[h];var d=u.edges;if(d!=null&&d.length>0){var p=d[0];var m=t.getVisibleTerminal(p,false);var c=this.vertexMapper.get(m);if(l[a]==c){m=t.getVisibleTerminal(p,true);c=this.vertexMapper.get(m)}if(c!=null&&l[a]!=c){u.target=c;if(c.connectsAsTarget.length==0){c.connectsAsTarget=[]}if(mxUtils.indexOf(c.connectsAsTarget,u)<0){c.connectsAsTarget.push(u)}}}}l[a].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null;mxSwimlaneModel.prototype.vertexMapper=null;mxSwimlaneModel.prototype.edgeMapper=null;mxSwimlaneModel.prototype.ranks=null;mxSwimlaneModel.prototype.roots=null;mxSwimlaneModel.prototype.parent=null;mxSwimlaneModel.prototype.dfsCount=0;mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8;mxSwimlaneModel.prototype.tightenToSource=false;mxSwimlaneModel.prototype.ranksPerGroup=null;mxSwimlaneModel.prototype.createInternalCells=function(t,e,i){var n=t.getGraph();var r=t.swimlanes;for(var s=0;s<e.length;s++){i[s]=new mxGraphHierarchyNode(e[s]);this.vertexMapper.put(e[s],i[s]);i[s].swimlaneIndex=-1;for(var l=0;l<r.length;l++){if(n.model.getParent(e[s])==r[l]){i[s].swimlaneIndex=l;break}}var a=t.getEdges(e[s]);i[s].connectsAsSource=[];for(var o=0;o<a.length;o++){var h=t.getVisibleTerminal(a[o],false);if(h!=e[s]&&t.graph.model.isVertex(h)&&!t.isVertexIgnored(h)){var u=t.getEdgesBetween(e[s],h,false);var d=t.getEdgesBetween(e[s],h,true);if(u!=null&&u.length>0&&this.edgeMapper.get(u[0])==null&&d.length*2>=u.length){var p=new mxGraphHierarchyEdge(u);for(var m=0;m<u.length;m++){var c=u[m];this.edgeMapper.put(c,p);n.resetEdge(c);if(t.disableEdgeStyle){t.setEdgeStyleEnabled(c,false);t.setOrthogonalEdge(c,true)}}p.source=i[s];if(mxUtils.indexOf(i[s].connectsAsSource,p)<0){i[s].connectsAsSource.push(p)}}}}i[s].temp[0]=0}};mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var t=[];var e=new Object;if(this.roots!=null){for(var i=0;i<this.roots.length;i++){var n=this.vertexMapper.get(this.roots[i]);this.maxChainDfs(null,n,null,e,0);if(n!=null){t.push(n)}}}var r=[];var s=[];for(var i=this.ranksPerGroup.length-1;i>=0;i--){if(i==this.ranksPerGroup.length-1){r[i]=0}else{r[i]=s[i+1]+1}s[i]=r[i]+this.ranksPerGroup[i]}this.maxRank=s[0];var l=this.vertexMapper.getValues();for(var i=0;i<l.length;i++){l[i].temp[0]=-1}while(t.length>0){var n=t[0];var a;var o;a=n.connectsAsTarget;o=n.connectsAsSource;var h=true;var u=s[0];for(var i=0;i<a.length;i++){var d=a[i];if(d.temp[0]==5270620){var p=d.source;u=Math.min(u,p.temp[0]-1)}else{h=false;break}}if(h){if(u>s[n.swimlaneIndex]){u=s[n.swimlaneIndex]}n.temp[0]=u;if(o!=null){for(var i=0;i<o.length;i++){var d=o[i];d.temp[0]=5270620;var p=d.target;if(p.temp[0]==-1){t.push(p);p.temp[0]=-2}}}t.shift()}else{var m=t.shift();t.push(n);if(m==n&&t.length==1){break}}}};mxSwimlaneModel.prototype.maxChainDfs=function(t,e,i,n,r){if(e!=null){var s=mxCellPath.create(e.cell);if(n[s]==null){n[s]=e;var l=e.swimlaneIndex;if(this.ranksPerGroup[l]==null||this.ranksPerGroup[l]<r){this.ranksPerGroup[l]=r}var a=e.connectsAsSource.slice();for(var o=0;o<a.length;o++){var h=a[o];var u=h.target;if(e.swimlaneIndex<u.swimlaneIndex){this.maxChainDfs(e,u,h,mxUtils.clone(n,null,true),0)}else if(e.swimlaneIndex==u.swimlaneIndex){this.maxChainDfs(e,u,h,mxUtils.clone(n,null,true),r+1)}}}}};mxSwimlaneModel.prototype.fixRanks=function(){var t=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++){t[e]=[];this.ranks[e]=t[e]}var i=null;if(this.roots!=null){var n=this.roots;i=[];for(var e=0;e<n.length;e++){var r=n[e];var s=this.vertexMapper.get(r);i[e]=s}}this.visit((function(e,i,n,r,s){if(s==0&&i.maxRank<0&&i.minRank<0){t[i.temp[0]].push(i);i.maxRank=i.temp[0];i.minRank=i.temp[0];i.temp[0]=t[i.maxRank].length-1}if(e!=null&&n!=null){var l=e.maxRank-i.maxRank;if(l>1){n.maxRank=e.maxRank;n.minRank=i.maxRank;n.temp=[];n.x=[];n.y=[];for(var a=n.minRank+1;a<n.maxRank;a++){t[a].push(n);n.setGeneralPurposeVariable(a,t[a].length-1)}}}}),i,false,null)};mxSwimlaneModel.prototype.visit=function(t,e,i,n){if(e!=null){for(var r=0;r<e.length;r++){var s=e[r];if(s!=null){if(n==null){n=new Object}if(i){s.hashCode=[];s.hashCode[0]=this.dfsCount;s.hashCode[1]=r;this.extendedDfs(null,s,null,t,n,s.hashCode,r,0)}else{this.dfs(null,s,null,t,n,0)}}}this.dfsCount++}};mxSwimlaneModel.prototype.dfs=function(t,e,i,n,r,s){if(e!=null){var l=e.id;if(r[l]==null){r[l]=e;n(t,e,i,s,0);var a=e.connectsAsSource.slice();for(var o=0;o<a.length;o++){var h=a[o];var u=h.target;this.dfs(e,u,h,n,r,s+1)}}else{n(t,e,i,s,1)}}};mxSwimlaneModel.prototype.extendedDfs=function(t,e,i,n,r,s,l,a){if(e!=null){if(t!=null){if(e.hashCode==null||e.hashCode[0]!=t.hashCode[0]){var o=t.hashCode.length+1;e.hashCode=t.hashCode.slice();e.hashCode[o-1]=l}}var h=e.id;if(r[h]==null){r[h]=e;n(t,e,i,a,0);var u=e.connectsAsSource.slice();var d=e.connectsAsTarget.slice();for(var p=0;p<u.length;p++){var m=u[p];var c=m.target;if(e.swimlaneIndex<=c.swimlaneIndex){this.extendedDfs(e,c,m,n,r,e.hashCode,p,a+1)}}for(var p=0;p<d.length;p++){var m=d[p];var c=m.source;if(e.swimlaneIndex<c.swimlaneIndex){this.extendedDfs(e,c,m,n,r,e.hashCode,p,a+1)}}}else{n(t,e,i,a,1)}}};__mxOutput.mxSwimlaneModel=typeof mxSwimlaneModel!=="undefined"?mxSwimlaneModel:undefined;function mxHierarchicalLayoutStage(){}mxHierarchicalLayoutStage.prototype.execute=function(t){};__mxOutput.mxHierarchicalLayoutStage=typeof mxHierarchicalLayoutStage!=="undefined"?mxHierarchicalLayoutStage:undefined;function mxMedianHybridCrossingReduction(t){this.layout=t}mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage;mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction;mxMedianHybridCrossingReduction.prototype.layout=null;mxMedianHybridCrossingReduction.prototype.maxIterations=24;mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null;mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0;mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0;mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2;mxMedianHybridCrossingReduction.prototype.execute=function(t){var e=this.layout.getModel();this.nestedBestRanks=[];for(var i=0;i<e.ranks.length;i++){this.nestedBestRanks[i]=e.ranks[i].slice()}var n=0;var r=this.calculateCrossings(e);for(var i=0;i<this.maxIterations&&n<this.maxNoImprovementIterations;i++){this.weightedMedian(i,e);this.transpose(i,e);var s=this.calculateCrossings(e);if(s<r){r=s;n=0;for(var l=0;l<this.nestedBestRanks.length;l++){var a=e.ranks[l];for(var o=0;o<a.length;o++){var h=a[o];this.nestedBestRanks[l][h.getGeneralPurposeVariable(l)]=h}}}else{n++;for(var l=0;l<this.nestedBestRanks.length;l++){var a=e.ranks[l];for(var o=0;o<a.length;o++){var h=a[o];h.setGeneralPurposeVariable(l,o)}}}if(r==0){break}}var u=[];var d=[];for(var i=0;i<e.maxRank+1;i++){d[i]=[];u[i]=d[i]}for(var i=0;i<this.nestedBestRanks.length;i++){for(var l=0;l<this.nestedBestRanks[i].length;l++){d[i].push(this.nestedBestRanks[i][l])}}e.ranks=u};mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(t){var e=t.ranks.length;var i=0;for(var n=1;n<e;n++){i+=this.calculateRankCrossing(n,t)}return i};mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(t,e){var i=0;var n=e.ranks[t];var r=e.ranks[t-1];var s=[];for(var l=0;l<n.length;l++){var a=n[l];var o=a.getGeneralPurposeVariable(t);var h=a.getPreviousLayerConnectedCells(t);var u=[];for(var d=0;d<h.length;d++){var p=h[d];var m=p.getGeneralPurposeVariable(t-1);u.push(m)}u.sort((function(t,e){return t-e}));s[o]=u}var c=[];for(var l=0;l<s.length;l++){c=c.concat(s[l])}var x=1;while(x<r.length){x<<=1}var f=2*x-1;x-=1;var g=[];for(var l=0;l<f;++l){g[l]=0}for(var l=0;l<c.length;l++){var v=c[l];var y=v+x;++g[y];while(y>0){if(y%2){i+=g[y+1]}y=y-1>>1;++g[y]}}return i};mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){var i=true;var n=0;var r=10;while(i&&n++<r){var s=t%2==1&&n%2==1;i=false;for(var l=0;l<e.ranks.length;l++){var a=e.ranks[l];var o=[];for(var h=0;h<a.length;h++){var u=a[h];var d=u.getGeneralPurposeVariable(l);if(d<0){d=h}o[d]=u}var p=null;var m=null;var c=null;var x=null;var f=null;var g=null;var v=null;var y=null;var C=null;var E=null;for(var h=0;h<a.length-1;h++){if(h==0){C=o[h];p=C.getNextLayerConnectedCells(l);m=C.getPreviousLayerConnectedCells(l);f=[];g=[];for(var S=0;S<p.length;S++){f[S]=p[S].getGeneralPurposeVariable(l+1)}for(var S=0;S<m.length;S++){g[S]=m[S].getGeneralPurposeVariable(l-1)}}else{p=c;m=x;f=v;g=y;C=E}E=o[h+1];c=E.getNextLayerConnectedCells(l);x=E.getPreviousLayerConnectedCells(l);v=[];y=[];for(var S=0;S<c.length;S++){v[S]=c[S].getGeneralPurposeVariable(l+1)}for(var S=0;S<x.length;S++){y[S]=x[S].getGeneralPurposeVariable(l-1)}var b=0;var w=0;for(var S=0;S<f.length;S++){for(var T=0;T<v.length;T++){if(f[S]>v[T]){b++}if(f[S]<v[T]){w++}}}for(var S=0;S<g.length;S++){for(var T=0;T<y.length;T++){if(g[S]>y[T]){b++}if(g[S]<y[T]){w++}}}if(w<b||w==b&&s){var L=C.getGeneralPurposeVariable(l);C.setGeneralPurposeVariable(l,E.getGeneralPurposeVariable(l));E.setGeneralPurposeVariable(l,L);c=p;x=m;v=f;y=g;E=C;if(!s){i=true}}}}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(t,e){var i=t%2==0;if(i){for(var n=e.maxRank-1;n>=0;n--){this.medianRank(n,i)}}else{for(var n=1;n<e.maxRank;n++){this.medianRank(n,i)}}};mxMedianHybridCrossingReduction.prototype.medianRank=function(t,e){var i=this.nestedBestRanks[t].length;var n=[];var r=[];for(var s=0;s<i;s++){var l=this.nestedBestRanks[t][s];var a=new MedianCellSorter;a.cell=l;var o;if(e){o=l.getNextLayerConnectedCells(t)}else{o=l.getPreviousLayerConnectedCells(t)}var h;if(e){h=t+1}else{h=t-1}if(o!=null&&o.length!=0){a.medianValue=this.medianValue(o,h);n.push(a)}else{r[l.getGeneralPurposeVariable(t)]=true}}n.sort(MedianCellSorter.prototype.compare);for(var s=0;s<i;s++){if(r[s]==null){var l=n.shift().cell;l.setGeneralPurposeVariable(t,s)}}};mxMedianHybridCrossingReduction.prototype.medianValue=function(t,e){var i=[];var n=0;for(var r=0;r<t.length;r++){var s=t[r];i[n++]=s.getGeneralPurposeVariable(e)}i.sort((function(t,e){return t-e}));if(n%2==1){return i[Math.floor(n/2)]}else if(n==2){return(i[0]+i[1])/2}else{var l=n/2;var a=i[l-1]-i[0];var o=i[n-1]-i[l];return(i[l-1]*o+i[l]*a)/(a+o)}};function MedianCellSorter(){}MedianCellSorter.prototype.medianValue=0;MedianCellSorter.prototype.cell=false;MedianCellSorter.prototype.compare=function(t,e){if(t!=null&&e!=null){if(e.medianValue>t.medianValue){return-1}else if(e.medianValue<t.medianValue){return 1}else{return 0}}else{return 0}};__mxOutput.mxMedianHybridCrossingReduction=typeof mxMedianHybridCrossingReduction!=="undefined"?mxMedianHybridCrossingReduction:undefined;function mxMinimumCycleRemover(t){this.layout=t}mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage;mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover;mxMinimumCycleRemover.prototype.layout=null;mxMinimumCycleRemover.prototype.execute=function(t){var e=this.layout.getModel();var i=new Object;var n=e.vertexMapper.getValues();var r=new Object;for(var s=0;s<n.length;s++){r[n[s].id]=n[s]}var l=null;if(e.roots!=null){var a=e.roots;l=[];for(var s=0;s<a.length;s++){l[s]=e.vertexMapper.get(a[s])}}e.visit((function(t,e,n,s,l){if(e.isAncestor(t)){n.invert();mxUtils.remove(n,t.connectsAsSource);t.connectsAsTarget.push(n);mxUtils.remove(n,e.connectsAsTarget);e.connectsAsSource.push(n)}i[e.id]=e;delete r[e.id]}),l,true,null);var o=mxUtils.clone(i,null,true);e.visit((function(t,e,n,s,l){if(e.isAncestor(t)){n.invert();mxUtils.remove(n,t.connectsAsSource);e.connectsAsSource.push(n);t.connectsAsTarget.push(n);mxUtils.remove(n,e.connectsAsTarget)}i[e.id]=e;delete r[e.id]}),r,true,o)};__mxOutput.mxMinimumCycleRemover=typeof mxMinimumCycleRemover!=="undefined"?mxMinimumCycleRemover:undefined;function mxCoordinateAssignment(t,e,i,n,r,s){this.layout=t;this.intraCellSpacing=e;this.interRankCellSpacing=i;this.orientation=n;this.initialX=r;this.parallelEdgeSpacing=s}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage;mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment;mxCoordinateAssignment.prototype.layout=null;mxCoordinateAssignment.prototype.intraCellSpacing=30;mxCoordinateAssignment.prototype.interRankCellSpacing=100;mxCoordinateAssignment.prototype.parallelEdgeSpacing=10;mxCoordinateAssignment.prototype.maxIterations=8;mxCoordinateAssignment.prototype.prefHozEdgeSep=5;mxCoordinateAssignment.prototype.prefVertEdgeOff=2;mxCoordinateAssignment.prototype.minEdgeJetty=12;mxCoordinateAssignment.prototype.channelBuffer=4;mxCoordinateAssignment.prototype.jettyPositions=null;mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH;mxCoordinateAssignment.prototype.initialX=null;mxCoordinateAssignment.prototype.limitX=null;mxCoordinateAssignment.prototype.currentXDelta=null;mxCoordinateAssignment.prototype.widestRank=null;mxCoordinateAssignment.prototype.rankTopY=null;mxCoordinateAssignment.prototype.rankBottomY=null;mxCoordinateAssignment.prototype.widestRankValue=null;mxCoordinateAssignment.prototype.rankWidths=null;mxCoordinateAssignment.prototype.rankY=null;mxCoordinateAssignment.prototype.fineTuning=true;mxCoordinateAssignment.prototype.nextLayerConnectedCache=null;mxCoordinateAssignment.prototype.previousLayerConnectedCache=null;mxCoordinateAssignment.prototype.groupPadding=10;mxCoordinateAssignment.prototype.printStatus=function(){var t=this.layout.getModel();mxLog.show();mxLog.writeln("======Coord assignment debug=======");for(var e=0;e<t.ranks.length;e++){mxLog.write("Rank ",e," : ");var i=t.ranks[e];for(var n=0;n<i.length;n++){var r=i[n];mxLog.write(r.getGeneralPurposeVariable(e)," ")}mxLog.writeln()}mxLog.writeln("====================================")};mxCoordinateAssignment.prototype.execute=function(t){this.jettyPositions=Object();var e=this.layout.getModel();this.currentXDelta=0;this.initialCoords(this.layout.getGraph(),e);if(this.fineTuning){this.minNode(e)}var i=1e8;if(this.fineTuning){for(var n=0;n<this.maxIterations;n++){if(n!=0){this.medianPos(n,e);this.minNode(e)}if(this.currentXDelta<i){for(var r=0;r<e.ranks.length;r++){var s=e.ranks[r];for(var l=0;l<s.length;l++){var a=s[l];a.setX(r,a.getGeneralPurposeVariable(r))}}i=this.currentXDelta}else{for(var r=0;r<e.ranks.length;r++){var s=e.ranks[r];for(var l=0;l<s.length;l++){var a=s[l];a.setGeneralPurposeVariable(r,a.getX(r))}}}this.minPath(this.layout.getGraph(),e);this.currentXDelta=0}}this.setCellLocations(this.layout.getGraph(),e)};mxCoordinateAssignment.prototype.minNode=function(t){var e=[];var i=new mxDictionary;var n=[];for(var r=0;r<=t.maxRank;r++){n[r]=t.ranks[r];for(var s=0;s<n[r].length;s++){var l=n[r][s];var a=new WeightedCellSorter(l,r);a.rankIndex=s;a.visited=true;e.push(a);i.put(l,a)}}var o=e.length*10;var h=0;var u=1;while(e.length>0&&h<=o){var d=e.shift();var p=d.cell;var m=d.weightedValue;var c=parseInt(d.rankIndex);var x=p.getNextLayerConnectedCells(m);var f=p.getPreviousLayerConnectedCells(m);var g=x.length;var v=f.length;var y=this.medianXValue(x,m+1);var C=this.medianXValue(f,m-1);var E=g+v;var S=p.getGeneralPurposeVariable(m);var b=S;if(E>0){b=(y*g+C*v)/E}var w=false;if(b<S-u){if(c==0){p.setGeneralPurposeVariable(m,b);w=true}else{var T=n[m][c-1];var L=T.getGeneralPurposeVariable(m);L=L+T.width/2+this.intraCellSpacing+p.width/2;if(L<b){p.setGeneralPurposeVariable(m,b);w=true}else if(L<p.getGeneralPurposeVariable(m)-u){p.setGeneralPurposeVariable(m,L);w=true}}}else if(b>S+u){var A=n[m].length;if(c==A-1){p.setGeneralPurposeVariable(m,b);w=true}else{var M=n[m][c+1];var _=M.getGeneralPurposeVariable(m);_=_-M.width/2-this.intraCellSpacing-p.width/2;if(_>b){p.setGeneralPurposeVariable(m,b);w=true}else if(_>p.getGeneralPurposeVariable(m)+u){p.setGeneralPurposeVariable(m,_);w=true}}}if(w){for(var r=0;r<x.length;r++){var I=x[r];var O=i.get(I);if(O!=null){if(O.visited==false){O.visited=true;e.push(O)}}}for(var r=0;r<f.length;r++){var I=f[r];var O=i.get(I);if(O!=null){if(O.visited==false){O.visited=true;e.push(O)}}}}d.visited=false;h++}};mxCoordinateAssignment.prototype.medianPos=function(t,e){var i=t%2==0;if(i){for(var n=e.maxRank;n>0;n--){this.rankMedianPosition(n-1,e,n)}}else{for(var n=0;n<e.maxRank-1;n++){this.rankMedianPosition(n+1,e,n)}}};mxCoordinateAssignment.prototype.rankMedianPosition=function(t,e,i){var n=e.ranks[t];var r=[];var s=new Object;for(var l=0;l<n.length;l++){var a=n[l];r[l]=new WeightedCellSorter;r[l].cell=a;r[l].rankIndex=l;s[a.id]=r[l];var o=null;if(i<t){o=a.getPreviousLayerConnectedCells(t)}else{o=a.getNextLayerConnectedCells(t)}r[l].weightedValue=this.calculatedWeightedValue(a,o)}r.sort(WeightedCellSorter.prototype.compare);for(var l=0;l<r.length;l++){var h=0;var u=r[l].cell;var o=null;var d=0;if(i<t){o=u.getPreviousLayerConnectedCells(t).slice()}else{o=u.getNextLayerConnectedCells(t).slice()}if(o!=null){h=o.length;if(h>0){d=this.medianXValue(o,i)}else{d=u.getGeneralPurposeVariable(t)}}var p=0;var m=-1e8;for(var c=r[l].rankIndex-1;c>=0;){var x=s[n[c].id];if(x!=null){var f=x.cell;if(x.visited){m=f.getGeneralPurposeVariable(t)+f.width/2+this.intraCellSpacing+p+u.width/2;c=-1}else{p+=f.width+this.intraCellSpacing;c--}}}var g=0;var v=1e8;for(var c=r[l].rankIndex+1;c<r.length;){var x=s[n[c].id];if(x!=null){var y=x.cell;if(x.visited){v=y.getGeneralPurposeVariable(t)-y.width/2-this.intraCellSpacing-g-u.width/2;c=r.length}else{g+=y.width+this.intraCellSpacing;c++}}}if(d>=m&&d<=v){u.setGeneralPurposeVariable(t,d)}else if(d<m){u.setGeneralPurposeVariable(t,m);this.currentXDelta+=m-d}else if(d>v){u.setGeneralPurposeVariable(t,v);this.currentXDelta+=d-v}r[l].visited=true}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){var i=0;for(var n=0;n<e.length;n++){var r=e[n];if(t.isVertex()&&r.isVertex()){i++}else if(t.isEdge()&&r.isEdge()){i+=8}else{i+=2}}return i};mxCoordinateAssignment.prototype.medianXValue=function(t,e){if(t.length==0){return 0}var i=[];for(var n=0;n<t.length;n++){i[n]=t[n].getGeneralPurposeVariable(e)}i.sort((function(t,e){return t-e}));if(t.length%2==1){return i[Math.floor(t.length/2)]}else{var r=t.length/2;var s=i[r-1];var l=i[r];return(s+l)/2}};mxCoordinateAssignment.prototype.initialCoords=function(t,e){this.calculateWidestRank(t,e);for(var i=this.widestRank;i>=0;i--){if(i<e.maxRank){this.rankCoordinates(i,t,e)}}for(var i=this.widestRank+1;i<=e.maxRank;i++){if(i>0){this.rankCoordinates(i,t,e)}}};mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){var n=i.ranks[t];var r=this.initialX+(this.widestRankValue-this.rankWidths[t])/2;var s=false;for(var l=0;l<n.length;l++){var a=n[l];if(a.isVertex()){var o=this.layout.getVertexBounds(a.cell);if(o!=null){if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){a.width=o.width;a.height=o.height}else{a.width=o.height;a.height=o.width}}else{s=true}}else if(a.isEdge()){var h=1;if(a.edges!=null){h=a.edges.length}else{mxLog.warn("edge.edges is null")}a.width=(h-1)*this.parallelEdgeSpacing}r+=a.width/2;a.setX(t,r);a.setGeneralPurposeVariable(t,r);r+=a.width/2;r+=this.intraCellSpacing}if(s==true){mxLog.warn("At least one cell has no bounds")}};mxCoordinateAssignment.prototype.calculateWidestRank=function(t,e){var i=-this.interRankCellSpacing;var n=0;this.rankWidths=[];this.rankY=[];for(var r=e.maxRank;r>=0;r--){var s=0;var l=e.ranks[r];var a=this.initialX;var o=false;for(var h=0;h<l.length;h++){var u=l[h];if(u.isVertex()){var d=this.layout.getVertexBounds(u.cell);if(d!=null){if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){u.width=d.width;u.height=d.height}else{u.width=d.height;u.height=d.width}}else{o=true}s=Math.max(s,u.height)}else if(u.isEdge()){var p=1;if(u.edges!=null){p=u.edges.length}else{mxLog.warn("edge.edges is null")}u.width=(p-1)*this.parallelEdgeSpacing}a+=u.width/2;u.setX(r,a);u.setGeneralPurposeVariable(r,a);a+=u.width/2;a+=this.intraCellSpacing;if(a>this.widestRankValue){this.widestRankValue=a;this.widestRank=r}this.rankWidths[r]=a}if(o==true){mxLog.warn("At least one cell has no bounds")}this.rankY[r]=i;var m=s/2+n/2+this.interRankCellSpacing;n=s;if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST){i+=m}else{i-=m}for(var h=0;h<l.length;h++){var c=l[h];c.setY(r,i)}}};mxCoordinateAssignment.prototype.minPath=function(t,e){var i=e.edgeMapper.getValues();for(var n=0;n<i.length;n++){var r=i[n];if(r.maxRank-r.minRank-1<1){continue}var s=r.getGeneralPurposeVariable(r.minRank+1);var l=true;var a=0;for(var o=r.minRank+2;o<r.maxRank;o++){var h=r.getGeneralPurposeVariable(o);if(s!=h){l=false;s=h}else{a++}}if(!l){var u=0;var d=0;var p=[];var m=[];var c=r.getGeneralPurposeVariable(r.minRank+1);for(var o=r.minRank+1;o<r.maxRank-1;o++){var x=r.getX(o+1);if(c==x){p[o-r.minRank-1]=c;u++}else if(this.repositionValid(e,r,o+1,c)){p[o-r.minRank-1]=c;u++}else{p[o-r.minRank-1]=x;c=x}}c=r.getX(o);for(var o=r.maxRank-1;o>r.minRank+1;o--){var x=r.getX(o-1);if(c==x){m[o-r.minRank-2]=c;d++}else if(this.repositionValid(e,r,o-1,c)){m[o-r.minRank-2]=c;d++}else{m[o-r.minRank-2]=r.getX(o-1);c=x}}if(d>a||u>a){if(d>=u){for(var o=r.maxRank-2;o>r.minRank;o--){r.setX(o,m[o-r.minRank-1])}}else if(u>d){for(var o=r.minRank+2;o<r.maxRank;o++){r.setX(o,p[o-r.minRank-2])}}}}}};mxCoordinateAssignment.prototype.repositionValid=function(t,e,i,n){var r=t.ranks[i];var s=-1;for(var l=0;l<r.length;l++){if(e==r[l]){s=l;break}}if(s<0){return false}var a=e.getGeneralPurposeVariable(i);if(n<a){if(s==0){return true}var o=r[s-1];var h=o.getGeneralPurposeVariable(i);h=h+o.width/2+this.intraCellSpacing+e.width/2;if(h<=n){return true}else{return false}}else if(n>a){if(s==r.length-1){return true}var u=r[s+1];var d=u.getGeneralPurposeVariable(i);d=d-u.width/2-this.intraCellSpacing-e.width/2;if(d>=n){return true}else{return false}}return true};mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[];this.rankBottomY=[];for(var i=0;i<e.ranks.length;i++){this.rankTopY[i]=Number.MAX_VALUE;this.rankBottomY[i]=-Number.MAX_VALUE}var n=e.vertexMapper.getValues();for(var i=0;i<n.length;i++){this.setVertexLocation(n[i])}if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.layout.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){this.localEdgeProcessing(e)}var r=e.edgeMapper.getValues();for(var i=0;i<r.length;i++){this.setEdgePosition(r[i])}};mxCoordinateAssignment.prototype.localEdgeProcessing=function(t){for(var e=0;e<t.ranks.length;e++){var i=t.ranks[e];for(var n=0;n<i.length;n++){var r=i[n];if(r.isVertex()){var s=r.getPreviousLayerConnectedCells(e);var l=e-1;for(var a=0;a<2;a++){if(l>-1&&l<t.ranks.length&&s!=null&&s.length>0){var o=[];for(var h=0;h<s.length;h++){var u=new WeightedCellSorter(s[h],s[h].getX(l));o.push(u)}o.sort(WeightedCellSorter.prototype.compare);var d=r.x[0]-r.width/2;var p=d+r.width;var m=0;var c=[];for(var h=0;h<o.length;h++){var x=o[h].cell;var f;if(x.isVertex()){if(a==0){f=r.connectsAsSource}else{f=r.connectsAsTarget}for(var g=0;g<f.length;g++){if(f[g].source==x||f[g].target==x){m+=f[g].edges.length;c.push(f[g])}}}else{m+=x.edges.length;c.push(x)}}var v=(m+1)*this.prefHozEdgeSep;if(r.width>v+2*this.prefHozEdgeSep){d+=this.prefHozEdgeSep;p-=this.prefHozEdgeSep}var y=p-d;var C=y/m;var E=d+C/2;var S=this.minEdgeJetty-this.prefVertEdgeOff;for(var h=0;h<c.length;h++){var b=c[h].edges.length;var w=this.jettyPositions[c[h].ids[0]];if(w==null){w=[];this.jettyPositions[c[h].ids[0]]=w}if(h<m/2){S+=this.prefVertEdgeOff}else if(h>m/2){S-=this.prefVertEdgeOff}for(var T=0;T<b;T++){w[T*4+a*2]=E;E+=C;w[T*4+a*2+1]=S}}}s=r.getNextLayerConnectedCells(e);l=e+1}}}}};mxCoordinateAssignment.prototype.setEdgePosition=function(t){var e=0;if(t.temp[0]!=101207){var i=t.maxRank;var n=t.minRank;if(i==n){i=t.source.maxRank;n=t.target.minRank}var r=0;var s=this.jettyPositions[t.ids[0]];var l=t.isReversed?t.target.cell:t.source.cell;var a=this.layout.graph;var o=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH;for(var h=0;h<t.edges.length;h++){var u=t.edges[h];var d=this.layout.getVisibleTerminal(u,true);var p=[];var m=t.isReversed;if(d!=l){m=!m}if(s!=null){var c=m?2:0;var x=m?o?this.rankBottomY[n]:this.rankTopY[n]:o?this.rankTopY[i]:this.rankBottomY[i];var f=s[r*4+1+c];if(m!=o){f=-f}x+=f;var g=s[r*4+c];var v=a.model.getTerminal(u,true);if(this.layout.isPort(v)&&a.model.getParent(v)==d){var y=a.view.getState(v);if(y!=null){g=y.x}else{g=d.geometry.x+t.source.width*v.geometry.x}}if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){p.push(new mxPoint(g,x));if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(g,x+f))}}else{p.push(new mxPoint(x,g));if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(x+f,g))}}}var C=t.x.length-1;var E=-1;var S=-1;var b=t.maxRank-1;if(m){C=0;E=t.x.length;S=1;b=t.minRank+1}for(var w=C;t.maxRank!=t.minRank&&w!=E;w+=S){var T=t.x[w]+e;var L=(this.rankTopY[b]+this.rankBottomY[b+1])/2;var A=(this.rankTopY[b-1]+this.rankBottomY[b])/2;if(m){var M=L;L=A;A=M}if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){p.push(new mxPoint(T,L));p.push(new mxPoint(T,A))}else{p.push(new mxPoint(L,T));p.push(new mxPoint(A,T))}this.limitX=Math.max(this.limitX,T);b+=S}if(s!=null){var c=m?2:0;var _=m?o?this.rankTopY[i]:this.rankBottomY[i]:o?this.rankBottomY[n]:this.rankTopY[n];var f=s[r*4+3-c];if(m!=o){f=-f}var x=_-f;var g=s[r*4+2-c];var I=a.model.getTerminal(u,false);var O=this.layout.getVisibleTerminal(u,false);if(this.layout.isPort(I)&&a.model.getParent(I)==O){var y=a.view.getState(I);if(y!=null){g=y.x}else{g=O.geometry.x+t.target.width*I.geometry.x}}if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(g,x-f))}p.push(new mxPoint(g,x))}else{if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(x-f,g))}p.push(new mxPoint(x,g))}}if(t.isReversed){this.processReversedEdge(t,u)}this.layout.setEdgePoints(u,p);if(e==0){e=this.parallelEdgeSpacing}else if(e>0){e=-e}else{e=-e+this.parallelEdgeSpacing}r++}t.temp[0]=101207}};mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell;var i=t.x[0]-t.width/2;var n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n);this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height);if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){this.layout.setVertexLocation(e,i,n)}else{this.layout.setVertexLocation(e,n,i)}this.limitX=Math.max(this.limitX,i+t.width)};mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){};__mxOutput.mxCoordinateAssignment=typeof mxCoordinateAssignment!=="undefined"?mxCoordinateAssignment:undefined;function mxSwimlaneOrdering(t){this.layout=t}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage;mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering;mxSwimlaneOrdering.prototype.layout=null;mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel();var i=new Object;var n=mxUtils.clone(e.vertexMapper,null,true);var r=null;if(e.roots!=null){var s=e.roots;r=[];for(var l=0;l<s.length;l++){r[l]=e.vertexMapper.get(s[l])}}e.visit((function(t,e,r,s,l){var a=t!=null&&t.swimlaneIndex==e.swimlaneIndex&&e.isAncestor(t);var o=t!=null&&r!=null&&t.swimlaneIndex<e.swimlaneIndex&&r.source==e;if(a){r.invert();mxUtils.remove(r,t.connectsAsSource);e.connectsAsSource.push(r);t.connectsAsTarget.push(r);mxUtils.remove(r,e.connectsAsTarget)}else if(o){r.invert();mxUtils.remove(r,t.connectsAsTarget);e.connectsAsTarget.push(r);t.connectsAsSource.push(r);mxUtils.remove(r,e.connectsAsSource)}var h=mxCellPath.create(e.cell);i[h]=e;delete n[h]}),r,true,null)};__mxOutput.mxSwimlaneOrdering=typeof mxSwimlaneOrdering!=="undefined"?mxSwimlaneOrdering:undefined;function mxHierarchicalLayout(t,e,i){mxGraphLayout.call(this,t);this.orientation=e!=null?e:mxConstants.DIRECTION_NORTH;this.deterministic=i!=null?i:true}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout;mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout;mxHierarchicalLayout.prototype.roots=null;mxHierarchicalLayout.prototype.resizeParent=false;mxHierarchicalLayout.prototype.maintainParentLocation=false;mxHierarchicalLayout.prototype.moveParent=false;mxHierarchicalLayout.prototype.parentBorder=0;mxHierarchicalLayout.prototype.intraCellSpacing=30;mxHierarchicalLayout.prototype.interRankCellSpacing=100;mxHierarchicalLayout.prototype.interHierarchySpacing=60;mxHierarchicalLayout.prototype.parallelEdgeSpacing=10;mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxHierarchicalLayout.prototype.fineTuning=true;mxHierarchicalLayout.prototype.tightenToSource=true;mxHierarchicalLayout.prototype.disableEdgeStyle=true;mxHierarchicalLayout.prototype.traverseAncestors=true;mxHierarchicalLayout.prototype.model=null;mxHierarchicalLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxHierarchicalLayout.prototype.getModel=function(){return this.model};mxHierarchicalLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(e!=null&&!(e instanceof Array)){e=[e]}if(e==null&&t==null){return}this.parentX=null;this.parentY=null;if(t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var n=this.graph.getCellGeometry(t);if(n!=null){this.parentX=n.x;this.parentY=n.y}}if(e!=null){var r=[];for(var s=0;s<e.length;s++){var l=t!=null?i.isAncestor(t,e[s]):true;if(l&&i.isVertex(e[s])){r.push(e[s])}}this.roots=r}i.beginUpdate();try{this.run(t);if(this.resizeParent&&!this.graph.isCellCollapsed(t)){this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent)}if(this.parentX!=null&&this.parentY!=null){var n=this.graph.getCellGeometry(t);if(n!=null){n=n.clone();n.x=this.parentX;n.y=this.parentY;i.setGeometry(t,n)}}}finally{i.endUpdate()}};mxHierarchicalLayout.prototype.findRoots=function(t,e){var i=[];if(t!=null&&e!=null){var n=this.graph.model;var r=null;var s=-1e5;for(var l in e){var a=e[l];if(n.isVertex(a)&&this.graph.isCellVisible(a)){var o=this.getEdges(a);var h=0;var u=0;for(var d=0;d<o.length;d++){var p=this.getVisibleTerminal(o[d],true);if(p==a){h++}else{u++}}if(u==0&&h>0){i.push(a)}var m=h-u;if(m>s){s=m;r=a}}}if(i.length==0&&r!=null){i.push(r)}}return i};mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null){return e}var i=this.graph.model;var n=[];var r=this.graph.isCellCollapsed(t);var s=i.getChildCount(t);for(var l=0;l<s;l++){var a=i.getChildAt(t,l);if(this.isPort(a)){n=n.concat(i.getEdges(a,true,true))}else if(r||!this.graph.isCellVisible(a)){n=n.concat(i.getEdges(a,true,true))}}n=n.concat(i.getEdges(t,true,true));var o=[];for(var l=0;l<n.length;l++){var h=this.getVisibleTerminal(n[l],true);var u=this.getVisibleTerminal(n[l],false);if(h==u||h!=u&&(u==t&&(this.parent==null||this.isAncestor(this.parent,h,this.traverseAncestors))||h==t&&(this.parent==null||this.isAncestor(this.parent,u,this.traverseAncestors)))){o.push(n[l])}}this.edgesCache.put(t,o);return o};mxHierarchicalLayout.prototype.getVisibleTerminal=function(t,e){var i=this.edgesTargetTermCache;if(e){i=this.edgeSourceTermCache}var n=i.get(t);if(n!=null){return n}var r=this.graph.view.getState(t);var s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);if(s==null){s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)}if(s!=null){if(this.isPort(s)){s=this.graph.model.getParent(s)}i.put(t,s)}return s};mxHierarchicalLayout.prototype.run=function(t){var e=[];var i=[];if(this.roots==null&&t!=null){var n=Object();this.filterDescendants(t,n);this.roots=[];var r=true;for(var s in n){if(n[s]!=null){r=false;break}}while(!r){var l=this.findRoots(t,n);for(var a=0;a<l.length;a++){var o=Object();e.push(o);this.traverse(l[a],true,null,i,o,e,n)}for(var a=0;a<l.length;a++){this.roots.push(l[a])}r=true;for(var s in n){if(n[s]!=null){r=false;break}}}}else{for(var a=0;a<this.roots.length;a++){var o=Object();e.push(o);this.traverse(this.roots[a],true,null,i,o,e,null)}}var h=0;for(var a=0;a<e.length;a++){var o=e[a];var u=[];for(var s in o){u.push(o[s])}this.model=new mxGraphHierarchyModel(this,u,this.roots,t,this.tightenToSource);this.cycleStage(t);this.layeringStage();this.crossingStage(t);h=this.placementStage(h,t)}};mxHierarchicalLayout.prototype.filterDescendants=function(t,e){var i=this.graph.model;if(i.isVertex(t)&&t!=this.parent&&this.graph.isCellVisible(t)){e[mxObjectIdentity.get(t)]=t}if(this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t)){var n=i.getChildCount(t);for(var r=0;r<n;r++){var s=i.getChildAt(t,r);if(!this.isPort(s)){this.filterDescendants(s,e)}}}};mxHierarchicalLayout.prototype.isPort=function(t){if(t!=null&&t.geometry!=null){return t.geometry.relative}else{return false}};mxHierarchicalLayout.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdges(t);var r=[];for(var s=0;s<n.length;s++){var l=this.getVisibleTerminal(n[s],true);var a=this.getVisibleTerminal(n[s],false);if(l==t&&a==e||!i&&l==e&&a==t){r.push(n[s])}}return r};mxHierarchicalLayout.prototype.traverse=function(t,e,i,n,r,s,l){if(t!=null&&n!=null){var a=mxObjectIdentity.get(t);if(n[a]==null&&(l==null?true:l[a]!=null)){if(r[a]==null){r[a]=t}if(n[a]==null){n[a]=t}if(l!==null){delete l[a]}var o=this.getEdges(t);var h=[];for(var u=0;u<o.length;u++){h[u]=this.getVisibleTerminal(o[u],true)==t}for(var u=0;u<o.length;u++){if(!e||h[u]){var d=this.getVisibleTerminal(o[u],!h[u]);var p=1;for(var m=0;m<o.length;m++){if(m==u){continue}else{var c=h[m];var x=this.getVisibleTerminal(o[m],!c);if(x==d){if(c){p++}else{p--}}}}if(p>=0){r=this.traverse(d,e,o[u],n,r,s,l)}}}}else{if(r[a]==null){for(var u=0;u<s.length;u++){var f=s[u];if(f[a]!=null){for(var g in f){r[g]=f[g]}s.splice(u,1);return r}}}}}return r};mxHierarchicalLayout.prototype.cycleStage=function(t){var e=new mxMinimumCycleRemover(this);e.execute(t)};mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxHierarchicalLayout.prototype.crossingStage=function(t){var e=new mxMedianHybridCrossingReduction(this);e.execute(t)};mxHierarchicalLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);i.fineTuning=this.fineTuning;i.execute(e);return i.limitX+this.interHierarchySpacing};__mxOutput.mxHierarchicalLayout=typeof mxHierarchicalLayout!=="undefined"?mxHierarchicalLayout:undefined;function mxSwimlaneLayout(t,e,i){mxGraphLayout.call(this,t);this.orientation=e!=null?e:mxConstants.DIRECTION_NORTH;this.deterministic=i!=null?i:true}mxSwimlaneLayout.prototype=new mxGraphLayout;mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout;mxSwimlaneLayout.prototype.roots=null;mxSwimlaneLayout.prototype.swimlanes=null;mxSwimlaneLayout.prototype.dummyVertexWidth=50;mxSwimlaneLayout.prototype.resizeParent=false;mxSwimlaneLayout.prototype.maintainParentLocation=false;mxSwimlaneLayout.prototype.moveParent=false;mxSwimlaneLayout.prototype.parentBorder=30;mxSwimlaneLayout.prototype.intraCellSpacing=30;mxSwimlaneLayout.prototype.interRankCellSpacing=100;mxSwimlaneLayout.prototype.interHierarchySpacing=60;mxSwimlaneLayout.prototype.parallelEdgeSpacing=10;mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxSwimlaneLayout.prototype.fineTuning=true;mxSwimlaneLayout.prototype.tightenToSource=true;mxSwimlaneLayout.prototype.disableEdgeStyle=true;mxSwimlaneLayout.prototype.traverseAncestors=true;mxSwimlaneLayout.prototype.model=null;mxSwimlaneLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxSwimlaneLayout.prototype.getModel=function(){return this.model};mxSwimlaneLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(e==null||e.length<1){return}if(t==null){t=i.getParent(e[0])}this.parentX=null;this.parentY=null;if(t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var n=this.graph.getCellGeometry(t);if(n!=null){this.parentX=n.x;this.parentY=n.y}}this.swimlanes=e;var r=[];for(var s=0;s<e.length;s++){var l=this.graph.getChildCells(e[s]);if(l==null||l.length==0){var a=this.graph.insertVertex(e[s],null,null,0,0,this.dummyVertexWidth,0);r.push(a)}}i.beginUpdate();try{this.run(t);if(this.resizeParent&&!this.graph.isCellCollapsed(t)){this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent)}if(this.parentX!=null&&this.parentY!=null){var n=this.graph.getCellGeometry(t);if(n!=null){n=n.clone();n.x=this.parentX;n.y=this.parentY;i.setGeometry(t,n)}}this.graph.removeCells(r)}finally{i.endUpdate()}};mxSwimlaneLayout.prototype.updateGroupBounds=function(){var t=[];var e=this.model;for(var i in e.edgeMapper){var n=e.edgeMapper[i];for(var r=0;r<n.edges.length;r++){t.push(n.edges[r])}}var s=this.graph.getBoundingBoxFromGeometry(t,true);var l=[];for(var r=0;r<this.swimlanes.length;r++){var a=this.swimlanes[r];var o=this.graph.getCellGeometry(a);if(o!=null){var h=this.graph.getChildCells(a);var u=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;var d=this.graph.getBoundingBoxFromGeometry(h);l[r]=d;var p=d.y+o.y-u.height-this.parentBorder;var m=d.y+o.y+d.height;if(s==null){s=new mxRectangle(0,p,0,m-p)}else{s.y=Math.min(s.y,p);var c=Math.max(s.y+s.height,m);s.height=c-s.y}}}for(var r=0;r<this.swimlanes.length;r++){var a=this.swimlanes[r];var o=this.graph.getCellGeometry(a);if(o!=null){var h=this.graph.getChildCells(a);var u=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;var x=o.clone();var f=r==0?this.parentBorder:this.interRankCellSpacing/2;var g=u.width+f;var v=l[r].x-g;var y=s.y-this.parentBorder;x.x+=v;x.y=y;x.width=l[r].width+g+this.interRankCellSpacing/2;x.height=s.height+u.height+2*this.parentBorder;this.graph.model.setGeometry(a,x);this.graph.moveCells(h,-v,o.y-y)}}};mxSwimlaneLayout.prototype.findRoots=function(t,e){var i=[];if(t!=null&&e!=null){var n=this.graph.model;var r=null;var s=-1e5;for(var l in e){var a=e[l];if(a!=null&&n.isVertex(a)&&this.graph.isCellVisible(a)&&n.isAncestor(t,a)){var o=this.getEdges(a);var h=0;var u=0;for(var d=0;d<o.length;d++){var p=this.getVisibleTerminal(o[d],true);if(p==a){var m=this.getVisibleTerminal(o[d],false);if(n.isAncestor(t,m)){h++}}else if(n.isAncestor(t,p)){u++}}if(u==0&&h>0){i.push(a)}var c=h-u;if(c>s){s=c;r=a}}}if(i.length==0&&r!=null){i.push(r)}}return i};mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null){return e}var i=this.graph.model;var n=[];var r=this.graph.isCellCollapsed(t);var s=i.getChildCount(t);for(var l=0;l<s;l++){var a=i.getChildAt(t,l);if(this.isPort(a)){n=n.concat(i.getEdges(a,true,true))}else if(r||!this.graph.isCellVisible(a)){n=n.concat(i.getEdges(a,true,true))}}n=n.concat(i.getEdges(t,true,true));var o=[];for(var l=0;l<n.length;l++){var h=this.getVisibleTerminal(n[l],true);var u=this.getVisibleTerminal(n[l],false);if(h==u||h!=u&&(u==t&&(this.parent==null||this.graph.isValidAncestor(h,this.parent,this.traverseAncestors))||h==t&&(this.parent==null||this.graph.isValidAncestor(u,this.parent,this.traverseAncestors)))){o.push(n[l])}}this.edgesCache.put(t,o);return o};mxSwimlaneLayout.prototype.getVisibleTerminal=function(t,e){var i=this.edgesTargetTermCache;if(e){i=this.edgeSourceTermCache}var n=i.get(t);if(n!=null){return n}var r=this.graph.view.getState(t);var s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);if(s==null){s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)}if(s!=null){if(this.isPort(s)){s=this.graph.model.getParent(s)}i.put(t,s)}return s};mxSwimlaneLayout.prototype.run=function(t){var e=[];var i=Object();if(this.swimlanes!=null&&this.swimlanes.length>0&&t!=null){var n=Object();for(var r=0;r<this.swimlanes.length;r++){this.filterDescendants(this.swimlanes[r],n)}this.roots=[];var s=true;for(var l in n){if(n[l]!=null){s=false;break}}var a=0;while(!s&&a<this.swimlanes.length){var o=this.findRoots(this.swimlanes[a],n);if(o.length==0){a++;continue}for(var r=0;r<o.length;r++){var h=Object();e.push(h);this.traverse(o[r],true,null,i,h,e,n,a)}for(var r=0;r<o.length;r++){this.roots.push(o[r])}s=true;for(var l in n){if(n[l]!=null){s=false;break}}}}else{for(var r=0;r<this.roots.length;r++){var h=Object();e.push(h);this.traverse(this.roots[r],true,null,i,h,e,null)}}var u=[];for(var l in i){u.push(i[l])}this.model=new mxSwimlaneModel(this,u,this.roots,t,this.tightenToSource);this.cycleStage(t);this.layeringStage();this.crossingStage(t);this.placementStage(0,t)};mxSwimlaneLayout.prototype.filterDescendants=function(t,e){var i=this.graph.model;if(i.isVertex(t)&&t!=this.parent&&i.getParent(t)!=this.parent&&this.graph.isCellVisible(t)){e[mxObjectIdentity.get(t)]=t}if(this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t)){var n=i.getChildCount(t);for(var r=0;r<n;r++){var s=i.getChildAt(t,r);if(!this.isPort(s)){this.filterDescendants(s,e)}}}};mxSwimlaneLayout.prototype.isPort=function(t){if(t.geometry.relative){return true}return false};mxSwimlaneLayout.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdges(t);var r=[];for(var s=0;s<n.length;s++){var l=this.getVisibleTerminal(n[s],true);var a=this.getVisibleTerminal(n[s],false);if(l==t&&a==e||!i&&l==e&&a==t){r.push(n[s])}}return r};mxSwimlaneLayout.prototype.traverse=function(t,e,i,n,r,s,l,a){if(t!=null&&n!=null){var o=mxObjectIdentity.get(t);if(n[o]==null&&(l==null?true:l[o]!=null)){if(r[o]==null){r[o]=t}if(n[o]==null){n[o]=t}if(l!==null){delete l[o]}var h=this.getEdges(t);var u=this.graph.model;for(var d=0;d<h.length;d++){var p=this.getVisibleTerminal(h[d],true);var m=p==t;if(m){p=this.getVisibleTerminal(h[d],false)}var c=0;for(c=0;c<this.swimlanes.length;c++){if(u.isAncestor(this.swimlanes[c],p)){break}}if(c>=this.swimlanes.length){continue}if(c>a||(!e||m)&&c==a){r=this.traverse(p,e,h[d],n,r,s,l,c)}}}else{if(r[o]==null){for(var d=0;d<s.length;d++){var x=s[d];if(x[o]!=null){for(var f in x){r[f]=x[f]}s.splice(d,1);return r}}}}}return r};mxSwimlaneLayout.prototype.cycleStage=function(t){var e=new mxSwimlaneOrdering(this);e.execute(t)};mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxSwimlaneLayout.prototype.crossingStage=function(t){var e=new mxMedianHybridCrossingReduction(this);e.execute(t)};mxSwimlaneLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);i.fineTuning=this.fineTuning;i.execute(e);return i.limitX+this.interHierarchySpacing};__mxOutput.mxSwimlaneLayout=typeof mxSwimlaneLayout!=="undefined"?mxSwimlaneLayout:undefined;function mxGraphModel(t){this.currentEdit=this.createUndoableEdit();if(t!=null){this.setRoot(t)}else{this.clear()}}mxGraphModel.prototype=new mxEventSource;mxGraphModel.prototype.constructor=mxGraphModel;mxGraphModel.prototype.root=null;mxGraphModel.prototype.cells=null;mxGraphModel.prototype.maintainEdgeParent=true;mxGraphModel.prototype.ignoreRelativeEdgeParent=true;mxGraphModel.prototype.createIds=true;mxGraphModel.prototype.prefix="";mxGraphModel.prototype.postfix="";mxGraphModel.prototype.nextId=0;mxGraphModel.prototype.currentEdit=null;mxGraphModel.prototype.updateLevel=0;mxGraphModel.prototype.endingUpdate=false;mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())};mxGraphModel.prototype.isCreateIds=function(){return this.createIds};mxGraphModel.prototype.setCreateIds=function(t){this.createIds=t};mxGraphModel.prototype.createRoot=function(){var t=new mxCell;t.insert(new mxCell);return t};mxGraphModel.prototype.getCell=function(t){return this.cells!=null?this.cells[t]:null};mxGraphModel.prototype.filterCells=function(t,e){var i=null;if(t!=null){i=[];for(var n=0;n<t.length;n++){if(e(t[n])){i.push(t[n])}}}return i};mxGraphModel.prototype.getDescendants=function(t){return this.filterDescendants(null,t)};mxGraphModel.prototype.filterDescendants=function(t,e){var i=[];e=e||this.getRoot();if(t==null||t(e)){i.push(e)}var n=this.getChildCount(e);for(var r=0;r<n;r++){var s=this.getChildAt(e,r);i=i.concat(this.filterDescendants(t,s))}return i};mxGraphModel.prototype.getRoot=function(t){var e=t||this.root;if(t!=null){while(t!=null){e=t;t=this.getParent(t)}}return e};mxGraphModel.prototype.setRoot=function(t){this.execute(new mxRootChange(this,t));return t};mxGraphModel.prototype.rootChanged=function(t){var e=this.root;this.root=t;this.nextId=0;this.cells=null;this.cellAdded(t);return e};mxGraphModel.prototype.isRoot=function(t){return t!=null&&this.root==t};mxGraphModel.prototype.isLayer=function(t){return this.isRoot(this.getParent(t))};mxGraphModel.prototype.isAncestor=function(t,e){while(e!=null&&e!=t){e=this.getParent(e)}return e==t};mxGraphModel.prototype.contains=function(t){return this.isAncestor(this.root,t)};mxGraphModel.prototype.getParent=function(t){return t!=null?t.getParent():null};mxGraphModel.prototype.add=function(t,e,i){if(e!=t&&t!=null&&e!=null){if(i==null){i=this.getChildCount(t)}var n=t!=this.getParent(e);this.execute(new mxChildChange(this,t,e,i));if(this.maintainEdgeParent&&n){this.updateEdgeParents(e)}}return e};mxGraphModel.prototype.cellAdded=function(t){if(t!=null){if(t.getId()==null&&this.createIds){t.setId(this.createId(t))}if(t.getId()!=null){var e=this.getCell(t.getId());if(e!=t){while(e!=null){t.setId(this.createId(t));e=this.getCell(t.getId())}if(this.cells==null){this.cells=new Object}this.cells[t.getId()]=t}}if(mxUtils.isNumeric(t.getId())){this.nextId=Math.max(this.nextId,t.getId())}var i=this.getChildCount(t);for(var n=0;n<i;n++){this.cellAdded(this.getChildAt(t,n))}}};mxGraphModel.prototype.createId=function(t){var e=this.nextId;this.nextId++;return this.prefix+e+this.postfix};mxGraphModel.prototype.updateEdgeParents=function(t,e){e=e||this.getRoot(t);var i=this.getChildCount(t);for(var n=0;n<i;n++){var r=this.getChildAt(t,n);this.updateEdgeParents(r,e)}var s=this.getEdgeCount(t);var l=[];for(var n=0;n<s;n++){l.push(this.getEdgeAt(t,n))}for(var n=0;n<l.length;n++){var a=l[n];if(this.isAncestor(e,a)){this.updateEdgeParent(a,e)}}};mxGraphModel.prototype.updateEdgeParent=function(t,e){var i=this.getTerminal(t,true);var n=this.getTerminal(t,false);var r=null;while(i!=null&&!this.isEdge(i)&&i.geometry!=null&&i.geometry.relative){i=this.getParent(i)}while(n!=null&&this.ignoreRelativeEdgeParent&&!this.isEdge(n)&&n.geometry!=null&&n.geometry.relative){n=this.getParent(n)}if(this.isAncestor(e,i)&&this.isAncestor(e,n)){if(i==n){r=this.getParent(i)}else{r=this.getNearestCommonAncestor(i,n)}if(r!=null&&(this.getParent(r)!=this.root||this.isAncestor(r,t))&&this.getParent(t)!=r){var s=this.getGeometry(t);if(s!=null){var l=this.getOrigin(this.getParent(t));var a=this.getOrigin(r);var o=a.x-l.x;var h=a.y-l.y;s=s.clone();s.translate(-o,-h);this.setGeometry(t,s)}this.add(r,t,this.getChildCount(r))}}};mxGraphModel.prototype.getOrigin=function(t){var e=null;if(t!=null){e=this.getOrigin(this.getParent(t));if(!this.isEdge(t)){var i=this.getGeometry(t);if(i!=null){e.x+=i.x;e.y+=i.y}}}else{e=new mxPoint}return e};mxGraphModel.prototype.getNearestCommonAncestor=function(t,e){if(t!=null&&e!=null){var i=mxCellPath.create(e);if(i!=null&&i.length>0){var n=t;var r=mxCellPath.create(n);if(i.length<r.length){n=e;var s=r;r=i;i=s}while(n!=null){var l=this.getParent(n);if(i.indexOf(r+mxCellPath.PATH_SEPARATOR)==0&&l!=null){return n}r=mxCellPath.getParentPath(r);n=l}}}return null};mxGraphModel.prototype.remove=function(t){if(t==this.root){this.setRoot(null)}else if(this.getParent(t)!=null){this.execute(new mxChildChange(this,null,t))}return t};mxGraphModel.prototype.cellRemoved=function(t){if(t!=null&&this.cells!=null){var e=this.getChildCount(t);for(var i=e-1;i>=0;i--){this.cellRemoved(this.getChildAt(t,i))}if(this.cells!=null&&t.getId()!=null){delete this.cells[t.getId()]}}};mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(e!=null){if(e!=n||n.getIndex(t)!=i){e.insert(t,i)}}else if(n!=null){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e);var l=this.contains(n);if(s&&!l){this.cellAdded(t)}else if(l&&!s){this.cellRemoved(t)}return n};mxGraphModel.prototype.getChildCount=function(t){return t!=null?t.getChildCount():0};mxGraphModel.prototype.getChildAt=function(t,e){return t!=null?t.getChildAt(e):null};mxGraphModel.prototype.getChildren=function(t){return t!=null?t.children:null};mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,true,false)};mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,false,true)};mxGraphModel.prototype.getChildCells=function(t,e,i){e=e!=null?e:false;i=i!=null?i:false;var n=this.getChildCount(t);var r=[];for(var s=0;s<n;s++){var l=this.getChildAt(t,s);if(!i&&!e||i&&this.isEdge(l)||e&&this.isVertex(l)){r.push(l)}}return r};mxGraphModel.prototype.getTerminal=function(t,e){return t!=null?t.getTerminal(e):null};mxGraphModel.prototype.setTerminal=function(t,e,i){var n=e!=this.getTerminal(t,i);this.execute(new mxTerminalChange(this,t,e,i));if(this.maintainEdgeParent&&n){this.updateEdgeParent(t,this.getRoot())}return e};mxGraphModel.prototype.setTerminals=function(t,e,i){this.beginUpdate();try{this.setTerminal(t,e,true);this.setTerminal(t,i,false)}finally{this.endUpdate()}};mxGraphModel.prototype.terminalForCellChanged=function(t,e,i){var n=this.getTerminal(t,i);if(e!=null){e.insertEdge(t,i)}else if(n!=null){n.removeEdge(t,i)}return n};mxGraphModel.prototype.getEdgeCount=function(t){return t!=null?t.getEdgeCount():0};mxGraphModel.prototype.getEdgeAt=function(t,e){return t!=null?t.getEdgeAt(e):null};mxGraphModel.prototype.getDirectedEdgeCount=function(t,e,i){var n=0;var r=this.getEdgeCount(t);for(var s=0;s<r;s++){var l=this.getEdgeAt(t,s);if(l!=i&&this.getTerminal(l,e)==t){n++}}return n};mxGraphModel.prototype.getConnections=function(t){return this.getEdges(t,true,true,false)};mxGraphModel.prototype.getIncomingEdges=function(t){return this.getEdges(t,true,false,false)};mxGraphModel.prototype.getOutgoingEdges=function(t){return this.getEdges(t,false,true,false)};mxGraphModel.prototype.getEdges=function(t,e,i,n){e=e!=null?e:true;i=i!=null?i:true;n=n!=null?n:true;var r=this.getEdgeCount(t);var s=[];for(var l=0;l<r;l++){var a=this.getEdgeAt(t,l);var o=this.getTerminal(a,true);var h=this.getTerminal(a,false);if(n&&o==h||o!=h&&(e&&h==t||i&&o==t)){s.push(a)}}return s};mxGraphModel.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdgeCount(t);var r=this.getEdgeCount(e);var s=t;var l=n;if(r<n){l=r;s=e}var a=[];for(var o=0;o<l;o++){var h=this.getEdgeAt(s,o);var u=this.getTerminal(h,true);var d=this.getTerminal(h,false);var p=u==t&&d==e;var m=d==t&&u==e;if(p||!i&&m){a.push(h)}}return a};mxGraphModel.prototype.getOpposites=function(t,e,i,n){i=i!=null?i:true;n=n!=null?n:true;var r=[];if(t!=null){for(var s=0;s<t.length;s++){var l=this.getTerminal(t[s],true);var a=this.getTerminal(t[s],false);if(l==e&&a!=null&&a!=e&&n){r.push(a)}else if(a==e&&l!=null&&l!=e&&i){r.push(l)}}}return r};mxGraphModel.prototype.getTopmostCells=function(t){var e=new mxDictionary;var i=[];for(var n=0;n<t.length;n++){e.put(t[n],true)}for(var n=0;n<t.length;n++){var r=t[n];var s=true;var l=this.getParent(r);while(l!=null){if(e.get(l)){s=false;break}l=this.getParent(l)}if(s){i.push(r)}}return i};mxGraphModel.prototype.isVertex=function(t){return t!=null?t.isVertex():false};mxGraphModel.prototype.isEdge=function(t){return t!=null?t.isEdge():false};mxGraphModel.prototype.isConnectable=function(t){return t!=null?t.isConnectable():false};mxGraphModel.prototype.getValue=function(t){return t!=null?t.getValue():null};mxGraphModel.prototype.setValue=function(t,e){this.execute(new mxValueChange(this,t,e));return e};mxGraphModel.prototype.valueForCellChanged=function(t,e){return t.valueChanged(e)};mxGraphModel.prototype.getGeometry=function(t){return t!=null?t.getGeometry():null};mxGraphModel.prototype.setGeometry=function(t,e){if(e!=this.getGeometry(t)){this.execute(new mxGeometryChange(this,t,e))}return e};mxGraphModel.prototype.geometryForCellChanged=function(t,e){var i=this.getGeometry(t);t.setGeometry(e);return i};mxGraphModel.prototype.getStyle=function(t){return t!=null?t.getStyle():null};mxGraphModel.prototype.setStyle=function(t,e){if(e!=this.getStyle(t)){this.execute(new mxStyleChange(this,t,e))}return e};mxGraphModel.prototype.styleForCellChanged=function(t,e){var i=this.getStyle(t);t.setStyle(e);return i};mxGraphModel.prototype.isCollapsed=function(t){return t!=null?t.isCollapsed():false};mxGraphModel.prototype.setCollapsed=function(t,e){if(e!=this.isCollapsed(t)){this.execute(new mxCollapseChange(this,t,e))}return e};mxGraphModel.prototype.collapsedStateForCellChanged=function(t,e){var i=this.isCollapsed(t);t.setCollapsed(e);return i};mxGraphModel.prototype.isVisible=function(t){return t!=null?t.isVisible():false};mxGraphModel.prototype.setVisible=function(t,e){if(e!=this.isVisible(t)){this.execute(new mxVisibleChange(this,t,e))}return e};mxGraphModel.prototype.visibleStateForCellChanged=function(t,e){var i=this.isVisible(t);t.setVisible(e);return i};mxGraphModel.prototype.execute=function(t){t.execute();this.beginUpdate();this.currentEdit.add(t);this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",t));this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t));this.endUpdate()};mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++;this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE));if(this.updateLevel==1){this.fireEvent(new mxEventObject(mxEvent.START_EDIT))}};mxGraphModel.prototype.endUpdate=function(){this.updateLevel--;if(this.updateLevel==0){this.fireEvent(new mxEventObject(mxEvent.END_EDIT))}if(!this.endingUpdate){this.endingUpdate=this.updateLevel==0;this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var t=this.currentEdit;this.currentEdit=this.createUndoableEdit();t.notify();this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t))}}finally{this.endingUpdate=false}}};mxGraphModel.prototype.createUndoableEdit=function(t){var e=new mxUndoableEdit(this,t!=null?t:true);e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes));e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))};return e};mxGraphModel.prototype.mergeChildren=function(t,e,i){i=i!=null?i:true;this.beginUpdate();try{var n=new Object;this.mergeChildrenImpl(t,e,i,n);for(var r in n){var s=n[r];var l=this.getTerminal(s,true);if(l!=null){l=n[mxCellPath.create(l)];this.setTerminal(s,l,true)}l=this.getTerminal(s,false);if(l!=null){l=n[mxCellPath.create(l)];this.setTerminal(s,l,false)}}}finally{this.endUpdate()}};mxGraphModel.prototype.mergeChildrenImpl=function(t,e,i,n){this.beginUpdate();try{var r=t.getChildCount();for(var s=0;s<r;s++){var l=t.getChildAt(s);if(typeof l.getId=="function"){var a=l.getId();var o=a!=null&&(!this.isEdge(l)||!i)?this.getCell(a):null;if(o==null){var h=l.clone();h.setId(a);h.setTerminal(l.getTerminal(true),true);h.setTerminal(l.getTerminal(false),false);o=e.insert(h);this.cellAdded(o)}n[mxCellPath.create(l)]=o;this.mergeChildrenImpl(l,o,i,n)}}}finally{this.endUpdate()}};mxGraphModel.prototype.getParents=function(t){var e=[];if(t!=null){var i=new mxDictionary;for(var n=0;n<t.length;n++){var r=this.getParent(t[n]);if(r!=null&&!i.get(r)){i.put(r,true);e.push(r)}}}return e};mxGraphModel.prototype.cloneCell=function(t,e){if(t!=null){return this.cloneCells([t],e)[0]}return null};mxGraphModel.prototype.cloneCells=function(t,e,i){e=e!=null?e:true;i=i!=null?i:new Object;var n=[];for(var r=0;r<t.length;r++){if(t[r]!=null){n.push(this.cloneCellImpl(t[r],i,e))}else{n.push(null)}}for(var r=0;r<n.length;r++){if(n[r]!=null){this.restoreClone(n[r],t[r],i)}}return n};mxGraphModel.prototype.cloneCellImpl=function(t,e,i){var n=mxObjectIdentity.get(t);var r=e[n];if(r==null){r=this.cellCloned(t);e[n]=r;if(i){var s=this.getChildCount(t);for(var l=0;l<s;l++){var a=this.cloneCellImpl(this.getChildAt(t,l),e,true);r.insert(a)}}}return r};mxGraphModel.prototype.cellCloned=function(t){return t.clone()};mxGraphModel.prototype.restoreClone=function(t,e,i){var n=this.getTerminal(e,true);if(n!=null){var r=i[mxObjectIdentity.get(n)];if(r!=null){r.insertEdge(t,true)}}var s=this.getTerminal(e,false);if(s!=null){var r=i[mxObjectIdentity.get(s)];if(r!=null){r.insertEdge(t,false)}}var l=this.getChildCount(t);for(var a=0;a<l;a++){this.restoreClone(this.getChildAt(t,a),this.getChildAt(e,a),i)}};function mxRootChange(t,e){this.model=t;this.root=e;this.previous=e}mxRootChange.prototype.execute=function(){this.root=this.previous;this.previous=this.model.rootChanged(this.previous)};function mxChildChange(t,e,i,n){this.model=t;this.parent=e;this.previous=e;this.child=i;this.index=n;this.previousIndex=n}mxChildChange.prototype.execute=function(){if(this.child!=null){var t=this.model.getParent(this.child);var e=t!=null?t.getIndex(this.child):0;if(this.previous==null){this.connect(this.child,false)}t=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex);if(this.previous!=null){this.connect(this.child,true)}this.parent=this.previous;this.previous=t;this.index=this.previousIndex;this.previousIndex=e}};mxChildChange.prototype.connect=function(t,e){e=e!=null?e:true;var i=t.getTerminal(true);var n=t.getTerminal(false);if(i!=null){if(e){this.model.terminalForCellChanged(t,i,true)}else{this.model.terminalForCellChanged(t,null,true)}}if(n!=null){if(e){this.model.terminalForCellChanged(t,n,false)}else{this.model.terminalForCellChanged(t,null,false)}}t.setTerminal(i,true);t.setTerminal(n,false);var r=this.model.getChildCount(t);for(var s=0;s<r;s++){this.connect(this.model.getChildAt(t,s),e)}};function mxTerminalChange(t,e,i,n){this.model=t;this.cell=e;this.terminal=i;this.previous=i;this.source=n}mxTerminalChange.prototype.execute=function(){if(this.cell!=null){this.terminal=this.previous;this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)}};function mxValueChange(t,e,i){this.model=t;this.cell=e;this.value=i;this.previous=i}mxValueChange.prototype.execute=function(){if(this.cell!=null){this.value=this.previous;this.previous=this.model.valueForCellChanged(this.cell,this.previous)}};function mxStyleChange(t,e,i){this.model=t;this.cell=e;this.style=i;this.previous=i}mxStyleChange.prototype.execute=function(){if(this.cell!=null){this.style=this.previous;this.previous=this.model.styleForCellChanged(this.cell,this.previous)}};function mxGeometryChange(t,e,i){this.model=t;this.cell=e;this.geometry=i;this.previous=i}mxGeometryChange.prototype.execute=function(){if(this.cell!=null){this.geometry=this.previous;this.previous=this.model.geometryForCellChanged(this.cell,this.previous)}};function mxCollapseChange(t,e,i){this.model=t;this.cell=e;this.collapsed=i;this.previous=i}mxCollapseChange.prototype.execute=function(){if(this.cell!=null){this.collapsed=this.previous;this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)}};function mxVisibleChange(t,e,i){this.model=t;this.cell=e;this.visible=i;this.previous=i}mxVisibleChange.prototype.execute=function(){if(this.cell!=null){this.visible=this.previous;this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)}};function mxCellAttributeChange(t,e,i){this.cell=t;this.attribute=e;this.value=i;this.previous=i}mxCellAttributeChange.prototype.execute=function(){if(this.cell!=null){var t=this.cell.getAttribute(this.attribute);if(this.previous==null){this.cell.value.removeAttribute(this.attribute)}else{this.cell.setAttribute(this.attribute,this.previous)}this.previous=t}};__mxOutput.mxGraphModel=typeof mxGraphModel!=="undefined"?mxGraphModel:undefined;function mxCell(t,e,i){this.value=t;this.setGeometry(e);this.setStyle(i);if(this.onInit!=null){this.onInit()}}mxCell.prototype.id=null;mxCell.prototype.value=null;mxCell.prototype.geometry=null;mxCell.prototype.style=null;mxCell.prototype.vertex=false;mxCell.prototype.edge=false;mxCell.prototype.connectable=true;mxCell.prototype.visible=true;mxCell.prototype.collapsed=false;mxCell.prototype.parent=null;mxCell.prototype.source=null;mxCell.prototype.target=null;mxCell.prototype.children=null;mxCell.prototype.edges=null;mxCell.prototype.mxTransient=["id","value","parent","source","target","children","edges"];mxCell.prototype.getId=function(){return this.id};mxCell.prototype.setId=function(t){this.id=t};mxCell.prototype.getValue=function(){return this.value};mxCell.prototype.setValue=function(t){this.value=t};mxCell.prototype.valueChanged=function(t){var e=this.getValue();this.setValue(t);return e};mxCell.prototype.getGeometry=function(){return this.geometry};mxCell.prototype.setGeometry=function(t){this.geometry=t};mxCell.prototype.getStyle=function(){return this.style};mxCell.prototype.setStyle=function(t){this.style=t};mxCell.prototype.isVertex=function(){return this.vertex!=0};mxCell.prototype.setVertex=function(t){this.vertex=t};mxCell.prototype.isEdge=function(){return this.edge!=0};mxCell.prototype.setEdge=function(t){this.edge=t};mxCell.prototype.isConnectable=function(){return this.connectable!=0};mxCell.prototype.setConnectable=function(t){this.connectable=t};mxCell.prototype.isVisible=function(){return this.visible!=0};mxCell.prototype.setVisible=function(t){this.visible=t};mxCell.prototype.isCollapsed=function(){return this.collapsed!=0};mxCell.prototype.setCollapsed=function(t){this.collapsed=t};mxCell.prototype.getParent=function(){return this.parent};mxCell.prototype.setParent=function(t){this.parent=t};mxCell.prototype.getTerminal=function(t){return t?this.source:this.target};mxCell.prototype.setTerminal=function(t,e){if(e){this.source=t}else{this.target=t}return t};mxCell.prototype.getChildCount=function(){return this.children==null?0:this.children.length};mxCell.prototype.getIndex=function(t){return mxUtils.indexOf(this.children,t)};mxCell.prototype.getChildAt=function(t){return this.children==null?null:this.children[t]};mxCell.prototype.insert=function(t,e){if(t!=null){if(e==null){e=this.getChildCount();if(t.getParent()==this){e--}}t.removeFromParent();t.setParent(this);if(this.children==null){this.children=[];this.children.push(t)}else{this.children.splice(e,0,t)}}return t};mxCell.prototype.remove=function(t){var e=null;if(this.children!=null&&t>=0){e=this.getChildAt(t);if(e!=null){this.children.splice(t,1);e.setParent(null)}}return e};mxCell.prototype.removeFromParent=function(){if(this.parent!=null){var t=this.parent.getIndex(this);this.parent.remove(t)}};mxCell.prototype.getEdgeCount=function(){return this.edges==null?0:this.edges.length};mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)};mxCell.prototype.getEdgeAt=function(t){return this.edges==null?null:this.edges[t]};mxCell.prototype.insertEdge=function(t,e){if(t!=null){t.removeFromTerminal(e);t.setTerminal(this,e);if(this.edges==null||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0){if(this.edges==null){this.edges=[]}this.edges.push(t)}}return t};mxCell.prototype.removeEdge=function(t,e){if(t!=null){if(t.getTerminal(!e)!=this&&this.edges!=null){var i=this.getEdgeIndex(t);if(i>=0){this.edges.splice(i,1)}}t.setTerminal(null,e)}return t};mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);if(e!=null){e.removeEdge(this,t)}};mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return e!=null&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):e.getAttribute(t)!=null};mxCell.prototype.getAttribute=function(t,e){var i=this.getValue();var n=i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return n!=null?n:e};mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();if(i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT){i.setAttribute(t,e)}};mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);t.setValue(this.cloneValue());return t};mxCell.prototype.cloneValue=function(){var t=this.getValue();if(t!=null){if(typeof t.clone=="function"){t=t.clone()}else if(!isNaN(t.nodeType)){t=t.cloneNode(true)}}return t};__mxOutput.mxCell=typeof mxCell!=="undefined"?mxCell:undefined;function mxGeometry(t,e,i,n){mxRectangle.call(this,t,e,i,n)}mxGeometry.prototype=new mxRectangle;mxGeometry.prototype.constructor=mxGeometry;mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=true;mxGeometry.prototype.alternateBounds=null;mxGeometry.prototype.sourcePoint=null;mxGeometry.prototype.targetPoint=null;mxGeometry.prototype.points=null;mxGeometry.prototype.offset=null;mxGeometry.prototype.relative=false;mxGeometry.prototype.swap=function(){if(this.alternateBounds!=null){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x;this.y=this.alternateBounds.y;this.width=this.alternateBounds.width;this.height=this.alternateBounds.height;this.alternateBounds=t}};mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint};mxGeometry.prototype.setTerminalPoint=function(t,e){if(e){this.sourcePoint=t}else{this.targetPoint=t}return t};mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t);var n=Math.cos(i);var r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY());var l=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(l.x-this.width/2);this.y=Math.round(l.y-this.height/2)}if(this.sourcePoint!=null){var l=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(l.x);this.sourcePoint.y=Math.round(l.y)}if(this.targetPoint!=null){var l=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(l.x);this.targetPoint.y=Math.round(l.y)}if(this.points!=null){for(var a=0;a<this.points.length;a++){if(this.points[a]!=null){var l=mxUtils.getRotatedPoint(this.points[a],n,r,e);this.points[a].x=Math.round(l.x);this.points[a].y=Math.round(l.y)}}}};mxGeometry.prototype.translate=function(t,e){t=parseFloat(t);e=parseFloat(e);if(!this.relative){this.x=parseFloat(this.x)+t;this.y=parseFloat(this.y)+e}if(this.sourcePoint!=null){this.sourcePoint.x=parseFloat(this.sourcePoint.x)+t;this.sourcePoint.y=parseFloat(this.sourcePoint.y)+e}if(this.targetPoint!=null){this.targetPoint.x=parseFloat(this.targetPoint.x)+t;this.targetPoint.y=parseFloat(this.targetPoint.y)+e}if(this.TRANSLATE_CONTROL_POINTS&&this.points!=null){for(var i=0;i<this.points.length;i++){if(this.points[i]!=null){this.points[i].x=parseFloat(this.points[i].x)+t;this.points[i].y=parseFloat(this.points[i].y)+e}}}};mxGeometry.prototype.scale=function(t,e,i){t=parseFloat(t);e=parseFloat(e);if(this.sourcePoint!=null){this.sourcePoint.x=parseFloat(this.sourcePoint.x)*t;this.sourcePoint.y=parseFloat(this.sourcePoint.y)*e}if(this.targetPoint!=null){this.targetPoint.x=parseFloat(this.targetPoint.x)*t;this.targetPoint.y=parseFloat(this.targetPoint.y)*e}if(this.points!=null){for(var n=0;n<this.points.length;n++){if(this.points[n]!=null){this.points[n].x=parseFloat(this.points[n].x)*t;this.points[n].y=parseFloat(this.points[n].y)*e}}}if(!this.relative){this.x=parseFloat(this.x)*t;this.y=parseFloat(this.y)*e;if(i){e=t=Math.min(t,e)}this.width=parseFloat(this.width)*t;this.height=parseFloat(this.height)*e}};mxGeometry.prototype.equals=function(t){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==t.relative&&(this.sourcePoint==null&&t.sourcePoint==null||this.sourcePoint!=null&&this.sourcePoint.equals(t.sourcePoint))&&(this.targetPoint==null&&t.targetPoint==null||this.targetPoint!=null&&this.targetPoint.equals(t.targetPoint))&&(this.points==null&&t.points==null||this.points!=null&&mxUtils.equalPoints(this.points,t.points))&&(this.alternateBounds==null&&t.alternateBounds==null||this.alternateBounds!=null&&this.alternateBounds.equals(t.alternateBounds))&&(this.offset==null&&t.offset==null||this.offset!=null&&this.offset.equals(t.offset))};__mxOutput.mxGeometry=typeof mxGeometry!=="undefined"?mxGeometry:undefined;var mxCellPath={PATH_SEPARATOR:".",create:function(t){var e="";if(t!=null){var i=t.getParent();while(i!=null){var n=i.getIndex(t);e=n+mxCellPath.PATH_SEPARATOR+e;t=i;i=t.getParent()}}var r=e.length;if(r>1){e=e.substring(0,r-1)}return e},getParentPath:function(t){if(t!=null){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0){return t.substring(0,e)}else if(t.length>0){return""}}return null},resolve:function(t,e){var i=t;if(e!=null){var n=e.split(mxCellPath.PATH_SEPARATOR);for(var r=0;r<n.length;r++){i=i.getChildAt(parseInt(n[r]))}}return i},compare:function(t,e){var i=Math.min(t.length,e.length);var n=0;for(var r=0;r<i;r++){if(t[r]!=e[r]){if(t[r].length==0||e[r].length==0){n=t[r]==e[r]?0:t[r]>e[r]?1:-1}else{var s=parseInt(t[r]);var l=parseInt(e[r]);n=s==l?0:s>l?1:-1}break}}if(n==0){var s=t.length;var l=e.length;if(s!=l){n=s>l?1:-1}}return n}};__mxOutput.mxCellPath=typeof mxCellPath!=="undefined"?mxCellPath:undefined;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX();var s=t.getCenterY();var l=i.x-r;var a=i.y-s;var o=Math.atan2(a,l);var h=new mxPoint(0,0);var u=Math.PI;var d=Math.PI/2;var p=d-o;var m=Math.atan2(t.height,t.width);if(o<-u+m||o>u-m){h.x=t.x;h.y=s-t.width*Math.tan(o)/2}else if(o<-m){h.y=t.y;h.x=r-t.height*Math.tan(p)/2}else if(o<m){h.x=t.x+t.width;h.y=s+t.width*Math.tan(o)/2}else{h.y=t.y+t.height;h.x=r+t.height*Math.tan(p)/2}if(n){if(i.x>=t.x&&i.x<=t.x+t.width){h.x=i.x}else if(i.y>=t.y&&i.y<=t.y+t.height){h.y=i.y}if(i.x<t.x){h.x=t.x}else if(i.x>t.x+t.width){h.x=t.x+t.width}if(i.y<t.y){h.y=t.y}else if(i.y>t.y+t.height){h.y=t.y+t.height}}return h},EllipsePerimeter:function(t,e,i,n){var r=t.x;var s=t.y;var l=t.width/2;var a=t.height/2;var o=r+l;var h=s+a;var u=i.x;var d=i.y;var p=parseInt(u-o);var m=parseInt(d-h);if(p==0&&m!=0){return new mxPoint(o,h+a*m/Math.abs(m))}else if(p==0&&m==0){return new mxPoint(u,d)}if(n){if(d>=s&&d<=s+t.height){var c=d-h;var x=Math.sqrt(l*l*(1-c*c/(a*a)))||0;if(u<=r){x=-x}return new mxPoint(o+x,d)}if(u>=r&&u<=r+t.width){var x=u-o;var c=Math.sqrt(a*a*(1-x*x/(l*l)))||0;if(d<=s){c=-c}return new mxPoint(u,h+c)}}var f=m/p;var g=h-f*o;var v=l*l*f*f+a*a;var y=-2*o*v;var C=l*l*f*f*o*o+a*a*o*o-l*l*a*a;var E=Math.sqrt(y*y-4*v*C);var S=(-y+E)/(2*v);var b=(-y-E)/(2*v);var w=f*S+g;var T=f*b+g;var L=Math.sqrt(Math.pow(S-u,2)+Math.pow(w-d,2));var A=Math.sqrt(Math.pow(b-u,2)+Math.pow(T-d,2));var M=0;var _=0;if(L<A){M=S;_=w}else{M=b;_=T}return new mxPoint(M,_)},RhombusPerimeter:function(t,e,i,n){var r=t.x;var s=t.y;var l=t.width;var a=t.height;var o=r+l/2;var h=s+a/2;var u=i.x;var d=i.y;if(o==u){if(h>d){return new mxPoint(o,s)}else{return new mxPoint(o,s+a)}}else if(h==d){if(o>u){return new mxPoint(r,h)}else{return new mxPoint(r+l,h)}}var p=o;var m=h;if(n){if(u>=r&&u<=r+l){p=u}else if(d>=s&&d<=s+a){m=d}}if(u<o){if(d<h){return mxUtils.intersection(u,d,p,m,o,s,r,h)}else{return mxUtils.intersection(u,d,p,m,o,s+a,r,h)}}else if(d<h){return mxUtils.intersection(u,d,p,m,o,s,r+l,h)}else{return mxUtils.intersection(u,d,p,m,o,s+a,r+l,h)}},TrianglePerimeter:function(t,e,i,n){var r=e!=null?e.style[mxConstants.STYLE_DIRECTION]:null;var s=r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH;var l=t.x;var a=t.y;var o=t.width;var h=t.height;var u=l+o/2;var d=a+h/2;var p=new mxPoint(l,a);var m=new mxPoint(l+o,d);var c=new mxPoint(l,a+h);if(r==mxConstants.DIRECTION_NORTH){p=c;m=new mxPoint(u,a);c=new mxPoint(l+o,a+h)}else if(r==mxConstants.DIRECTION_SOUTH){m=new mxPoint(u,a+h);c=new mxPoint(l+o,a)}else if(r==mxConstants.DIRECTION_WEST){p=new mxPoint(l+o,a);m=new mxPoint(l,d);c=new mxPoint(l+o,a+h)}var x=i.x-u;var f=i.y-d;var g=s?Math.atan2(x,f):Math.atan2(f,x);var v=s?Math.atan2(o,h):Math.atan2(h,o);var y=false;if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_WEST){y=g>-v&&g<v}else{y=g<-Math.PI+v||g>Math.PI-v}var C=null;if(y){if(n&&(s&&i.x>=p.x&&i.x<=c.x||!s&&i.y>=p.y&&i.y<=c.y)){if(s){C=new mxPoint(i.x,p.y)}else{C=new mxPoint(p.x,i.y)}}else{if(r==mxConstants.DIRECTION_NORTH){C=new mxPoint(l+o/2+h*Math.tan(g)/2,a+h)}else if(r==mxConstants.DIRECTION_SOUTH){C=new mxPoint(l+o/2-h*Math.tan(g)/2,a)}else if(r==mxConstants.DIRECTION_WEST){C=new mxPoint(l+o,a+h/2+o*Math.tan(g)/2)}else{C=new mxPoint(l,a+h/2-o*Math.tan(g)/2)}}}else{if(n){var E=new mxPoint(u,d);if(i.y>=a&&i.y<=a+h){E.x=s?u:r==mxConstants.DIRECTION_WEST?l+o:l;E.y=i.y}else if(i.x>=l&&i.x<=l+o){E.x=i.x;E.y=!s?d:r==mxConstants.DIRECTION_NORTH?a+h:a}x=i.x-E.x;f=i.y-E.y;u=E.x;d=E.y}if(s&&i.x<=l+o/2||!s&&i.y<=a+h/2){C=mxUtils.intersection(i.x,i.y,u,d,p.x,p.y,m.x,m.y)}else{C=mxUtils.intersection(i.x,i.y,u,d,m.x,m.y,c.x,c.y)}}if(C==null){C=new mxPoint(u,d)}return C},HexagonPerimeter:function(t,e,i,n){var r=t.x;var s=t.y;var l=t.width;var a=t.height;var o=t.getCenterX();var h=t.getCenterY();var u=i.x;var d=i.y;var p=u-o;var m=d-h;var c=-Math.atan2(m,p);var x=Math.PI;var f=Math.PI/2;var g=new mxPoint(o,h);var v=e!=null?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var y=v==mxConstants.DIRECTION_NORTH||v==mxConstants.DIRECTION_SOUTH;var C=new mxPoint;var E=new mxPoint;if(u<r&&d<s||u<r&&d>s+a||u>r+l&&d<s||u>r+l&&d>s+a){n=false}if(n){if(y){if(u==o){if(d<=s){return new mxPoint(o,s)}else if(d>=s+a){return new mxPoint(o,s+a)}}else if(u<r){if(d==s+a/4){return new mxPoint(r,s+a/4)}else if(d==s+3*a/4){return new mxPoint(r,s+3*a/4)}}else if(u>r+l){if(d==s+a/4){return new mxPoint(r+l,s+a/4)}else if(d==s+3*a/4){return new mxPoint(r+l,s+3*a/4)}}else if(u==r){if(d<h){return new mxPoint(r,s+a/4)}else if(d>h){return new mxPoint(r,s+3*a/4)}}else if(u==r+l){if(d<h){return new mxPoint(r+l,s+a/4)}else if(d>h){return new mxPoint(r+l,s+3*a/4)}}if(d==s){return new mxPoint(o,s)}else if(d==s+a){return new mxPoint(o,s+a)}if(u<o){if(d>s+a/4&&d<s+3*a/4){C=new mxPoint(r,s);E=new mxPoint(r,s+a)}else if(d<s+a/4){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s-Math.floor(.25*a))}else if(d>s+3*a/4){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s+Math.floor(1.25*a))}}else if(u>o){if(d>s+a/4&&d<s+3*a/4){C=new mxPoint(r+l,s);E=new mxPoint(r+l,s+a)}else if(d<s+a/4){C=new mxPoint(r,s-Math.floor(.25*a));E=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a))}else if(d>s+3*a/4){C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a));E=new mxPoint(r,s+Math.floor(1.25*a))}}}else{if(d==h){if(u<=r){return new mxPoint(r,s+a/2)}else if(u>=r+l){return new mxPoint(r+l,s+a/2)}}else if(d<s){if(u==r+l/4){return new mxPoint(r+l/4,s)}else if(u==r+3*l/4){return new mxPoint(r+3*l/4,s)}}else if(d>s+a){if(u==r+l/4){return new mxPoint(r+l/4,s+a)}else if(u==r+3*l/4){return new mxPoint(r+3*l/4,s+a)}}else if(d==s){if(u<o){return new mxPoint(r+l/4,s)}else if(u>o){return new mxPoint(r+3*l/4,s)}}else if(d==s+a){if(u<o){return new mxPoint(r+l/4,s+a)}else if(d>h){return new mxPoint(r+3*l/4,s+a)}}if(u==r){return new mxPoint(r,h)}else if(u==r+l){return new mxPoint(r+l,h)}if(d<h){if(u>r+l/4&&u<r+3*l/4){C=new mxPoint(r,s);E=new mxPoint(r+l,s)}else if(u<r+l/4){C=new mxPoint(r-Math.floor(.25*l),s+a);E=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a))}else if(u>r+3*l/4){C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a));E=new mxPoint(r+Math.floor(1.25*l),s+a)}}else if(d>h){if(u>r+l/4&&u<r+3*l/4){C=new mxPoint(r,s+a);E=new mxPoint(r+l,s+a)}else if(u<r+l/4){C=new mxPoint(r-Math.floor(.25*l),s);E=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a))}else if(u>r+3*l/4){C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a));E=new mxPoint(r+Math.floor(1.25*l),s)}}}var S=o;var b=h;if(u>=r&&u<=r+l){S=u;if(d<h){b=s+a}else{b=s}}else if(d>=s&&d<=s+a){b=d;if(u<o){S=r+l}else{S=r}}g=mxUtils.intersection(S,b,i.x,i.y,C.x,C.y,E.x,E.y)}else{if(y){var w=Math.atan2(a/4,l/2);if(c==w){return new mxPoint(r+l,s+Math.floor(.25*a))}else if(c==f){return new mxPoint(r+Math.floor(.5*l),s)}else if(c==x-w){return new mxPoint(r,s+Math.floor(.25*a))}else if(c==-w){return new mxPoint(r+l,s+Math.floor(.75*a))}else if(c==-f){return new mxPoint(r+Math.floor(.5*l),s+a)}else if(c==-x+w){return new mxPoint(r,s+Math.floor(.75*a))}if(c<w&&c>-w){C=new mxPoint(r+l,s);E=new mxPoint(r+l,s+a)}else if(c>w&&c<f){C=new mxPoint(r,s-Math.floor(.25*a));E=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a))}else if(c>f&&c<x-w){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s-Math.floor(.25*a))}else if(c>x-w&&c<=x||c<-x+w&&c>=-x){C=new mxPoint(r,s);E=new mxPoint(r,s+a)}else if(c<-w&&c>-f){C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a));E=new mxPoint(r,s+Math.floor(1.25*a))}else if(c<-f&&c>-x+w){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s+Math.floor(1.25*a))}}else{var w=Math.atan2(a/2,l/4);if(c==w){return new mxPoint(r+Math.floor(.75*l),s)}else if(c==x-w){return new mxPoint(r+Math.floor(.25*l),s)}else if(c==x||c==-x){return new mxPoint(r,s+Math.floor(.5*a))}else if(c==0){return new mxPoint(r+l,s+Math.floor(.5*a))}else if(c==-w){return new mxPoint(r+Math.floor(.75*l),s+a)}else if(c==-x+w){return new mxPoint(r+Math.floor(.25*l),s+a)}if(c>0&&c<w){C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a));E=new mxPoint(r+Math.floor(1.25*l),s+a)}else if(c>w&&c<x-w){C=new mxPoint(r,s);E=new mxPoint(r+l,s)}else if(c>x-w&&c<x){C=new mxPoint(r-Math.floor(.25*l),s+a);E=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a))}else if(c<0&&c>-w){C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a));E=new mxPoint(r+Math.floor(1.25*l),s)}else if(c<-w&&c>-x+w){C=new mxPoint(r,s+a);E=new mxPoint(r+l,s+a)}else if(c<-x+w&&c>-x){C=new mxPoint(r-Math.floor(.25*l),s);E=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a))}}g=mxUtils.intersection(o,h,i.x,i.y,C.x,C.y,E.x,E.y)}if(g==null){return new mxPoint(o,h)}return g}};__mxOutput.mxPerimeter=typeof mxPerimeter!=="undefined"?mxPerimeter:undefined;function mxPrintPreview(t,e,i,n,r,s,l,a,o){this.graph=t;this.scale=e!=null?e:1/t.pageScale;this.border=n!=null?n:0;this.pageFormat=mxRectangle.fromRectangle(i!=null?i:t.pageFormat);this.title=a!=null?a:"Printer-friendly version";this.x0=r!=null?r:0;this.y0=s!=null?s:0;this.borderColor=l;this.pageSelector=o!=null?o:true}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=true;mxPrintPreview.prototype.printOverlays=false;mxPrintPreview.prototype.printControls=false;mxPrintPreview.prototype.printBackgroundImage=false;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=true;mxPrintPreview.prototype.getWindow=function(){return this.wnd};mxPrintPreview.prototype.getDoctype=function(){var t="";if(document.documentMode==5){t='<meta http-equiv="X-UA-Compatible" content="IE=5">'}else if(document.documentMode==8){t='<meta http-equiv="X-UA-Compatible" content="IE=8">'}else if(document.documentMode>8){t='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e'}return t};mxPrintPreview.prototype.appendGraph=function(t,e,i,n,r,s){this.graph=t;this.scale=e!=null?e:1/t.pageScale;this.x0=i;this.y0=n;this.open(null,null,r,s)};mxPrintPreview.prototype.open=function(t,e,i,n){var r=this.graph.cellRenderer.initializeOverlay;var s=null;try{if(this.printOverlays){this.graph.cellRenderer.initializeOverlay=function(t,e){e.init(t.view.getDrawPane())}}if(this.printControls){this.graph.cellRenderer.initControl=function(t,e,i,n){e.dialect=t.view.graph.dialect;e.init(t.view.getDrawPane())}}this.wnd=e!=null?e:this.wnd;var l=false;if(this.wnd==null){l=true;this.wnd=window.open()}var a=this.wnd.document;if(l){var o=this.getDoctype();if(o!=null&&o.length>0){a.writeln(o)}if(mxClient.IS_VML){a.writeln('<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">')}else{if(document.compatMode==="CSS1Compat"){a.writeln("<!DOCTYPE html>")}a.writeln("<html>")}a.writeln("<head>");this.writeHead(a,t);a.writeln("</head>");a.writeln('<body class="mxPage">')}var h=this.graph.getGraphBounds().clone();var u=this.graph.getView().getScale();var d=u/this.scale;var p=this.graph.getView().getTranslate();if(!this.autoOrigin){this.x0-=p.x*this.scale;this.y0-=p.y*this.scale;h.width+=h.x;h.height+=h.y;h.x=0;h.y=0;this.border=0}var m=this.pageFormat.width-this.border*2;var c=this.pageFormat.height-this.border*2;this.pageFormat.height+=this.marginTop+this.marginBottom;h.width/=d;h.height/=d;var x=Math.max(1,Math.ceil((h.width+this.x0)/m));var f=Math.max(1,Math.ceil((h.height+this.y0)/c));this.pageCount=x*f;var g=mxUtils.bind(this,(function(){if(this.pageSelector&&(f>1||x>1)){var t=this.createPageSelector(f,x);a.body.appendChild(t);if(mxClient.IS_IE&&a.documentMode==null||a.documentMode==5||a.documentMode==8||a.documentMode==7){t.style.position="absolute";var e=function(){t.style.top=(a.body.scrollTop||a.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()}));mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}}));var v=mxUtils.bind(this,(function(t,e){if(this.borderColor!=null){t.style.borderColor=this.borderColor;t.style.borderStyle="solid";t.style.borderWidth="1px"}t.style.background=this.backgroundColor;if(i||e){t.style.pageBreakAfter="always"}if(l&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE)){a.writeln(t.outerHTML);t.parentNode.removeChild(t)}else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var n=a.createElement("div");n.innerHTML=t.outerHTML;n=n.getElementsByTagName("div")[0];a.body.appendChild(n);t.parentNode.removeChild(t)}else{t.parentNode.removeChild(t);a.body.appendChild(t)}if(i||e){this.addPageBreak(a)}}));var y=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(y!=null){for(var C=0;C<y.length;C++){v(y[C],true)}}var E=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(var C=0;C<f;C++){var S=C*c/this.scale-this.y0/this.scale+(h.y-p.y*u)/u;for(var b=0;b<x;b++){if(this.wnd==null){return null}var w=b*m/this.scale-this.x0/this.scale+(h.x-p.x*u)/u;var T=C*x+b+1;var L=new mxRectangle(w,S,m,c);s=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,(function(t){this.addGraphFragment(-w,-S,this.scale,T,t,L);if(this.printBackgroundImage){this.insertBackgroundImage(t,-w,-S)}})),T);s.setAttribute("id","mxPage-"+T);v(s,E!=null||C<f-1||b<x-1)}}if(E!=null){for(var C=0;C<E.length;C++){v(E[C],C<E.length-1)}}if(l&&!n){this.closeDocument();g()}this.wnd.focus()}catch(A){if(s!=null&&s.parentNode!=null){s.parentNode.removeChild(s)}}finally{this.graph.cellRenderer.initializeOverlay=r}return this.wnd};mxPrintPreview.prototype.addPageBreak=function(t){var e=t.createElement("hr");e.className="mxPageBreak";t.body.appendChild(e)};mxPrintPreview.prototype.closeDocument=function(){try{if(this.wnd!=null&&this.wnd.document!=null){var t=this.wnd.document;this.writePostfix(t);t.writeln("</body>");t.writeln("</html>");t.close();mxEvent.release(t.body)}}catch(e){}};mxPrintPreview.prototype.writeHead=function(t,e){if(this.title!=null){t.writeln("<title>"+this.title+"</title>")}if(mxClient.IS_VML){t.writeln('<style type="text/css">v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}</style>')}mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t);t.writeln('<style type="text/css">');t.writeln("@media print {");t.writeln(" * { -webkit-print-color-adjust: exact; }");t.writeln(" table.mxPageSelector { display: none; }");t.writeln(" hr.mxPageBreak { display: none; }");t.writeln("}");t.writeln("@media screen {");t.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;"+"font-family: Arial; font-size:10pt; border: solid 1px darkgray;"+"background: white; border-collapse:collapse; }");t.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }");t.writeln(" body.mxPage { background: gray; }");t.writeln("}");if(e!=null){t.writeln(e)}t.writeln("</style>")};mxPrintPreview.prototype.writePostfix=function(t){};mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document;var n=i.createElement("table");n.className="mxPageSelector";n.setAttribute("border","0");var r=i.createElement("tbody");for(var s=0;s<t;s++){var l=i.createElement("tr");for(var a=0;a<e;a++){var o=s*e+a+1;var h=i.createElement("td");var u=i.createElement("a");u.setAttribute("href","#mxPage-"+o);if(mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var d="var page = document.getElementById('mxPage-"+o+"');page.scrollIntoView(true);event.preventDefault();";u.setAttribute("onclick",d)}mxUtils.write(u,o,i);h.appendChild(u);l.appendChild(h)}r.appendChild(l)}n.appendChild(r);return n};mxPrintPreview.prototype.renderPage=function(t,e,i,n,r,s){var l=this.wnd.document;var a=document.createElement("div");var o=null;try{if(i!=0||n!=0){a.style.position="relative";a.style.width=t+"px";a.style.height=e+"px";a.style.pageBreakInside="avoid";var h=document.createElement("div");h.style.position="relative";h.style.top=this.border+"px";h.style.left=this.border+"px";h.style.width=t-2*this.border+"px";h.style.height=e-2*this.border+"px";h.style.overflow="hidden";var u=document.createElement("div");u.style.position="relative";u.style.marginLeft=i+"px";u.style.marginTop=n+"px";if(l.documentMode==8){h.style.position="absolute";u.style.position="absolute"}if(l.documentMode==10){u.style.width="100%";u.style.height="100%"}h.appendChild(u);a.appendChild(h);document.body.appendChild(a);o=u}else{a.style.width=t+"px";a.style.height=e+"px";a.style.overflow="hidden";a.style.pageBreakInside="avoid";if(l.documentMode==8){a.style.position="relative"}var h=document.createElement("div");h.style.width=t-2*this.border+"px";h.style.height=e-2*this.border+"px";h.style.overflow="hidden";if(mxClient.IS_IE&&(l.documentMode==null||l.documentMode==5||l.documentMode==8||l.documentMode==7)){h.style.marginTop=this.border+"px";h.style.marginLeft=this.border+"px"}else{h.style.top=this.border+"px";h.style.left=this.border+"px"}if(this.graph.dialect==mxConstants.DIALECT_VML){h.style.position="absolute"}a.appendChild(h);document.body.appendChild(a);o=h}}catch(d){a.parentNode.removeChild(a);a=null;throw d}r(o);return a};mxPrintPreview.prototype.getRoot=function(){var t=this.graph.view.currentRoot;if(t==null){t=this.graph.getModel().getRoot()}return t};mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF};mxPrintPreview.prototype.addGraphFragment=function(t,e,i,n,r,s){var l=this.graph.getView();var a=this.graph.container;this.graph.container=r;var o=l.getCanvas();var h=l.getBackgroundPane();var u=l.getDrawPane();var d=l.getOverlayPane();var p=i;if(this.graph.dialect==mxConstants.DIALECT_SVG){l.createSvg();if(this.useCssTransforms()){var m=l.getDrawPane().parentNode;var c=m.getAttribute("transform");m.setAttribute("transformOrigin","0 0");m.setAttribute("transform","scale("+i+","+i+")"+"translate("+t+","+e+")");i=1;t=0;e=0}}else if(this.graph.dialect==mxConstants.DIALECT_VML){l.createVml()}else{l.createHtml()}var x=l.isEventsEnabled();l.setEventsEnabled(false);var f=this.graph.isEnabled();this.graph.setEnabled(false);var g=l.getTranslate();l.translate=new mxPoint(t,e);var v=this.graph.cellRenderer.redraw;var y=l.states;var C=l.scale;if(this.clipping){var E=new mxRectangle((s.x+g.x)*C,(s.y+g.y)*C,s.width*C/p,s.height*C/p);this.graph.cellRenderer.redraw=function(t,e,i){if(t!=null){var n=y.get(t.cell);if(n!=null){var r=l.getBoundingBox(n,false);if(r!=null&&r.width>0&&r.height>0&&!mxUtils.intersects(E,r)){return}}}v.apply(this,arguments)}}var S=null;try{var b=[this.getRoot()];S=new mxTemporaryCellStates(l,i,b,null,mxUtils.bind(this,(function(t){return this.getLinkForCellState(t)})))}finally{if(mxClient.IS_IE){l.overlayPane.innerHTML="";l.canvas.style.overflow="hidden";l.canvas.style.position="relative";l.canvas.style.top=this.marginTop+"px";l.canvas.style.width=s.width+"px";l.canvas.style.height=s.height+"px"}else{var w=r.firstChild;while(w!=null){var T=w.nextSibling;var L=w.nodeName.toLowerCase();if(L=="svg"){w.style.overflow="hidden";w.style.position="relative";w.style.top=this.marginTop+"px";w.setAttribute("width",s.width);w.setAttribute("height",s.height);w.style.width="";w.style.height=""}else if(w.style.cursor!="default"&&L!="div"){w.parentNode.removeChild(w)}w=T}}if(this.printBackgroundImage){var A=r.getElementsByTagName("svg");if(A.length>0){A[0].style.position="absolute"}}l.overlayPane.parentNode.removeChild(l.overlayPane);this.graph.setEnabled(f);this.graph.container=a;this.graph.cellRenderer.redraw=v;l.canvas=o;l.backgroundPane=h;l.drawPane=u;l.overlayPane=d;l.translate=g;S.destroy();l.setEventsEnabled(x)}};mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)};mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(n!=null){var r=document.createElement("img");r.style.position="absolute";r.style.marginLeft=Math.round(e*this.scale)+"px";r.style.marginTop=Math.round(i*this.scale)+"px";r.setAttribute("width",Math.round(this.scale*n.width));r.setAttribute("height",Math.round(this.scale*n.height));r.src=n.src;t.insertBefore(r,t.firstChild)}};mxPrintPreview.prototype.getCoverPages=function(){return null};mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(t){var e=this.open(t);if(e!=null){e.print()}};mxPrintPreview.prototype.close=function(){if(this.wnd!=null){this.wnd.close();this.wnd=null}};__mxOutput.mxPrintPreview=typeof mxPrintPreview!=="undefined"?mxPrintPreview:undefined;function mxStylesheet(){this.styles=new Object;this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";t[mxConstants.STYLE_STROKECOLOR]="#6482B9";t[mxConstants.STYLE_FONTCOLOR]="#774400";return t};mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR;t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC;t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;t[mxConstants.STYLE_STROKECOLOR]="#6482B9";t[mxConstants.STYLE_FONTCOLOR]="#446299";return t};mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)};mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)};mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles["defaultVertex"]};mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles["defaultEdge"]};mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e};mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(t!=null&&t.length>0){var n=t.split(";");if(i!=null&&t.charAt(0)!=";"){i=mxUtils.clone(i)}else{i=new Object}for(var r=0;r<n.length;r++){var s=n[r];var l=s.indexOf("=");if(l>=0){var a=s.substring(0,l);var o=s.substring(l+1);if(o==mxConstants.NONE){delete i[a]}else if(mxUtils.isNumeric(o)){i[a]=parseFloat(o)}else{i[a]=o}}else{var h=this.styles[s];if(h!=null){for(var a in h){i[a]=h[a]}}}}}return i};__mxOutput.mxStylesheet=typeof mxStylesheet!=="undefined"?mxStylesheet:undefined;function mxCellState(t,e,i){this.view=t;this.cell=e;this.style=i!=null?i:{};this.origin=new mxPoint;this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle;mxCellState.prototype.constructor=mxCellState;mxCellState.prototype.view=null;mxCellState.prototype.cell=null;mxCellState.prototype.style=null;mxCellState.prototype.invalidStyle=false;mxCellState.prototype.invalid=true;mxCellState.prototype.origin=null;mxCellState.prototype.absolutePoints=null;mxCellState.prototype.absoluteOffset=null;mxCellState.prototype.visibleSourceState=null;mxCellState.prototype.visibleTargetState=null;mxCellState.prototype.terminalDistance=0;mxCellState.prototype.length=0;mxCellState.prototype.segments=null;mxCellState.prototype.shape=null;mxCellState.prototype.text=null;mxCellState.prototype.unscaledWidth=null;mxCellState.prototype.unscaledHeight=null;mxCellState.prototype.getPerimeterBounds=function(t,e){t=t||0;e=e!=null?e:new mxRectangle(this.x,this.y,this.width,this.height);if(this.shape!=null&&this.shape.stencil!=null&&this.shape.stencil.aspect=="fixed"){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x;e.y=i.y;e.width=this.shape.stencil.w0*i.width;e.height=this.shape.stencil.h0*i.height}if(t!=0){e.grow(t)}return e};mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){if(e){if(this.absolutePoints==null){this.absolutePoints=[]}if(this.absolutePoints.length==0){this.absolutePoints.push(t)}else{this.absolutePoints[0]=t}}else{if(this.absolutePoints==null){this.absolutePoints=[];this.absolutePoints.push(null);this.absolutePoints.push(t)}else if(this.absolutePoints.length==1){this.absolutePoints.push(t)}else{this.absolutePoints[this.absolutePoints.length-1]=t}}};mxCellState.prototype.setCursor=function(t){if(this.shape!=null){this.shape.setCursor(t)}if(this.text!=null){this.text.setCursor(t)}};mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return e!=null?e.cell:null};mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState};mxCellState.prototype.setVisibleTerminalState=function(t,e){if(e){this.visibleSourceState=t}else{this.visibleTargetState=t}};mxCellState.prototype.getCellBounds=function(){return this.cellBounds};mxCellState.prototype.getPaintBounds=function(){return this.paintBounds};mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate;var e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e);this.paintBounds=mxRectangle.fromRectangle(this.cellBounds);if(this.shape!=null&&this.shape.isPaintBoundsInverted()){this.paintBounds.rotate90()}};mxCellState.prototype.setState=function(t){this.view=t.view;this.cell=t.cell;this.style=t.style;this.absolutePoints=t.absolutePoints;this.origin=t.origin;this.absoluteOffset=t.absoluteOffset;this.boundingBox=t.boundingBox;this.terminalDistance=t.terminalDistance;this.segments=t.segments;this.length=t.length;this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height;this.unscaledWidth=t.unscaledWidth;this.unscaledHeight=t.unscaledHeight};mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(this.absolutePoints!=null){t.absolutePoints=[];for(var e=0;e<this.absolutePoints.length;e++){t.absolutePoints[e]=this.absolutePoints[e].clone()}}if(this.origin!=null){t.origin=this.origin.clone()}if(this.absoluteOffset!=null){t.absoluteOffset=this.absoluteOffset.clone()}if(this.boundingBox!=null){t.boundingBox=this.boundingBox.clone()}t.terminalDistance=this.terminalDistance;t.segments=this.segments;t.length=this.length;t.x=this.x;t.y=this.y;t.width=this.width;t.height=this.height;t.unscaledWidth=this.unscaledWidth;t.unscaledHeight=this.unscaledHeight;return t};mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)};__mxOutput.mxCellState=typeof mxCellState!=="undefined"?mxCellState:undefined;function mxGraphSelectionModel(t){this.graph=t;this.cells=[]}mxGraphSelectionModel.prototype=new mxEventSource;mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel;mxGraphSelectionModel.prototype.doneResource=mxClient.language!="none"?"done":"";mxGraphSelectionModel.prototype.updatingSelectionResource=mxClient.language!="none"?"updatingSelection":"";mxGraphSelectionModel.prototype.graph=null;mxGraphSelectionModel.prototype.singleSelection=false;mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection};mxGraphSelectionModel.prototype.setSingleSelection=function(t){this.singleSelection=t};mxGraphSelectionModel.prototype.isSelected=function(t){if(t!=null){return mxUtils.indexOf(this.cells,t)>=0}return false};mxGraphSelectionModel.prototype.isEmpty=function(){return this.cells.length==0};mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)};mxGraphSelectionModel.prototype.setCell=function(t){if(t!=null){this.setCells([t])}};mxGraphSelectionModel.prototype.setCells=function(t){if(t!=null){if(this.singleSelection){t=[this.getFirstSelectableCell(t)]}var e=[];for(var i=0;i<t.length;i++){if(this.graph.isCellSelectable(t[i])){e.push(t[i])}}this.changeSelection(e,this.cells)}};mxGraphSelectionModel.prototype.getFirstSelectableCell=function(t){if(t!=null){for(var e=0;e<t.length;e++){if(this.graph.isCellSelectable(t[e])){return t[e]}}}return null};mxGraphSelectionModel.prototype.addCell=function(t){if(t!=null){this.addCells([t])}};mxGraphSelectionModel.prototype.addCells=function(t){if(t!=null){var e=null;if(this.singleSelection){e=this.cells;t=[this.getFirstSelectableCell(t)]}var i=[];for(var n=0;n<t.length;n++){if(!this.isSelected(t[n])&&this.graph.isCellSelectable(t[n])){i.push(t[n])}}this.changeSelection(i,e)}};mxGraphSelectionModel.prototype.removeCell=function(t){if(t!=null){this.removeCells([t])}};mxGraphSelectionModel.prototype.removeCells=function(t){if(t!=null){var e=[];for(var i=0;i<t.length;i++){if(this.isSelected(t[i])){e.push(t[i])}}this.changeSelection(null,e)}};mxGraphSelectionModel.prototype.changeSelection=function(t,e){if(t!=null&&t.length>0&&t[0]!=null||e!=null&&e.length>0&&e[0]!=null){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,false);n.add(i);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}};mxGraphSelectionModel.prototype.cellAdded=function(t){if(t!=null&&!this.isSelected(t)){this.cells.push(t)}};mxGraphSelectionModel.prototype.cellRemoved=function(t){if(t!=null){var e=mxUtils.indexOf(this.cells,t);if(e>=0){this.cells.splice(e,1)}}};function mxSelectionChange(t,e,i){this.selectionModel=t;this.added=e!=null?e.slice():null;this.removed=i!=null?i.slice():null}mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource;if(this.removed!=null){for(var e=0;e<this.removed.length;e++){this.selectionModel.cellRemoved(this.removed[e])}}if(this.added!=null){for(var e=0;e<this.added.length;e++){this.selectionModel.cellAdded(this.added[e])}}var i=this.added;this.added=this.removed;this.removed=i;window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource;mxLog.leave("mxSelectionChange.execute",t);this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))};__mxOutput.mxGraphSelectionModel=typeof mxGraphSelectionModel!=="undefined"?mxGraphSelectionModel:undefined;function mxCellEditor(t){this.graph=t;this.zoomHandler=mxUtils.bind(this,(function(){if(this.graph.isEditing()){this.resize()}}));this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler);this.changeHandler=mxUtils.bind(this,(function(t){if(this.editingCell!=null&&this.graph.getView().getState(this.editingCell)==null){this.stopEditing(true)}}));this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}mxCellEditor.prototype.graph=null;mxCellEditor.prototype.textarea=null;mxCellEditor.prototype.editingCell=null;mxCellEditor.prototype.trigger=null;mxCellEditor.prototype.modified=false;mxCellEditor.prototype.autoSize=true;mxCellEditor.prototype.selectText=true;mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"";mxCellEditor.prototype.escapeCancelsEditing=true;mxCellEditor.prototype.textNode="";mxCellEditor.prototype.zIndex=5;mxCellEditor.prototype.minResize=new mxRectangle(0,20);mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:!mxClient.IS_IE11?1:0;mxCellEditor.prototype.blurEnabled=false;mxCellEditor.prototype.initialValue=null;mxCellEditor.prototype.align=null;mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div");this.textarea.className="mxCellEditor mxPlainTextEditor";this.textarea.contentEditable=true;if(mxClient.IS_GC){this.textarea.style.minHeight="1em"}this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative";this.installListeners(this.textarea)};mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)};mxCellEditor.prototype.setAlign=function(t){if(this.textarea!=null){this.textarea.style.textAlign=t}this.align=t;this.resize()};mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),false);if(!mxClient.IS_QUIRKS&&document.documentMode!=8&&document.documentMode!=9&&document.documentMode!=10){i=mxUtils.replaceTrailingNewlines(i,"<div><br></div>")}return i.replace(/\n/g,"<br>")};mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)};mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)};mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,(function(t){this.graph.stopEditing(false);mxEvent.consume(t)})));mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){if(this.blurEnabled){this.focusLost(t)}})));mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){if(!mxEvent.isConsumed(t)){if(this.isStopEditingEvent(t)){this.graph.stopEditing(false);mxEvent.consume(t)}else if(t.keyCode==27){this.graph.stopEditing(this.isCancelEditingKeyEvent(t));mxEvent.consume(t)}}})));var e=mxUtils.bind(this,(function(e){if(this.editingCell!=null){if(this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||e.keyCode!=8&&e.keyCode!=46)){this.clearOnChange=false;t.innerHTML=""}}}));mxEvent.addListener(t,"keypress",e);mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,(function(t){if(this.editingCell!=null){if(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="<br>"){this.textarea.innerHTML=this.getEmptyLabelText();this.clearOnChange=this.textarea.innerHTML.length>0}else{this.clearOnChange=false}}}));mxEvent.addListener(t,!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keyup",i);mxEvent.addListener(t,"cut",i);mxEvent.addListener(t,"paste",i);var n=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown";var r=mxUtils.bind(this,(function(t){if(this.editingCell!=null&&this.autoSize&&!mxEvent.isConsumed(t)){if(this.resizeThread!=null){window.clearTimeout(this.resizeThread)}this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null;this.resize()})),0)}}));mxEvent.addListener(t,n,r);mxEvent.addListener(window,"resize",r);if(document.documentMode>=9){mxEvent.addListener(t,"DOMNodeRemoved",r);mxEvent.addListener(t,"DOMNodeInserted",r)}else{mxEvent.addListener(t,"cut",r);mxEvent.addListener(t,"paste",r)}};mxCellEditor.prototype.isStopEditingEvent=function(t){return t.keyCode==113||this.graph.isEnterStopsCellEditing()&&t.keyCode==13&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)};mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea};mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(t==null){this.stopEditing(true)}else if(this.textarea!=null){var e=this.graph.getModel().isEdge(t.cell);var i=this.graph.getView().scale;var n=null;if(!this.autoSize||t.style[mxConstants.STYLE_OVERFLOW]=="fill"){this.bounds=this.getEditorBounds(t);this.textarea.style.width=Math.round(this.bounds.width/i)+"px";this.textarea.style.height=Math.round(this.bounds.height/i)+"px";if(document.documentMode==8||mxClient.IS_QUIRKS){this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px"}else{this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px";this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP;this.textarea.style.whiteSpace="normal";if(t.style[mxConstants.STYLE_OVERFLOW]!="fill"){this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px"}}else{this.textarea.style.whiteSpace="nowrap";if(t.style[mxConstants.STYLE_OVERFLOW]!="fill"){this.textarea.style.width=""}}}else{var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);n=t.text!=null&&this.align==null?t.text.margin:null;if(n==null){n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))}if(e){this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0);if(r!=null){var s=(parseFloat(r)+2)*i;this.bounds.width=s;this.bounds.x+=n.x*s}}else{var l=mxRectangle.fromRectangle(t);var a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=t.shape!=null&&a==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l;if(r!=null){l.width=parseFloat(r)*i}if(!t.view.graph.cellRenderer.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="width"){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i;var u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+h;var d=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+h;var p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+h;var m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+h;var a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+m,l.y+u,l.width-(a==mxConstants.ALIGN_CENTER&&r==null?m+d:0),l.height-(o==mxConstants.ALIGN_MIDDLE?u+p:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP;this.textarea.style.whiteSpace="normal";var s=Math.round(this.bounds.width/(document.documentMode==8?i:i))+this.wordWrapPadding;if(this.textarea.style.position!="relative"){this.textarea.style.width=s+"px";if(this.textarea.scrollWidth>s){this.textarea.style.width=this.textarea.scrollWidth+"px"}}else{this.textarea.style.maxWidth=s+"px"}}else{this.textarea.style.whiteSpace="nowrap";this.textarea.style.width=""}if(document.documentMode==8){this.textarea.style.zoom="1";this.textarea.style.height="auto"}var c=this.textarea.scrollWidth;var x=this.textarea.scrollHeight;if(document.documentMode==8){this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(c+1)*i)+c*(i-1)*0+(n.x+.5)*2)/i))+"px";this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(x+.5)*i)+x*(i-1)*0+Math.abs(n.y+.5)*1)/i))+"px";this.textarea.style.width=Math.round(c*i)+"px";this.textarea.style.height=Math.round(x*i)+"px"}else if(mxClient.IS_QUIRKS){this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(c+1)*i)+c*(i-1)*0+(n.x+.5)*2))+"px";this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(x+.5)*i)+x*(i-1)*0+Math.abs(n.y+.5)*1))+"px"}else{this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px";this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(n.y==-1?3:0))+1)+"px"}}if(mxClient.IS_VML){this.textarea.style.zoom=i}else{mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(n==null?"":" translate("+n.x*100+"%,"+n.y*100+"%)"))}}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};mxCellEditor.prototype.getBackgroundColor=function(t){return null};mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML){return true}else{var t=false;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(e!=null){var i=mxUtils.getCurrentStyle(e);if(i!=null){t=i.position=="absolute"}}}return!t}};mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(true);this.align=null;if(this.textarea==null){this.init()}if(this.graph.tooltipHandler!=null){this.graph.tooltipHandler.hideTooltip()}var i=this.graph.getView().getState(t);if(i!=null){var n=this.graph.getView().scale;var r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);var s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var l=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black");var a=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT);var o=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD;var h=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC;var u=[];if((mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){u.push("underline")}if((mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){u.push("line-through")}this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(r*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.backgroundColor=this.getBackgroundColor(i);this.textarea.style.textDecoration=u.join(" ");this.textarea.style.fontWeight=o?"bold":"normal";this.textarea.style.fontStyle=h?"italic":"";this.textarea.style.fontSize=Math.round(r)+"px";this.textarea.style.zIndex=this.zIndex;this.textarea.style.fontFamily=s;this.textarea.style.textAlign=a;this.textarea.style.outline="none";this.textarea.style.color=l;var d=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);if(d==mxConstants.TEXT_DIRECTION_AUTO){if(i!=null&&i.text!=null&&i.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(i.text.value)){d=i.text.getAutoDirection()}}if(d==mxConstants.TEXT_DIRECTION_LTR||d==mxConstants.TEXT_DIRECTION_RTL){this.textarea.setAttribute("dir",d)}else{this.textarea.removeAttribute("dir")}this.textarea.innerHTML=this.getInitialValue(i,e)||"";this.initialValue=this.textarea.innerHTML;if(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="<br>"){this.textarea.innerHTML=this.getEmptyLabelText();this.clearOnChange=true}else{this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText()}this.graph.container.appendChild(this.textarea);this.editingCell=t;this.trigger=e;this.textNode=null;if(i.text!=null&&this.isHideLabel(i)){this.textNode=i.text.node;this.textNode.style.visibility="hidden"}if(this.autoSize&&(this.graph.model.isEdge(i.cell)||i.style[mxConstants.STYLE_OVERFLOW]!="fill")){window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0)}this.resize();try{this.textarea.focus();if(this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)){document.execCommand("selectAll",false,null)}}catch(p){}}};mxCellEditor.prototype.isSelectText=function(){return this.selectText};mxCellEditor.prototype.clearSelection=function(){var t=null;if(window.getSelection){t=window.getSelection()}else if(document.selection){t=document.selection}if(t!=null){if(t.empty){t.empty()}else if(t.removeAllRanges){t.removeAllRanges()}}};mxCellEditor.prototype.stopEditing=function(t){t=t||false;if(this.editingCell!=null){if(this.textNode!=null){this.textNode.style.visibility="visible";this.textNode=null}var e=!t?this.graph.view.getState(this.editingCell):null;var i=this.initialValue;this.initialValue=null;this.editingCell=null;this.trigger=null;this.bounds=null;this.textarea.blur();this.clearSelection();if(this.textarea.parentNode!=null){this.textarea.parentNode.removeChild(this.textarea)}if(this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()){this.textarea.innerHTML="";this.clearOnChange=false}if(e!=null&&(this.textarea.innerHTML!=i||this.align!=null)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{if(n!=null){this.applyValue(e,n)}if(this.align!=null){this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea);this.textarea=null;this.align=null}};mxCellEditor.prototype.prepareTextarea=function(){if(this.textarea.lastChild!=null&&this.textarea.lastChild.nodeName=="BR"){this.textarea.removeChild(this.textarea.lastChild)}};mxCellEditor.prototype.isHideLabel=function(t){return true};mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,t.text==null?30:t.text.size*e+20,this.textarea.style.textAlign=="left"?120:40)};mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell);var i=this.graph.getView().scale;var n=this.getMinimumSize(t);var r=n.width;var s=n.height;var l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&t.style[mxConstants.STYLE_OVERFLOW]=="fill"){l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t))}else{var a=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i;var o=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+a;var h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+a;var u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+a;var d=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+a;l=new mxRectangle(t.x,t.y,Math.max(r,t.width-d-h),Math.max(s,t.height-o-u));var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var m=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=t.shape!=null&&p==mxConstants.ALIGN_CENTER&&m==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l;if(e){l.x=t.absoluteOffset.x;l.y=t.absoluteOffset.y;if(t.text!=null&&t.text.boundingBox!=null){if(t.text.boundingBox.x>0){l.x=t.text.boundingBox.x}if(t.text.boundingBox.y>0){l.y=t.text.boundingBox.y}}}else if(t.text!=null&&t.text.boundingBox!=null){l.x=Math.min(l.x,t.text.boundingBox.x);l.y=Math.min(l.y,t.text.boundingBox.y)}l.x+=d;l.y+=o;if(t.text!=null&&t.text.boundingBox!=null){if(!e){l.width=Math.max(l.width,t.text.boundingBox.width);l.height=Math.max(l.height,t.text.boundingBox.height)}else{l.width=Math.max(r,t.text.boundingBox.width);l.height=Math.max(s,t.text.boundingBox.height)}}if(this.graph.getModel().isVertex(t.cell)){var c=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(c==mxConstants.ALIGN_LEFT){l.x-=t.width}else if(c==mxConstants.ALIGN_RIGHT){l.x+=t.width}var x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(x==mxConstants.ALIGN_TOP){l.y-=t.height}else if(x==mxConstants.ALIGN_BOTTOM){l.y+=t.height}}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))};mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText};mxCellEditor.prototype.getEditingCell=function(){return this.editingCell};mxCellEditor.prototype.destroy=function(){if(this.textarea!=null){mxEvent.release(this.textarea);if(this.textarea.parentNode!=null){this.textarea.parentNode.removeChild(this.textarea)}this.textarea=null}if(this.changeHandler!=null){this.graph.getModel().removeListener(this.changeHandler);this.changeHandler=null}if(this.zoomHandler){this.graph.view.removeListener(this.zoomHandler);this.zoomHandler=null}};__mxOutput.mxCellEditor=typeof mxCellEditor!=="undefined"?mxCellEditor:undefined;function mxCellRenderer(){}mxCellRenderer.defaultShapes=new Object;mxCellRenderer.prototype.defaultEdgeShape=mxConnector;mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape;mxCellRenderer.prototype.defaultTextShape=mxText;mxCellRenderer.prototype.legacyControlPosition=true;mxCellRenderer.prototype.legacySpacing=true;mxCellRenderer.prototype.antiAlias=true;mxCellRenderer.prototype.minSvgStrokeWidth=1;mxCellRenderer.prototype.forceControlClickHandler=false;mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e};mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape);mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus);mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder);mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor);mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle);mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon);mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud);mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane);mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape);mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel);mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect;this.configureShape(t);t.shape.init(t.view.getDrawPane())};mxCellRenderer.prototype.createShape=function(t){var e=null;if(t.style!=null){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(i!=null){e=new mxShape(i)}else{var n=this.getShapeConstructor(t);e=new n}}return e};mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))};mxCellRenderer.prototype.getShape=function(t){return t!=null?mxCellRenderer.defaultShapes[t]:null};mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);if(e==null){e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape}return e};mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t);t.shape.image=t.view.graph.getImage(t);t.shape.indicatorColor=t.view.graph.getIndicatorColor(t);t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR];t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t);t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION];t.shape.indicatorImage=t.view.graph.getIndicatorImage(t);this.postConfigureShape(t)};mxCellRenderer.prototype.postConfigureShape=function(t){if(t.shape!=null){this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR);this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR);this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR);this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR);this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR)}};mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(t.style!=null){var e=["inherit","swimlane","indicated"];var i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR];for(var n=0;n<i.length;n++){if(mxUtils.indexOf(e,t.style[i[n]])>=0){return true}}}return false};mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=i==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(n!=null){var r=t.view.graph;var s=n[e];var l=null;if(s=="inherit"){l=r.model.getParent(t.cell)}else if(s=="swimlane"){n[e]=i==mxConstants.STYLE_STROKECOLOR||i==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff";if(r.model.getTerminal(t.cell,false)!=null){l=r.model.getTerminal(t.cell,false)}else{l=t.cell}l=r.getSwimlane(l);i=r.swimlaneIndicatorColorAttribute}else if(s=="indicated"&&t.shape!=null){n[e]=t.shape.indicatorColor}else if(i!=mxConstants.STYLE_FILLCOLOR&&s==mxConstants.STYLE_FILLCOLOR&&t.shape!=null){n[e]=t.style[mxConstants.STYLE_FILLCOLOR]}else if(i!=mxConstants.STYLE_STROKECOLOR&&s==mxConstants.STYLE_STROKECOLOR&&t.shape!=null){n[e]=t.style[mxConstants.STYLE_STROKECOLOR]}if(l!=null){var a=r.getView().getState(l);n[e]=null;if(a!=null){var o=i==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;if(o!=null&&e!="indicatorColor"){n[e]=o[e]}else{n[e]=a.style[i]}}}}};mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)};mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;var n=i.getModel().isEdge(t.cell);if(t.style[mxConstants.STYLE_FONTSIZE]>0||t.style[mxConstants.STYLE_FONTSIZE]==null){var r=i.isHtmlLabel(t.cell)||e!=null&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION));t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100);t.text.dialect=r?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect;t.text.style=t.style;t.text.state=t;this.initializeLabel(t,t.text);var s=false;var l=function(e){var n=t;if(mxClient.IS_TOUCH||s){var r=mxEvent.getClientX(e);var l=mxEvent.getClientY(e);var a=mxUtils.convertPoint(i.container,r,l);n=i.view.getState(i.getCellAt(a.x,a.y))}return n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t));s=i.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(e).nodeName=="IMG"}})),mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,l(e)))}})),mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,l(e)));s=false}})));if(i.nativeDblClickEnabled){mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.dblClick(e,t.cell);mxEvent.consume(e)}})))}}};mxCellRenderer.prototype.initializeLabel=function(t,e){if(mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG){e.init(t.view.graph.container)}else{e.init(t.view.getDrawPane())}};mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph;var i=e.getCellOverlays(t.cell);var n=null;if(i!=null){n=new mxDictionary;for(var r=0;r<i.length;r++){var s=t.overlays!=null?t.overlays.remove(i[r]):null;if(s==null){var l=new mxImageShape(new mxRectangle,i[r].image.src);l.dialect=t.view.graph.dialect;l.preserveImageAspect=false;l.overlay=i[r];this.initializeOverlay(t,l);this.installCellOverlayListeners(t,i[r],l);if(i[r].cursor!=null){l.node.style.cursor=i[r].cursor}n.put(i[r],l)}else{n.put(i[r],s)}}}if(t.overlays!=null){t.overlays.visit((function(t,e){e.destroy()}))}t.overlays=n};mxCellRenderer.prototype.initializeOverlay=function(t,e){e.init(t.view.getOverlayPane())};mxCellRenderer.prototype.installCellOverlayListeners=function(t,e,i){var n=t.view.graph;mxEvent.addListener(i.node,"click",(function(i){if(n.isEditing()){n.stopEditing(!n.isInvokesStopCellEditing())}e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",i,"cell",t.cell))}));mxEvent.addGestureListeners(i.node,(function(t){mxEvent.consume(t)}),(function(e){n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}));if(mxClient.IS_TOUCH){mxEvent.addListener(i.node,"touchend",(function(i){e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",i,"cell",t.cell))}))}};mxCellRenderer.prototype.createControl=function(t){var e=t.view.graph;var i=e.getFoldingImage(t);if(e.foldingEnabled&&i!=null){if(t.control==null){var n=new mxRectangle(0,0,i.width,i.height);t.control=new mxImageShape(n,i.src);t.control.preserveImageAspect=false;t.control.dialect=e.dialect;this.initControl(t,t.control,true,this.createControlClickHandler(t))}}else if(t.control!=null){t.control.destroy();t.control=null}};mxCellRenderer.prototype.createControlClickHandler=function(t){var e=t.view.graph;return mxUtils.bind(this,(function(i){if(this.forceControlClickHandler||e.isEnabled()){var n=!e.isCellCollapsed(t.cell);e.foldCells(n,false,[t.cell],null,i);mxEvent.consume(i)}}))};mxCellRenderer.prototype.initControl=function(t,e,i,n){var r=t.view.graph;var s=r.isHtmlLabel(t.cell)&&mxClient.NO_FO&&r.dialect==mxConstants.DIALECT_SVG;if(s){e.dialect=mxConstants.DIALECT_PREFERHTML;e.init(r.container);e.node.style.zIndex=1}else{e.init(t.view.getOverlayPane())}var l=e.innerNode||e.node;if(n!=null&&!mxClient.IS_IOS){if(r.isEnabled()){l.style.cursor="pointer"}mxEvent.addListener(l,"click",n)}if(i){var a=null;mxEvent.addGestureListeners(l,(function(e){a=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));r.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t));mxEvent.consume(e)}),(function(e){r.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),(function(e){r.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,t));mxEvent.consume(e)}));if(n!=null&&mxClient.IS_IOS){l.addEventListener("touchend",(function(t){if(a!=null){var e=r.tolerance;if(Math.abs(a.x-mxEvent.getClientX(t))<e&&Math.abs(a.y-mxEvent.getClientY(t))<e){n.call(n,t);mxEvent.consume(t)}}}),true)}}return l};mxCellRenderer.prototype.isShapeEvent=function(t,e){return true};mxCellRenderer.prototype.isLabelEvent=function(t,e){return true};mxCellRenderer.prototype.installListeners=function(t){var e=t.view.graph;var i=function(i){var n=t;if(e.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(i).nodeName=="IMG"||mxClient.IS_TOUCH){var r=mxEvent.getClientX(i);var s=mxEvent.getClientY(i);var l=mxUtils.convertPoint(e.container,r,s);n=e.view.getState(e.getCellAt(l.x,l.y))}return n};mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,(function(i){if(this.isShapeEvent(t,i)){e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(i,t))}})),mxUtils.bind(this,(function(n){if(this.isShapeEvent(t,n)){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(n,i(n)))}})),mxUtils.bind(this,(function(n){if(this.isShapeEvent(t,n)){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(n,i(n)))}})));if(e.nativeDblClickEnabled){mxEvent.addListener(t.shape.node,"dblclick",mxUtils.bind(this,(function(i){if(this.isShapeEvent(t,i)){e.dblClick(i,t.cell);mxEvent.consume(i)}})))}};mxCellRenderer.prototype.redrawLabel=function(t,e){var i=t.view.graph;var n=this.getLabelValue(t);var r=i.isWrapping(t.cell);var s=i.isLabelClipped(t.cell);var l=t.view.graph.isHtmlLabel(t.cell)||n!=null&&mxUtils.isNode(n);var a=l?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect;var o=t.style[mxConstants.STYLE_OVERFLOW]||"visible";if(t.text!=null&&(t.text.wrap!=r||t.text.clipped!=s||t.text.overflow!=o||t.text.dialect!=a)){t.text.destroy();t.text=null}if(t.text==null&&n!=null&&(mxUtils.isNode(n)||n.length>0)){this.createLabel(t,n)}else if(t.text!=null&&(n==null||n.length==0)){t.text.destroy();t.text=null}if(t.text!=null){if(e){if(t.text.lastValue!=null&&this.isTextShapeInvalid(t,t.text)){t.text.lastValue=null}t.text.resetStyles();t.text.apply(t);t.text.valign=i.getVerticalAlign(t)}var h=this.getLabelBounds(t);var u=this.getTextScale(t);this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR);if(e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=o||t.text.isClipping!=s||t.text.scale!=u||t.text.dialect!=a||t.text.bounds==null||!t.text.bounds.equals(h)){t.text.dialect=a;t.text.value=n;t.text.bounds=h;t.text.scale=u;t.text.wrap=r;t.text.clipped=s;t.text.overflow=o;var d=t.text.node.style.visibility;this.redrawLabelShape(t.text);t.text.node.style.visibility=d}}};mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(i,n,r){var s=false;if(n=="spacingTop"||n=="spacingRight"||n=="spacingBottom"||n=="spacingLeft"){s=parseFloat(e[i])-parseFloat(e.spacing)!=(t.style[n]||r)}else{s=e[i]!=(t.style[n]||r)}return s}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,true)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)};mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()};mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale};mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph;var i=t.view.scale;var n=e.getModel().isEdge(t.cell);var r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i;r.y+=s.y*i;var l=e.getCellGeometry(t.cell);if(l!=null){r.width=Math.max(0,l.width*i);r.height=Math.max(0,l.height*i)}}else{if(t.text.isPaintBoundsInverted()){var a=r.x;r.x=r.y;r.y=a}r.x+=t.x;r.y+=t.y;r.width=Math.max(1,t.width);r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var o=(t.width-t.height)/2;r.x+=o;r.y-=o;var a=r.width;r.width=r.height;r.height=a}if(t.shape!=null){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE){r=t.shape.getLabelBounds(r)}}var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(d!=null){r.width=parseFloat(d)*i}if(!n){this.rotateLabelBounds(t,r)}return r};mxCellRenderer.prototype.rotateLabelBounds=function(t,e){e.y-=t.text.margin.y*e.height;e.x-=t.text.margin.x*e.width;if(!this.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&t.style[mxConstants.STYLE_OVERFLOW]!="width"){var i=t.view.scale;var n=t.text.getSpacing();e.x+=n.x*i;e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);var l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&l==null?t.text.spacingLeft*i+t.text.spacingRight*i:0));e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var a=t.text.getTextRotation();if(a!=0&&t!=null&&t.view.graph.model.isVertex(t.cell)){var o=t.getCenterX();var h=t.getCenterY();if(e.x!=o||e.y!=h){var u=a*(Math.PI/180);var d=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(o,h));e.x=d.x;e.y=d.y}}};mxCellRenderer.prototype.redrawCellOverlays=function(t,e){this.createCellOverlays(t);if(t.overlays!=null){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90);var n=mxUtils.toRadians(i);var r=Math.cos(n);var s=Math.sin(n);t.overlays.visit((function(n,l){var a=l.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)){if(t.shape!=null&&i!=0){var o=a.getCenterX();var h=a.getCenterY();var u=mxUtils.getRotatedPoint(new mxPoint(o,h),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));o=u.x;h=u.y;a.x=Math.round(o-a.width/2);a.y=Math.round(h-a.height/2)}}if(e||l.bounds==null||l.scale!=t.view.scale||!l.bounds.equals(a)){l.bounds=a;l.scale=t.view.scale;l.redraw()}}))}};mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(t.control!=null&&i!=null){var n=this.getControlBounds(t,i.width,i.height);var r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation();var s=t.view.scale;if(e||t.control.scale!=s||!t.control.bounds.equals(n)||t.control.rotation!=r){t.control.rotation=r;t.control.bounds=n;t.control.scale=s;t.control.redraw()}}};mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(t.control!=null){var n=t.view.scale;var r=t.getCenterX();var s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)){r=t.x+e*n;s=t.y+i*n;if(t.shape!=null){var l=t.shape.getShapeRotation();if(this.legacyControlPosition){l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0)}else{if(t.shape.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r+=a;s-=a}}if(l!=0){var o=mxUtils.toRadians(l);var h=Math.cos(o);var u=Math.sin(o);var d=mxUtils.getRotatedPoint(new mxPoint(r,s),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));r=d.x;s=d.y}}}return t.view.graph.getModel().isEdge(t.cell)?new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n)):new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null};mxCellRenderer.prototype.insertStateAfter=function(t,e,i){var n=this.getShapesForState(t);for(var r=0;r<n.length;r++){if(n[r]!=null&&n[r].node!=null){var s=n[r].node.parentNode!=t.view.getDrawPane()&&n[r].node.parentNode!=t.view.getOverlayPane();var l=s?i:e;if(l!=null&&l.nextSibling!=n[r].node){if(l.nextSibling==null){l.parentNode.appendChild(n[r].node)}else{l.parentNode.insertBefore(n[r].node,l.nextSibling)}}else if(l==null){if(n[r].node.parentNode==t.view.graph.container){var a=t.view.canvas;while(a!=null&&a.parentNode!=t.view.graph.container){a=a.parentNode}if(a!=null&&a.nextSibling!=null){if(a.nextSibling!=n[r].node){n[r].node.parentNode.insertBefore(n[r].node,a.nextSibling)}}else{n[r].node.parentNode.appendChild(n[r].node)}}else if(n[r].node.parentNode!=null&&n[r].node.parentNode.firstChild!=null&&n[r].node.parentNode.firstChild!=n[r].node){n[r].node.parentNode.insertBefore(n[r].node,n[r].node.parentNode.firstChild)}}if(s){i=n[r].node}else{e=n[r].node}}}return[e,i]};mxCellRenderer.prototype.getShapesForState=function(t){return[t.shape,t.text,t.control]};mxCellRenderer.prototype.redraw=function(t,e,i){var n=this.redrawShape(t,e,i);if(t.shape!=null&&(i==null||i)){this.redrawLabel(t,n);this.redrawCellOverlays(t,n);this.redrawControl(t,n)}};mxCellRenderer.prototype.redrawShape=function(t,e,i){var n=t.view.graph.model;var r=false;if(t.shape!=null&&t.shape.style!=null&&t.style!=null&&t.shape.style[mxConstants.STYLE_SHAPE]!=t.style[mxConstants.STYLE_SHAPE]){t.shape.destroy();t.shape=null}if(t.shape==null&&t.view.graph.container!=null&&t.cell!=t.view.currentRoot&&(n.isVertex(t.cell)||n.isEdge(t.cell))){t.shape=this.createShape(t);if(t.shape!=null){t.shape.minSvgStrokeWidth=this.minSvgStrokeWidth;t.shape.antiAlias=this.antiAlias;this.createIndicatorShape(t);this.initializeShape(t);this.createCellOverlays(t);this.installListeners(t);t.view.graph.selectionCellsHandler.updateHandler(t)}}else if(!e&&t.shape!=null&&(!mxUtils.equalEntries(t.shape.style,t.style)||this.checkPlaceholderStyles(t))){t.shape.resetStyles();this.configureShape(t);t.view.graph.selectionCellsHandler.updateHandler(t);e=true}if(t.shape!=null&&t.shape.indicatorShape!=this.getShape(t.view.graph.getIndicatorShape(t))){if(t.shape.indicator!=null){t.shape.indicator.destroy();t.shape.indicator=null}this.createIndicatorShape(t);if(t.shape.indicatorShape!=null){t.shape.indicator=new t.shape.indicatorShape;t.shape.indicator.dialect=t.shape.dialect;t.shape.indicator.init(t.node);e=true}}if(t.shape!=null){this.createControl(t);if(e||this.isShapeInvalid(t,t.shape)){if(t.absolutePoints!=null){t.shape.points=t.absolutePoints.slice();t.shape.bounds=null}else{t.shape.points=null;t.shape.bounds=new mxRectangle(t.x,t.y,t.width,t.height)}t.shape.scale=t.view.scale;if(i==null||i){this.doRedrawShape(t)}else{t.shape.updateBoundingBox()}r=true}}return r};mxCellRenderer.prototype.doRedrawShape=function(t){t.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(t,e){return e.bounds==null||e.scale!=t.view.scale||t.absolutePoints==null&&!e.bounds.equals(t)||t.absolutePoints!=null&&!mxUtils.equalPoints(e.points,t.absolutePoints)};mxCellRenderer.prototype.destroy=function(t){if(t.shape!=null){if(t.text!=null){t.text.destroy();t.text=null}if(t.overlays!=null){t.overlays.visit((function(t,e){e.destroy()}));t.overlays=null}if(t.control!=null){t.control.destroy();t.control=null}t.shape.destroy();t.shape=null}};__mxOutput.mxCellRenderer=typeof mxCellRenderer!=="undefined"?mxCellRenderer:undefined;var mxEdgeStyle={EntityRelation:function(t,e,i,n,r){var s=t.view;var l=s.graph;var a=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var o=t.absolutePoints;var h=o[0];var u=o[o.length-1];var d=false;if(e!=null){var p=l.getCellGeometry(e.cell);if(p.relative){d=p.x<=.5}else if(i!=null){d=(u!=null?u.x:i.x+i.width)<(h!=null?h.x:e.x)}}if(h!=null){e=new mxCellState;e.x=h.x;e.y=h.y}else if(e!=null){var m=mxUtils.getPortConstraints(e,t,true,mxConstants.DIRECTION_MASK_NONE);if(m!=mxConstants.DIRECTION_MASK_NONE&&m!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST){d=m==mxConstants.DIRECTION_MASK_WEST}}else{return}var c=true;if(i!=null){var x=l.getCellGeometry(i.cell);if(x.relative){c=x.x<=.5}else if(e!=null){c=(h!=null?h.x:e.x+e.width)<(u!=null?u.x:i.x)}}if(u!=null){i=new mxCellState;i.x=u.x;i.y=u.y}else if(i!=null){var m=mxUtils.getPortConstraints(i,t,false,mxConstants.DIRECTION_MASK_NONE);if(m!=mxConstants.DIRECTION_MASK_NONE&&m!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST){c=m==mxConstants.DIRECTION_MASK_WEST}}if(e!=null&&i!=null){var f=d?e.x:e.x+e.width;var g=s.getRoutingCenterY(e);var v=c?i.x:i.x+i.width;var y=s.getRoutingCenterY(i);var C=a;var E=d?-C:C;var S=new mxPoint(f+E,g);E=c?-C:C;var b=new mxPoint(v+E,y);if(d==c){var w=d?Math.min(f,v)-a:Math.max(f,v)+a;r.push(new mxPoint(w,g));r.push(new mxPoint(w,y))}else if(S.x<b.x==d){var T=g+(y-g)/2;r.push(S);r.push(new mxPoint(S.x,T));r.push(new mxPoint(b.x,T));r.push(b)}else{r.push(S);r.push(b)}}},Loop:function(t,e,i,n,r){var s=t.absolutePoints;var l=s[0];var a=s[s.length-1];if(l!=null&&a!=null){if(n!=null&&n.length>0){for(var o=0;o<n.length;o++){var h=n[o];h=t.view.transformControlPoint(t,h);r.push(new mxPoint(h.x,h.y))}}return}if(e!=null){var u=t.view;var d=u.graph;var h=n!=null&&n.length>0?n[0]:null;if(h!=null){h=u.transformControlPoint(t,h);if(mxUtils.contains(e,h.x,h.y)){h=null}}var p=0;var m=0;var c=0;var x=0;var f=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,d.gridSize)*u.scale;var g=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);if(g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH){p=u.getRoutingCenterX(e);m=f}else{c=u.getRoutingCenterY(e);x=f}if(h==null||h.x<e.x||h.x>e.x+e.width){if(h!=null){p=h.x;x=Math.max(Math.abs(c-h.y),x)}else{if(g==mxConstants.DIRECTION_NORTH){c=e.y-2*m}else if(g==mxConstants.DIRECTION_SOUTH){c=e.y+e.height+2*m}else if(g==mxConstants.DIRECTION_EAST){p=e.x-2*x}else{p=e.x+e.width+2*x}}}else if(h!=null){p=u.getRoutingCenterX(e);m=Math.max(Math.abs(p-h.x),x);c=h.y;x=0}r.push(new mxPoint(p-m,c-x));r.push(new mxPoint(p+m,c+x))}},ElbowConnector:function(t,e,i,n,r){var s=n!=null&&n.length>0?n[0]:null;var l=false;var a=false;if(e!=null&&i!=null){if(s!=null){var o=Math.min(e.x,i.x);var h=Math.max(e.x+e.width,i.x+i.width);var u=Math.min(e.y,i.y);var d=Math.max(e.y+e.height,i.y+i.height);s=t.view.transformControlPoint(t,s);l=s.y<u||s.y>d;a=s.x<o||s.x>h}else{var o=Math.max(e.x,i.x);var h=Math.min(e.x+e.width,i.x+i.width);l=o==h;if(!l){var u=Math.max(e.y,i.y);var d=Math.min(e.y+e.height,i.y+i.height);a=u==d}}}if(!a&&(l||t.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)){mxEdgeStyle.TopToBottom(t,e,i,n,r)}else{mxEdgeStyle.SideToSide(t,e,i,n,r)}},SideToSide:function(t,e,i,n,r){var s=t.view;var l=n!=null&&n.length>0?n[0]:null;var a=t.absolutePoints;var o=a[0];var h=a[a.length-1];if(l!=null){l=s.transformControlPoint(t,l)}if(o!=null){e=new mxCellState;e.x=o.x;e.y=o.y}if(h!=null){i=new mxCellState;i.x=h.x;i.y=h.y}if(e!=null&&i!=null){var u=Math.max(e.x,i.x);var d=Math.min(e.x+e.width,i.x+i.width);var p=l!=null?l.x:Math.round(d+(u-d)/2);var m=s.getRoutingCenterY(e);var c=s.getRoutingCenterY(i);if(l!=null){if(l.y>=e.y&&l.y<=e.y+e.height){m=l.y}if(l.y>=i.y&&l.y<=i.y+i.height){c=l.y}}if(!mxUtils.contains(i,p,m)&&!mxUtils.contains(e,p,m)){r.push(new mxPoint(p,m))}if(!mxUtils.contains(i,p,c)&&!mxUtils.contains(e,p,c)){r.push(new mxPoint(p,c))}if(r.length==1){if(l!=null){if(!mxUtils.contains(i,p,l.y)&&!mxUtils.contains(e,p,l.y)){r.push(new mxPoint(p,l.y))}}else{var x=Math.max(e.y,i.y);var f=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(p,x+(f-x)/2))}}}},TopToBottom:function(t,e,i,n,r){var s=t.view;var l=n!=null&&n.length>0?n[0]:null;var a=t.absolutePoints;var o=a[0];var h=a[a.length-1];if(l!=null){l=s.transformControlPoint(t,l)}if(o!=null){e=new mxCellState;e.x=o.x;e.y=o.y}if(h!=null){i=new mxCellState;i.x=h.x;i.y=h.y}if(e!=null&&i!=null){var u=Math.max(e.y,i.y);var d=Math.min(e.y+e.height,i.y+i.height);var p=s.getRoutingCenterX(e);if(l!=null&&l.x>=e.x&&l.x<=e.x+e.width){p=l.x}var m=l!=null?l.y:Math.round(d+(u-d)/2);if(!mxUtils.contains(i,p,m)&&!mxUtils.contains(e,p,m)){r.push(new mxPoint(p,m))}if(l!=null&&l.x>=i.x&&l.x<=i.x+i.width){p=l.x}else{p=s.getRoutingCenterX(i)}if(!mxUtils.contains(i,p,m)&&!mxUtils.contains(e,p,m)){r.push(new mxPoint(p,m))}if(r.length==1){if(l!=null&&r.length==1){if(!mxUtils.contains(i,l.x,m)&&!mxUtils.contains(e,l.x,m)){r.push(new mxPoint(l.x,m))}}else{var c=Math.max(e.x,i.x);var x=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(c+(x-c)/2,m))}}}},SegmentConnector:function(t,e,i,n,r){var s=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale);var l=mxEdgeStyle.scaleCellState(e,t.view.scale);var a=mxEdgeStyle.scaleCellState(i,t.view.scale);var o=1;var h=r.length>0?r[0]:null;var u=true;var d=null;function p(e){e.x=Math.round(e.x*t.view.scale*10)/10;e.y=Math.round(e.y*t.view.scale*10)/10;if(h==null||Math.abs(h.x-e.x)>=o||Math.abs(h.y-e.y)>=Math.max(1,t.view.scale)){r.push(e);h=e}return h}var m=s[0];if(m==null&&l!=null){m=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l))}else if(m!=null){m=m.clone()}var c=s.length-1;if(n!=null&&n.length>0){var x=[];for(var f=0;f<n.length;f++){var g=t.view.transformControlPoint(t,n[f],true);if(g!=null){x.push(g)}}if(x.length==0){return}if(m!=null&&x[0]!=null){if(Math.abs(x[0].x-m.x)<o){x[0].x=m.x}if(Math.abs(x[0].y-m.y)<o){x[0].y=m.y}}var v=s[c];if(v!=null&&x[x.length-1]!=null){if(Math.abs(x[x.length-1].x-v.x)<o){x[x.length-1].x=v.x}if(Math.abs(x[x.length-1].y-v.y)<o){x[x.length-1].y=v.y}}d=x[0];var y=l;var C=s[0];var E=false;var S=false;var b=d;if(C!=null){y=null}for(var f=0;f<2;f++){var w=C!=null&&C.x==b.x;var T=C!=null&&C.y==b.y;var L=y!=null&&(b.y>=y.y&&b.y<=y.y+y.height);var A=y!=null&&(b.x>=y.x&&b.x<=y.x+y.width);E=T||C==null&&L;S=w||C==null&&A;if(f==0&&(E&&S||w&&T));else{if(C!=null&&(!T&&!w)&&(L||A)){u=L?false:true;break}if(S||E){u=E;if(f==1){u=x.length%2==0?E:S}break}}y=a;C=s[c];if(C!=null){y=null}b=x[x.length-1];if(w&&T){x=x.slice(1)}}if(u&&(s[0]!=null&&s[0].y!=d.y||s[0]==null&&l!=null&&(d.y<l.y||d.y>l.y+l.height))){p(new mxPoint(m.x,d.y))}else if(!u&&(s[0]!=null&&s[0].x!=d.x||s[0]==null&&l!=null&&(d.x<l.x||d.x>l.x+l.width))){p(new mxPoint(d.x,m.y))}if(u){m.y=d.y}else{m.x=d.x}for(var f=0;f<x.length;f++){u=!u;d=x[f];if(u){m.y=d.y}else{m.x=d.x}p(m.clone())}}else{d=m;u=true}m=s[c];if(m==null&&a!=null){m=new mxPoint(t.view.getRoutingCenterX(a),t.view.getRoutingCenterY(a))}if(m!=null){if(d!=null){if(u&&(s[c]!=null&&s[c].y!=d.y||s[c]==null&&a!=null&&(d.y<a.y||d.y>a.y+a.height))){p(new mxPoint(m.x,d.y))}else if(!u&&(s[c]!=null&&s[c].x!=d.x||s[c]==null&&a!=null&&(d.x<a.x||d.x>a.x+a.width))){p(new mxPoint(d.x,m.y))}}}if(s[0]==null&&l!=null){while(r.length>1&&r[1]!=null&&mxUtils.contains(l,r[1].x,r[1].y)){r.splice(1,1)}}if(s[c]==null&&a!=null){while(r.length>1&&r[r.length-1]!=null&&mxUtils.contains(a,r[r.length-1].x,r[r.length-1].y)){r.splice(r.length-1,1)}}if(v!=null&&r[r.length-1]!=null&&Math.abs(v.x-r[r.length-1].x)<=o&&Math.abs(v.y-r[r.length-1].y)<=o){r.splice(r.length-1,1);if(r[r.length-1]!=null){if(Math.abs(r[r.length-1].x-v.x)<o){r[r.length-1].x=v.x}if(Math.abs(r[r.length-1].y-v.y)<o){r[r.length-1].y=v.y}}}},orthBuffer:10,orthPointsFallback:true,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(t,e){var i=mxUtils.getValue(t.style,e?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(t.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));if(i=="auto"){var n=mxUtils.getValue(t.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE);if(n!=mxConstants.NONE){var r=mxUtils.getNumber(t.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);i=Math.max(2,Math.ceil((r+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer}else{i=2*mxEdgeStyle.orthBuffer}}return i},scalePointArray:function(t,e){var i=[];if(t!=null){for(var n=0;n<t.length;n++){if(t[n]!=null){var r=new mxPoint(Math.round(t[n].x/e*10)/10,Math.round(t[n].y/e*10)/10);i[n]=r}else{i[n]=null}}}else{i=null}return i},scaleCellState:function(t,e){var i=null;if(t!=null){i=t.clone();i.setRect(Math.round(t.x/e*10)/10,Math.round(t.y/e*10)/10,Math.round(t.width/e*10)/10,Math.round(t.height/e*10)/10)}else{i=null}return i},OrthConnector:function(t,e,i,n,r){var s=t.view.graph;var l=h==null?false:s.getModel().isEdge(h.cell);var a=u==null?false:s.getModel().isEdge(u.cell);var o=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale);var h=mxEdgeStyle.scaleCellState(e,t.view.scale);var u=mxEdgeStyle.scaleCellState(i,t.view.scale);var d=o[0];var p=o[o.length-1];var m=h!=null?h.x:d.x;var c=h!=null?h.y:d.y;var x=h!=null?h.width:0;var f=h!=null?h.height:0;var g=u!=null?u.x:p.x;var v=u!=null?u.y:p.y;var y=u!=null?u.width:0;var C=u!=null?u.height:0;var E=mxEdgeStyle.getJettySize(t,true);var S=mxEdgeStyle.getJettySize(t,false);if(h!=null&&u==h){S=Math.max(E,S);E=S}var b=S+E;var w=false;if(d!=null&&p!=null){var T=p.x-d.x;var L=p.y-d.y;w=T*T+L*L<b*b}if(w||mxEdgeStyle.orthPointsFallback&&(n!=null&&n.length>0)||l||a){mxEdgeStyle.SegmentConnector(t,e,i,n,r);return}var A=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL];var M=0;if(h!=null){A[0]=mxUtils.getPortConstraints(h,t,true,mxConstants.DIRECTION_MASK_ALL);M=mxUtils.getValue(h.style,mxConstants.STYLE_ROTATION,0);if(M!=0){var _=mxUtils.getBoundingBox(new mxRectangle(m,c,x,f),M);m=_.x;c=_.y;x=_.width;f=_.height}}if(u!=null){A[1]=mxUtils.getPortConstraints(u,t,false,mxConstants.DIRECTION_MASK_ALL);M=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0);if(M!=0){var _=mxUtils.getBoundingBox(new mxRectangle(g,v,y,C),M);g=_.x;v=_.y;y=_.width;C=_.height}}var I=[0,0];var O=[[m,c,x,f],[g,v,y,C]];var P=[E,S];for(var R=0;R<2;R++){mxEdgeStyle.limits[R][1]=O[R][0]-P[R];mxEdgeStyle.limits[R][2]=O[R][1]-P[R];mxEdgeStyle.limits[R][4]=O[R][0]+O[R][2]+P[R];mxEdgeStyle.limits[R][8]=O[R][1]+O[R][3]+P[R]}var H=O[0][0]+O[0][2]/2;var N=O[0][1]+O[0][3]/2;var G=O[1][0]+O[1][2]/2;var D=O[1][1]+O[1][3]/2;var T=H-G;var L=N-D;var U=0;if(T<0){if(L<0){U=2}else{U=1}}else{if(L<=0){U=3;if(T==0){U=2}}}var V=null;if(h!=null){V=d}var k=[[.5,.5],[.5,.5]];for(var R=0;R<2;R++){if(V!=null){k[R][0]=(V.x-O[R][0])/O[R][2];if(Math.abs(V.x-O[R][0])<=1){I[R]=mxConstants.DIRECTION_MASK_WEST}else if(Math.abs(V.x-O[R][0]-O[R][2])<=1){I[R]=mxConstants.DIRECTION_MASK_EAST}k[R][1]=(V.y-O[R][1])/O[R][3];if(Math.abs(V.y-O[R][1])<=1){I[R]=mxConstants.DIRECTION_MASK_NORTH}else if(Math.abs(V.y-O[R][1]-O[R][3])<=1){I[R]=mxConstants.DIRECTION_MASK_SOUTH}}V=null;if(u!=null){V=p}}var F=O[0][1]-(O[1][1]+O[1][3]);var B=O[0][0]-(O[1][0]+O[1][2]);var Y=O[1][1]-(O[0][1]+O[0][3]);var z=O[1][0]-(O[0][0]+O[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(B-b,0);mxEdgeStyle.vertexSeperations[2]=Math.max(F-b,0);mxEdgeStyle.vertexSeperations[4]=Math.max(Y-b,0);mxEdgeStyle.vertexSeperations[3]=Math.max(z-b,0);var j=[];var X=[];var W=[];X[0]=B>=z?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;W[0]=F>=Y?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;X[1]=mxUtils.reversePortConstraints(X[0]);W[1]=mxUtils.reversePortConstraints(W[0]);var K=B>=z?B:z;var Z=F>=Y?F:Y;var q=[[0,0],[0,0]];var Q=false;for(var R=0;R<2;R++){if(I[R]!=0){continue}if((X[R]&A[R])==0){X[R]=mxUtils.reversePortConstraints(X[R])}if((W[R]&A[R])==0){W[R]=mxUtils.reversePortConstraints(W[R])}q[R][0]=W[R];q[R][1]=X[R]}if(Z>0&&K>0){if((X[0]&A[0])>0&&(W[1]&A[1])>0){q[0][0]=X[0];q[0][1]=W[0];q[1][0]=W[1];q[1][1]=X[1];Q=true}else if((W[0]&A[0])>0&&(X[1]&A[1])>0){q[0][0]=W[0];q[0][1]=X[0];q[1][0]=X[1];q[1][1]=W[1];Q=true}}if(Z>0&&!Q){q[0][0]=W[0];q[0][1]=X[0];q[1][0]=W[1];q[1][1]=X[1];Q=true}if(K>0&&!Q){q[0][0]=X[0];q[0][1]=W[0];q[1][0]=X[1];q[1][1]=W[1];Q=true}for(var R=0;R<2;R++){if(I[R]!=0){continue}if((q[R][0]&A[R])==0){q[R][0]=q[R][1]}j[R]=q[R][0]&A[R];j[R]|=(q[R][1]&A[R])<<8;j[R]|=(q[1-R][R]&A[R])<<16;j[R]|=(q[1-R][1-R]&A[R])<<24;if((j[R]&15)==0){j[R]=j[R]<<8}if((j[R]&3840)==0){j[R]=j[R]&15|j[R]>>8}if((j[R]&983040)==0){j[R]=j[R]&65535|(j[R]&251658240)>>8}I[R]=j[R]&15;if(A[R]==mxConstants.DIRECTION_MASK_WEST||A[R]==mxConstants.DIRECTION_MASK_NORTH||A[R]==mxConstants.DIRECTION_MASK_EAST||A[R]==mxConstants.DIRECTION_MASK_SOUTH){I[R]=A[R]}}var J=I[0]==mxConstants.DIRECTION_MASK_EAST?3:I[0];var $=I[1]==mxConstants.DIRECTION_MASK_EAST?3:I[1];J-=U;$-=U;if(J<1){J+=4}if($<1){$+=4}var tt=mxEdgeStyle.routePatterns[J-1][$-1];mxEdgeStyle.wayPoints1[0][0]=O[0][0];mxEdgeStyle.wayPoints1[0][1]=O[0][1];switch(I[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=E;mxEdgeStyle.wayPoints1[0][1]+=k[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=k[0][0]*O[0][2];mxEdgeStyle.wayPoints1[0][1]+=O[0][3]+E;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=O[0][2]+E;mxEdgeStyle.wayPoints1[0][1]+=k[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=k[0][0]*O[0][2];mxEdgeStyle.wayPoints1[0][1]-=E;break}var et=0;var it=(I[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1;var nt=it;var rt=0;for(var R=0;R<tt.length;R++){var st=tt[R]&15;var lt=st==mxConstants.DIRECTION_MASK_EAST?3:st;lt+=U;if(lt>4){lt-=4}var at=mxEdgeStyle.dirVectors[lt-1];rt=lt%2>0?0:1;if(rt!=it){et++;mxEdgeStyle.wayPoints1[et][0]=mxEdgeStyle.wayPoints1[et-1][0];mxEdgeStyle.wayPoints1[et][1]=mxEdgeStyle.wayPoints1[et-1][1]}var ot=(tt[R]&mxEdgeStyle.TARGET_MASK)>0;var ht=(tt[R]&mxEdgeStyle.SOURCE_MASK)>0;var ut=(tt[R]&mxEdgeStyle.SIDE_MASK)>>5;ut=ut<<U;if(ut>15){ut=ut>>4}var dt=(tt[R]&mxEdgeStyle.CENTER_MASK)>0;if((ht||ot)&&ut<9){var pt=0;var mt=ht?0:1;if(dt&&rt==0){pt=O[mt][0]+k[mt][0]*O[mt][2]}else if(dt){pt=O[mt][1]+k[mt][1]*O[mt][3]}else{pt=mxEdgeStyle.limits[mt][ut]}if(rt==0){var ct=mxEdgeStyle.wayPoints1[et][0];var xt=(pt-ct)*at[0];if(xt>0){mxEdgeStyle.wayPoints1[et][0]+=at[0]*xt}}else{var ft=mxEdgeStyle.wayPoints1[et][1];var gt=(pt-ft)*at[1];if(gt>0){mxEdgeStyle.wayPoints1[et][1]+=at[1]*gt}}}else if(dt){mxEdgeStyle.wayPoints1[et][0]+=at[0]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2);mxEdgeStyle.wayPoints1[et][1]+=at[1]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2)}if(et>0&&mxEdgeStyle.wayPoints1[et][rt]==mxEdgeStyle.wayPoints1[et-1][rt]){et--}else{it=rt}}for(var R=0;R<=et;R++){if(R==et){var vt=(I[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1;var yt=vt==nt?0:1;if(yt!=(et+1)%2){break}}r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[R][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[R][1]*t.view.scale*10)/10))}var Ct=1;while(Ct<r.length){if(r[Ct-1]==null||r[Ct]==null||r[Ct-1].x!=r[Ct].x||r[Ct-1].y!=r[Ct].y){Ct++}else{r.splice(Ct,1)}}},getRoutePattern:function(t,e,i,n){var r=t[0]==mxConstants.DIRECTION_MASK_EAST?3:t[0];var s=t[1]==mxConstants.DIRECTION_MASK_EAST?3:t[1];r-=e;s-=e;if(r<1){r+=4}if(s<1){s+=4}var l=routePatterns[r-1][s-1];if(i==0||n==0){if(inlineRoutePatterns[r-1][s-1]!=null){l=inlineRoutePatterns[r-1][s-1]}}return l}};__mxOutput.mxEdgeStyle=typeof mxEdgeStyle!=="undefined"?mxEdgeStyle:undefined;var mxStyleRegistry={values:[],putValue:function(t,e){mxStyleRegistry.values[t]=e},getValue:function(t){return mxStyleRegistry.values[t]},getName:function(t){for(var e in mxStyleRegistry.values){if(mxStyleRegistry.values[e]==t){return e}}return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter);__mxOutput.mxStyleRegistry=typeof mxStyleRegistry!=="undefined"?mxStyleRegistry:undefined;function mxGraphView(t){this.graph=t;this.translate=new mxPoint;this.graphBounds=new mxRectangle;this.states=new mxDictionary}mxGraphView.prototype=new mxEventSource;mxGraphView.prototype.constructor=mxGraphView;mxGraphView.prototype.EMPTY_POINT=new mxPoint;mxGraphView.prototype.doneResource=mxClient.language!="none"?"done":"";mxGraphView.prototype.updatingDocumentResource=mxClient.language!="none"?"updatingDocument":"";mxGraphView.prototype.allowEval=false;mxGraphView.prototype.captureDocumentGesture=true;mxGraphView.prototype.optimizeVmlReflows=true;mxGraphView.prototype.rendering=true;mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null;mxGraphView.prototype.graphBounds=null;mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=false;mxGraphView.prototype.lastNode=null;mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.setGraphBounds=function(t){this.graphBounds=t};mxGraphView.prototype.getBounds=function(t){var e=null;if(t!=null&&t.length>0){var i=this.graph.getModel();for(var n=0;n<t.length;n++){if(i.isVertex(t[n])||i.isEdge(t[n])){var r=this.getState(t[n]);if(r!=null){if(e==null){e=mxRectangle.fromRectangle(r)}else{e.add(r)}}}}}return e};mxGraphView.prototype.setCurrentRoot=function(t){if(this.currentRoot!=t){var e=new mxCurrentRootChange(this,t);e.execute();var i=new mxUndoableEdit(this,true);i.add(e);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",i));this.graph.sizeDidChange()}return t};mxGraphView.prototype.scaleAndTranslate=function(t,e,i){var n=this.scale;var r=new mxPoint(this.translate.x,this.translate.y);if(this.scale!=t||this.translate.x!=e||this.translate.y!=i){this.scale=t;this.translate.x=e;this.translate.y=i;if(this.isEventsEnabled()){this.viewStateChanged()}}this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",t,"previousScale",n,"translate",this.translate,"previousTranslate",r))};mxGraphView.prototype.getScale=function(){return this.scale};mxGraphView.prototype.setScale=function(t){var e=this.scale;if(this.scale!=t){this.scale=t;if(this.isEventsEnabled()){this.viewStateChanged()}}this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",t,"previousScale",e))};mxGraphView.prototype.getTranslate=function(){return this.translate};mxGraphView.prototype.setTranslate=function(t,e){var i=new mxPoint(this.translate.x,this.translate.y);if(this.translate.x!=t||this.translate.y!=e){this.translate.x=t;this.translate.y=e;if(this.isEventsEnabled()){this.viewStateChanged()}}this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",i))};mxGraphView.prototype.viewStateChanged=function(){this.revalidate();this.graph.sizeDidChange()};mxGraphView.prototype.refresh=function(){if(this.currentRoot!=null){this.clear()}this.revalidate()};mxGraphView.prototype.revalidate=function(){this.invalidate();this.validate()};mxGraphView.prototype.clear=function(t,e,i){var n=this.graph.getModel();t=t||n.getRoot();e=e!=null?e:false;i=i!=null?i:true;this.removeState(t);if(i&&(e||t!=this.currentRoot)){var r=n.getChildCount(t);for(var s=0;s<r;s++){this.clear(n.getChildAt(t,s),e)}}else{this.invalidate(t)}};mxGraphView.prototype.invalidate=function(t,e,i){var n=this.graph.getModel();t=t||n.getRoot();e=e!=null?e:true;i=i!=null?i:true;var r=this.getState(t);if(r!=null){r.invalid=true}if(!t.invalidating){t.invalidating=true;if(e){var s=n.getChildCount(t);for(var l=0;l<s;l++){var a=n.getChildAt(t,l);this.invalidate(a,e,i)}}if(i){var o=n.getEdgeCount(t);for(var l=0;l<o;l++){this.invalidate(n.getEdgeAt(t,l),e,i)}}delete t.invalidating}};mxGraphView.prototype.validate=function(t){var e=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;this.resetValidationState();var i=null;if(this.optimizeVmlReflows&&this.canvas!=null&&this.textDiv==null&&(document.documentMode==8&&!mxClient.IS_EM||mxClient.IS_QUIRKS)){this.placeholder=document.createElement("div");this.placeholder.style.position="absolute";this.placeholder.style.width=this.canvas.clientWidth+"px";this.placeholder.style.height=this.canvas.clientHeight+"px";this.canvas.parentNode.appendChild(this.placeholder);i=this.drawPane.style.display;this.canvas.style.display="none";this.textDiv=document.createElement("div");this.textDiv.style.position="absolute";this.textDiv.style.whiteSpace="nowrap";this.textDiv.style.visibility="hidden";this.textDiv.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";this.textDiv.style.zoom="1";document.body.appendChild(this.textDiv)}var n=this.getBoundingBox(this.validateCellState(this.validateCell(t||(this.currentRoot!=null?this.currentRoot:this.graph.getModel().getRoot()))));this.setGraphBounds(n!=null?n:this.getEmptyBounds());this.validateBackground();if(i!=null){this.canvas.style.display=i;this.textDiv.parentNode.removeChild(this.textDiv);if(this.placeholder!=null){this.placeholder.parentNode.removeChild(this.placeholder)}this.textDiv=null}this.resetValidationState();window.status=mxResources.get(this.doneResource)||this.doneResource;mxLog.leave("mxGraphView.validate",e)};mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)};mxGraphView.prototype.getBoundingBox=function(t,e){e=e!=null?e:true;var i=null;if(t!=null){if(t.shape!=null&&t.shape.boundingBox!=null){i=t.shape.boundingBox.clone()}if(t.text!=null&&t.text.boundingBox!=null){if(i!=null){i.add(t.text.boundingBox)}else{i=t.text.boundingBox.clone()}}if(e){var n=this.graph.getModel();var r=n.getChildCount(t.cell);for(var s=0;s<r;s++){var l=this.getBoundingBox(this.getState(n.getChildAt(t.cell,s)));if(l!=null){if(i==null){i=l}else{i.add(l)}}}}}return i};mxGraphView.prototype.createBackgroundPageShape=function(t){return new mxRectangleShape(t,"white","black")};mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage();this.validateBackgroundPage()};mxGraphView.prototype.validateBackgroundImage=function(){var t=this.graph.getBackgroundImage();if(t!=null){if(this.backgroundImage==null||this.backgroundImage.image!=t.src){if(this.backgroundImage!=null){this.backgroundImage.destroy()}var e=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(e,t.src);this.backgroundImage.dialect=this.graph.dialect;this.backgroundImage.init(this.backgroundPane);this.backgroundImage.redraw();if(document.documentMode==8&&!mxClient.IS_EM){mxEvent.addGestureListeners(this.backgroundImage.node,mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))})),mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))})),mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))})))}}this.redrawBackgroundImage(this.backgroundImage,t)}else if(this.backgroundImage!=null){this.backgroundImage.destroy();this.backgroundImage=null}};mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var t=this.getBackgroundPageBounds();if(this.backgroundPageShape==null){this.backgroundPageShape=this.createBackgroundPageShape(t);this.backgroundPageShape.scale=this.scale;this.backgroundPageShape.isShadow=true;this.backgroundPageShape.dialect=this.graph.dialect;this.backgroundPageShape.init(this.backgroundPane);this.backgroundPageShape.redraw();if(this.graph.nativeDblClickEnabled){mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,(function(t){this.graph.dblClick(t)})))}mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))})),mxUtils.bind(this,(function(t){if(this.graph.tooltipHandler!=null&&this.graph.tooltipHandler.isHideOnHover()){this.graph.tooltipHandler.hide()}if(this.graph.isMouseDown&&!mxEvent.isConsumed(t)){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}})),mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))})))}else{this.backgroundPageShape.scale=this.scale;this.backgroundPageShape.bounds=t;this.backgroundPageShape.redraw()}}else if(this.backgroundPageShape!=null){this.backgroundPageShape.destroy();this.backgroundPageShape=null}};mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.graph.pageFormat;var e=this.scale*this.graph.pageScale;var i=new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,t.width*e,t.height*e);return i};mxGraphView.prototype.redrawBackgroundImage=function(t,e){t.scale=this.scale;t.bounds.x=this.scale*this.translate.x;t.bounds.y=this.scale*this.translate.y;t.bounds.width=this.scale*e.width;t.bounds.height=this.scale*e.height;t.redraw()};mxGraphView.prototype.validateCell=function(t,e){e=e!=null?e:true;if(t!=null){e=e&&this.graph.isCellVisible(t);var i=this.getState(t,e);if(i!=null&&!e){this.removeState(t)}else{var n=this.graph.getModel();var r=n.getChildCount(t);for(var s=0;s<r;s++){this.validateCell(n.getChildAt(t,s),e&&(!this.isCellCollapsed(t)||t==this.currentRoot))}}}return t};mxGraphView.prototype.validateCellState=function(t,e){e=e!=null?e:true;var i=null;if(t!=null){i=this.getState(t);if(i!=null){var n=this.graph.getModel();if(i.invalid){i.invalid=false;if(i.style==null||i.invalidStyle){i.style=this.graph.getCellStyle(i.cell);i.invalidStyle=false}if(t!=this.currentRoot){this.validateCellState(n.getParent(t),false)}i.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,true),false),true);i.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,false),false),false);this.updateCellState(i);if(t!=this.currentRoot&&!i.invalid){this.graph.cellRenderer.redraw(i,false,this.isRendering());i.updateCachedBounds()}}if(e&&!i.invalid){if(i.shape!=null){this.stateValidated(i)}var r=n.getChildCount(t);for(var s=0;s<r;s++){this.validateCellState(n.getChildAt(t,s))}}}}return i};mxGraphView.prototype.updateCellState=function(t){t.absoluteOffset.x=0;t.absoluteOffset.y=0;t.origin.x=0;t.origin.y=0;t.length=0;if(t.cell!=this.currentRoot){var e=this.graph.getModel();var i=this.getState(e.getParent(t.cell));if(i!=null&&i.cell!=this.currentRoot){t.origin.x+=i.origin.x;t.origin.y+=i.origin.y}var n=this.graph.getChildOffsetForCell(t.cell);if(n!=null){t.origin.x+=n.x;t.origin.y+=n.y}var r=this.graph.getCellGeometry(t.cell);if(r!=null){if(!e.isEdge(t.cell)){n=r.offset!=null?r.offset:this.EMPTY_POINT;if(r.relative&&i!=null){if(e.isEdge(i.cell)){var s=this.getPoint(i,r);if(s!=null){t.origin.x+=s.x/this.scale-i.origin.x-this.translate.x;t.origin.y+=s.y/this.scale-i.origin.y-this.translate.y}}else{t.origin.x+=r.x*i.unscaledWidth+n.x;t.origin.y+=r.y*i.unscaledHeight+n.y}}else{t.absoluteOffset.x=this.scale*n.x;t.absoluteOffset.y=this.scale*n.y;t.origin.x+=r.x;t.origin.y+=r.y}}t.x=this.scale*(this.translate.x+t.origin.x);t.y=this.scale*(this.translate.y+t.origin.y);t.width=this.scale*r.width;t.unscaledWidth=r.width;t.height=this.scale*r.height;t.unscaledHeight=r.height;if(e.isVertex(t.cell)){this.updateVertexState(t,r)}if(e.isEdge(t.cell)){this.updateEdgeState(t,r)}}}t.updateCachedBounds()};mxGraphView.prototype.isCellCollapsed=function(t){return this.graph.isCellCollapsed(t)};mxGraphView.prototype.updateVertexState=function(t,e){var i=this.graph.getModel();var n=this.getState(i.getParent(t.cell));if(e.relative&&n!=null&&!i.isEdge(n.cell)){var r=mxUtils.toRadians(n.style[mxConstants.STYLE_ROTATION]||"0");if(r!=0){var s=Math.cos(r);var l=Math.sin(r);var a=new mxPoint(t.getCenterX(),t.getCenterY());var o=new mxPoint(n.getCenterX(),n.getCenterY());var h=mxUtils.getRotatedPoint(a,s,l,o);t.x=h.x-t.width/2;t.y=h.y-t.height/2}}this.updateVertexLabelOffset(t)};mxGraphView.prototype.updateEdgeState=function(t,e){var i=t.getVisibleTerminalState(true);var n=t.getVisibleTerminalState(false);if(this.graph.model.getTerminal(t.cell,true)!=null&&i==null||i==null&&e.getTerminalPoint(true)==null||this.graph.model.getTerminal(t.cell,false)!=null&&n==null||n==null&&e.getTerminalPoint(false)==null){this.clear(t.cell,true)}else{this.updateFixedTerminalPoints(t,i,n);this.updatePoints(t,e.points,i,n);this.updateFloatingTerminalPoints(t,i,n);var r=t.absolutePoints;if(t.cell!=this.currentRoot&&(r==null||r.length<2||r[0]==null||r[r.length-1]==null)){this.clear(t.cell,true)}else{this.updateEdgeBounds(t);this.updateEdgeLabelOffset(t)}}};mxGraphView.prototype.updateVertexLabelOffset=function(t){var e=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(e==mxConstants.ALIGN_LEFT){var i=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(i!=null){i*=this.scale}else{i=t.width}t.absoluteOffset.x-=i}else if(e==mxConstants.ALIGN_RIGHT){t.absoluteOffset.x+=t.width}else if(e==mxConstants.ALIGN_CENTER){var i=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(i!=null){var n=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);var r=0;if(n==mxConstants.ALIGN_CENTER){r=.5}else if(n==mxConstants.ALIGN_RIGHT){r=1}if(r!=0){t.absoluteOffset.x-=(i*this.scale-t.width)*r}}}var s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(s==mxConstants.ALIGN_TOP){t.absoluteOffset.y-=t.height}else if(s==mxConstants.ALIGN_BOTTOM){t.absoluteOffset.y+=t.height}};mxGraphView.prototype.resetValidationState=function(){this.lastNode=null;this.lastHtmlNode=null;this.lastForegroundNode=null;this.lastForegroundHtmlNode=null};mxGraphView.prototype.stateValidated=function(t){var e=this.graph.getModel().isEdge(t.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(t.cell)&&this.graph.keepEdgesInBackground;var i=e?this.lastForegroundHtmlNode||this.lastHtmlNode:this.lastHtmlNode;var n=e?this.lastForegroundNode||this.lastNode:this.lastNode;var r=this.graph.cellRenderer.insertStateAfter(t,n,i);if(e){this.lastForegroundHtmlNode=r[1];this.lastForegroundNode=r[0]}else{this.lastHtmlNode=r[1];this.lastNode=r[0]}};mxGraphView.prototype.updateFixedTerminalPoints=function(t,e,i){this.updateFixedTerminalPoint(t,e,true,this.graph.getConnectionConstraint(t,e,true));this.updateFixedTerminalPoint(t,i,false,this.graph.getConnectionConstraint(t,i,false))};mxGraphView.prototype.updateFixedTerminalPoint=function(t,e,i,n){t.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(t,e,i,n),i)};mxGraphView.prototype.getFixedTerminalPoint=function(t,e,i,n){var r=null;if(n!=null){r=this.graph.getConnectionPoint(e,n,false)}if(r==null&&e==null){var s=this.scale;var l=this.translate;var a=t.origin;var o=this.graph.getCellGeometry(t.cell);r=o.getTerminalPoint(i);if(r!=null){r=new mxPoint(s*(l.x+r.x+a.x),s*(l.y+r.y+a.y))}}return r};mxGraphView.prototype.updateBoundsFromStencil=function(t){var e=null;if(t!=null&&t.shape!=null&&t.shape.stencil!=null&&t.shape.stencil.aspect=="fixed"){e=mxRectangle.fromRectangle(t);var i=t.shape.stencil.computeAspect(t.style,t.x,t.y,t.width,t.height);t.setRect(i.x,i.y,t.shape.stencil.w0*i.width,t.shape.stencil.h0*i.height)}return e};mxGraphView.prototype.updatePoints=function(t,e,i,n){if(t!=null){var r=[];r.push(t.absolutePoints[0]);var s=this.getEdgeStyle(t,e,i,n);if(s!=null){var l=this.getTerminalPort(t,i,true);var a=this.getTerminalPort(t,n,false);var o=this.updateBoundsFromStencil(l);var h=this.updateBoundsFromStencil(a);s(t,l,a,e,r);if(o!=null){l.setRect(o.x,o.y,o.width,o.height)}if(h!=null){a.setRect(h.x,h.y,h.width,h.height)}}else if(e!=null){for(var u=0;u<e.length;u++){if(e[u]!=null){var d=mxUtils.clone(e[u]);r.push(this.transformControlPoint(t,d))}}}var p=t.absolutePoints;r.push(p[p.length-1]);t.absolutePoints=r}};mxGraphView.prototype.transformControlPoint=function(t,e,i){if(t!=null&&e!=null){var n=t.origin;var r=i?1:this.scale;return new mxPoint(r*(e.x+this.translate.x+n.x),r*(e.y+this.translate.y+n.y))}return null};mxGraphView.prototype.isLoopStyleEnabled=function(t,e,i,n){var r=this.graph.getConnectionConstraint(t,i,true);var s=this.graph.getConnectionConstraint(t,n,false);if((e==null||e.length<2)&&(!mxUtils.getValue(t.style,mxConstants.STYLE_ORTHOGONAL_LOOP,false)||(r==null||r.point==null)&&(s==null||s.point==null))){return i!=null&&i==n}return false};mxGraphView.prototype.getEdgeStyle=function(t,e,i,n){var r=this.isLoopStyleEnabled(t,e,i,n)?mxUtils.getValue(t.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):!mxUtils.getValue(t.style,mxConstants.STYLE_NOEDGESTYLE,false)?t.style[mxConstants.STYLE_EDGE]:null;if(typeof r=="string"){var s=mxStyleRegistry.getValue(r);if(s==null&&this.isAllowEval()){s=mxUtils.eval(r)}r=s}if(typeof r=="function"){return r}return null};mxGraphView.prototype.updateFloatingTerminalPoints=function(t,e,i){var n=t.absolutePoints;var r=n[0];var s=n[n.length-1];if(s==null&&i!=null){this.updateFloatingTerminalPoint(t,i,e,false)}if(r==null&&e!=null){this.updateFloatingTerminalPoint(t,e,i,true)}};mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,i,n){t.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(t,e,i,n),n)};mxGraphView.prototype.getFloatingTerminalPoint=function(t,e,i,n){e=this.getTerminalPort(t,e,n);var r=this.getNextPoint(t,i,n);var s=this.graph.isOrthogonal(t);var l=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0"));var a=new mxPoint(e.getCenterX(),e.getCenterY());if(l!=0){var o=Math.cos(-l);var h=Math.sin(-l);r=mxUtils.getRotatedPoint(r,o,h,a)}var u=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(t.style[n?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);var d=this.getPerimeterPoint(e,r,l==0&&s,u);if(l!=0){var o=Math.cos(l);var h=Math.sin(l);d=mxUtils.getRotatedPoint(d,o,h,a)}return d};mxGraphView.prototype.getTerminalPort=function(t,e,i){var n=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;var r=mxUtils.getValue(t.style,n);if(r!=null){var s=this.getState(this.graph.getModel().getCell(r));if(s!=null){e=s}}return e};mxGraphView.prototype.getPerimeterPoint=function(t,e,i,n){var r=null;if(t!=null){var s=this.getPerimeterFunction(t);if(s!=null&&e!=null){var l=this.getPerimeterBounds(t,n);if(l.width>0||l.height>0){r=new mxPoint(e.x,e.y);var a=false;var o=false;if(this.graph.model.isVertex(t.cell)){a=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0)==1;o=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0)==1;if(t.shape!=null&&t.shape.stencil!=null){a=mxUtils.getValue(t.style,"stencilFlipH",0)==1||a;o=mxUtils.getValue(t.style,"stencilFlipV",0)==1||o}if(a){r.x=2*l.getCenterX()-r.x}if(o){r.y=2*l.getCenterY()-r.y}}r=s(l,t,r,i);if(r!=null){if(a){r.x=2*l.getCenterX()-r.x}if(o){r.y=2*l.getCenterY()-r.y}}}}if(r==null){r=this.getPoint(t)}}return r};mxGraphView.prototype.getRoutingCenterX=function(t){var e=t.style!=null?parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0:0;return t.getCenterX()+e*t.width};mxGraphView.prototype.getRoutingCenterY=function(t){var e=t.style!=null?parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return t.getCenterY()+e*t.height};mxGraphView.prototype.getPerimeterBounds=function(t,e){e=e!=null?e:0;if(t!=null){e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)}return t.getPerimeterBounds(e*this.scale)};mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if(typeof e=="string"){var i=mxStyleRegistry.getValue(e);if(i==null&&this.isAllowEval()){i=mxUtils.eval(e)}e=i}if(typeof e=="function"){return e}return null};mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints;var r=null;if(n!=null&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}if(r==null&&e!=null){r=new mxPoint(e.getCenterX(),e.getCenterY())}return r};mxGraphView.prototype.getVisibleTerminal=function(t,e){var i=this.graph.getModel();var n=i.getTerminal(t,e);var r=n;while(n!=null&&n!=this.currentRoot){if(!this.graph.isCellVisible(r)||this.isCellCollapsed(n)){r=n}n=i.getParent(n)}if(r!=null&&(!i.contains(r)||i.getParent(r)==i.getRoot()||r==this.currentRoot)){r=null}return r};mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints;var i=e[0];var n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x;var s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else{t.terminalDistance=0}var l=0;var a=[];var o=i;if(o!=null){var h=o.x;var u=o.y;var d=h;var p=u;for(var m=1;m<e.length;m++){var c=e[m];if(c!=null){var r=o.x-c.x;var s=o.y-c.y;var x=Math.sqrt(r*r+s*s);a.push(x);l+=x;o=c;h=Math.min(o.x,h);u=Math.min(o.y,u);d=Math.max(o.x,d);p=Math.max(o.y,p)}}t.length=l;t.segments=a;var f=1;t.x=h;t.y=u;t.width=Math.max(f,d-h);t.height=Math.max(f,p-u)}};mxGraphView.prototype.getPoint=function(t,e){var i=t.getCenterX();var n=t.getCenterY();if(t.segments!=null&&(e==null||e.relative)){var r=e!=null?e.x/2:0;var s=t.absolutePoints.length;var l=Math.round((r+.5)*t.length);var a=t.segments[0];var o=0;var h=1;while(l>=Math.round(o+a)&&h<s-1){o+=a;a=t.segments[h++]}var u=a==0?0:(l-o)/a;var d=t.absolutePoints[h-1];var p=t.absolutePoints[h];if(d!=null&&p!=null){var m=0;var c=0;var x=0;if(e!=null){m=e.y;var f=e.offset;if(f!=null){c=f.x;x=f.y}}var g=p.x-d.x;var v=p.y-d.y;var y=a==0?0:v/a;var C=a==0?0:g/a;i=d.x+g*u+(y*m+c)*this.scale;n=d.y+v*u-(C*m-x)*this.scale}}else if(e!=null){var f=e.offset;if(f!=null){i+=f.x;n+=f.y}}return new mxPoint(i,n)};mxGraphView.prototype.getRelativePoint=function(t,e,i){var n=this.graph.getModel();var r=n.getGeometry(t.cell);if(r!=null){var s=t.absolutePoints.length;if(r.relative&&s>1){var l=t.length;var a=t.segments;var o=t.absolutePoints[0];var h=t.absolutePoints[1];var u=mxUtils.ptSegDistSq(o.x,o.y,h.x,h.y,e,i);var d=0;var p=0;var m=0;for(var c=2;c<s;c++){p+=a[c-2];h=t.absolutePoints[c];var x=mxUtils.ptSegDistSq(o.x,o.y,h.x,h.y,e,i);if(x<=u){u=x;d=c-1;m=p}o=h}var f=a[d];o=t.absolutePoints[d];h=t.absolutePoints[d+1];var g=o.x;var v=o.y;var y=h.x;var C=h.y;var E=e;var S=i;var b=g-y;var w=v-C;E-=y;S-=C;var T=0;E=b-E;S=w-S;var L=E*b+S*w;if(L<=0){T=0}else{T=L*L/(b*b+w*w)}var A=Math.sqrt(T);if(A>f){A=f}var M=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,h.x,h.y,e,i));var _=mxUtils.relativeCcw(o.x,o.y,h.x,h.y,e,i);if(_==-1){M=-M}return new mxPoint((l/2-m-A)/l*-2,M/this.scale)}}return new mxPoint};mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;t.absoluteOffset.x=t.getCenterX();t.absoluteOffset.y=t.getCenterY();if(e!=null&&e.length>0&&t.segments!=null){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);if(n!=null){t.absoluteOffset=n}}else{var r=e[0];var s=e[e.length-1];if(r!=null&&s!=null){var l=s.x-r.x;var a=s.y-r.y;var o=0;var h=0;var u=i.offset;if(u!=null){o=u.x;h=u.y}var d=r.x+l/2+o*this.scale;var p=r.y+a/2+h*this.scale;t.absoluteOffset.x=d;t.absoluteOffset.y=p}}}};mxGraphView.prototype.getState=function(t,e){e=e||false;var i=null;if(t!=null){i=this.states.get(t);if(e&&(i==null||this.updateStyle)&&this.graph.isCellVisible(t)){if(i==null){i=this.createState(t);this.states.put(t,i)}else{i.style=this.graph.getCellStyle(t)}}}return i};mxGraphView.prototype.isRendering=function(){return this.rendering};mxGraphView.prototype.setRendering=function(t){this.rendering=t};mxGraphView.prototype.isAllowEval=function(){return this.allowEval};mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t};mxGraphView.prototype.getStates=function(){return this.states};mxGraphView.prototype.setStates=function(t){this.states=t};mxGraphView.prototype.getCellStates=function(t){if(t==null){return this.states}else{var e=[];for(var i=0;i<t.length;i++){var n=this.getState(t[i]);if(n!=null){e.push(n)}}return e}};mxGraphView.prototype.removeState=function(t){var e=null;if(t!=null){e=this.states.remove(t);if(e!=null){this.graph.cellRenderer.destroy(e);e.invalid=true;e.destroy()}}return e};mxGraphView.prototype.createState=function(t){return new mxCellState(this,t,this.graph.getCellStyle(t))};mxGraphView.prototype.getCanvas=function(){return this.canvas};mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane};mxGraphView.prototype.getDrawPane=function(){return this.drawPane};mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane};mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane};mxGraphView.prototype.isContainerEvent=function(t){var e=mxEvent.getSource(t);return e==this.graph.container||e.parentNode==this.backgroundPane||e.parentNode!=null&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane||e==this.decoratorPane};mxGraphView.prototype.isScrollEvent=function(t){var e=mxUtils.getOffset(this.graph.container);var i=new mxPoint(t.clientX-e.x,t.clientY-e.y);var n=this.graph.container.offsetWidth;var r=this.graph.container.clientWidth;if(n>r&&i.x>r+2&&i.x<=n){return true}var s=this.graph.container.offsetHeight;var l=this.graph.container.clientHeight;if(s>l&&i.y>l+2&&i.y<=s){return true}return false};mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;if(t.dialect==mxConstants.DIALECT_SVG){this.createSvg()}else if(t.dialect==mxConstants.DIALECT_VML){this.createVml()}else{this.createHtml()}};mxGraphView.prototype.installListeners=function(){var t=this.graph;var e=t.container;if(e!=null){if(mxClient.IS_TOUCH){mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,(function(e){t.fireGestureEvent(e);mxEvent.consume(e)})));mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,(function(e){t.fireGestureEvent(e);mxEvent.consume(e)})));mxEvent.addListener(e,"gestureend",mxUtils.bind(this,(function(e){t.fireGestureEvent(e);mxEvent.consume(e)})))}var i=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))){t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e));i=e.pointerId}})),mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)&&(i==null||e.pointerId==i)){t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}})),mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)){t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}i=null})));mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)){t.dblClick(e)}})));var n=function(i){var n=null;if(mxClient.IS_TOUCH){var r=mxEvent.getClientX(i);var s=mxEvent.getClientY(i);var l=mxUtils.convertPoint(e,r,s);n=t.view.getState(t.getCellAt(l.x,l.y))}return n};t.addMouseListener({mouseDown:function(e,i){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}});this.moveHandler=mxUtils.bind(this,(function(e){if(t.tooltipHandler!=null&&t.tooltipHandler.isHideOnHover()){t.tooltipHandler.hide()}if(this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(e)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&!mxEvent.isConsumed(e)){t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n(e)))}}));this.endHandler=mxUtils.bind(this,(function(e){if(this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(e)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"){t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}}));mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}};mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(t!=null){this.canvas=this.createHtmlPane("100%","100%");this.canvas.style.overflow="hidden";this.backgroundPane=this.createHtmlPane("1px","1px");this.drawPane=this.createHtmlPane("1px","1px");this.overlayPane=this.createHtmlPane("1px","1px");this.decoratorPane=this.createHtmlPane("1px","1px");this.canvas.appendChild(this.backgroundPane);this.canvas.appendChild(this.drawPane);this.canvas.appendChild(this.overlayPane);this.canvas.appendChild(this.decoratorPane);t.appendChild(this.canvas);this.updateContainerStyle(t);if(mxClient.IS_QUIRKS){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds();var i=e.x+e.width+this.graph.border;var n=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(i,n)}));mxEvent.addListener(window,"resize",e)}}};mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(this.graph.container!=null){var i=this.graph.container.offsetWidth;var n=this.graph.container.offsetHeight;if(i<t){this.canvas.style.width=t+"px"}else{this.canvas.style.width="100%"}if(n<e){this.canvas.style.height=e+"px"}else{this.canvas.style.height="100%"}}};mxGraphView.prototype.createHtmlPane=function(t,e){var i=document.createElement("DIV");if(t!=null&&e!=null){i.style.position="absolute";i.style.left="0px";i.style.top="0px";i.style.width=t;i.style.height=e}else{i.style.position="relative"}return i};mxGraphView.prototype.createVml=function(){var t=this.graph.container;if(t!=null){var e=t.offsetWidth;var i=t.offsetHeight;this.canvas=this.createVmlPane(e,i);this.canvas.style.overflow="hidden";this.backgroundPane=this.createVmlPane(e,i);this.drawPane=this.createVmlPane(e,i);this.overlayPane=this.createVmlPane(e,i);this.decoratorPane=this.createVmlPane(e,i);this.canvas.appendChild(this.backgroundPane);this.canvas.appendChild(this.drawPane);this.canvas.appendChild(this.overlayPane);this.canvas.appendChild(this.decoratorPane);t.appendChild(this.canvas)}};mxGraphView.prototype.createVmlPane=function(t,e){var i=document.createElement(mxClient.VML_PREFIX+":group");i.style.position="absolute";i.style.left="0px";i.style.top="0px";i.style.width=t+"px";i.style.height=e+"px";i.setAttribute("coordsize",t+","+e);i.setAttribute("coordorigin","0,0");return i};mxGraphView.prototype.createSvg=function(){var t=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g");this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.backgroundPane);this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.drawPane);this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.overlayPane);this.decoratorPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.decoratorPane);var e=document.createElementNS(mxConstants.NS_SVG,"svg");e.style.left="0px";e.style.top="0px";e.style.width="100%";e.style.height="100%";e.style.display="block";e.appendChild(this.canvas);if(mxClient.IS_IE||mxClient.IS_IE11){e.style.overflow="hidden"}if(t!=null){t.appendChild(e);this.updateContainerStyle(t)}};mxGraphView.prototype.updateContainerStyle=function(t){var e=mxUtils.getCurrentStyle(t);if(e!=null&&e.position=="static"){t.style.position="relative"}if(mxClient.IS_POINTER){t.style.touchAction="none"}};mxGraphView.prototype.destroy=function(){var t=this.canvas!=null?this.canvas.ownerSVGElement:null;if(t==null){t=this.canvas}if(t!=null&&t.parentNode!=null){this.clear(this.currentRoot,true);mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler);mxEvent.release(this.graph.container);t.parentNode.removeChild(t);this.moveHandler=null;this.endHandler=null;this.canvas=null;this.backgroundPane=null;this.drawPane=null;this.overlayPane=null;this.decoratorPane=null}};function mxCurrentRootChange(t,e){this.view=t;this.root=e;this.previous=e;this.isUp=e==null;if(!this.isUp){var i=this.view.currentRoot;var n=this.view.graph.getModel();while(i!=null){if(i==e){this.isUp=true;break}i=n.getParent(i)}}}mxCurrentRootChange.prototype.execute=function(){var t=this.view.currentRoot;this.view.currentRoot=this.previous;this.previous=t;var e=this.view.graph.getTranslateForRoot(this.view.currentRoot);if(e!=null){this.view.translate=new mxPoint(-e.x,-e.y)}if(this.isUp){this.view.clear(this.view.currentRoot,true);this.view.validate()}else{this.view.refresh()}var i=this.isUp?mxEvent.UP:mxEvent.DOWN;this.view.fireEvent(new mxEventObject(i,"root",this.view.currentRoot,"previous",this.previous));this.isUp=!this.isUp};__mxOutput.mxGraphView=typeof mxGraphView!=="undefined"?mxGraphView:undefined;function mxGraph(t,e,i,n){this.mouseListeners=null;this.renderHint=i;if(mxClient.IS_SVG){this.dialect=mxConstants.DIALECT_SVG}else if(i==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML){this.dialect=mxConstants.DIALECT_VML}else if(i==mxConstants.RENDERING_HINT_FASTEST){this.dialect=mxConstants.DIALECT_STRICTHTML}else if(i==mxConstants.RENDERING_HINT_FASTER){this.dialect=mxConstants.DIALECT_PREFERHTML}else{this.dialect=mxConstants.DIALECT_MIXEDHTML}this.model=e!=null?e:new mxGraphModel;this.multiplicities=[];this.imageBundles=[];this.cellRenderer=this.createCellRenderer();this.setSelectionModel(this.createSelectionModel());this.setStylesheet(n!=null?n:this.createStylesheet());this.view=this.createGraphView();this.graphModelChangeListener=mxUtils.bind(this,(function(t,e){this.graphModelChanged(e.getProperty("edit").changes)}));this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener);this.createHandlers();if(t!=null){this.init(t)}this.view.revalidate()}if(mxLoadResources){mxResources.add(mxClient.basePath+"/resources/graph")}else{mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph")}mxGraph.prototype=new mxEventSource;mxGraph.prototype.constructor=mxGraph;mxGraph.prototype.mouseListeners=null;mxGraph.prototype.isMouseDown=false;mxGraph.prototype.model=null;mxGraph.prototype.view=null;mxGraph.prototype.stylesheet=null;mxGraph.prototype.selectionModel=null;mxGraph.prototype.cellEditor=null;mxGraph.prototype.cellRenderer=null;mxGraph.prototype.multiplicities=null;mxGraph.prototype.renderHint=null;mxGraph.prototype.dialect=null;mxGraph.prototype.gridSize=10;mxGraph.prototype.gridEnabled=true;mxGraph.prototype.portsEnabled=true;mxGraph.prototype.nativeDblClickEnabled=true;mxGraph.prototype.doubleTapEnabled=true;mxGraph.prototype.doubleTapTimeout=500;mxGraph.prototype.doubleTapTolerance=25;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchTime=0;mxGraph.prototype.tapAndHoldEnabled=true;mxGraph.prototype.tapAndHoldDelay=500;mxGraph.prototype.tapAndHoldInProgress=false;mxGraph.prototype.tapAndHoldValid=false;mxGraph.prototype.initialTouchX=0;mxGraph.prototype.initialTouchY=0;mxGraph.prototype.tolerance=4;mxGraph.prototype.defaultOverlap=.5;mxGraph.prototype.defaultParent=null;mxGraph.prototype.alternateEdgeStyle=null;mxGraph.prototype.backgroundImage=null;mxGraph.prototype.pageVisible=false;mxGraph.prototype.pageBreaksVisible=false;mxGraph.prototype.pageBreakColor="gray";mxGraph.prototype.pageBreakDashed=true;mxGraph.prototype.minPageBreakDist=20;mxGraph.prototype.preferPageSize=false;mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT;mxGraph.prototype.pageScale=1.5;mxGraph.prototype.enabled=true;mxGraph.prototype.escapeEnabled=true;mxGraph.prototype.invokesStopCellEditing=true;mxGraph.prototype.enterStopsCellEditing=false;mxGraph.prototype.useScrollbarsForPanning=true;mxGraph.prototype.exportEnabled=true;mxGraph.prototype.importEnabled=true;mxGraph.prototype.cellsLocked=false;mxGraph.prototype.cellsCloneable=true;mxGraph.prototype.foldingEnabled=true;mxGraph.prototype.cellsEditable=true;mxGraph.prototype.cellsDeletable=true;mxGraph.prototype.cellsMovable=true;mxGraph.prototype.edgeLabelsMovable=true;mxGraph.prototype.vertexLabelsMovable=false;mxGraph.prototype.dropEnabled=false;mxGraph.prototype.splitEnabled=true;mxGraph.prototype.cellsResizable=true;mxGraph.prototype.cellsBendable=true;mxGraph.prototype.cellsSelectable=true;mxGraph.prototype.cellsDisconnectable=true;mxGraph.prototype.autoSizeCells=false;mxGraph.prototype.autoSizeCellsOnAdd=false;mxGraph.prototype.autoScroll=true;mxGraph.prototype.ignoreScrollbars=false;mxGraph.prototype.translateToScrollPosition=false;mxGraph.prototype.timerAutoScroll=false;mxGraph.prototype.allowAutoPanning=false;mxGraph.prototype.autoExtend=true;mxGraph.prototype.maximumGraphBounds=null;mxGraph.prototype.minimumGraphSize=null;mxGraph.prototype.minimumContainerSize=null;mxGraph.prototype.maximumContainerSize=null;mxGraph.prototype.resizeContainer=false;mxGraph.prototype.border=0;mxGraph.prototype.keepEdgesInForeground=false;mxGraph.prototype.keepEdgesInBackground=false;mxGraph.prototype.allowNegativeCoordinates=true;mxGraph.prototype.constrainChildren=true;mxGraph.prototype.constrainRelativeChildren=false;mxGraph.prototype.extendParents=true;mxGraph.prototype.extendParentsOnAdd=true;mxGraph.prototype.extendParentsOnMove=false;mxGraph.prototype.recursiveResize=false;mxGraph.prototype.collapseToPreferredSize=true;mxGraph.prototype.zoomFactor=1.2;mxGraph.prototype.keepSelectionVisibleOnZoom=false;mxGraph.prototype.centerZoom=true;mxGraph.prototype.resetViewOnRootChange=true;mxGraph.prototype.resetEdgesOnResize=false;mxGraph.prototype.resetEdgesOnMove=false;mxGraph.prototype.resetEdgesOnConnect=true;mxGraph.prototype.allowLoops=false;mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop;mxGraph.prototype.multigraph=true;mxGraph.prototype.connectableEdges=false;mxGraph.prototype.allowDanglingEdges=true;mxGraph.prototype.cloneInvalidEdges=false;mxGraph.prototype.disconnectOnMove=true;mxGraph.prototype.labelsVisible=true;mxGraph.prototype.htmlLabels=false;mxGraph.prototype.swimlaneSelectionEnabled=true;mxGraph.prototype.swimlaneNesting=true;mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR;mxGraph.prototype.imageBundles=null;mxGraph.prototype.minFitScale=.1;mxGraph.prototype.maxFitScale=8;mxGraph.prototype.panDx=0;mxGraph.prototype.panDy=0;mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9);mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9);mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16);mxGraph.prototype.alreadyConnectedResource=mxClient.language!="none"?"alreadyConnected":"";mxGraph.prototype.containsValidationErrorsResource=mxClient.language!="none"?"containsValidationErrors":"";mxGraph.prototype.collapseExpandResource=mxClient.language!="none"?"collapse-expand":"";mxGraph.prototype.init=function(t){this.container=t;this.cellEditor=this.createCellEditor();this.view.init();this.sizeDidChange();mxEvent.addListener(t,"mouseleave",mxUtils.bind(this,(function(t){if(this.tooltipHandler!=null&&this.tooltipHandler.div!=null&&this.tooltipHandler.div!=t.relatedTarget){this.tooltipHandler.hide()}})));if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})));mxEvent.addListener(t,"selectstart",mxUtils.bind(this,(function(t){return this.isEditing()||!this.isMouseDown&&!mxEvent.isShiftDown(t)})))}if(document.documentMode==8){t.insertAdjacentHTML("beforeend","<"+mxClient.VML_PREFIX+":group"+' style="DISPLAY: none;"></'+mxClient.VML_PREFIX+":group>")}};mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler();this.tooltipHandler.setEnabled(false);this.selectionCellsHandler=this.createSelectionCellsHandler();this.connectionHandler=this.createConnectionHandler();this.connectionHandler.setEnabled(false);this.graphHandler=this.createGraphHandler();this.panningHandler=this.createPanningHandler();this.panningHandler.panningEnabled=false;this.popupMenuHandler=this.createPopupMenuHandler()};mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)};mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)};mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)};mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)};mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)};mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)};mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t};mxGraph.prototype.getSelectionCellsForChanges=function(t,e){var i=new mxDictionary;var n=[];var r=mxUtils.bind(this,(function(t){if(!i.get(t)&&this.model.contains(t)){if(this.model.isEdge(t)||this.model.isVertex(t)){i.put(t,true);n.push(t)}else{var e=this.model.getChildCount(t);for(var s=0;s<e;s++){r(this.model.getChildAt(t,s))}}}}));for(var s=0;s<t.length;s++){var l=t[s];if(l.constructor!=mxRootChange&&(e==null||!e(l))){var a=null;if(l instanceof mxChildChange){a=l.child}else if(l.cell!=null&&l.cell instanceof mxCell){a=l.cell}if(a!=null){r(a)}}}return n};mxGraph.prototype.graphModelChanged=function(t){for(var e=0;e<t.length;e++){this.processChange(t[e])}this.updateSelection();this.view.validate();this.sizeDidChange()};mxGraph.prototype.updateSelection=function(){var t=this.getSelectionCells();var e=[];for(var i=0;i<t.length;i++){if(!this.model.contains(t[i])||!this.isCellVisible(t[i])){e.push(t[i])}else{var n=this.model.getParent(t[i]);while(n!=null&&n!=this.view.currentRoot){if(this.isCellCollapsed(n)||!this.isCellVisible(n)){e.push(t[i]);break}n=this.model.getParent(n)}}}this.removeSelectionCells(e)};mxGraph.prototype.processChange=function(t){if(t instanceof mxRootChange){this.clearSelection();this.setDefaultParent(null);this.removeStateForCell(t.previous);if(this.resetViewOnRootChange){this.view.scale=1;this.view.translate.x=0;this.view.translate.y=0}this.fireEvent(new mxEventObject(mxEvent.ROOT))}else if(t instanceof mxChildChange){var e=this.model.getParent(t.child);this.view.invalidate(t.child,true,true);if(!this.model.contains(e)||this.isCellCollapsed(e)){this.view.invalidate(t.child,true,true);this.removeStateForCell(t.child);if(this.view.currentRoot==t.child){this.home()}}if(e!=t.previous){if(e!=null){this.view.invalidate(e,false,false)}if(t.previous!=null){this.view.invalidate(t.previous,false,false)}}}else if(t instanceof mxTerminalChange||t instanceof mxGeometryChange){if(t instanceof mxTerminalChange||(t.previous==null&&t.geometry!=null||t.previous!=null&&!t.previous.equals(t.geometry))){this.view.invalidate(t.cell)}}else if(t instanceof mxValueChange){this.view.invalidate(t.cell,false,false)}else if(t instanceof mxStyleChange){this.view.invalidate(t.cell,true,true);var i=this.view.getState(t.cell);if(i!=null){i.invalidStyle=true}}else if(t.cell!=null&&t.cell instanceof mxCell){this.removeStateForCell(t.cell)}};mxGraph.prototype.removeStateForCell=function(t){var e=this.model.getChildCount(t);for(var i=0;i<e;i++){this.removeStateForCell(this.model.getChildAt(t,i))}this.view.invalidate(t,false,true);this.view.removeState(t)};mxGraph.prototype.addCellOverlay=function(t,e){if(t.overlays==null){t.overlays=[]}t.overlays.push(e);var i=this.view.getState(t);if(i!=null){this.cellRenderer.redraw(i)}this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",t,"overlay",e));return e};mxGraph.prototype.getCellOverlays=function(t){return t.overlays};mxGraph.prototype.removeCellOverlay=function(t,e){if(e==null){this.removeCellOverlays(t)}else{var i=mxUtils.indexOf(t.overlays,e);if(i>=0){t.overlays.splice(i,1);if(t.overlays.length==0){t.overlays=null}var n=this.view.getState(t);if(n!=null){this.cellRenderer.redraw(n)}this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else{e=null}}return e};mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(e!=null){t.overlays=null;var i=this.view.getState(t);if(i!=null){this.cellRenderer.redraw(i)}for(var n=0;n<e.length;n++){this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e[n]))}}return e};mxGraph.prototype.clearCellOverlays=function(t){t=t!=null?t:this.model.getRoot();this.removeCellOverlays(t);var e=this.model.getChildCount(t);for(var i=0;i<e;i++){var n=this.model.getChildAt(t,i);this.clearCellOverlays(n)}};mxGraph.prototype.setCellWarning=function(t,e,i,n){if(e!=null&&e.length>0){i=i!=null?i:this.warningImage;var r=new mxCellOverlay(i,"<font color=red>"+e+"</font>");if(n){r.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,i){if(this.isEnabled()){this.setSelectionCell(t)}})))}return this.addCellOverlay(t,r)}else{this.removeCellOverlays(t)}return null};mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)};mxGraph.prototype.startEditingAtCell=function(t,e){if(e==null||!mxEvent.isMultiTouchEvent(e)){if(t==null){t=this.getSelectionCell();if(t!=null&&!this.isCellEditable(t)){t=null}}if(t!=null){this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e));this.cellEditor.startEditing(t,e);this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))}}};mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)};mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t);this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))};mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t));this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e);if(i){this.cellSizeUpdated(t,false)}}finally{this.model.endUpdate()}};mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))};mxGraph.prototype.click=function(t){var e=t.getEvent();var i=t.getCell();var n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()){n.consume()}this.fireEvent(n);if(this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()){if(i!=null){if(this.isTransparentClickEvent(e)){var r=false;var s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);r=r||e;return!r||e||t.cell!=i&&this.model.isAncestor(t.cell,i)})));if(s!=null){i=s}}}else if(this.isSwimlaneSelectionEnabled()){i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY());if(i!=null&&(!this.isToggleEvent(e)||!mxEvent.isAltDown(e))){var l=i;var a=[];while(l!=null){l=this.model.getParent(l);var o=this.view.getState(l);if(this.isSwimlane(l)&&o!=null){a.push(l)}}if(a.length>0){a=a.reverse();a.splice(0,0,i);a.push(i);for(var h=0;h<a.length-1;h++){if(this.isCellSelected(a[h])){i=a[this.isToggleEvent(e)?h:h+1]}}}}}if(i!=null){this.selectCellForEvent(i,e)}else if(!this.isToggleEvent(e)){this.clearSelection()}}};mxGraph.prototype.isSiblingSelected=function(t){var e=this.model;var i=e.getParent(t);var n=e.getChildCount(i);for(var r=0;r<n;r++){var s=e.getChildAt(i,r);if(t!=s&&this.isCellSelected(s)){return true}}return false};mxGraph.prototype.dblClick=function(t,e){var i=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(i);if(this.isEnabled()&&!mxEvent.isConsumed(t)&&!i.isConsumed()&&e!=null&&this.isCellEditable(e)&&!this.isEditing(e)){this.startEditingAtCell(e,t);mxEvent.consume(t)}};mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent();var i=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());this.fireEvent(i);if(i.isConsumed()){this.panningHandler.panningTrigger=false}if(this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed()&&this.connectionHandler.isEnabled()){var n=this.view.getState(this.connectionHandler.marker.getCell(t));if(n!=null){this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor;this.connectionHandler.marker.markedState=n;this.connectionHandler.marker.mark();this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY());this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t);this.connectionHandler.previous=n;this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))}}};mxGraph.prototype.scrollPointToVisible=function(t,e,i,n){if(!this.timerAutoScroll&&(this.ignoreScrollbars||mxUtils.hasScrollbars(this.container))){var r=this.container;n=n!=null?n:20;if(t>=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s<n){var l=r.scrollLeft;r.scrollLeft+=n-s;if(i&&l==r.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){var a=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+n-s;a.style.width=o+"px"}else{var o=Math.max(r.clientWidth,r.scrollWidth)+n-s;var h=this.view.getCanvas();h.style.width=o+"px"}r.scrollLeft+=n-s}}else{s=t-r.scrollLeft;if(s<n){r.scrollLeft-=n-s}}var u=r.scrollTop+r.clientHeight-e;if(u<n){var l=r.scrollTop;r.scrollTop+=n-u;if(l==r.scrollTop&&i){if(this.dialect==mxConstants.DIALECT_SVG){var a=this.view.getDrawPane().ownerSVGElement;var d=this.container.scrollHeight+n-u;a.style.height=d+"px"}else{var d=Math.max(r.clientHeight,r.scrollHeight)+n-u;var h=this.view.getCanvas();h.style.height=d+"px"}r.scrollTop+=n-u}}else{u=e-r.scrollTop;if(u<n){r.scrollTop-=n-u}}}}else if(this.allowAutoPanning&&!this.panningHandler.isActive()){if(this.panningManager==null){this.panningManager=this.createPanningManager()}this.panningManager.panTo(t+this.panDx,e+this.panDy)}};mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)};mxGraph.prototype.getBorderSizes=function(){var t=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(t.paddingLeft)+(t.borderLeftStyle!="none"?mxUtils.parseCssNumber(t.borderLeftWidth):0),mxUtils.parseCssNumber(t.paddingTop)+(t.borderTopStyle!="none"?mxUtils.parseCssNumber(t.borderTopWidth):0),mxUtils.parseCssNumber(t.paddingRight)+(t.borderRightStyle!="none"?mxUtils.parseCssNumber(t.borderRightWidth):0),mxUtils.parseCssNumber(t.paddingBottom)+(t.borderBottomStyle!="none"?mxUtils.parseCssNumber(t.borderBottomWidth):0))};mxGraph.prototype.getPreferredPageSize=function(t,e,i){var n=this.view.translate;var r=this.pageFormat;var s=this.pageScale;var l=new mxRectangle(0,0,Math.ceil(r.width*s),Math.ceil(r.height*s));var a=this.pageBreaksVisible?Math.ceil(e/l.width):1;var o=this.pageBreaksVisible?Math.ceil(i/l.height):1;return new mxRectangle(0,0,a*l.width+2+n.x,o*l.height+2+n.y)};mxGraph.prototype.fit=function(t,e,i,n,r,s,l){if(this.container!=null){t=t!=null?t:this.getBorder();e=e!=null?e:false;i=i!=null?i:0;n=n!=null?n:true;r=r!=null?r:false;s=s!=null?s:false;var a=this.getBorderSizes();var o=this.container.offsetWidth-a.x-a.width-1;var h=l!=null?l:this.container.offsetHeight-a.y-a.height-1;var u=this.view.getGraphBounds();if(u.width>0&&u.height>0){if(e&&u.x!=null&&u.y!=null){u=u.clone();u.width+=u.x;u.height+=u.y;u.x=0;u.y=0}var d=this.view.scale;var p=u.width/d;var m=u.height/d;if(this.backgroundImage!=null){p=Math.max(p,this.backgroundImage.width-u.x/d);m=Math.max(m,this.backgroundImage.height-u.y/d)}var c=(e?t:2*t)+i+1;o-=c;h-=c;var x=r?h/m:s?o/p:Math.min(o/p,h/m);if(this.minFitScale!=null){x=Math.max(x,this.minFitScale)}if(this.maxFitScale!=null){x=Math.min(x,this.maxFitScale)}if(n){if(!e){if(!mxUtils.hasScrollbars(this.container)){var f=u.x!=null?Math.floor(this.view.translate.x-u.x/d+t/x+i/2):t;var g=u.y!=null?Math.floor(this.view.translate.y-u.y/d+t/x+i/2):t;this.view.scaleAndTranslate(x,f,g)}else{this.view.setScale(x);var v=this.getGraphBounds();if(v.x!=null){this.container.scrollLeft=v.x}if(v.y!=null){this.container.scrollTop=v.y}}}else if(this.view.scale!=x){this.view.setScale(x)}}else{return x}}}return this.view.scale};mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(this.container!=null){var e=this.getBorder();var i=Math.max(0,t.x)+t.width+2*e;var n=Math.max(0,t.y)+t.height+2*e;if(this.minimumContainerSize!=null){i=Math.max(i,this.minimumContainerSize.width);n=Math.max(n,this.minimumContainerSize.height)}if(this.resizeContainer){this.doResizeContainer(i,n)}if(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));if(r!=null){i=r.width*this.view.scale;n=r.height*this.view.scale}}if(this.minimumGraphSize!=null){i=Math.max(i,this.minimumGraphSize.width*this.view.scale);n=Math.max(n,this.minimumGraphSize.height*this.view.scale)}i=Math.ceil(i);n=Math.ceil(n);if(this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;if(s!=null){s.style.minWidth=Math.max(1,i)+"px";s.style.minHeight=Math.max(1,n)+"px";s.style.width="100%";s.style.height="100%"}}else{if(mxClient.IS_QUIRKS){this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n))}else{this.view.canvas.style.minWidth=Math.max(1,i)+"px";this.view.canvas.style.minHeight=Math.max(1,n)+"px"}}this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))};mxGraph.prototype.doResizeContainer=function(t,e){if(this.maximumContainerSize!=null){t=Math.min(this.maximumContainerSize.width,t);e=Math.min(this.maximumContainerSize.height,e)}this.container.style.width=Math.ceil(t)+"px";this.container.style.height=Math.ceil(e)+"px"};mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale;var r=this.view.translate;var s=this.pageFormat;var l=n*this.pageScale;var a=new mxRectangle(0,0,s.width*l,s.height*l);var o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width);o.height=Math.max(1,o.height);a.x=Math.floor((o.x-r.x*n)/a.width)*a.width+r.x*n;a.y=Math.floor((o.y-r.y*n)/a.height)*a.height+r.y*n;o.width=Math.ceil((o.width+(o.x-a.x))/a.width)*a.width;o.height=Math.ceil((o.height+(o.y-a.y))/a.height)*a.height;t=t&&Math.min(a.width,a.height)>this.minPageBreakDist;var h=t?Math.ceil(o.height/a.height)+1:0;var u=t?Math.ceil(o.width/a.width)+1:0;var d=(u-1)*a.width;var p=(h-1)*a.height;if(this.horizontalPageBreaks==null&&h>0){this.horizontalPageBreaks=[]}if(this.verticalPageBreaks==null&&u>0){this.verticalPageBreaks=[]}var m=mxUtils.bind(this,(function(t){if(t!=null){var e=t==this.horizontalPageBreaks?h:u;for(var i=0;i<=e;i++){var n=t==this.horizontalPageBreaks?[new mxPoint(Math.round(a.x),Math.round(a.y+i*a.height)),new mxPoint(Math.round(a.x+d),Math.round(a.y+i*a.height))]:[new mxPoint(Math.round(a.x+i*a.width),Math.round(a.y)),new mxPoint(Math.round(a.x+i*a.width),Math.round(a.y+p))];if(t[i]!=null){t[i].points=n;t[i].redraw()}else{var r=new mxPolyline(n,this.pageBreakColor);r.dialect=this.dialect;r.pointerEvents=false;r.isDashed=this.pageBreakDashed;r.init(this.view.backgroundPane);r.redraw();t[i]=r}}for(var i=e;i<t.length;i++){t[i].destroy()}t.splice(e,t.length-e)}}));m(this.horizontalPageBreaks);m(this.verticalPageBreaks)};mxGraph.prototype.getCurrentCellStyle=function(t,e){var i=e?null:this.view.getState(t);return i!=null?i.style:this.getCellStyle(t)};mxGraph.prototype.getCellStyle=function(t){var e=this.model.getStyle(t);var i=null;if(this.model.isEdge(t)){i=this.stylesheet.getDefaultEdgeStyle()}else{i=this.stylesheet.getDefaultVertexStyle()}if(e!=null){i=this.postProcessCellStyle(this.stylesheet.getCellStyle(e,i))}if(i==null){i=new Object}return i};mxGraph.prototype.postProcessCellStyle=function(t){if(t!=null){var e=t[mxConstants.STYLE_IMAGE];var i=this.getImageFromBundles(e);if(i!=null){t[mxConstants.STYLE_IMAGE]=i}else{i=e}if(i!=null&&i.substring(0,11)=="data:image/"){if(i.substring(0,20)=="data:image/svg+xml,<"){i=i.substring(0,19)+encodeURIComponent(i.substring(19))}else if(i.substring(0,22)!="data:image/svg+xml,%3C"){var n=i.indexOf(",");if(n>0&&i.substring(n-7,n+1)!=";base64,"){i=i.substring(0,n)+";base64,"+i.substring(n+1)}}t[mxConstants.STYLE_IMAGE]=i}}return t};mxGraph.prototype.setCellStyle=function(t,e){e=e||this.getSelectionCells();if(e!=null){this.model.beginUpdate();try{for(var i=0;i<e.length;i++){this.model.setStyle(e[i],t)}}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(t,e,i){i=i||this.getSelectionCell();return this.toggleCellStyles(t,e,[i])};mxGraph.prototype.toggleCellStyles=function(t,e,i){e=e!=null?e:false;i=i||this.getSelectionCells();var n=null;if(i!=null&&i.length>0){var r=this.getCurrentCellStyle(i[0]);n=mxUtils.getValue(r,t,e)?0:1;this.setCellStyles(t,n,i)}return n};mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells();mxUtils.setCellStyles(this.model,i,t,e)};mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)};mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){n=n||this.getSelectionCells();if(n!=null&&n.length>0){if(i==null){var r=this.getCurrentCellStyle(n[0]);var s=parseInt(r[t]||0);i=!((s&e)==e)}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}};mxGraph.prototype.alignCells=function(t,e,i){if(e==null){e=this.getSelectionCells()}if(e!=null&&e.length>1){if(i==null){for(var n=0;n<e.length;n++){var r=this.view.getState(e[n]);if(r!=null&&!this.model.isEdge(e[n])){if(i==null){if(t==mxConstants.ALIGN_CENTER){i=r.x+r.width/2;break}else if(t==mxConstants.ALIGN_RIGHT){i=r.x+r.width}else if(t==mxConstants.ALIGN_TOP){i=r.y}else if(t==mxConstants.ALIGN_MIDDLE){i=r.y+r.height/2;break}else if(t==mxConstants.ALIGN_BOTTOM){i=r.y+r.height}else{i=r.x}}else{if(t==mxConstants.ALIGN_RIGHT){i=Math.max(i,r.x+r.width)}else if(t==mxConstants.ALIGN_TOP){i=Math.min(i,r.y)}else if(t==mxConstants.ALIGN_BOTTOM){i=Math.max(i,r.y+r.height)}else{i=Math.min(i,r.x)}}}}}if(i!=null){var s=this.view.scale;this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var r=this.view.getState(e[n]);if(r!=null){var l=this.getCellGeometry(e[n]);if(l!=null&&!this.model.isEdge(e[n])){l=l.clone();if(t==mxConstants.ALIGN_CENTER){l.x+=(i-r.x-r.width/2)/s}else if(t==mxConstants.ALIGN_RIGHT){l.x+=(i-r.x-r.width)/s}else if(t==mxConstants.ALIGN_TOP){l.y+=(i-r.y)/s}else if(t==mxConstants.ALIGN_MIDDLE){l.y+=(i-r.y-r.height/2)/s}else if(t==mxConstants.ALIGN_BOTTOM){l.y+=(i-r.y-r.height)/s}else{l.x+=(i-r.x)/s}this.resizeCell(e[n],l)}}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",e))}finally{this.model.endUpdate()}}}return e};mxGraph.prototype.flipEdge=function(t){if(t!=null&&this.alternateEdgeStyle!=null){this.model.beginUpdate();try{var e=this.model.getStyle(t);if(e==null||e.length==0){this.model.setStyle(t,this.alternateEdgeStyle)}else{this.model.setStyle(t,null)}this.resetEdge(t);this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",t))}finally{this.model.endUpdate()}}return t};mxGraph.prototype.addImageBundle=function(t){this.imageBundles.push(t)};mxGraph.prototype.removeImageBundle=function(t){var e=[];for(var i=0;i<this.imageBundles.length;i++){if(this.imageBundles[i]!=t){e.push(this.imageBundles[i])}}this.imageBundles=e};mxGraph.prototype.getImageFromBundles=function(t){if(t!=null){for(var e=0;e<this.imageBundles.length;e++){var i=this.imageBundles[e].getImage(t);if(i!=null){return i}}}return null};mxGraph.prototype.orderCells=function(t,e){if(e==null){e=mxUtils.sortCells(this.getSelectionCells(),true)}this.model.beginUpdate();try{this.cellsOrdered(e,t);this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",t,"cells",e))}finally{this.model.endUpdate()}return e};mxGraph.prototype.cellsOrdered=function(t,e){if(t!=null){this.model.beginUpdate();try{for(var i=0;i<t.length;i++){var n=this.model.getParent(t[i]);if(e){this.model.add(n,t[i],i)}else{this.model.add(n,t[i],this.model.getChildCount(n)-1)}}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",e,"cells",t))}finally{this.model.endUpdate()}}};mxGraph.prototype.groupCells=function(t,e,i){if(i==null){i=mxUtils.sortCells(this.getSelectionCells(),true)}i=this.getCellsForGroup(i);if(t==null){t=this.createGroupCell(i)}var n=this.getBoundsForGroup(t,i,e);if(i.length>1&&n!=null){var r=this.model.getParent(t);if(r==null){r=this.model.getParent(i[0])}this.model.beginUpdate();try{if(this.getCellGeometry(t)==null){this.model.setGeometry(t,new mxGeometry)}var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,false,false,false);s=this.model.getChildCount(t);this.cellsAdded(i,t,s,null,null,false,false,false);this.cellsMoved(i,-n.x,-n.y,false,false,false);this.cellsResized([t],[n],false);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t};mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(t!=null&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n<t.length;n++){if(this.model.getParent(t[n])==i){e.push(t[n])}}}return e};mxGraph.prototype.getBoundsForGroup=function(t,e,i){var n=this.getBoundingBoxFromGeometry(e,true);if(n!=null){if(this.isSwimlane(t)){var r=this.getStartSize(t);n.x-=r.width;n.y-=r.height;n.width+=r.width;n.height+=r.height}if(i!=null){n.x-=i;n.y-=i;n.width+=2*i;n.height+=2*i}}return n};mxGraph.prototype.createGroupCell=function(t){var e=new mxCell("");e.setVertex(true);e.setConnectable(false);return e};mxGraph.prototype.ungroupCells=function(t){var e=[];if(t==null){t=this.getCellsForUngroup()}if(t!=null&&t.length>0){this.model.beginUpdate();try{for(var i=0;i<t.length;i++){var n=this.model.getChildren(t[i]);if(n!=null&&n.length>0){n=n.slice();var r=this.model.getParent(t[i]);var s=this.model.getChildCount(r);this.cellsAdded(n,r,s,null,null,true);e=e.concat(n);for(var l=0;l<n.length;l++){var a=this.view.getState(n[l]);var o=this.getCellGeometry(n[l]);if(a!=null&&o!=null&&o.relative){o=o.clone();o.x=a.origin.x;o.y=a.origin.y;o.relative=false;this.model.setGeometry(n[l],o)}}}}this.removeCellsAfterUngroup(t);this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e};mxGraph.prototype.getCellsForUngroup=function(){var t=this.getSelectionCells();var e=[];for(var i=0;i<t.length;i++){if(this.model.isVertex(t[i])&&this.model.getChildCount(t[i])>0){e.push(t[i])}}return e};mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))};mxGraph.prototype.removeCellsFromParent=function(t){if(t==null){t=this.getSelectionCells()}this.model.beginUpdate();try{var e=this.getDefaultParent();var i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,true);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t};mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,l){if(t==null){t=this.getSelectionCells()}e=e!=null?e:0;i=i!=null?i:false;n=n!=null?n:0;r=r!=null?r:0;s=s!=null?s:0;l=l!=null?l:0;this.model.beginUpdate();try{for(var a=t.length-1;a>=0;a--){var o=this.getCellGeometry(t[a]);if(o!=null){var h=this.getChildCells(t[a]);if(h!=null&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,true);if(u!=null&&u.width>0&&u.height>0){var d=this.isSwimlane(t[a])?this.getActualStartSize(t[a],true):new mxRectangle;o=o.clone();if(i){o.x=Math.round(o.x+u.x-e-d.x-l);o.y=Math.round(o.y+u.y-e-d.y-n)}o.width=Math.round(u.width+2*e+d.x+l+r+d.width);o.height=Math.round(u.height+2*e+d.y+n+s+d.height);this.model.setGeometry(t[a],o);this.moveCells(h,e+d.x-u.x+l,e+d.y-u.y+n)}}}}}finally{this.model.endUpdate()}return t};mxGraph.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){for(var i=0;i<t.length;i++){if(this.model.isVertex(t[i])||this.model.isEdge(t[i])){var n=this.view.getBoundingBox(this.view.getState(t[i]),true);if(n!=null){if(e==null){e=mxRectangle.fromRectangle(n)}else{e.add(n)}}}}}return e};mxGraph.prototype.cloneCell=function(t,e,i,n){return this.cloneCells([t],e,i,n)[0]};mxGraph.prototype.cloneCells=function(t,e,i,n){e=e!=null?e:true;var r=null;if(t!=null){var s=new mxDictionary;var l=[];for(var a=0;a<t.length;a++){s.put(t[a],true);l.push(t[a])}if(l.length>0){var o=this.view.scale;var h=this.view.translate;r=this.model.cloneCells(t,true,i);for(var a=0;a<t.length;a++){if(!e&&this.model.isEdge(r[a])&&this.getEdgeValidationError(r[a],this.model.getTerminal(r[a],true),this.model.getTerminal(r[a],false))!=null){r[a]=null}else{var u=this.model.getGeometry(r[a]);if(u!=null){var d=this.view.getState(t[a]);var p=this.view.getState(this.model.getParent(t[a]));if(d!=null&&p!=null){var m=n?0:p.origin.x;var c=n?0:p.origin.y;if(this.model.isEdge(r[a])){var x=d.absolutePoints;if(x!=null){var f=this.model.getTerminal(t[a],true);while(f!=null&&!s.get(f)){f=this.model.getParent(f)}if(f==null&&x[0]!=null){u.setTerminalPoint(new mxPoint(x[0].x/o-h.x,x[0].y/o-h.y),true)}var g=this.model.getTerminal(t[a],false);while(g!=null&&!s.get(g)){g=this.model.getParent(g)}var v=x.length-1;if(g==null&&x[v]!=null){u.setTerminalPoint(new mxPoint(x[v].x/o-h.x,x[v].y/o-h.y),false)}var y=u.points;if(y!=null){for(var C=0;C<y.length;C++){y[C].x+=m;y[C].y+=c}}}}else{u.translate(m,c)}}}}}}else{r=[]}}return r};mxGraph.prototype.insertVertex=function(t,e,i,n,r,s,l,a,o){var h=this.createVertex(t,e,i,n,r,s,l,a,o);return this.addCell(h,t)};mxGraph.prototype.createVertex=function(t,e,i,n,r,s,l,a,o){var h=new mxGeometry(n,r,s,l);h.relative=o!=null?o:false;var u=new mxCell(i,h,a);u.setId(e);u.setVertex(true);u.setConnectable(true);return u};mxGraph.prototype.insertEdge=function(t,e,i,n,r,s){var l=this.createEdge(t,e,i,n,r,s);return this.addEdge(l,t,n,r)};mxGraph.prototype.createEdge=function(t,e,i,n,r,s){var l=new mxCell(i,new mxGeometry,s);l.setId(e);l.setEdge(true);l.geometry.relative=true;return l};mxGraph.prototype.addEdge=function(t,e,i,n,r){return this.addCell(t,e,r,i,n)};mxGraph.prototype.addCell=function(t,e,i,n,r){return this.addCells([t],e,i,n,r)[0]};mxGraph.prototype.addCells=function(t,e,i,n,r,s){if(e==null){e=this.getDefaultParent()}if(i==null){i=this.model.getChildCount(e)}this.model.beginUpdate();try{this.cellsAdded(t,e,i,n,r,s!=null?s:false,true);this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",t,"parent",e,"index",i,"source",n,"target",r))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellsAdded=function(t,e,i,n,r,s,l,a){if(t!=null&&e!=null&&i!=null){this.model.beginUpdate();try{var o=s?this.view.getState(e):null;var h=o!=null?o.origin:null;var u=new mxPoint(0,0);for(var d=0;d<t.length;d++){if(t[d]==null){i--}else{var p=this.model.getParent(t[d]);if(h!=null&&t[d]!=e&&e!=p){var m=this.view.getState(p);var c=m!=null?m.origin:u;var x=this.model.getGeometry(t[d]);if(x!=null){var f=c.x-h.x;var g=c.y-h.y;x=x.clone();x.translate(f,g);if(!x.relative&&this.model.isVertex(t[d])&&!this.isAllowNegativeCoordinates()){x.x=Math.max(0,x.x);x.y=Math.max(0,x.y)}this.model.setGeometry(t[d],x)}}if(e==p&&i+d>this.model.getChildCount(e)){i--}this.model.add(e,t[d],i+d);if(this.autoSizeCellsOnAdd){this.autoSizeCell(t[d],true)}if((a==null||a)&&this.isExtendParentsOnAdd(t[d])&&this.isExtendParent(t[d])){this.extendParent(t[d])}if(l==null||l){this.constrainChild(t[d])}if(n!=null){this.cellConnected(t[d],n,true)}if(r!=null){this.cellConnected(t[d],r,false)}}}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(t,e){e=e!=null?e:true;if(e){var i=this.model.getChildCount(t);for(var n=0;n<i;n++){this.autoSizeCell(this.model.getChildAt(t,n))}}if(this.getModel().isVertex(t)&&this.isAutoSizeCell(t)){this.updateCellSize(t)}};mxGraph.prototype.removeCells=function(t,e){e=e!=null?e:true;if(t==null){t=this.getDeletableCells(this.getSelectionCells())}if(e){t=this.getDeletableCells(this.addAllEdges(t))}else{t=t.slice();var i=this.getDeletableCells(this.getAllEdges(t));var n=new mxDictionary;for(var r=0;r<t.length;r++){n.put(t[r],true)}for(var r=0;r<i.length;r++){if(this.view.getState(i[r])==null&&!n.get(i[r])){n.put(i[r],true);t.push(i[r])}}}this.model.beginUpdate();try{this.cellsRemoved(t);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",t,"includeEdges",e))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellsRemoved=function(t){if(t!=null&&t.length>0){var e=this.view.scale;var i=this.view.translate;this.model.beginUpdate();try{var n=new mxDictionary;for(var r=0;r<t.length;r++){n.put(t[r],true)}for(var r=0;r<t.length;r++){var s=this.getAllEdges([t[r]]);var l=mxUtils.bind(this,(function(n,s){var l=this.model.getGeometry(n);if(l!=null){var a=this.model.getTerminal(n,s);var o=false;var h=a;while(h!=null){if(t[r]==h){o=true;break}h=this.model.getParent(h)}if(o){l=l.clone();var u=this.view.getState(n);if(u!=null&&u.absolutePoints!=null){var d=u.absolutePoints;var p=s?0:d.length-1;l.setTerminalPoint(new mxPoint(d[p].x/e-i.x-u.origin.x,d[p].y/e-i.y-u.origin.y),s)}else{var m=this.view.getState(a);if(m!=null){l.setTerminalPoint(new mxPoint(m.getCenterX()/e-i.x,m.getCenterY()/e-i.y),s)}}this.model.setGeometry(n,l);this.model.setTerminal(n,null,s)}}}));for(var a=0;a<s.length;a++){if(!n.get(s[a])){n.put(s[a],true);l(s[a],true);l(s[a],false)}}this.model.remove(t[r])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",t))}finally{this.model.endUpdate()}}};mxGraph.prototype.splitEdge=function(t,e,i,n,r,s,l,a){n=n||0;r=r||0;a=a!=null?a:this.model.getParent(t);var o=this.model.getTerminal(t,true);this.model.beginUpdate();try{if(i==null){i=this.cloneCell(t);var h=this.view.getState(t);var u=this.getCellGeometry(i);if(u!=null&&u.points!=null&&h!=null){var d=this.view.translate;var p=this.view.scale;var m=mxUtils.findNearestSegment(h,(n+d.x)*p,(r+d.y)*p);u.points=u.points.slice(0,m);u=this.getCellGeometry(t);if(u!=null&&u.points!=null){u=u.clone();u.points=u.points.slice(m);this.model.setGeometry(t,u)}}}this.cellsMoved(e,n,r,false,false);this.cellsAdded(e,a,this.model.getChildCount(a),null,null,true);this.cellsAdded([i],a,this.model.getChildCount(a),o,e[0],false);this.cellConnected(t,e[0],true);this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",t,"cells",e,"newEdge",i,"dx",n,"dy",r))}finally{this.model.endUpdate()}return i};mxGraph.prototype.toggleCells=function(t,e,i){if(e==null){e=this.getSelectionCells()}if(i){e=this.addAllEdges(e)}this.model.beginUpdate();try{this.cellsToggled(e,t);this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",t,"cells",e,"includeEdges",i))}finally{this.model.endUpdate()}return e};mxGraph.prototype.cellsToggled=function(t,e){if(t!=null&&t.length>0){this.model.beginUpdate();try{for(var i=0;i<t.length;i++){this.model.setVisible(t[i],e)}}finally{this.model.endUpdate()}}};mxGraph.prototype.foldCells=function(t,e,i,n,r){e=e!=null?e:false;if(i==null){i=this.getFoldableCells(this.getSelectionCells(),t)}this.stopEditing(false);this.model.beginUpdate();try{this.cellsFolded(i,t,e,n);this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",t,"recurse",e,"cells",i))}finally{this.model.endUpdate()}return i};mxGraph.prototype.cellsFolded=function(t,e,i,n){if(t!=null&&t.length>0){this.model.beginUpdate();try{for(var r=0;r<t.length;r++){if((!n||this.isCellFoldable(t[r],e))&&e!=this.isCellCollapsed(t[r])){this.model.setCollapsed(t[r],e);this.swapBounds(t[r],e);if(this.isExtendParent(t[r])){this.extendParent(t[r])}if(i){var s=this.model.getChildren(t[r]);this.cellsFolded(s,e,i)}this.constrainChild(t[r])}}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",t,"collapse",e,"recurse",i))}finally{this.model.endUpdate()}}};mxGraph.prototype.swapBounds=function(t,e){if(t!=null){var i=this.model.getGeometry(t);if(i!=null){i=i.clone();this.updateAlternateBounds(t,i,e);i.swap();this.model.setGeometry(t,i)}}};mxGraph.prototype.updateAlternateBounds=function(t,e,i){if(t!=null&&e!=null){var n=this.getCurrentCellStyle(t);if(e.alternateBounds==null){var r=e;if(this.collapseToPreferredSize){var s=this.getPreferredSizeForCell(t);if(s!=null){r=s;var l=mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE);if(l>0){r.height=Math.max(r.height,l)}}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(e.alternateBounds!=null){e.alternateBounds.x=e.x;e.alternateBounds.y=e.y;var a=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||0);if(a!=0){var o=e.alternateBounds.getCenterX()-e.getCenterX();var h=e.alternateBounds.getCenterY()-e.getCenterY();var u=Math.cos(a);var d=Math.sin(a);var p=u*o-d*h;var m=d*o+u*h;e.alternateBounds.x+=p-o;e.alternateBounds.y+=m-h}}}};mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))};mxGraph.prototype.getAllEdges=function(t){var e=[];if(t!=null){for(var i=0;i<t.length;i++){var n=this.model.getEdgeCount(t[i]);for(var r=0;r<n;r++){e.push(this.model.getEdgeAt(t[i],r))}var s=this.model.getChildren(t[i]);e=e.concat(this.getAllEdges(s))}}return e};mxGraph.prototype.updateCellSize=function(t,e){e=e!=null?e:false;this.model.beginUpdate();try{this.cellSizeUpdated(t,e);this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",t,"ignoreChildren",e))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellSizeUpdated=function(t,e){if(t!=null){this.model.beginUpdate();try{var i=this.getPreferredSizeForCell(t);var n=this.model.getGeometry(t);if(i!=null&&n!=null){var r=this.isCellCollapsed(t);n=n.clone();if(this.isSwimlane(t)){var s=this.getCellStyle(t);var l=this.model.getStyle(t);if(l==null){l=""}if(mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,true)){l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,i.height+8);if(r){n.height=i.height+8}n.width=i.width}else{l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,i.width+8);if(r){n.width=i.width+8}n.height=i.height}this.model.setStyle(t,l)}else{var a=this.view.createState(t);var o=a.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER;if(o==mxConstants.ALIGN_RIGHT){n.x+=n.width-i.width}else if(o==mxConstants.ALIGN_CENTER){n.x+=Math.round((n.width-i.width)/2)}var h=this.getVerticalAlign(a);if(h==mxConstants.ALIGN_BOTTOM){n.y+=n.height-i.height}else if(h==mxConstants.ALIGN_MIDDLE){n.y+=Math.round((n.height-i.height)/2)}n.width=i.width;n.height=i.height}if(!e&&!r){var u=this.view.getBounds(this.model.getChildren(t));if(u!=null){var d=this.view.translate;var p=this.view.scale;var m=(u.x+u.width)/p-n.x-d.x;var c=(u.y+u.height)/p-n.y-d.y;n.width=Math.max(n.width,m);n.height=Math.max(n.height,c)}}this.cellsResized([t],[n],false)}}finally{this.model.endUpdate()}}};mxGraph.prototype.getPreferredSizeForCell=function(t,e){var i=null;if(t!=null){var n=this.view.createState(t);var r=n.style;if(!this.model.isEdge(t)){var s=r[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE;var l=0;var a=0;if(this.getImage(n)!=null||r[mxConstants.STYLE_IMAGE]!=null){if(r[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL){if(r[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE){l+=parseFloat(r[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize}if(r[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER){a+=parseFloat(r[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize}}}l+=2*(r[mxConstants.STYLE_SPACING]||0);l+=r[mxConstants.STYLE_SPACING_LEFT]||0;l+=r[mxConstants.STYLE_SPACING_RIGHT]||0;a+=2*(r[mxConstants.STYLE_SPACING]||0);a+=r[mxConstants.STYLE_SPACING_TOP]||0;a+=r[mxConstants.STYLE_SPACING_BOTTOM]||0;var o=this.getFoldingImage(n);if(o!=null){l+=o.width+8}var h=this.cellRenderer.getLabelValue(n);if(h!=null&&h.length>0){if(!this.isHtmlLabel(n.cell)){h=mxUtils.htmlEntities(h,false)}h=h.replace(/\n/g,"<br>");var u=mxUtils.getSizeForString(h,s,r[mxConstants.STYLE_FONTFAMILY],e,r[mxConstants.STYLE_FONTSTYLE]);var d=u.width+l;var p=u.height+a;if(!mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,true)){var m=p;p=d;d=m}if(this.gridEnabled){d=this.snap(d+this.gridSize/2);p=this.snap(p+this.gridSize/2)}i=new mxRectangle(0,0,d,p)}else{var c=4*this.gridSize;i=new mxRectangle(0,0,c,c)}}}return i};mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]};mxGraph.prototype.resizeCells=function(t,e,i){i=i!=null?i:this.isRecursiveResize();this.model.beginUpdate();try{var n=this.cellsResized(t,e,i);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellsResized=function(t,e,i){i=i!=null?i:false;var n=[];if(t!=null&&e!=null&&t.length==e.length){this.model.beginUpdate();try{for(var r=0;r<t.length;r++){n.push(this.cellResized(t[r],e[r],false,i));if(this.isExtendParent(t[r])){this.extendParent(t[r])}this.constrainChild(t[r])}if(this.resetEdgesOnResize){this.resetEdges(t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}}return n};mxGraph.prototype.cellResized=function(t,e,i,n){var r=this.model.getGeometry(t);if(r!=null&&(r.x!=e.x||r.y!=e.y||r.width!=e.width||r.height!=e.height)){var s=r.clone();if(!i&&s.relative){var l=s.offset;if(l!=null){l.x+=e.x-s.x;l.y+=e.y-s.y}}else{s.x=e.x;s.y=e.y}s.width=e.width;s.height=e.height;if(!s.relative&&this.model.isVertex(t)&&!this.isAllowNegativeCoordinates()){s.x=Math.max(0,s.x);s.y=Math.max(0,s.y)}this.model.beginUpdate();try{if(n){this.resizeChildCells(t,s)}this.model.setGeometry(t,s);this.constrainChildCells(t)}finally{this.model.endUpdate()}}return r};mxGraph.prototype.resizeChildCells=function(t,e){var i=this.model.getGeometry(t);var n=i.width!=0?e.width/i.width:1;var r=i.height!=0?e.height/i.height:1;var s=this.model.getChildCount(t);for(var l=0;l<s;l++){this.scaleCell(this.model.getChildAt(t,l),n,r,true)}};mxGraph.prototype.constrainChildCells=function(t){var e=this.model.getChildCount(t);for(var i=0;i<e;i++){this.constrainChild(this.model.getChildAt(t,i))}};mxGraph.prototype.scaleCell=function(t,e,i,n){var r=this.model.getGeometry(t);if(r!=null){var s=this.getCurrentCellStyle(t);r=r.clone();var l=r.x;var a=r.y;var o=r.width;var h=r.height;r.scale(e,i,s[mxConstants.STYLE_ASPECT]=="fixed");if(s[mxConstants.STYLE_RESIZE_WIDTH]=="1"){r.width=o*e}else if(s[mxConstants.STYLE_RESIZE_WIDTH]=="0"){r.width=o}if(s[mxConstants.STYLE_RESIZE_HEIGHT]=="1"){r.height=h*i}else if(s[mxConstants.STYLE_RESIZE_HEIGHT]=="0"){r.height=h}if(!this.isCellMovable(t)){r.x=l;r.y=a}if(!this.isCellResizable(t)){r.width=o;r.height=h}if(this.model.isVertex(t)){this.cellResized(t,r,true,n)}else{this.model.setGeometry(t,r)}}};mxGraph.prototype.extendParent=function(t){if(t!=null){var e=this.model.getParent(t);var i=this.getCellGeometry(e);if(e!=null&&i!=null&&!this.isCellCollapsed(e)){var n=this.getCellGeometry(t);if(n!=null&&!n.relative&&(i.width<n.x+n.width||i.height<n.y+n.height)){i=i.clone();i.width=Math.max(i.width,n.x+n.width);i.height=Math.max(i.height,n.y+n.height);this.cellsResized([e],[i],false)}}}};mxGraph.prototype.importCells=function(t,e,i,n,r,s){return this.moveCells(t,e,i,true,n,r,s)};mxGraph.prototype.moveCells=function(t,e,i,n,r,s,l){e=e!=null?e:0;i=i!=null?i:0;n=n!=null?n:false;if(t!=null&&(e!=0||i!=0||n||r!=null)){t=this.model.getTopmostCells(t);var a=t;this.model.beginUpdate();try{var o=new mxDictionary;for(var h=0;h<t.length;h++){o.put(t[h],true)}var u=mxUtils.bind(this,(function(t){while(t!=null){if(o.get(t)){return true}t=this.model.getParent(t)}return false}));var d=[];for(var h=0;h<t.length;h++){var p=this.getCellGeometry(t[h]);var m=this.model.getParent(t[h]);if(p==null||!p.relative||!this.model.isEdge(m)||!u(this.model.getTerminal(m,true))&&!u(this.model.getTerminal(m,false))){d.push(t[h])}}t=d;if(n){t=this.cloneCells(t,this.isCloneInvalidEdges(),l);if(r==null){r=this.getDefaultParent()}}var c=this.isAllowNegativeCoordinates();if(r!=null){this.setAllowNegativeCoordinates(true)}this.cellsMoved(t,e,i,!n&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),r==null,this.isExtendParentsOnMove()&&r==null);this.setAllowNegativeCoordinates(c);if(r!=null){var x=this.model.getChildCount(r);this.cellsAdded(t,r,x,null,null,true);if(n){for(var h=0;h<t.length;h++){var p=this.getCellGeometry(t[h]);var m=this.model.getParent(a[h]);if(p!=null&&p.relative&&this.model.isEdge(m)&&this.model.contains(m)){this.model.add(m,t[h])}}}}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",t,"dx",e,"dy",i,"clone",n,"target",r,"event",s))}finally{this.model.endUpdate()}}return t};mxGraph.prototype.cellsMoved=function(t,e,i,n,r,s){if(t!=null&&(e!=0||i!=0)){s=s!=null?s:false;this.model.beginUpdate();try{if(n){this.disconnectGraph(t)}for(var l=0;l<t.length;l++){this.translateCell(t[l],e,i);if(s&&this.isExtendParent(t[l])){this.extendParent(t[l])}else if(r){this.constrainChild(t[l])}}if(this.resetEdgesOnMove){this.resetEdges(t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",t,"dx",e,"dy",i,"disconnect",n))}finally{this.model.endUpdate()}}};mxGraph.prototype.translateCell=function(t,e,i){var n=this.model.getGeometry(t);if(n!=null){e=parseFloat(e);i=parseFloat(i);n=n.clone();n.translate(e,i);if(!n.relative&&this.model.isVertex(t)&&!this.isAllowNegativeCoordinates()){n.x=Math.max(0,parseFloat(n.x));n.y=Math.max(0,parseFloat(n.y))}if(n.relative&&!this.model.isEdge(t)){var r=this.model.getParent(t);var s=0;if(this.model.isVertex(r)){var l=this.getCurrentCellStyle(r);s=mxUtils.getValue(l,mxConstants.STYLE_ROTATION,0)}if(s!=0){var a=mxUtils.toRadians(-s);var o=Math.cos(a);var h=Math.sin(a);var u=mxUtils.getRotatedPoint(new mxPoint(e,i),o,h,new mxPoint(0,0));e=u.x;i=u.y}if(n.offset==null){n.offset=new mxPoint(e,i)}else{n.offset.x=parseFloat(n.offset.x)+e;n.offset.y=parseFloat(n.offset.y)+i}}this.model.setGeometry(t,n)}};mxGraph.prototype.getCellContainmentArea=function(t){if(t!=null&&!this.model.isEdge(t)){var e=this.model.getParent(t);if(e!=null&&e!=this.getDefaultParent()){var i=this.model.getGeometry(e);if(i!=null){var n=0;var r=0;var s=i.width;var l=i.height;if(this.isSwimlane(e)){var a=this.getStartSize(e);var o=this.getCurrentCellStyle(e);var h=mxUtils.getValue(o,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var u=mxUtils.getValue(o,mxConstants.STYLE_FLIPH,0)==1;var d=mxUtils.getValue(o,mxConstants.STYLE_FLIPV,0)==1;if(h==mxConstants.DIRECTION_SOUTH||h==mxConstants.DIRECTION_NORTH){var p=a.width;a.width=a.height;a.height=p}if(h==mxConstants.DIRECTION_EAST&&!d||h==mxConstants.DIRECTION_NORTH&&!u||h==mxConstants.DIRECTION_WEST&&d||h==mxConstants.DIRECTION_SOUTH&&u){n=a.width;r=a.height}s-=a.width;l-=a.height}return new mxRectangle(n,r,s,l)}}}return null};mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds};mxGraph.prototype.constrainChild=function(t,e){if(t!=null){var i=this.getCellGeometry(t);if(i!=null&&(this.isConstrainRelativeChildren()||!i.relative)){var n=this.model.getParent(t);var r=this.getCellGeometry(n);var s=this.getMaximumGraphBounds();if(s!=null){var l=this.getBoundingBoxFromGeometry([n],false);if(l!=null){s=mxRectangle.fromRectangle(s);s.x-=l.x;s.y-=l.y}}if(this.isConstrainChild(t)){var a=this.getCellContainmentArea(t);if(a!=null){var o=this.getOverlap(t);if(o>0){a=mxRectangle.fromRectangle(a);a.x-=a.width*o;a.y-=a.height*o;a.width+=2*a.width*o;a.height+=2*a.height*o}if(s==null){s=a}else{s=mxRectangle.fromRectangle(s);s.intersect(a)}}}if(s!=null){var h=[t];if(!this.isCellCollapsed(t)){var u=this.model.getDescendants(t);for(var d=0;d<u.length;d++){if(this.isCellVisible(u[d])){h.push(u[d])}}}var p=this.getBoundingBoxFromGeometry(h,false);if(p!=null){i=i.clone();var m=0;if(i.width>s.width){m=i.width-s.width;i.width-=m}if(p.x+p.width>s.x+s.width){m-=p.x+p.width-s.x-s.width-m}var c=0;if(i.height>s.height){c=i.height-s.height;i.height-=c}if(p.y+p.height>s.y+s.height){c-=p.y+p.height-s.y-s.height-c}if(p.x<s.x){m-=p.x-s.x}if(p.y<s.y){c-=p.y-s.y}if(m!=0||c!=0){if(i.relative){if(i.offset==null){i.offset=new mxPoint}i.offset.x+=m;i.offset.y+=c}else{i.x+=m;i.y+=c}}this.model.setGeometry(t,i)}}}}};mxGraph.prototype.resetEdges=function(t){if(t!=null){var e=new mxDictionary;for(var i=0;i<t.length;i++){e.put(t[i],true)}this.model.beginUpdate();try{for(var i=0;i<t.length;i++){var n=this.model.getEdges(t[i]);if(n!=null){for(var r=0;r<n.length;r++){var s=this.view.getState(n[r]);var l=s!=null?s.getVisibleTerminal(true):this.view.getVisibleTerminal(n[r],true);var a=s!=null?s.getVisibleTerminal(false):this.view.getVisibleTerminal(n[r],false);if(!e.get(l)||!e.get(a)){this.resetEdge(n[r])}}}this.resetEdges(this.model.getChildren(t[i]))}}finally{this.model.endUpdate()}}};mxGraph.prototype.resetEdge=function(t){var e=this.model.getGeometry(t);if(e!=null&&e.points!=null&&e.points.length>0){e=e.clone();e.points=[];this.model.setGeometry(t,e)}return t};mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(e.shape!=null){var n=this.view.getPerimeterBounds(e);var r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2;n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height;n.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(l!=0){var a=Math.cos(-l);var o=Math.sin(-l);var h=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,a,o,h)}var u=1;var d=1;var p=0;var m=0;if(this.getModel().isVertex(e.cell)){var c=e.style[mxConstants.STYLE_FLIPH];var x=e.style[mxConstants.STYLE_FLIPV];if(e.shape!=null&&e.shape.stencil!=null){c=mxUtils.getValue(e.style,"stencilFlipH",0)==1||c;x=mxUtils.getValue(e.style,"stencilFlipV",0)==1||x}if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){var s=c;c=x;x=s}if(c){u=-1;p=-n.width}if(x){d=-1;m=-n.height}}t=new mxPoint((t.x-n.x)*u-p+n.x,(t.y-n.y)*d-m+n.y);var f=n.width==0?0:Math.round((t.x-n.x)*1e3/n.width)/1e3;var g=n.height==0?0:Math.round((t.y-n.y)*1e3/n.height)/1e3;return new mxConnectionConstraint(new mxPoint(f,g),false)}return null};mxGraph.prototype.getAllConnectionConstraints=function(t,e){if(t!=null&&t.shape!=null&&t.shape.stencil!=null){return t.shape.stencil.constraints}return null};mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null;var r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(r!=null){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];if(s!=null){n=new mxPoint(parseFloat(r),parseFloat(s))}}var l=false;var a=0,o=0;if(n!=null){l=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,true);a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]);o=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]);a=isFinite(a)?a:0;o=isFinite(o)?o:0}return new mxConnectionConstraint(n,l,null,a,o)};mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(n!=null){this.model.beginUpdate();try{if(n==null||n.point==null){this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])}else if(n.point!=null){this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]);if(!n.perimeter){this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t])}else{this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])}}}finally{this.model.endUpdate()}}};mxGraph.prototype.getConnectionPoint=function(t,e,i){i=i!=null?i:true;var n=null;if(t!=null&&e.point!=null){var r=this.view.getPerimeterBounds(t);var s=new mxPoint(r.getCenterX(),r.getCenterY());var l=t.style[mxConstants.STYLE_DIRECTION];var a=0;if(l!=null&&mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)==1){if(l==mxConstants.DIRECTION_NORTH){a+=270}else if(l==mxConstants.DIRECTION_WEST){a+=180}else if(l==mxConstants.DIRECTION_SOUTH){a+=90}if(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){r.rotate90()}}var o=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*o,r.y+e.point.y*r.height+e.dy*o);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(a!=0){var u=0;var d=0;if(a==90){d=1}else if(a==180){u=-1}else if(a==270){d=-1}n=mxUtils.getRotatedPoint(n,u,d,s)}n=this.view.getPerimeterPoint(t,n,false)}else{h+=a;if(this.getModel().isVertex(t.cell)){var p=t.style[mxConstants.STYLE_FLIPH]==1;var m=t.style[mxConstants.STYLE_FLIPV]==1;if(t.shape!=null&&t.shape.stencil!=null){p=mxUtils.getValue(t.style,"stencilFlipH",0)==1||p;m=mxUtils.getValue(t.style,"stencilFlipV",0)==1||m}if(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){var c=p;p=m;m=c}if(p){n.x=2*r.getCenterX()-n.x}if(m){n.y=2*r.getCenterY()-n.y}}}if(h!=0&&n!=null){var x=mxUtils.toRadians(h);var u=Math.cos(x);var d=Math.sin(x);n=mxUtils.getRotatedPoint(n,u,d,s)}}if(i&&n!=null){n.x=Math.round(n.x);n.y=Math.round(n.y)}return n};mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n);this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellConnected=function(t,e,i,n){if(t!=null){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.setConnectionConstraint(t,e,i,n);if(this.isPortsEnabled()){var s=null;if(this.isPort(e)){s=e.getId();e=this.getTerminalForPort(e,i)}var l=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,i);if(this.resetEdgesOnConnect){this.resetEdge(t)}this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}};mxGraph.prototype.disconnectGraph=function(t){if(t!=null){this.model.beginUpdate();try{var e=this.view.scale;var i=this.view.translate;var n=new mxDictionary;for(var r=0;r<t.length;r++){n.put(t[r],true)}for(var r=0;r<t.length;r++){if(this.model.isEdge(t[r])){var s=this.model.getGeometry(t[r]);if(s!=null){var l=this.view.getState(t[r]);var a=this.view.getState(this.model.getParent(t[r]));if(l!=null&&a!=null){s=s.clone();var o=-a.origin.x;var h=-a.origin.y;var u=l.absolutePoints;var d=this.model.getTerminal(t[r],true);if(d!=null&&this.isCellDisconnectable(t[r],d,true)){while(d!=null&&!n.get(d)){d=this.model.getParent(d)}if(d==null){s.setTerminalPoint(new mxPoint(u[0].x/e-i.x+o,u[0].y/e-i.y+h),true);this.model.setTerminal(t[r],null,true)}}var p=this.model.getTerminal(t[r],false);if(p!=null&&this.isCellDisconnectable(t[r],p,false)){while(p!=null&&!n.get(p)){p=this.model.getParent(p)}if(p==null){var m=u.length-1;s.setTerminalPoint(new mxPoint(u[m].x/e-i.x+o,u[m].y/e-i.y+h),false);this.model.setTerminal(t[r],null,false)}}this.model.setGeometry(t[r],s)}}}}}finally{this.model.endUpdate()}}};mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot};mxGraph.prototype.getTranslateForRoot=function(t){return null};mxGraph.prototype.isPort=function(t){return false};mxGraph.prototype.getTerminalForPort=function(t,e){return this.model.getParent(t)};mxGraph.prototype.getChildOffsetForCell=function(t){return null};mxGraph.prototype.enterGroup=function(t){t=t||this.getSelectionCell();if(t!=null&&this.isValidRoot(t)){this.view.setCurrentRoot(t);this.clearSelection()}};mxGraph.prototype.exitGroup=function(){var t=this.model.getRoot();var e=this.getCurrentRoot();if(e!=null){var i=this.model.getParent(e);while(i!=t&&!this.isValidRoot(i)&&this.model.getParent(i)!=t){i=this.model.getParent(i)}if(i==t||this.model.getParent(i)==t){this.view.setCurrentRoot(null)}else{this.view.setCurrentRoot(i)}var n=this.view.getState(e);if(n!=null){this.setSelectionCell(e)}}};mxGraph.prototype.home=function(){var t=this.getCurrentRoot();if(t!=null){this.view.setCurrentRoot(null);var e=this.view.getState(t);if(e!=null){this.setSelectionCell(t)}}};mxGraph.prototype.isValidRoot=function(t){return t!=null};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()};mxGraph.prototype.getCellBounds=function(t,e,i){var n=[t];if(e){n=n.concat(this.model.getEdges(t))}var r=this.view.getBounds(n);if(i){var s=this.model.getChildCount(t);for(var l=0;l<s;l++){var a=this.getCellBounds(this.model.getChildAt(t,l),e,true);if(r!=null){r.add(a)}else{r=a}}}return r};mxGraph.prototype.getBoundingBoxFromGeometry=function(t,e){e=e!=null?e:false;var i=null;if(t!=null){for(var n=0;n<t.length;n++){if(e||this.model.isVertex(t[n])){var r=this.getCellGeometry(t[n]);if(r!=null){var s=null;if(this.model.isEdge(t[n])){var l=function(t){if(t!=null){if(o==null){o=new mxRectangle(t.x,t.y,0,0)}else{o.add(new mxRectangle(t.x,t.y,0,0))}}};if(this.model.getTerminal(t[n],true)==null){l(r.getTerminalPoint(true))}if(this.model.getTerminal(t[n],false)==null){l(r.getTerminalPoint(false))}var a=r.points;if(a!=null&&a.length>0){var o=new mxRectangle(a[0].x,a[0].y,0,0);for(var h=1;h<a.length;h++){l(a[h])}}s=o}else{var u=this.model.getParent(t[n]);if(r.relative){if(this.model.isVertex(u)&&u!=this.view.currentRoot){var o=this.getBoundingBoxFromGeometry([u],false);if(o!=null){s=new mxRectangle(r.x*o.width,r.y*o.height,r.width,r.height);if(mxUtils.indexOf(t,u)>=0){s.x+=o.x;s.y+=o.y}}}}else{s=mxRectangle.fromRectangle(r);if(this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0){var o=this.getBoundingBoxFromGeometry([u],false);if(o!=null){s.x+=o.x;s.y+=o.y}}}if(s!=null&&r.offset!=null){s.x+=r.offset.x;s.y+=r.offset.y}var d=this.getCurrentCellStyle(t[n]);if(s!=null){var p=mxUtils.getValue(d,mxConstants.STYLE_ROTATION,0);if(p!=0){s=mxUtils.getBoundingBox(s,p)}}}if(s!=null){if(i==null){i=mxRectangle.fromRectangle(s)}else{i.add(s)}}}}}}return i};mxGraph.prototype.refresh=function(t){this.view.clear(t,t==null);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(t){if(this.gridEnabled){t=Math.round(t/this.gridSize)*this.gridSize}return t};mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate;var l=this.view.scale;if(!i&&this.gridEnabled){var a=this.gridSize*l*.5;if(!n){var o=e.x-(this.snap(e.x/l-s.x)+s.x)*l;if(Math.abs(t.x-o)<a){t.x=0}else{t.x=this.snap(t.x/l)*l-o}}if(!r){var h=e.y-(this.snap(e.y/l-s.y)+s.y)*l;if(Math.abs(t.y-h)<a){t.y=0}else{t.y=this.snap(t.y/l)*l-h}}}else{var a=.5*l;if(!n){var o=e.x-(Math.round(e.x/l-s.x)+s.x)*l;if(Math.abs(t.x-o)<a){t.x=0}else{t.x=Math.round(t.x/l)*l-o}}if(!r){var h=e.y-(Math.round(e.y/l-s.y)+s.y)*l;if(Math.abs(t.y-h)<a){t.y=0}else{t.y=Math.round(t.y/l)*l-h}}}return t};mxGraph.prototype.panGraph=function(t,e){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)){this.container.scrollLeft=-t;this.container.scrollTop=-e}else{var i=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG){if(t==0&&e==0){if(mxClient.IS_IE){i.setAttribute("transform","translate("+t+","+e+")")}else{i.removeAttribute("transform")}if(this.shiftPreview1!=null){var n=this.shiftPreview1.firstChild;while(n!=null){var r=n.nextSibling;this.container.appendChild(n);n=r}if(this.shiftPreview1.parentNode!=null){this.shiftPreview1.parentNode.removeChild(this.shiftPreview1)}this.shiftPreview1=null;this.container.appendChild(i.parentNode);n=this.shiftPreview2.firstChild;while(n!=null){var r=n.nextSibling;this.container.appendChild(n);n=r}if(this.shiftPreview2.parentNode!=null){this.shiftPreview2.parentNode.removeChild(this.shiftPreview2)}this.shiftPreview2=null}}else{i.setAttribute("transform","translate("+t+","+e+")");if(this.shiftPreview1==null){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position="absolute";this.shiftPreview1.style.overflow="visible";this.shiftPreview2=document.createElement("div");this.shiftPreview2.style.position="absolute";this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;var n=this.container.firstChild;while(n!=null){var r=n.nextSibling;if(n!=i.parentNode){s.appendChild(n)}else{s=this.shiftPreview2}n=r}if(this.shiftPreview1.firstChild!=null){this.container.insertBefore(this.shiftPreview1,i.parentNode)}if(this.shiftPreview2.firstChild!=null){this.container.appendChild(this.shiftPreview2)}}this.shiftPreview1.style.left=t+"px";this.shiftPreview1.style.top=e+"px";this.shiftPreview2.style.left=t+"px";this.shiftPreview2.style.top=e+"px"}}else{i.style.left=t+"px";i.style.top=e+"px"}this.panDx=t;this.panDy=e;this.fireEvent(new mxEventObject(mxEvent.PAN))}};mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)};mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)};mxGraph.prototype.zoomActual=function(){if(this.view.scale==1){this.view.setTranslate(0,0)}else{this.view.translate.x=0;this.view.translate.y=0;this.view.setScale(1)}};mxGraph.prototype.zoomTo=function(t,e){this.zoom(t/this.view.scale,e)};mxGraph.prototype.center=function(t,e,i,n){t=t!=null?t:true;e=e!=null?e:true;i=i!=null?i:.5;n=n!=null?n:.5;var r=mxUtils.hasScrollbars(this.container);var s=2*this.getBorder();var l=this.container.clientWidth-s;var a=this.container.clientHeight-s;var o=this.getGraphBounds();var h=this.view.translate;var u=this.view.scale;var d=t?l-o.width:0;var p=e?a-o.height:0;if(!r){this.view.setTranslate(t?Math.floor(h.x-o.x*u+d*i/u):h.x,e?Math.floor(h.y-o.y*u+p*n/u):h.y)}else{o.x-=h.x;o.y-=h.y;var m=this.container.scrollWidth;var c=this.container.scrollHeight;if(m>l){d=0}if(c>a){p=0}this.view.setTranslate(Math.floor(d/2-o.x),Math.floor(p/2-o.y));this.container.scrollLeft=(m-l)/2;this.container.scrollTop=(c-a)/2}};mxGraph.prototype.zoom=function(t,e){e=e!=null?e:this.centerZoom;var i=Math.round(this.view.scale*t*100)/100;var n=this.view.getState(this.getSelectionCell());t=i/this.view.scale;if(this.keepSelectionVisibleOnZoom&&n!=null){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i;if(!this.scrollRectToVisible(r)){this.view.revalidate();this.view.setScale(i)}}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var l=this.container.offsetWidth;var a=this.container.offsetHeight;if(t>1){var o=(t-1)/(i*2);l*=-o;a*=-o}else{var o=(1/t-1)/(this.view.scale*2);l*=o;a*=o}this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x;var u=this.view.translate.y;var d=this.container.scrollLeft;var p=this.container.scrollTop;this.view.setScale(i);if(s){var l=0;var a=0;if(e){l=this.container.offsetWidth*(t-1)/2;a=this.container.offsetHeight*(t-1)/2}this.container.scrollLeft=(this.view.translate.x-h)*this.view.scale+Math.round(d*t+l);this.container.scrollTop=(this.view.translate.y-u)*this.view.scale+Math.round(p*t+a)}}}};mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width;var i=this.container.clientHeight/t.height;var n=e/i;t.x=Math.max(0,t.x);t.y=Math.max(0,t.y);var r=Math.min(this.container.scrollWidth,t.x+t.width);var s=Math.min(this.container.scrollHeight,t.y+t.height);t.width=r-t.x;t.height=s-t.y;if(n<1){var l=t.height/n;var a=(l-t.height)/2;t.height=l;var o=Math.min(t.y,a);t.y=t.y-o;s=Math.min(this.container.scrollHeight,t.y+t.height);t.height=s-t.y}else{var h=t.width*n;var u=(h-t.width)/2;t.width=h;var d=Math.min(t.x,u);t.x=t.x-d;r=Math.min(this.container.scrollWidth,t.x+t.width);t.width=r-t.x}var p=this.container.clientWidth/t.width;var m=this.view.scale*p;if(!mxUtils.hasScrollbars(this.container)){this.view.scaleAndTranslate(m,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)}else{this.view.setScale(m);this.container.scrollLeft=Math.round(t.x*p);this.container.scrollTop=Math.round(t.y*p)}};mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x;var n=-this.view.translate.y;var r=this.view.getState(t);if(r!=null){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&this.container!=null){var l=this.container.clientWidth;var a=this.container.clientHeight;s.x=s.getCenterX()-l/2;s.width=l;s.y=s.getCenterY()-a/2;s.height=a}var o=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=o.x;this.view.translate.y=o.y;this.view.setTranslate(h.x,h.y)}}};mxGraph.prototype.scrollRectToVisible=function(t){var e=false;if(t!=null){var i=this.container.offsetWidth;var n=this.container.offsetHeight;var r=Math.min(i,t.width);var s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x;t.y+=this.view.translate.y;var a=l.scrollLeft-t.x;var o=Math.max(a-l.scrollLeft,0);if(a>0){l.scrollLeft-=a+2}else{a=t.x+r-l.scrollLeft-l.clientWidth;if(a>0){l.scrollLeft+=a+2}}var h=l.scrollTop-t.y;var u=Math.max(0,h-l.scrollTop);if(h>0){l.scrollTop-=h+2}else{h=t.y+s-l.scrollTop-l.clientHeight;if(h>0){l.scrollTop+=h+2}}if(!this.useScrollbarsForPanning&&(o!=0||u!=0)){this.view.setTranslate(o,u)}}else{var d=-this.view.translate.x;var p=-this.view.translate.y;var m=this.view.scale;if(t.x+r>d+i){this.view.translate.x-=(t.x+r-i-d)/m;e=true}if(t.y+s>p+n){this.view.translate.y-=(t.y+s-n-p)/m;e=true}if(t.x<d){this.view.translate.x+=(d-t.x)/m;e=true}if(t.y<p){this.view.translate.y+=(p-t.y)/m;e=true}if(e){this.view.refresh();if(this.selectionCellsHandler!=null){this.selectionCellsHandler.refresh()}}}}return e};mxGraph.prototype.getCellGeometry=function(t){return this.model.getGeometry(t)};mxGraph.prototype.isCellVisible=function(t){return this.model.isVisible(t)};mxGraph.prototype.isCellCollapsed=function(t){return this.model.isCollapsed(t)};mxGraph.prototype.isCellConnectable=function(t){return this.model.isConnectable(t)};mxGraph.prototype.isOrthogonal=function(t){var e=t.style[mxConstants.STYLE_ORTHOGONAL];if(e!=null){return e}var i=this.view.getEdgeStyle(t);return i==mxEdgeStyle.SegmentConnector||i==mxEdgeStyle.ElbowConnector||i==mxEdgeStyle.SideToSide||i==mxEdgeStyle.TopToBottom||i==mxEdgeStyle.EntityRelation||i==mxEdgeStyle.OrthConnector};mxGraph.prototype.isLoop=function(t){var e=t.getVisibleTerminalState(true);var i=t.getVisibleTerminalState(false);return e!=null&&e==i};mxGraph.prototype.isCloneEvent=function(t){return mxEvent.isControlDown(t)};mxGraph.prototype.isTransparentClickEvent=function(t){return false};mxGraph.prototype.isToggleEvent=function(t){return mxClient.IS_MAC?mxEvent.isMetaDown(t):mxEvent.isControlDown(t)};mxGraph.prototype.isGridEnabledEvent=function(t){return t!=null&&!mxEvent.isAltDown(t)};mxGraph.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t)};mxGraph.prototype.isIgnoreTerminalEvent=function(t){return false};mxGraph.prototype.validationAlert=function(t){mxUtils.alert(t)};mxGraph.prototype.isEdgeValid=function(t,e,i){return this.getEdgeValidationError(t,e,i)==null};mxGraph.prototype.getEdgeValidationError=function(t,e,i){if(t!=null&&!this.isAllowDanglingEdges()&&(e==null||i==null)){return""}if(t!=null&&this.model.getTerminal(t,true)==null&&this.model.getTerminal(t,false)==null){return null}if(!this.allowLoops&&e==i&&e!=null){return""}if(!this.isValidConnection(e,i)){return""}if(e!=null&&i!=null){var n="";if(!this.multigraph){var r=this.model.getEdgesBetween(e,i,true);if(r.length>1||r.length==1&&r[0]!=t){n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n"}}var s=this.model.getDirectedEdgeCount(e,true,t);var l=this.model.getDirectedEdgeCount(i,false,t);if(this.multiplicities!=null){for(var a=0;a<this.multiplicities.length;a++){var o=this.multiplicities[a].check(this,t,e,i,s,l);if(o!=null){n+=o}}}var o=this.validateEdge(t,e,i);if(o!=null){n+=o}return n.length>0?n:null}return this.allowDanglingEdges?null:""};mxGraph.prototype.validateEdge=function(t,e,i){return null};mxGraph.prototype.validateGraph=function(t,e){t=t!=null?t:this.model.getRoot();e=e!=null?e:new Object;var i=true;var n=this.model.getChildCount(t);for(var r=0;r<n;r++){var s=this.model.getChildAt(t,r);var l=e;if(this.isValidRoot(s)){l=new Object}var a=this.validateGraph(s,l);if(a!=null){this.setCellWarning(s,a.replace(/\n/g,"<br>"))}else{this.setCellWarning(s,null)}i=i&&a==null}var o="";if(this.isCellCollapsed(t)&&!i){o+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"}if(this.model.isEdge(t)){o+=this.getEdgeValidationError(t,this.model.getTerminal(t,true),this.model.getTerminal(t,false))||""}else{o+=this.getCellValidationError(t)||""}var h=this.validateCell(t,e);if(h!=null){o+=h}if(this.model.getParent(t)==null){this.view.validate()}return o.length>0||!i?o:null};mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,true);var i=this.model.getDirectedEdgeCount(t,false);var n=this.model.getValue(t);var r="";if(this.multiplicities!=null){for(var s=0;s<this.multiplicities.length;s++){var l=this.multiplicities[s];if(l.source&&mxUtils.isNode(n,l.type,l.attr,l.value)&&(e>l.max||e<l.min)){r+=l.countError+"\n"}else if(!l.source&&mxUtils.isNode(n,l.type,l.attr,l.value)&&(i>l.max||i<l.min)){r+=l.countError+"\n"}}}return r.length>0?r:null};mxGraph.prototype.validateCell=function(t,e){return null};mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage};mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t};mxGraph.prototype.getFoldingImage=function(t){if(t!=null&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e)){return e?this.collapsedImage:this.expandedImage}}return null};mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(e!=null){if(mxUtils.isNode(e)){return e.nodeName}else if(typeof e.toString=="function"){return e.toString()}}return""};mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&t!=null){var i=this.getCurrentCellStyle(t);if(!mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,false)){e=this.convertValueToString(t)}}return e};mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()};mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels};mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t};mxGraph.prototype.isWrapping=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]=="wrap"};mxGraph.prototype.isLabelClipped=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]=="hidden"};mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(t!=null){if(t.control!=null&&(e==t.control.node||e.parentNode==t.control.node)){r=this.collapseExpandResource;r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"<br>")}if(r==null&&t.overlays!=null){t.overlays.visit((function(t,i){if(r==null&&(e==i.node||e.parentNode==i.node)){r=i.overlay.toString()}}))}if(r==null){var s=this.selectionCellsHandler.getHandler(t.cell);if(s!=null&&typeof s.getTooltipForNode=="function"){r=s.getTooltipForNode(e)}}if(r==null){r=this.getTooltipForCell(t.cell)}}return r};mxGraph.prototype.getTooltipForCell=function(t){var e=null;if(t!=null&&t.getTooltip!=null){e=t.getTooltip()}else{e=this.convertValueToString(t)}return e};mxGraph.prototype.getLinkForCell=function(t){return null};mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())};mxGraph.prototype.getCursorForCell=function(t){return null};mxGraph.prototype.getStartSize=function(t,e){var i=new mxRectangle;var n=this.getCurrentCellStyle(t,e);var r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));if(mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,true)){i.height=r}else{i.width=r}return i};mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var i=mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0)==1;var n=mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0)==1;var r=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,true);var s=r?0:3;if(e==mxConstants.DIRECTION_NORTH){s--}else if(e==mxConstants.DIRECTION_WEST){s+=2}else if(e==mxConstants.DIRECTION_SOUTH){s+=1}var l=mxUtils.mod(s,2);if(i&&l==1){s+=2}if(n&&l==0){s+=2}return[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]};mxGraph.prototype.getActualStartSize=function(t,e){var i=new mxRectangle;if(this.isSwimlane(t,e)){var n=this.getCurrentCellStyle(t,e);var r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));var s=this.getSwimlaneDirection(n);if(s==mxConstants.DIRECTION_NORTH){i.y=r}else if(s==mxConstants.DIRECTION_WEST){i.x=r}else if(s==mxConstants.DIRECTION_SOUTH){i.height=r}else{i.width=r}}return i};mxGraph.prototype.getImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_IMAGE]:null};mxGraph.prototype.isTransparentState=function(t){var e=false;if(t!=null){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE);var n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&this.getImage(t)==null}return e};mxGraph.prototype.getVerticalAlign=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null};mxGraph.prototype.getIndicatorColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null};mxGraph.prototype.getIndicatorGradientColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null};mxGraph.prototype.getIndicatorShape=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null};mxGraph.prototype.getIndicatorImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null};mxGraph.prototype.getBorder=function(){return this.border};mxGraph.prototype.setBorder=function(t){this.border=t};mxGraph.prototype.isSwimlane=function(t,e){if(t!=null&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)){return this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE}return false};mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer};mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t};mxGraph.prototype.isEnabled=function(){return this.enabled};mxGraph.prototype.setEnabled=function(t){this.enabled=t};mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled};mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t};mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing};mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t};mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing};mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t};mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||e!=null&&this.model.isVertex(t)&&e.relative};mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked};mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t};mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellCloneable(t)})))};mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&e[mxConstants.STYLE_CLONEABLE]!=0};mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable};mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t};mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canExportCell(t)})))};mxGraph.prototype.canExportCell=function(t){return this.exportEnabled};mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canImportCell(t)})))};mxGraph.prototype.canImportCell=function(t){return this.importEnabled};mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()};mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable};mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t};mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellDeletable(t)})))};mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&e[mxConstants.STYLE_DELETABLE]!=0};mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable};mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t};mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)};mxGraph.prototype.isCellRotatable=function(t){var e=this.getCurrentCellStyle(t);return e[mxConstants.STYLE_ROTATABLE]!=0};mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellMovable(t)})))};mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_MOVABLE]!=0};mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable};mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t};mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled};mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t};mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled};mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t};mxGraph.prototype.getGridSize=function(){return this.gridSize};mxGraph.prototype.setGridSize=function(t){this.gridSize=t};mxGraph.prototype.getTolerance=function(){return this.tolerance};mxGraph.prototype.setTolerance=function(t){this.tolerance=t};mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable};mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t};mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable};mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t};mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting};mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t};mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled};mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t};mxGraph.prototype.isMultigraph=function(){return this.multigraph};mxGraph.prototype.setMultigraph=function(t){this.multigraph=t};mxGraph.prototype.isAllowLoops=function(){return this.allowLoops};mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t};mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges};mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t};mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges};mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t};mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges};mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t};mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove};mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t};mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled};mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t};mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled};mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t};mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")!="0"};mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable};mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t};mxGraph.prototype.isTerminalPointMovable=function(t,e){return true};mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_BENDABLE]!=0};mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable};mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t};mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_EDITABLE]!=0};mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable};mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t};mxGraph.prototype.isCellDisconnectable=function(t,e,i){return this.isCellsDisconnectable()&&!this.isCellLocked(t)};mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable};mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t};mxGraph.prototype.isValidSource=function(t){return t==null&&this.allowDanglingEdges||t!=null&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)};mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)};mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)};mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)};mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()};mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)};mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t};mxGraph.prototype.isEditing=function(t){if(this.cellEditor!=null){var e=this.cellEditor.getEditingCell();return t==null?e!=null:t==e}return false};mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||e[mxConstants.STYLE_AUTOSIZE]==1};mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells};mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t};mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()};mxGraph.prototype.isExtendParents=function(){return this.extendParents};mxGraph.prototype.setExtendParents=function(t){this.extendParents=t};mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd};mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t};mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove};mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t};mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize};mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t};mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))};mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren};mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t};mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren};mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t};mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates};mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t};mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0};mxGraph.prototype.isAllowOverlapParent=function(t){return false};mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellFoldable(t,e)})))};mxGraph.prototype.isCellFoldable=function(t,e){var i=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&i[mxConstants.STYLE_FOLDABLE]!=0};mxGraph.prototype.isValidDropTarget=function(t,e,i){return t!=null&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))};mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&e!=null&&e.length==1&&this.isCellConnectable(e[0])&&this.getEdgeValidationError(t,this.model.getTerminal(t,true),e[0])==null){var n=this.model.getTerminal(t,true);var r=this.model.getTerminal(t,false);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return false};mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting()){for(var r=0;r<t.length;r++){if(this.isSwimlane(t[r])){return null}}}var s=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));s.x-=this.panDx;s.y-=this.panDy;var l=this.getSwimlaneAt(s.x,s.y);if(i==null){i=l}else if(l!=null){var a=this.model.getParent(l);while(a!=null&&this.isSwimlane(a)&&a!=i){a=this.model.getParent(a)}if(a==i){i=l}}while(i!=null&&!this.isValidDropTarget(i,t,e)&&!this.model.isLayer(i)){i=this.model.getParent(i)}if(n==null||!n){var o=i;while(o!=null&&mxUtils.indexOf(t,o)<0){o=this.model.getParent(o)}}return!this.model.isLayer(i)&&o==null?i:null};mxGraph.prototype.getDefaultParent=function(){var t=this.getCurrentRoot();if(t==null){t=this.defaultParent;if(t==null){var e=this.model.getRoot();t=this.model.getChildAt(e,0)}}return t};mxGraph.prototype.setDefaultParent=function(t){this.defaultParent=t};mxGraph.prototype.getSwimlane=function(t){while(t!=null&&!this.isSwimlane(t)){t=this.model.getParent(t)}return t};mxGraph.prototype.getSwimlaneAt=function(t,e,i){if(i==null){i=this.getCurrentRoot();if(i==null){i=this.model.getRoot()}}if(i!=null){var n=this.model.getChildCount(i);for(var r=0;r<n;r++){var s=this.model.getChildAt(i,r);if(s!=null){var l=this.getSwimlaneAt(t,e,s);if(l!=null){return l}else if(this.isCellVisible(s)&&this.isSwimlane(s)){var a=this.view.getState(s);if(this.intersects(a,t,e)){return s}}}}}return null};mxGraph.prototype.getCellAt=function(t,e,i,n,r,s){n=n!=null?n:true;r=r!=null?r:true;if(i==null){i=this.getCurrentRoot();if(i==null){i=this.getModel().getRoot()}}if(i!=null){var l=this.model.getChildCount(i);for(var a=l-1;a>=0;a--){var o=this.model.getChildAt(i,a);var h=this.getCellAt(t,e,o,n,r,s);if(h!=null){return h}else if(this.isCellVisible(o)&&(r&&this.model.isEdge(o)||n&&this.model.isVertex(o))){var u=this.view.getState(o);if(u!=null&&(s==null||!s(u,t,e))&&this.intersects(u,t,e)){return o}}}}return null};mxGraph.prototype.intersects=function(t,e,i){if(t!=null){var n=t.absolutePoints;if(n!=null){var r=this.tolerance*this.tolerance;var s=n[0];for(var l=1;l<n.length;l++){var a=n[l];var o=mxUtils.ptSegDistSq(s.x,s.y,a.x,a.y,e,i);if(o<=r){return true}s=a}}else{var h=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(h!=0){var u=Math.cos(-h);var d=Math.sin(-h);var p=new mxPoint(t.getCenterX(),t.getCenterY());var s=mxUtils.getRotatedPoint(new mxPoint(e,i),u,d,p);e=s.x;i=s.y}if(mxUtils.contains(t,e,i)){return true}}}return false};mxGraph.prototype.hitsSwimlaneContent=function(t,e,i){var n=this.getView().getState(t);var r=this.getStartSize(t);if(n!=null){var s=this.getView().getScale();e-=n.x;i-=n.y;if(r.width>0&&e>0&&e>r.width*s){return true}else if(r.height>0&&i>0&&i>r.height*s){return true}}return false};mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,true,false)};mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,false,true)};mxGraph.prototype.getChildCells=function(t,e,i){t=t!=null?t:this.getDefaultParent();e=e!=null?e:false;i=i!=null?i:false;var n=this.model.getChildCells(t,e,i);var r=[];for(var s=0;s<n.length;s++){if(this.isCellVisible(n[s])){r.push(n[s])}}return r};mxGraph.prototype.getConnections=function(t,e){return this.getEdges(t,e,true,true,false)};mxGraph.prototype.getIncomingEdges=function(t,e){return this.getEdges(t,e,true,false,false)};mxGraph.prototype.getOutgoingEdges=function(t,e){return this.getEdges(t,e,false,true,false)};mxGraph.prototype.getEdges=function(t,e,i,n,r,s){i=i!=null?i:true;n=n!=null?n:true;r=r!=null?r:true;s=s!=null?s:false;var l=[];var a=this.isCellCollapsed(t);var o=this.model.getChildCount(t);for(var h=0;h<o;h++){var u=this.model.getChildAt(t,h);if(a||!this.isCellVisible(u)){l=l.concat(this.model.getEdges(u,i,n))}}l=l.concat(this.model.getEdges(t,i,n));var d=[];for(var h=0;h<l.length;h++){var p=this.view.getState(l[h]);var m=p!=null?p.getVisibleTerminal(true):this.view.getVisibleTerminal(l[h],true);var c=p!=null?p.getVisibleTerminal(false):this.view.getVisibleTerminal(l[h],false);if(r&&m==c||m!=c&&(i&&c==t&&(e==null||this.isValidAncestor(m,e,s))||n&&m==t&&(e==null||this.isValidAncestor(c,e,s)))){d.push(l[h])}}return d};mxGraph.prototype.isValidAncestor=function(t,e,i){return i?this.model.isAncestor(e,t):this.model.getParent(t)==e};mxGraph.prototype.getOpposites=function(t,e,i,n){i=i!=null?i:true;n=n!=null?n:true;var r=[];var s=new mxDictionary;if(t!=null){for(var l=0;l<t.length;l++){var a=this.view.getState(t[l]);var o=a!=null?a.getVisibleTerminal(true):this.view.getVisibleTerminal(t[l],true);var h=a!=null?a.getVisibleTerminal(false):this.view.getVisibleTerminal(t[l],false);if(o==e&&h!=null&&h!=e&&n){if(!s.get(h)){s.put(h,true);r.push(h)}}else if(h==e&&o!=null&&o!=e&&i){if(!s.get(o)){s.put(o,true);r.push(o)}}}}return r};mxGraph.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdges(t);var r=[];for(var s=0;s<n.length;s++){var l=this.view.getState(n[s]);var a=l!=null?l.getVisibleTerminal(true):this.view.getVisibleTerminal(n[s],true);var o=l!=null?l.getVisibleTerminal(false):this.view.getVisibleTerminal(n[s],false);if(a==t&&o==e||!i&&a==e&&o==t){r.push(n[s])}}return r};mxGraph.prototype.getPointForEvent=function(t,e){var i=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t));var n=this.view.scale;var r=this.view.translate;var s=e!=false?this.gridSize/2:0;i.x=this.snap(i.x/n-r.x-s);i.y=this.snap(i.y/n-r.y-s);return i};mxGraph.prototype.getCells=function(t,e,i,n,r,s,l,a,o){s=s!=null?s:[];if(i>0||n>0||l!=null){var h=this.getModel();var u=t+i;var d=e+n;if(r==null){r=this.getCurrentRoot();if(r==null){r=h.getRoot()}}if(r!=null){var p=h.getChildCount(r);for(var m=0;m<p;m++){var c=h.getChildAt(r,m);var x=this.view.getState(c);if(x!=null&&this.isCellVisible(c)&&(a==null||!a(x))){var f=mxUtils.getValue(x.style,mxConstants.STYLE_ROTATION)||0;var g=x;if(f!=0){g=mxUtils.getBoundingBox(g,f)}var v=l!=null&&h.isVertex(c)&&mxUtils.intersects(l,g)||l==null&&(h.isEdge(c)||h.isVertex(c))&&g.x>=t&&g.y+g.height<=d&&g.y>=e&&g.x+g.width<=u;if(v){s.push(c)}if(!v||o){this.getCells(t,e,i,n,c,s,l,a,o)}}}}}return s};mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if(n||r){if(i==null){i=this.getDefaultParent()}if(i!=null){var l=this.model.getChildCount(i);for(var a=0;a<l;a++){var o=this.model.getChildAt(i,a);var h=this.view.getState(o);if(this.isCellVisible(o)&&h!=null){if((!n||h.x>=t)&&(!r||h.y>=e)){s.push(o)}}}}}return s};mxGraph.prototype.findTreeRoots=function(t,e,i){e=e!=null?e:false;i=i!=null?i:false;var n=[];if(t!=null){var r=this.getModel();var s=r.getChildCount(t);var l=null;var a=0;for(var o=0;o<s;o++){var h=r.getChildAt(t,o);if(this.model.isVertex(h)&&this.isCellVisible(h)){var u=this.getConnections(h,e?t:null);var d=0;var p=0;for(var m=0;m<u.length;m++){var c=this.view.getVisibleTerminal(u[m],true);if(c==h){d++}else{p++}}if(i&&d==0&&p>0||!i&&p==0&&d>0){n.push(h)}var x=i?p-d:d-p;if(x>a){a=x;l=h}}}if(n.length==0&&l!=null){n.push(l)}}return n};mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(i!=null&&t!=null){e=e!=null?e:true;s=s!=null?s:false;r=r||new mxDictionary;if(!r.get(t)){r.put(t,true);var l=i(t,n);if(l==null||l){var a=this.model.getEdgeCount(t);if(a>0){for(var o=0;o<a;o++){var h=this.model.getEdgeAt(t,o);var u=this.model.getTerminal(h,true)==t;if(!e||!s==u){var d=this.model.getTerminal(h,!u);this.traverse(d,e,i,h,r,s)}}}}}}};mxGraph.prototype.isCellSelected=function(t){return this.getSelectionModel().isSelected(t)};mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()};mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()};mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length};mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]};mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()};mxGraph.prototype.setSelectionCell=function(t){this.getSelectionModel().setCell(t)};mxGraph.prototype.setSelectionCells=function(t){this.getSelectionModel().setCells(t)};mxGraph.prototype.addSelectionCell=function(t){this.getSelectionModel().addCell(t)};mxGraph.prototype.addSelectionCells=function(t){this.getSelectionModel().addCells(t)};mxGraph.prototype.removeSelectionCell=function(t){this.getSelectionModel().removeCell(t)};mxGraph.prototype.removeSelectionCells=function(t){this.getSelectionModel().removeCells(t)};mxGraph.prototype.selectRegion=function(t,e){var i=this.getCells(t.x,t.y,t.width,t.height);this.selectCellsForEvent(i,e);return i};mxGraph.prototype.selectNextCell=function(){this.selectCell(true)};mxGraph.prototype.selectPreviousCell=function(){this.selectCell()};mxGraph.prototype.selectParentCell=function(){this.selectCell(false,true)};mxGraph.prototype.selectChildCell=function(){this.selectCell(false,false,true)};mxGraph.prototype.selectCell=function(t,e,i){var n=this.selectionModel;var r=n.cells.length>0?n.cells[0]:null;if(n.cells.length>1){n.clear()}var s=r!=null?this.model.getParent(r):this.getDefaultParent();var l=this.model.getChildCount(s);if(r==null&&l>0){var a=this.model.getChildAt(s,0);this.setSelectionCell(a)}else if((r==null||e)&&this.view.getState(s)!=null&&this.model.getGeometry(s)!=null){if(this.getCurrentRoot()!=s){this.setSelectionCell(s)}}else if(r!=null&&i){var o=this.model.getChildCount(r);if(o>0){var a=this.model.getChildAt(r,0);this.setSelectionCell(a)}}else if(l>0){var h=s.getIndex(r);if(t){h++;var a=this.model.getChildAt(s,h%l);this.setSelectionCell(a)}else{h--;var u=h<0?l-1:h;var a=this.model.getChildAt(s,u);this.setSelectionCell(a)}}};mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,(function(e){return e!=t&&this.view.getState(e)!=null})),t):this.model.getChildren(t);if(i!=null){this.setSelectionCells(i)}};mxGraph.prototype.selectVertices=function(t,e){this.selectCells(true,false,t,e)};mxGraph.prototype.selectEdges=function(t){this.selectCells(false,true,t)};mxGraph.prototype.selectCells=function(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,(function(i){return this.view.getState(i)!=null&&((n||this.model.getChildCount(i)==0)&&this.model.isVertex(i)&&t&&!this.model.isEdge(this.model.getParent(i))||this.model.isEdge(i)&&e)}));var s=this.model.filterDescendants(r,i);if(s!=null){this.setSelectionCells(s)}};mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);if(this.isToggleEvent(e)){if(i){this.removeSelectionCell(t)}else{this.addSelectionCell(t)}}else if(!i||this.getSelectionCount()!=1){this.setSelectionCell(t)}};mxGraph.prototype.selectCellsForEvent=function(t,e){if(this.isToggleEvent(e)){this.addSelectionCells(t)}else{this.setSelectionCells(t)}};mxGraph.prototype.createHandler=function(t){var e=null;if(t!=null){if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(true);var n=t.getVisibleTerminalState(false);var r=this.getCellGeometry(t.cell);var s=this.view.getEdgeStyle(t,r!=null?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else{e=this.createVertexHandler(t)}}return e};mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)};mxGraph.prototype.createEdgeHandler=function(t,e){var i=null;if(e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom){i=this.createElbowEdgeHandler(t)}else if(e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector){i=this.createEdgeSegmentHandler(t)}else{i=new mxEdgeHandler(t)}return i};mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)};mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)};mxGraph.prototype.addMouseListener=function(t){if(this.mouseListeners==null){this.mouseListeners=[]}this.mouseListeners.push(t)};mxGraph.prototype.removeMouseListener=function(t){if(this.mouseListeners!=null){for(var e=0;e<this.mouseListeners.length;e++){if(this.mouseListeners[e]==t){this.mouseListeners.splice(e,1);break}}}};mxGraph.prototype.updateMouseEvent=function(t,e){if(t.graphX==null||t.graphY==null){var i=mxUtils.convertPoint(this.container,t.getX(),t.getY());t.graphX=i.x-this.panDx;t.graphY=i.y-this.panDy;if(t.getCell()==null&&this.isMouseDown&&e==mxEvent.MOUSE_MOVE){t.state=this.view.getState(this.getCellAt(i.x,i.y,null,null,null,(function(t){return t.shape==null||t.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||mxUtils.getValue(t.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"||t.shape.fill!=null&&t.shape.fill!=mxConstants.NONE})))}}return t};mxGraph.prototype.getStateForTouchEvent=function(t){var e=mxEvent.getClientX(t);var i=mxEvent.getClientY(t);var n=mxUtils.convertPoint(this.container,e,i);return this.view.getState(this.getCellAt(n.x,n.y))};mxGraph.prototype.isEventIgnored=function(t,e,i){var n=mxEvent.isMouseEvent(e.getEvent());var r=false;if(e.getEvent()==this.lastEvent){r=true}else{this.lastEvent=e.getEvent()}if(this.eventSource!=null&&t!=mxEvent.MOUSE_MOVE){mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect);this.mouseMoveRedirect=null;this.mouseUpRedirect=null;this.eventSource=null}else if(!mxClient.IS_GC&&this.eventSource!=null&&e.getSource()!=this.eventSource){r=true}else if(mxClient.IS_TOUCH&&t==mxEvent.MOUSE_DOWN&&!n&&!mxEvent.isPenEvent(e.getEvent())){this.eventSource=e.getSource();this.mouseMoveRedirect=mxUtils.bind(this,(function(t){this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}));this.mouseUpRedirect=mxUtils.bind(this,(function(t){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}));mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect)}if(this.isSyntheticEventIgnored(t,e,i)){r=true}if(!mxEvent.isPopupTrigger(this.lastEvent)&&t!=mxEvent.MOUSE_MOVE&&this.lastEvent.detail==2){return true}if(t==mxEvent.MOUSE_UP&&this.isMouseDown){this.isMouseDown=false}else if(t==mxEvent.MOUSE_DOWN&&!this.isMouseDown){this.isMouseDown=true;this.isMouseTrigger=n}else if(!r&&((!mxClient.IS_FF||t!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=n||t==mxEvent.MOUSE_DOWN&&this.isMouseDown||t==mxEvent.MOUSE_UP&&!this.isMouseDown)){r=true}if(!r&&t==mxEvent.MOUSE_DOWN){this.lastMouseX=e.getX();this.lastMouseY=e.getY()}return r};mxGraph.prototype.isSyntheticEventIgnored=function(t,e,i){var n=false;var r=mxEvent.isMouseEvent(e.getEvent());if(this.ignoreMouseEvents&&r&&t!=mxEvent.MOUSE_MOVE){this.ignoreMouseEvents=t!=mxEvent.MOUSE_UP;n=true}else if(mxClient.IS_FF&&!r&&t==mxEvent.MOUSE_UP){this.ignoreMouseEvents=true}return n};mxGraph.prototype.isEventSourceIgnored=function(t,e){var i=e.getSource();var n=i.nodeName!=null?i.nodeName.toLowerCase():"";var r=!mxEvent.isMouseEvent(e.getEvent())||mxEvent.isLeftMouseButton(e.getEvent());return t==mxEvent.MOUSE_DOWN&&r&&(n=="select"||n=="option"||n=="input"&&i.type!="checkbox"&&i.type!="radio"&&i.type!="button"&&i.type!="submit"&&i.type!="file")};mxGraph.prototype.getEventState=function(t){return t};mxGraph.prototype.fireMouseEvent=function(t,e,i){if(this.isEventSourceIgnored(t,e)){if(this.tooltipHandler!=null){this.tooltipHandler.hide()}return}if(i==null){i=this}e=this.updateMouseEvent(e,t);if(!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(e.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))){var n=(new Date).getTime();if(!mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_DOWN||mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_UP&&!this.fireDoubleClick){if(this.lastTouchEvent!=null&&this.lastTouchEvent!=e.getEvent()&&n-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance&&this.doubleClickCounter<2){this.doubleClickCounter++;var r=false;if(t==mxEvent.MOUSE_UP){if(e.getCell()==this.lastTouchCell&&this.lastTouchCell!=null){this.lastTouchTime=0;var s=this.lastTouchCell;this.lastTouchCell=null;if(mxClient.IS_QUIRKS){e.getSource().fireEvent("ondblclick")}this.dblClick(e.getEvent(),s);r=true}}else{this.fireDoubleClick=true;this.lastTouchTime=0}if(!mxClient.IS_QUIRKS||r){mxEvent.consume(e.getEvent());return}}else if(this.lastTouchEvent==null||this.lastTouchEvent!=e.getEvent()){this.lastTouchCell=e.getCell();this.lastTouchX=e.getX();this.lastTouchY=e.getY();this.lastTouchTime=n;this.lastTouchEvent=e.getEvent();this.doubleClickCounter=0}}else if((this.isMouseDown||t==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=false;var s=this.lastTouchCell;this.lastTouchCell=null;this.isMouseDown=false;var l=s!=null||(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF);if(l&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance){this.dblClick(e.getEvent(),s)}else{mxEvent.consume(e.getEvent())}return}}if(!this.isEventIgnored(t,e,i)){e.state=this.getEventState(e.getState());this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",t,"event",e));if(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE11||mxClient.IS_IE&&mxClient.IS_SVG||e.getEvent().target!=this.container){if(t==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(e.getEvent)){this.scrollPointToVisible(e.getGraphX(),e.getGraphY(),this.autoExtend)}else if(t==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(this.container.scrollLeft!=0||this.container.scrollTop!=0)){var a=this.view.scale;var o=this.view.translate;this.view.setTranslate(o.x-this.container.scrollLeft/a,o.y-this.container.scrollTop/a);this.container.scrollLeft=0;this.container.scrollTop=0}if(this.mouseListeners!=null){var h=[i,e];if(!e.getEvent().preventDefault){e.getEvent().returnValue=true}for(var u=0;u<this.mouseListeners.length;u++){var d=this.mouseListeners[u];if(t==mxEvent.MOUSE_DOWN){d.mouseDown.apply(d,h)}else if(t==mxEvent.MOUSE_MOVE){d.mouseMove.apply(d,h)}else if(t==mxEvent.MOUSE_UP){d.mouseUp.apply(d,h)}}}if(t==mxEvent.MOUSE_UP){this.click(e)}}if((mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&t==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress){this.tapAndHoldInProgress=true;this.initialTouchX=e.getGraphX();this.initialTouchY=e.getGraphY();var p=function(){if(this.tapAndHoldValid){this.tapAndHold(e)}this.tapAndHoldInProgress=false;this.tapAndHoldValid=false};if(this.tapAndHoldThread){window.clearTimeout(this.tapAndHoldThread)}this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,p),this.tapAndHoldDelay);this.tapAndHoldValid=true}else if(t==mxEvent.MOUSE_UP){this.tapAndHoldInProgress=false;this.tapAndHoldValid=false}else if(this.tapAndHoldValid){this.tapAndHoldValid=Math.abs(this.initialTouchX-e.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-e.getGraphY())<this.tolerance}if(t==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(e.getEvent())){this.stopEditing(!this.isInvokesStopCellEditing())}this.consumeMouseEvent(t,e,i)}};mxGraph.prototype.consumeMouseEvent=function(t,e,i){if(t==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(e.getEvent())){e.consume(false)}};mxGraph.prototype.fireGestureEvent=function(t,e){this.lastTouchTime=0;this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",t,"cell",e))};mxGraph.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;if(this.tooltipHandler!=null){this.tooltipHandler.destroy()}if(this.selectionCellsHandler!=null){this.selectionCellsHandler.destroy()}if(this.panningHandler!=null){this.panningHandler.destroy()}if(this.popupMenuHandler!=null){this.popupMenuHandler.destroy()}if(this.connectionHandler!=null){this.connectionHandler.destroy()}if(this.graphHandler!=null){this.graphHandler.destroy()}if(this.cellEditor!=null){this.cellEditor.destroy()}if(this.view!=null){this.view.destroy()}if(this.model!=null&&this.graphModelChangeListener!=null){this.model.removeListener(this.graphModelChangeListener);this.graphModelChangeListener=null}this.container=null}};__mxOutput.mxGraph=typeof mxGraph!=="undefined"?mxGraph:undefined;function mxCellOverlay(t,e,i,n,r,s){this.image=t;this.tooltip=e;this.align=i!=null?i:this.align;this.verticalAlign=n!=null?n:this.verticalAlign;this.offset=r!=null?r:new mxPoint;this.cursor=s!=null?s:"help"}mxCellOverlay.prototype=new mxEventSource;mxCellOverlay.prototype.constructor=mxCellOverlay;mxCellOverlay.prototype.image=null;mxCellOverlay.prototype.tooltip=null;mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT;mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM;mxCellOverlay.prototype.offset=null;mxCellOverlay.prototype.cursor=null;mxCellOverlay.prototype.defaultOverlap=.5;mxCellOverlay.prototype.getBounds=function(t){var e=t.view.graph.getModel().isEdge(t.cell);var i=t.view.scale;var n=null;var r=this.image.width;var s=this.image.height;if(e){var l=t.absolutePoints;if(l.length%2==1){n=l[Math.floor(l.length/2)]}else{var a=l.length/2;var o=l[a-1];var h=l[a];n=new mxPoint(o.x+(h.x-o.x)/2,o.y+(h.y-o.y)/2)}}else{n=new mxPoint;if(this.align==mxConstants.ALIGN_LEFT){n.x=t.x}else if(this.align==mxConstants.ALIGN_CENTER){n.x=t.x+t.width/2}else{n.x=t.x+t.width}if(this.verticalAlign==mxConstants.ALIGN_TOP){n.y=t.y}else if(this.verticalAlign==mxConstants.ALIGN_MIDDLE){n.y=t.y+t.height/2}else{n.y=t.y+t.height}}return new mxRectangle(Math.round(n.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(n.y-(s*this.defaultOverlap-this.offset.y)*i),r*i,s*i)};mxCellOverlay.prototype.toString=function(){return this.tooltip};__mxOutput.mxCellOverlay=typeof mxCellOverlay!=="undefined"?mxCellOverlay:undefined;function mxOutline(t,e){this.source=t;if(e!=null){this.init(e)}}mxOutline.prototype.source=null;mxOutline.prototype.outline=null;mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER;mxOutline.prototype.enabled=true;mxOutline.prototype.showViewport=true;mxOutline.prototype.border=10;mxOutline.prototype.sizerSize=8;mxOutline.prototype.labelsVisible=false;mxOutline.prototype.updateOnPan=false;mxOutline.prototype.sizerImage=null;mxOutline.prototype.minScale=1e-4;mxOutline.prototype.suspended=false;mxOutline.prototype.forceVmlHandles=document.documentMode==8;mxOutline.prototype.createGraph=function(t){var e=new mxGraph(t,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet());e.foldingEnabled=false;e.autoScroll=false;return e};mxOutline.prototype.init=function(t){this.outline=this.createGraph(t);var e=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,(function(t){if(!this.suspended&&this.outline!=null){e.apply(this.outline,arguments)}}));if(mxClient.IS_SVG){var i=this.outline.getView().getCanvas().parentNode;i.setAttribute("shape-rendering","optimizeSpeed");i.setAttribute("image-rendering","optimizeSpeed")}this.outline.labelsVisible=this.labelsVisible;this.outline.setEnabled(false);this.updateHandler=mxUtils.bind(this,(function(t,e){if(!this.suspended&&!this.active){this.update()}}));this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler);this.outline.addMouseListener(this);var n=this.source.getView();n.addListener(mxEvent.SCALE,this.updateHandler);n.addListener(mxEvent.TRANSLATE,this.updateHandler);n.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler);n.addListener(mxEvent.DOWN,this.updateHandler);n.addListener(mxEvent.UP,this.updateHandler);mxEvent.addListener(this.source.container,"scroll",this.updateHandler);this.panHandler=mxUtils.bind(this,(function(t){if(this.updateOnPan){this.updateHandler.apply(this,arguments)}}));this.source.addListener(mxEvent.PAN,this.panHandler);this.refreshHandler=mxUtils.bind(this,(function(t){this.outline.setStylesheet(this.source.getStylesheet());this.outline.refresh()}));this.source.addListener(mxEvent.REFRESH,this.refreshHandler);this.bounds=new mxRectangle(0,0,0,0);this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH);this.selectionBorder.dialect=this.outline.dialect;if(this.forceVmlHandles){this.selectionBorder.isHtmlAllowed=function(){return false}}this.selectionBorder.init(this.outline.getView().getOverlayPane());var r=mxUtils.bind(this,(function(t){var e=mxEvent.getSource(t);var i=mxUtils.bind(this,(function(t){this.outline.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}));var n=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(e,null,i,n);this.outline.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}));mxEvent.addGestureListeners(e,null,i,n);this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}));mxEvent.addGestureListeners(this.selectionBorder.node,r);this.sizer=this.createSizer();if(this.forceVmlHandles){this.sizer.isHtmlAllowed=function(){return false}}this.sizer.init(this.outline.getView().getOverlayPane());if(this.enabled){this.sizer.node.style.cursor="nwse-resize"}mxEvent.addGestureListeners(this.sizer.node,r);this.selectionBorder.node.style.display=this.showViewport?"":"none";this.sizer.node.style.display=this.selectionBorder.node.style.display;this.selectionBorder.node.style.cursor="move";this.update(false)};mxOutline.prototype.isEnabled=function(){return this.enabled};mxOutline.prototype.setEnabled=function(t){this.enabled=t};mxOutline.prototype.setZoomEnabled=function(t){this.sizer.node.style.visibility=t?"visible":"hidden"};mxOutline.prototype.refresh=function(){this.update(true)};mxOutline.prototype.createSizer=function(){if(this.sizerImage!=null){var t=new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src);t.dialect=this.outline.dialect;return t}else{var t=new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);t.dialect=this.outline.dialect;return t}};mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)};mxOutline.prototype.getOutlineOffset=function(t){return null};mxOutline.prototype.getSourceGraphBounds=function(){return this.source.getGraphBounds()};mxOutline.prototype.update=function(t){if(this.source!=null&&this.source.container!=null&&this.outline!=null&&this.outline.container!=null){var e=this.source.view.scale;var i=this.getSourceGraphBounds();var n=new mxRectangle(i.x/e+this.source.panDx,i.y/e+this.source.panDy,i.width/e,i.height/e);var r=new mxRectangle(0,0,this.source.container.clientWidth/e,this.source.container.clientHeight/e);var s=n.clone();s.add(r);var l=this.getSourceContainerSize();var a=Math.max(l.width/e,s.width);var o=Math.max(l.height/e,s.height);var h=Math.max(0,this.outline.container.clientWidth-this.border);var u=Math.max(0,this.outline.container.clientHeight-this.border);var d=Math.min(h/a,u/o);var p=isNaN(d)?this.minScale:Math.max(this.minScale,d);if(p>0){if(this.outline.getView().scale!=p){this.outline.getView().scale=p;t=true}var m=this.outline.getView();if(m.currentRoot!=this.source.getView().currentRoot){m.setCurrentRoot(this.source.getView().currentRoot)}var c=this.source.view.translate;var x=c.x+this.source.panDx;var f=c.y+this.source.panDy;var g=this.getOutlineOffset(p);if(g!=null){x+=g.x;f+=g.y}if(n.x<0){x=x-n.x}if(n.y<0){f=f-n.y}if(m.translate.x!=x||m.translate.y!=f){m.translate.x=x;m.translate.y=f;t=true}var v=m.translate;p=this.source.getView().scale;var y=p/m.scale;var C=1/m.scale;var E=this.source.container;this.bounds=new mxRectangle((v.x-c.x-this.source.panDx)/C,(v.y-c.y-this.source.panDy)/C,E.clientWidth/y,E.clientHeight/y);this.bounds.x+=this.source.container.scrollLeft*m.scale/p;this.bounds.y+=this.source.container.scrollTop*m.scale/p;var S=this.selectionBorder.bounds;if(S.x!=this.bounds.x||S.y!=this.bounds.y||S.width!=this.bounds.width||S.height!=this.bounds.height){this.selectionBorder.bounds=this.bounds;this.selectionBorder.redraw()}var S=this.sizer.bounds;var b=new mxRectangle(this.bounds.x+this.bounds.width-S.width/2,this.bounds.y+this.bounds.height-S.height/2,S.width,S.height);if(S.x!=b.x||S.y!=b.y||S.width!=b.width||S.height!=b.height){this.sizer.bounds=b;if(this.sizer.node.style.visibility!="hidden"){this.sizer.redraw()}}if(t){this.outline.view.revalidate()}}}};mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=!mxEvent.isMouseEvent(e.getEvent())?this.source.tolerance:0;var n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||n!=null&&mxUtils.intersects(shape.bounds,n);this.startX=e.getX();this.startY=e.getY();this.active=true;if(this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)){this.dx0=this.source.container.scrollLeft;this.dy0=this.source.container.scrollTop}else{this.dx0=0;this.dy0=0}}e.consume()};mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none";this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e);var n=i.x;var r=i.y;var s=null;if(!this.zoom){var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=s;this.selectionBorder.redraw();n/=l;n*=this.source.getView().scale;r/=l;r*=this.source.getView().scale;this.source.panGraph(-n-this.dx0,-r-this.dy0)}else{var a=this.source.container;var o=a.clientWidth/a.clientHeight;r=n/o;s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r));this.selectionBorder.bounds=s;this.selectionBorder.redraw()}var h=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-h.width/2,s.y+s.height-h.height/2,h.width,h.height);if(this.sizer.node.style.visibility!="hidden"){this.sizer.redraw()}e.consume()}};mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)};mxOutline.prototype.mouseUp=function(t,e){if(this.active){var i=this.getTranslateForEvent(e);var n=i.x;var r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(!this.zoom){if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0);n/=this.outline.getView().scale;r/=this.outline.getView().scale;var s=this.source.getView().translate;this.source.getView().setTranslate(s.x-n,s.y-r)}}else{var l=this.selectionBorder.bounds.width;var a=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,a-n*a/l),false)}this.update();e.consume()}this.index=null;this.active=false}};mxOutline.prototype.destroy=function(){if(this.source!=null){this.source.removeListener(this.panHandler);this.source.removeListener(this.refreshHandler);this.source.getModel().removeListener(this.updateHandler);this.source.getView().removeListener(this.updateHandler);mxEvent.removeListener(this.source.container,"scroll",this.updateHandler);this.source=null}if(this.outline!=null){this.outline.removeMouseListener(this);this.outline.destroy();this.outline=null}if(this.selectionBorder!=null){this.selectionBorder.destroy();this.selectionBorder=null}if(this.sizer!=null){this.sizer.destroy();this.sizer=null}};__mxOutput.mxOutline=typeof mxOutline!=="undefined"?mxOutline:undefined;function mxMultiplicity(t,e,i,n,r,s,l,a,o,h){this.source=t;this.type=e;this.attr=i;this.value=n;this.min=r!=null?r:0;this.max=s!=null?s:"n";this.validNeighbors=l;this.countError=mxResources.get(a)||a;this.typeError=mxResources.get(o)||o;this.validNeighborsAllowed=h!=null?h:true}mxMultiplicity.prototype.type=null;mxMultiplicity.prototype.attr=null;mxMultiplicity.prototype.value=null;mxMultiplicity.prototype.source=null;mxMultiplicity.prototype.min=null;mxMultiplicity.prototype.max=null;mxMultiplicity.prototype.validNeighbors=null;mxMultiplicity.prototype.validNeighborsAllowed=true;mxMultiplicity.prototype.countError=null;mxMultiplicity.prototype.typeError=null;mxMultiplicity.prototype.check=function(t,e,i,n,r,s){var l="";if(this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e)){if(this.countError!=null&&(this.source&&(this.max==0||r>=this.max)||!this.source&&(this.max==0||s>=this.max))){l+=this.countError+"\n"}if(this.validNeighbors!=null&&this.typeError!=null&&this.validNeighbors.length>0){var a=this.checkNeighbors(t,e,i,n);if(!a){l+=this.typeError+"\n"}}}return l.length>0?l:null};mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){var r=t.model.getValue(i);var s=t.model.getValue(n);var l=!this.validNeighborsAllowed;var a=this.validNeighbors;for(var o=0;o<a.length;o++){if(this.source&&this.checkType(t,s,a[o])){l=this.validNeighborsAllowed;break}else if(!this.source&&this.checkType(t,r,a[o])){l=this.validNeighborsAllowed;break}}return l};mxMultiplicity.prototype.checkTerminal=function(t,e,i){var n=t.model.getValue(e);return this.checkType(t,n,this.type,this.attr,this.value)};mxMultiplicity.prototype.checkType=function(t,e,i,n,r){if(e!=null){if(!isNaN(e.nodeType)){return mxUtils.isNode(e,i,n,r)}else{return e==i}}return false};__mxOutput.mxMultiplicity=typeof mxMultiplicity!=="undefined"?mxMultiplicity:undefined;function mxLayoutManager(t){this.undoHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.beforeUndo(e.getProperty("edit"))}}));this.moveHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.cellsMoved(e.getProperty("cells"),e.getProperty("event"))}}));this.resizeHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.cellsResized(e.getProperty("cells"),e.getProperty("bounds"),e.getProperty("previous"))}}));this.setGraph(t)}mxLayoutManager.prototype=new mxEventSource;mxLayoutManager.prototype.constructor=mxLayoutManager;mxLayoutManager.prototype.graph=null;mxLayoutManager.prototype.bubbling=true;mxLayoutManager.prototype.enabled=true;mxLayoutManager.prototype.undoHandler=null;mxLayoutManager.prototype.moveHandler=null;mxLayoutManager.prototype.resizeHandler=null;mxLayoutManager.prototype.isEnabled=function(){return this.enabled};mxLayoutManager.prototype.setEnabled=function(t){this.enabled=t};mxLayoutManager.prototype.isBubbling=function(){return this.bubbling};mxLayoutManager.prototype.setBubbling=function(t){this.bubbling=t};mxLayoutManager.prototype.getGraph=function(){return this.graph};mxLayoutManager.prototype.setGraph=function(t){if(this.graph!=null){var e=this.graph.getModel();e.removeListener(this.undoHandler);this.graph.removeListener(this.moveHandler);this.graph.removeListener(this.resizeHandler)}this.graph=t;if(this.graph!=null){var e=this.graph.getModel();e.addListener(mxEvent.BEFORE_UNDO,this.undoHandler);this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler);this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler)}};mxLayoutManager.prototype.hasLayout=function(t){return this.getLayout(t,mxEvent.LAYOUT_CELLS)};mxLayoutManager.prototype.getLayout=function(t,e){return null};mxLayoutManager.prototype.beforeUndo=function(t){this.executeLayoutForCells(this.getCellsForChanges(t.changes))};mxLayoutManager.prototype.cellsMoved=function(t,e){if(t!=null&&e!=null){var i=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e));var n=this.getGraph().getModel();for(var r=0;r<t.length;r++){var s=this.getLayout(n.getParent(t[r]),mxEvent.MOVE_CELLS);if(s!=null){s.moveCell(t[r],i.x,i.y)}}}};mxLayoutManager.prototype.cellsResized=function(t,e,i){if(t!=null&&e!=null){var n=this.getGraph().getModel();for(var r=0;r<t.length;r++){var s=this.getLayout(n.getParent(t[r]),mxEvent.RESIZE_CELLS);if(s!=null){s.resizeCell(t[r],e[r],i[r])}}}};mxLayoutManager.prototype.getCellsForChanges=function(t){var e=[];for(var i=0;i<t.length;i++){var n=t[i];if(n instanceof mxRootChange){return[]}else{e=e.concat(this.getCellsForChange(n))}}return e};mxLayoutManager.prototype.getCellsForChange=function(t){if(t instanceof mxChildChange){return this.addCellsWithLayout(t.child,this.addCellsWithLayout(t.previous))}else if(t instanceof mxTerminalChange||t instanceof mxGeometryChange){return this.addCellsWithLayout(t.cell)}else if(t instanceof mxVisibleChange||t instanceof mxStyleChange){return this.addCellsWithLayout(t.cell)}return[]};mxLayoutManager.prototype.addCellsWithLayout=function(t,e){return this.addDescendantsWithLayout(t,this.addAncestorsWithLayout(t,e))};mxLayoutManager.prototype.addAncestorsWithLayout=function(t,e){e=e!=null?e:[];if(t!=null){var i=this.hasLayout(t);if(i!=null){e.push(t)}if(this.isBubbling()){var n=this.getGraph().getModel();this.addAncestorsWithLayout(n.getParent(t),e)}}return e};mxLayoutManager.prototype.addDescendantsWithLayout=function(t,e){e=e!=null?e:[];if(t!=null&&this.hasLayout(t)){var i=this.getGraph().getModel();for(var n=0;n<i.getChildCount(t);n++){var r=i.getChildAt(t,n);if(this.hasLayout(r)){e.push(r);this.addDescendantsWithLayout(r,e)}}}return e};mxLayoutManager.prototype.executeLayoutForCells=function(t){var e=mxUtils.sortCells(t,false);this.layoutCells(e,true);this.layoutCells(e.reverse(),false)};mxLayoutManager.prototype.layoutCells=function(t,e){if(t.length>0){var i=this.getGraph().getModel();i.beginUpdate();try{var n=null;for(var r=0;r<t.length;r++){if(t[r]!=i.getRoot()&&t[r]!=n){this.executeLayout(t[r],e);n=t[r]}}this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",t))}finally{i.endUpdate()}}};mxLayoutManager.prototype.executeLayout=function(t,e){var i=this.getLayout(t,e?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);if(i!=null){i.execute(t)}};mxLayoutManager.prototype.destroy=function(){this.setGraph(null)};__mxOutput.mxLayoutManager=typeof mxLayoutManager!=="undefined"?mxLayoutManager:undefined;function mxSwimlaneManager(t,e,i,n){this.horizontal=e!=null?e:true;this.addEnabled=i!=null?i:true;this.resizeEnabled=n!=null?n:true;this.addHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()&&this.isAddEnabled()){this.cellsAdded(e.getProperty("cells"))}}));this.resizeHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()&&this.isResizeEnabled()){this.cellsResized(e.getProperty("cells"))}}));this.setGraph(t)}mxSwimlaneManager.prototype=new mxEventSource;mxSwimlaneManager.prototype.constructor=mxSwimlaneManager;mxSwimlaneManager.prototype.graph=null;mxSwimlaneManager.prototype.enabled=true;mxSwimlaneManager.prototype.horizontal=true;mxSwimlaneManager.prototype.addEnabled=true;mxSwimlaneManager.prototype.resizeEnabled=true;mxSwimlaneManager.prototype.addHandler=null;mxSwimlaneManager.prototype.resizeHandler=null;mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled};mxSwimlaneManager.prototype.setEnabled=function(t){this.enabled=t};mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal};mxSwimlaneManager.prototype.setHorizontal=function(t){this.horizontal=t};mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled};mxSwimlaneManager.prototype.setAddEnabled=function(t){this.addEnabled=t};mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled};mxSwimlaneManager.prototype.setResizeEnabled=function(t){this.resizeEnabled=t};mxSwimlaneManager.prototype.getGraph=function(){return this.graph};mxSwimlaneManager.prototype.setGraph=function(t){if(this.graph!=null){this.graph.removeListener(this.addHandler);this.graph.removeListener(this.resizeHandler)}this.graph=t;if(this.graph!=null){this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler);this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler)}};mxSwimlaneManager.prototype.isSwimlaneIgnored=function(t){return!this.getGraph().isSwimlane(t)};mxSwimlaneManager.prototype.isCellHorizontal=function(t){if(this.graph.isSwimlane(t)){var e=this.graph.getCellStyle(t);return mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)==1}return!this.isHorizontal()};mxSwimlaneManager.prototype.cellsAdded=function(t){if(t!=null){var e=this.getGraph().getModel();e.beginUpdate();try{for(var i=0;i<t.length;i++){if(!this.isSwimlaneIgnored(t[i])){this.swimlaneAdded(t[i])}}}finally{e.endUpdate()}}};mxSwimlaneManager.prototype.swimlaneAdded=function(t){var e=this.getGraph().getModel();var i=e.getParent(t);var n=e.getChildCount(i);var r=null;for(var s=0;s<n;s++){var l=e.getChildAt(i,s);if(l!=t&&!this.isSwimlaneIgnored(l)){r=e.getGeometry(l);if(r!=null){break}}}if(r!=null){var a=i!=null?this.isCellHorizontal(i):this.horizontal;this.resizeSwimlane(t,r.width,r.height,a)}};mxSwimlaneManager.prototype.cellsResized=function(t){if(t!=null){var e=this.getGraph().getModel();e.beginUpdate();try{for(var i=0;i<t.length;i++){if(!this.isSwimlaneIgnored(t[i])){var n=e.getGeometry(t[i]);if(n!=null){var r=new mxRectangle(0,0,n.width,n.height);var s=t[i];var l=s;while(l!=null){s=l;l=e.getParent(l);var a=this.graph.isSwimlane(l)?this.graph.getStartSize(l):new mxRectangle;r.width+=a.width;r.height+=a.height}var o=l!=null?this.isCellHorizontal(l):this.horizontal;this.resizeSwimlane(s,r.width,r.height,o)}}}}finally{e.endUpdate()}}};mxSwimlaneManager.prototype.resizeSwimlane=function(t,e,i,n){var r=this.getGraph().getModel();r.beginUpdate();try{var s=this.isCellHorizontal(t);if(!this.isSwimlaneIgnored(t)){var l=r.getGeometry(t);if(l!=null){if(n&&l.height!=i||!n&&l.width!=e){l=l.clone();if(n){l.height=i}else{l.width=e}r.setGeometry(t,l)}}}var a=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;e-=a.width;i-=a.height;var o=r.getChildCount(t);for(var h=0;h<o;h++){var u=r.getChildAt(t,h);this.resizeSwimlane(u,e,i,s)}}finally{r.endUpdate()}};mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)};__mxOutput.mxSwimlaneManager=typeof mxSwimlaneManager!=="undefined"?mxSwimlaneManager:undefined;function mxTemporaryCellStates(t,e,i,n,r){e=e!=null?e:1;this.view=t;this.oldValidateCellState=t.validateCellState;this.oldBounds=t.getGraphBounds();this.oldStates=t.getStates();this.oldScale=t.getScale();this.oldDoRedrawShape=t.graph.cellRenderer.doRedrawShape;var s=this;if(r!=null){t.graph.cellRenderer.doRedrawShape=function(e){var i=e.shape.paint;e.shape.paint=function(t){var n=r(e);if(n!=null){t.setLink(n)}i.apply(this,arguments);if(n!=null){t.setLink(null)}};s.oldDoRedrawShape.apply(t.graph.cellRenderer,arguments);e.shape.paint=i}}t.validateCellState=function(e,i){if(e==null||n==null||n(e)){return s.oldValidateCellState.apply(t,arguments)}return null};t.setStates(new mxDictionary);t.setScale(e);if(i!=null){t.resetValidationState();var l=null;for(var a=0;a<i.length;a++){var o=t.getBoundingBox(t.validateCellState(t.validateCell(i[a])));if(l==null){l=o}else{l.add(o)}}t.setGraphBounds(l||new mxRectangle)}}mxTemporaryCellStates.prototype.view=null;mxTemporaryCellStates.prototype.oldStates=null;mxTemporaryCellStates.prototype.oldBounds=null;mxTemporaryCellStates.prototype.oldScale=null;mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale);this.view.setStates(this.oldStates);this.view.setGraphBounds(this.oldBounds);this.view.validateCellState=this.oldValidateCellState;this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape};__mxOutput.mxTemporaryCellStates=typeof mxTemporaryCellStates!=="undefined"?mxTemporaryCellStates:undefined;function mxCellStatePreview(t){this.deltas=new mxDictionary;this.graph=t}mxCellStatePreview.prototype.graph=null;mxCellStatePreview.prototype.deltas=null;mxCellStatePreview.prototype.count=0;mxCellStatePreview.prototype.isEmpty=function(){return this.count==0};mxCellStatePreview.prototype.moveState=function(t,e,i,n,r){n=n!=null?n:true;r=r!=null?r:true;var s=this.deltas.get(t.cell);if(s==null){s={point:new mxPoint(e,i),state:t};this.deltas.put(t.cell,s);this.count++}else if(n){s.point.x+=e;s.point.y+=i}else{s.point.x=e;s.point.y=i}if(r){this.addEdges(t)}return s.point};mxCellStatePreview.prototype.show=function(t){this.deltas.visit(mxUtils.bind(this,(function(t,e){this.translateState(e.state,e.point.x,e.point.y)})));this.deltas.visit(mxUtils.bind(this,(function(e,i){this.revalidateState(i.state,i.point.x,i.point.y,t)})))};mxCellStatePreview.prototype.translateState=function(t,e,i){if(t!=null){var n=this.graph.getModel();if(n.isVertex(t.cell)){t.view.updateCellState(t);var r=n.getGeometry(t.cell);if((e!=0||i!=0)&&r!=null&&(!r.relative||this.deltas.get(t.cell)!=null)){t.x+=e;t.y+=i}}var s=n.getChildCount(t.cell);for(var l=0;l<s;l++){this.translateState(t.view.getState(n.getChildAt(t.cell,l)),e,i)}}};mxCellStatePreview.prototype.revalidateState=function(t,e,i,n){if(t!=null){var r=this.graph.getModel();if(r.isEdge(t.cell)){t.view.updateCellState(t)}var s=this.graph.getCellGeometry(t.cell);var l=t.view.getState(r.getParent(t.cell));if((e!=0||i!=0)&&s!=null&&s.relative&&r.isVertex(t.cell)&&(l==null||r.isVertex(l.cell)||this.deltas.get(t.cell)!=null)){t.x+=e;t.y+=i}this.graph.cellRenderer.redraw(t);if(n!=null){n(t)}var a=r.getChildCount(t.cell);for(var o=0;o<a;o++){this.revalidateState(this.graph.view.getState(r.getChildAt(t.cell,o)),e,i,n)}}};mxCellStatePreview.prototype.addEdges=function(t){var e=this.graph.getModel();var i=e.getEdgeCount(t.cell);for(var n=0;n<i;n++){var r=t.view.getState(e.getEdgeAt(t.cell,n));if(r!=null){this.moveState(r,0,0)}}};__mxOutput.mxCellStatePreview=typeof mxCellStatePreview!=="undefined"?mxCellStatePreview:undefined;function mxConnectionConstraint(t,e,i,n,r){this.point=t;this.perimeter=e!=null?e:true;this.name=i;this.dx=n?n:0;this.dy=r?r:0}mxConnectionConstraint.prototype.point=null;mxConnectionConstraint.prototype.perimeter=null;mxConnectionConstraint.prototype.name=null;mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=null;__mxOutput.mxConnectionConstraint=typeof mxConnectionConstraint!=="undefined"?mxConnectionConstraint:undefined;function mxGraphHandler(t){this.graph=t;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,(function(){if(!this.suspended){this.updatePreview();this.updateHint()}}));this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,(function(t,e){this.reset()}));this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,(function(t,e){if(this.refreshThread){window.clearTimeout(this.refreshThread)}this.refreshThread=window.setTimeout(mxUtils.bind(this,(function(){this.refreshThread=null;if(this.first!=null&&!this.suspended){var t=this.currentDx;var e=this.currentDy;this.currentDx=0;this.currentDy=0;this.updatePreview();this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);if(this.pBounds==null&&!this.livePreviewUsed){this.reset()}else{this.currentDx=t;this.currentDy=e;this.updatePreview();this.updateHint();if(this.livePreviewUsed){this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),false,true);this.updatePreview()}}}})),0)}));this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.addListener(mxEvent.REFRESH,this.refreshHandler);this.keyHandler=mxUtils.bind(this,(function(t){if(this.graph.container!=null&&this.graph.container.style.visibility!="hidden"&&this.first!=null&&!this.suspended){var e=this.graph.isCloneEvent(t)&&this.graph.isCellsCloneable()&&this.isCloneEnabled();if(e!=this.cloning){this.cloning=e;this.checkPreview();this.updatePreview()}}}));mxEvent.addListener(document,"keydown",this.keyHandler);mxEvent.addListener(document,"keyup",this.keyHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50;mxGraphHandler.prototype.enabled=true;mxGraphHandler.prototype.highlightEnabled=true;mxGraphHandler.prototype.cloneEnabled=true;mxGraphHandler.prototype.moveEnabled=true;mxGraphHandler.prototype.guidesEnabled=false;mxGraphHandler.prototype.handlesVisible=true;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=true;mxGraphHandler.prototype.selectEnabled=true;mxGraphHandler.prototype.removeCellsFromParent=true;mxGraphHandler.prototype.removeEmptyParents=false;mxGraphHandler.prototype.connectOnDrop=false;mxGraphHandler.prototype.scrollOnMove=true;mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=false;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=false;mxGraphHandler.prototype.rotationEnabled=true;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(t){this.enabled=t};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};mxGraphHandler.prototype.setCloneEnabled=function(t){this.cloneEnabled=t};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};mxGraphHandler.prototype.setMoveEnabled=function(t){this.moveEnabled=t};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(t){this.selectEnabled=t};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(t){this.removeCellsFromParent=t};mxGraphHandler.prototype.isPropagateSelectionCell=function(t,e,i){var n=this.graph.model.getParent(t);if(e){var r=this.graph.model.isEdge(t)?null:this.graph.getCellGeometry(t);return!this.graph.isSiblingSelected(t)&&(r!=null&&r.relative||!this.graph.isSwimlane(n))}else{return(!this.graph.isToggleEvent(i.getEvent())||(!this.graph.isSiblingSelected(t)&&!this.graph.isCellSelected(t)&&!this.graph.isSwimlane(n)||this.graph.isCellSelected(n)))&&(this.graph.isToggleEvent(i.getEvent())||!this.graph.isCellSelected(n))}};mxGraphHandler.prototype.getInitialCellForEvent=function(t){var e=t.getState();if((!this.graph.isToggleEvent(t.getEvent())||!mxEvent.isAltDown(t.getEvent()))&&e!=null&&!this.graph.isCellSelected(e.cell)){var i=this.graph.model;var n=this.graph.view.getState(i.getParent(e.cell));while(n!=null&&!this.graph.isCellSelected(n.cell)&&(i.isVertex(n.cell)||i.isEdge(n.cell))&&this.isPropagateSelectionCell(e.cell,true,t)){e=n;n=this.graph.view.getState(this.graph.getModel().getParent(e.cell))}}return e!=null?e.cell:null};mxGraphHandler.prototype.isDelayedSelection=function(t,e){if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent())){while(t!=null){if(this.graph.selectionCellsHandler.isHandled(t)){return this.graph.cellEditor.getEditingCell()!=t}t=this.graph.model.getParent(t)}}return this.graph.isToggleEvent(e.getEvent())&&!mxEvent.isAltDown(e.getEvent())};mxGraphHandler.prototype.selectDelayed=function(t){if(!this.graph.popupMenuHandler.isPopupTrigger(t)){var e=t.getCell();if(e==null){e=this.cell}this.selectCellForEvent(e,t)}};mxGraphHandler.prototype.selectCellForEvent=function(t,e){var i=this.graph.view.getState(t);if(i!=null){if(e.isSource(i.control)){this.graph.selectCellForEvent(t,e.getEvent())}else{if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent())){var n=this.graph.getModel();var r=n.getParent(t);while(this.graph.view.getState(r)!=null&&(n.isVertex(r)||n.isEdge(r))&&this.isPropagateSelectionCell(t,false,e)){t=r;r=n.getParent(t)}}this.graph.selectCellForEvent(t,e.getEvent())}}return t};mxGraphHandler.prototype.consumeMouseEvent=function(t,e){e.consume()};mxGraphHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&e.getState()!=null&&!mxEvent.isMultiTouchEvent(e.getEvent())){var i=this.getInitialCellForEvent(e);this.delayedSelection=this.isDelayedSelection(i,e);this.cell=null;if(this.isSelectEnabled()&&!this.delayedSelection){this.graph.selectCellForEvent(i,e.getEvent())}if(this.isMoveEnabled()){var n=this.graph.model;var r=n.getGeometry(i);if(this.graph.isCellMovable(i)&&(!n.isEdge(i)||this.graph.getSelectionCount()>1||r.points!=null&&r.points.length>0||n.getTerminal(i,true)==null||n.getTerminal(i,false)==null||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())){this.start(i,e.getX(),e.getY())}else if(this.delayedSelection){this.cell=i}this.cellWasClicked=true;this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}};mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent();var e=this.graph.getModel();var i=mxUtils.bind(this,(function(t){return this.graph.view.getState(t)!=null&&e.isVertex(t)&&e.getGeometry(t)!=null&&!e.getGeometry(t).relative}));return this.graph.view.getCellStates(e.filterDescendants(i,t))};mxGraphHandler.prototype.getCells=function(t){if(!this.delayedSelection&&this.graph.isCellMovable(t)){return[t]}else{return this.graph.getMovableCells(this.graph.getSelectionCells())}};mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(e!=null){e.width=Math.max(0,e.width-1);e.height=Math.max(0,e.height-1);if(e.width<this.minimumSize){var i=this.minimumSize-e.width;e.x-=i/2;e.width=this.minimumSize}else{e.x=Math.round(e.x);e.width=Math.ceil(e.width)}if(e.height<this.minimumSize){var n=this.minimumSize-e.height;e.y-=n/2;e.height=this.minimumSize}else{e.y=Math.round(e.y);e.height=Math.ceil(e.height)}}return e};mxGraphHandler.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){var i=this.graph.getModel();for(var n=0;n<t.length;n++){if(i.isVertex(t[n])||i.isEdge(t[n])){var r=this.graph.view.getState(t[n]);if(r!=null){var s=r;if(i.isVertex(t[n])&&r.shape!=null&&r.shape.boundingBox!=null){s=r.shape.boundingBox}if(e==null){e=mxRectangle.fromRectangle(s)}else{e.add(s)}}}}}return e};mxGraphHandler.prototype.createPreviewShape=function(t){var e=new mxRectangleShape(t,null,this.previewColor);e.isDashed=true;if(this.htmlPreview){e.dialect=mxConstants.DIALECT_STRICTHTML;e.init(this.graph.container)}else{e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;e.init(this.graph.getView().getOverlayPane());e.pointerEvents=false;if(mxClient.IS_IOS){e.getSvgScreenOffset=function(){return 0}}}return e};mxGraphHandler.prototype.start=function(t,e,i,n){this.cell=t;this.first=mxUtils.convertPoint(this.graph.container,e,i);this.cells=n!=null?n:this.getCells(this.cell);this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);this.allCells=new mxDictionary;this.cloning=false;this.cellCount=0;for(var r=0;r<this.cells.length;r++){this.cellCount+=this.addStates(this.cells[r],this.allCells)}if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var s=this.graph.model.getParent(t);var l=this.graph.model.getChildCount(s)<2;var a=new mxDictionary;var o=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(var r=0;r<o.length;r++){var h=this.graph.view.getState(o[r]);if(h!=null&&!a.get(h)){a.put(h,true)}}this.guide.isStateIgnored=mxUtils.bind(this,(function(t){var e=this.graph.model.getParent(t.cell);return t.cell!=null&&(!this.cloning&&this.isCellMoving(t.cell)||t.cell!=(this.target||s)&&!l&&!a.get(t)&&(this.target==null||this.graph.model.getChildCount(this.target)>=2)&&e!=(this.target||s))}))}};mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t);var n=0;if(i!=null&&e.get(t)==null){e.put(t,i);n++;var r=this.graph.model.getChildCount(t);for(var s=0;s<r;s++){n+=this.addStates(this.graph.model.getChildAt(t,s),e)}}return n};mxGraphHandler.prototype.isCellMoving=function(t){return this.allCells.get(t)!=null};mxGraphHandler.prototype.useGuidesForEvent=function(t){return this.guide!=null?this.guide.isEnabledForEvent(t.getEvent())&&!this.graph.isConstrainedEvent(t.getEvent()):true};mxGraphHandler.prototype.snap=function(t){var e=this.scaleGrid?this.graph.view.scale:1;t.x=this.graph.snap(t.x/e)*e;t.y=this.graph.snap(t.y/e)*e;return t};mxGraphHandler.prototype.getDelta=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());return new mxPoint(e.x-this.first.x-this.graph.panDx,e.y-this.first.y-this.graph.panDy)};mxGraphHandler.prototype.updateHint=function(t){};mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(t){return Math.round(t*100)/100};mxGraphHandler.prototype.isValidDropTarget=function(t,e){return this.graph.model.getParent(this.cell)!=t};mxGraphHandler.prototype.checkPreview=function(){if(this.livePreviewActive&&this.cloning){this.resetLivePreview();this.livePreviewActive=false}else if(this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview){if(!this.cloning||!this.livePreviewActive){this.livePreviewActive=true;this.livePreviewUsed=true}}else if(!this.livePreviewUsed&&this.shape==null){this.shape=this.createPreviewShape(this.bounds)}};mxGraphHandler.prototype.mouseMove=function(t,e){var i=this.graph;if(!e.isConsumed()&&i.isMouseDown&&this.cell!=null&&this.first!=null&&this.bounds!=null&&!this.suspended){if(mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var n=this.getDelta(e);var r=i.tolerance;if(this.shape!=null||this.livePreviewActive||Math.abs(n.x)>r||Math.abs(n.y)>r){if(this.highlight==null){this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)}var s=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled();var l=i.isGridEnabledEvent(e.getEvent());var a=e.getCell();var o=true;var h=null;this.cloning=s;if(i.isDropEnabled()&&this.highlightEnabled){h=i.getDropTarget(this.cells,e.getEvent(),a,s)}var u=i.getView().getState(h);var d=false;if(u!=null&&(s||this.isValidDropTarget(h,e))){if(this.target!=h){this.target=h;this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)}d=true}else{this.target=null;if(this.connectOnDrop&&a!=null&&this.cells.length==1&&i.getModel().isVertex(a)&&i.isCellConnectable(a)){u=i.getView().getState(a);if(u!=null){var p=i.getEdgeValidationError(null,this.cell,a);var m=p==null?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(m);d=true}}}if(u!=null&&d){this.highlight.highlight(u)}else{this.highlight.hide()}if(this.guide!=null&&this.useGuidesForEvent(e)){n=this.guide.move(this.bounds,n,l,s);o=false}else{n=this.graph.snapDelta(n,this.bounds,!l,false,false)}if(this.guide!=null&&o){this.guide.hide()}if(i.isConstrainedEvent(e.getEvent())){if(Math.abs(n.x)>Math.abs(n.y)){n.y=0}else{n.x=0}}this.checkPreview();if(this.currentDx!=n.x||this.currentDy!=n.y){this.currentDx=n.x;this.currentDy=n.y;this.updatePreview()}}this.updateHint(e);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e);mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!i.isMouseDown){var c=i.getCursorForMouseEvent(e);if(c==null&&i.isEnabled()&&i.isCellMovable(e.getCell())){if(i.getModel().isEdge(e.getCell())){c=mxConstants.CURSOR_MOVABLE_EDGE}else{c=mxConstants.CURSOR_MOVABLE_VERTEX}}if(c!=null&&e.sourceState!=null){e.sourceState.setCursor(c)}}};mxGraphHandler.prototype.updatePreview=function(t){if(this.livePreviewUsed&&!t){if(this.cells!=null){this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),false);this.updateLivePreview(this.currentDx,this.currentDy)}}else{this.updatePreviewShape()}};mxGraphHandler.prototype.updatePreviewShape=function(){if(this.shape!=null&&this.pBounds!=null){this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height);this.shape.redraw()}};mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var i=[];if(this.allCells!=null){this.allCells.visit(mxUtils.bind(this,(function(n,r){var s=this.graph.view.getState(r.cell);if(s!=r){r.destroy();if(s!=null){this.allCells.put(r.cell,s)}else{this.allCells.remove(r.cell)}r=s}if(r!=null){var l=r.clone();i.push([r,l]);if(r.shape!=null){if(r.shape.originalPointerEvents==null){r.shape.originalPointerEvents=r.shape.pointerEvents}r.shape.pointerEvents=false;if(r.text!=null){if(r.text.originalPointerEvents==null){r.text.originalPointerEvents=r.text.pointerEvents}r.text.pointerEvents=false}}if(this.graph.model.isVertex(r.cell)){r.x+=t;r.y+=e;if(!this.cloning){r.view.graph.cellRenderer.redraw(r,true);r.view.invalidate(r.cell);r.invalid=false;if(r.control!=null&&r.control.node!=null){r.control.node.style.visibility="hidden"}}else if(r.text!=null){r.text.updateBoundingBox();if(r.text.boundingBox!=null){r.text.boundingBox.x+=t;r.text.boundingBox.y+=e}if(r.text.unrotatedBoundingBox!=null){r.text.unrotatedBoundingBox.x+=t;r.text.unrotatedBoundingBox.y+=e}}}}})))}if(i.length==0){this.reset()}else{var n=this.graph.view.scale;for(var r=0;r<i.length;r++){var s=i[r][0];if(this.graph.model.isEdge(s.cell)){var l=this.graph.getCellGeometry(s.cell);var a=[];if(l!=null&&l.points!=null){for(var o=0;o<l.points.length;o++){if(l.points[o]!=null){a.push(new mxPoint(l.points[o].x+t/n,l.points[o].y+e/n))}}}var h=s.visibleSourceState;var u=s.visibleTargetState;var d=i[r][1].absolutePoints;if(h==null||!this.isCellMoving(h.cell)){var p=d[0];s.setAbsoluteTerminalPoint(new mxPoint(p.x+t,p.y+e),true);h=null}else{s.view.updateFixedTerminalPoint(s,h,true,this.graph.getConnectionConstraint(s,h,true))}if(u==null||!this.isCellMoving(u.cell)){var m=d[d.length-1];s.setAbsoluteTerminalPoint(new mxPoint(m.x+t,m.y+e),false);u=null}else{s.view.updateFixedTerminalPoint(s,u,false,this.graph.getConnectionConstraint(s,u,false))}s.view.updatePoints(s,a,h,u);s.view.updateFloatingTerminalPoints(s,h,u);s.view.updateEdgeLabelOffset(s);s.invalid=false;if(!this.cloning){s.view.graph.cellRenderer.redraw(s,true)}}}this.graph.view.validate();this.redrawHandles(i);this.resetPreviewStates(i)}}};mxGraphHandler.prototype.redrawHandles=function(t){for(var e=0;e<t.length;e++){var i=this.graph.selectionCellsHandler.getHandler(t[e][0].cell);if(i!=null){i.redraw(true)}}};mxGraphHandler.prototype.resetPreviewStates=function(t){for(var e=0;e<t.length;e++){t[e][0].setState(t[e][1])}};mxGraphHandler.prototype.suspend=function(){if(!this.suspended){if(this.livePreviewUsed){this.updateLivePreview(0,0)}if(this.shape!=null){this.shape.node.style.visibility="hidden"}if(this.guide!=null){this.guide.setVisible(false)}this.suspended=true}};mxGraphHandler.prototype.resume=function(){if(this.suspended){this.suspended=null;if(this.livePreviewUsed){this.livePreviewActive=true}if(this.shape!=null){this.shape.node.style.visibility="visible"}if(this.guide!=null){this.guide.setVisible(true)}}};mxGraphHandler.prototype.resetLivePreview=function(){if(this.allCells!=null){this.allCells.visit(mxUtils.bind(this,(function(t,e){if(e.shape!=null&&e.shape.originalPointerEvents!=null){e.shape.pointerEvents=e.shape.originalPointerEvents;e.shape.originalPointerEvents=null;e.shape.bounds=null;if(e.text!=null){e.text.pointerEvents=e.text.originalPointerEvents;e.text.originalPointerEvents=null}}if(e.control!=null&&e.control.node!=null&&e.control.node.style.visibility=="hidden"){e.control.node.style.visibility=""}if(!this.cloning){if(e.text!=null){e.text.updateBoundingBox()}}e.view.invalidate(e.cell)})));this.graph.view.validate()}};mxGraphHandler.prototype.setHandlesVisibleForCells=function(t,e,i){if(i||this.handlesVisible!=e){this.handlesVisible=e;for(var n=0;n<t.length;n++){var r=this.graph.selectionCellsHandler.getHandler(t[n]);if(r!=null){r.setHandlesVisible(e);if(e){r.redraw()}}}}};mxGraphHandler.prototype.setHighlightColor=function(t){if(this.highlight!=null){this.highlight.setHighlightColor(t)}};mxGraphHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()){if(this.livePreviewUsed){this.resetLivePreview()}if(this.cell!=null&&this.first!=null&&(this.shape!=null||this.livePreviewUsed)&&this.currentDx!=null&&this.currentDy!=null){var i=this.graph;var n=e.getCell();if(this.connectOnDrop&&this.target==null&&n!=null&&i.getModel().isVertex(n)&&i.isCellConnectable(n)&&i.isEdgeValid(null,this.cell,n)){i.connectionHandler.connect(this.cell,n,e.getEvent())}else{var r=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled();var s=i.getView().scale;var l=this.roundLength(this.currentDx/s);var a=this.roundLength(this.currentDy/s);var o=this.target;if(i.isSplitEnabled()&&i.isSplitTarget(o,this.cells,e.getEvent())){i.splitEdge(o,this.cells,null,l,a,e.getGraphX(),e.getGraphY())}else{this.moveCells(this.cells,l,a,r,this.target,e.getEvent())}}}else if(this.isSelectEnabled()&&this.delayedSelection&&this.cell!=null){this.selectDelayed(e)}}if(this.cellWasClicked){this.consumeMouseEvent(mxEvent.MOUSE_UP,e)}this.reset()};mxGraphHandler.prototype.reset=function(){if(this.livePreviewUsed){this.resetLivePreview();this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),true)}this.destroyShapes();this.removeHint();this.delayedSelection=false;this.livePreviewActive=null;this.livePreviewUsed=null;this.cellWasClicked=false;this.suspended=null;this.currentDx=null;this.currentDy=null;this.cellCount=null;this.cloning=false;this.allCells=null;this.pBounds=null;this.guides=null;this.target=null;this.first=null;this.cells=null;this.cell=null};mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(t,e,i){if(this.graph.getModel().isVertex(t)){var n=this.graph.getView().getState(t);if(n!=null){var r=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(i),mxEvent.getClientY(i));var s=mxUtils.toRadians(mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION)||0);if(s!=0){var l=Math.cos(-s);var a=Math.sin(-s);var o=new mxPoint(n.getCenterX(),n.getCenterY());r=mxUtils.getRotatedPoint(r,l,a,o)}return!mxUtils.contains(n,r.x,r.y)}}return false};mxGraphHandler.prototype.moveCells=function(t,e,i,n,r,s){if(n){t=this.graph.getCloneableCells(t)}var l=this.graph.getModel().getParent(this.cell);if(r==null&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(l,t,s)){r=this.graph.getDefaultParent()}n=n&&!this.graph.isCellLocked(r||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{var a=[];if(!n&&r!=null&&this.removeEmptyParents){var o=new mxDictionary;for(var h=0;h<t.length;h++){o.put(t[h],true)}for(var h=0;h<t.length;h++){var u=this.graph.model.getParent(t[h]);if(u!=null&&!o.get(u)){o.put(u,true);a.push(u)}}}t=this.graph.moveCells(t,e,i,n,r,s);var d=[];for(var h=0;h<a.length;h++){if(this.shouldRemoveParent(a[h])){d.push(a[h])}}this.graph.removeCells(d,false)}finally{this.graph.getModel().endUpdate()}if(n){this.graph.setSelectionCells(t)}if(this.isSelectEnabled()&&this.scrollOnMove){this.graph.scrollCellToVisible(t[0])}};mxGraphHandler.prototype.shouldRemoveParent=function(t){var e=this.graph.view.getState(t);return e!=null&&(this.graph.model.isEdge(e.cell)||this.graph.model.isVertex(e.cell))&&this.graph.isCellDeletable(e.cell)&&this.graph.model.getChildCount(e.cell)==0&&this.graph.isTransparentState(e)};mxGraphHandler.prototype.destroyShapes=function(){if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.guide!=null){this.guide.destroy();this.guide=null}if(this.highlight!=null){this.highlight.destroy();this.highlight=null}};mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);if(this.escapeHandler!=null){this.graph.removeListener(this.escapeHandler);this.escapeHandler=null}if(this.refreshHandler!=null){this.graph.getModel().removeListener(this.refreshHandler);this.graph.removeListener(this.refreshHandler);this.refreshHandler=null}mxEvent.removeListener(document,"keydown",this.keyHandler);mxEvent.removeListener(document,"keyup",this.keyHandler);this.destroyShapes();this.removeHint()};__mxOutput.mxGraphHandler=typeof mxGraphHandler!=="undefined"?mxGraphHandler:undefined;function mxPanningHandler(t){if(t!=null){this.graph=t;this.graph.addMouseListener(this);this.forcePanningHandler=mxUtils.bind(this,(function(t,e){var i=e.getProperty("eventName");var n=e.getProperty("event");if(i==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(n)){this.start(n);this.active=true;this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",n));n.consume()}}));this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler);this.gestureHandler=mxUtils.bind(this,(function(t,e){if(this.isPinchEnabled()){var i=e.getProperty("event");if(!mxEvent.isConsumed(i)&&i.type=="gesturestart"){this.initialScale=this.graph.view.scale;if(!this.active&&this.mouseDownEvent!=null){this.start(this.mouseDownEvent);this.mouseDownEvent=null}}else if(i.type=="gestureend"&&this.initialScale!=null){this.initialScale=null}if(this.initialScale!=null){this.zoomGraph(i)}}}));this.graph.addListener(mxEvent.GESTURE,this.gestureHandler);this.mouseUpListener=mxUtils.bind(this,(function(){if(this.active){this.reset()}}));mxEvent.addListener(document,"mouseup",this.mouseUpListener)}}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=false;mxPanningHandler.prototype.usePopupTrigger=true;mxPanningHandler.prototype.ignoreCell=false;mxPanningHandler.prototype.previewEnabled=true;mxPanningHandler.prototype.useGrid=false;mxPanningHandler.prototype.panningEnabled=true;mxPanningHandler.prototype.pinchEnabled=true;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||this.initialScale!=null};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled};mxPanningHandler.prototype.setPanningEnabled=function(t){this.panningEnabled=t};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(t){this.pinchEnabled=t};mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return this.useLeftButtonForPanning&&t.getState()==null&&mxEvent.isLeftMouseButton(e)||mxEvent.isControlDown(e)&&mxEvent.isShiftDown(e)||this.usePopupTrigger&&mxEvent.isPopupTrigger(e)};mxPanningHandler.prototype.isForcePanningEvent=function(t){return this.ignoreCell||mxEvent.isMultiTouchEvent(t.getEvent())};mxPanningHandler.prototype.mouseDown=function(t,e){this.mouseDownEvent=e;if(!e.isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(e)){this.start(e);this.consumePanningTrigger(e)}};mxPanningHandler.prototype.start=function(t){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=t.getX();this.startY=t.getY();this.dx=null;this.dy=null;this.panningTrigger=true};mxPanningHandler.prototype.consumePanningTrigger=function(t){t.consume()};mxPanningHandler.prototype.mouseMove=function(t,e){this.dx=e.getX()-this.startX;this.dy=e.getY()-this.startY;if(this.active){if(this.previewEnabled){if(this.useGrid){this.dx=this.graph.snap(this.dx);this.dy=this.graph.snap(this.dy)}this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)}this.fireEvent(new mxEventObject(mxEvent.PAN,"event",e))}else if(this.panningTrigger){var i=this.active;this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance;if(!i&&this.active){this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}}if(this.active||this.panningTrigger){e.consume()}};mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(this.dx!=null&&this.dy!=null){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale;var n=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()};mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;if(this.minScale!=null){e=Math.max(this.minScale,e)}if(this.maxScale!=null){e=Math.min(this.maxScale,e)}if(this.graph.view.scale!=e){this.graph.zoomTo(e);mxEvent.consume(t)}};mxPanningHandler.prototype.reset=function(){this.panningTrigger=false;this.mouseDownEvent=null;this.active=false;this.dx=null;this.dy=null};mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)};mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.forcePanningHandler);this.graph.removeListener(this.gestureHandler);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)};__mxOutput.mxPanningHandler=typeof mxPanningHandler!=="undefined"?mxPanningHandler:undefined;function mxPopupMenuHandler(t,e){if(t!=null){this.graph=t;this.factoryMethod=e;this.graph.addMouseListener(this);this.gestureHandler=mxUtils.bind(this,(function(t,e){this.inTolerance=false}));this.graph.addListener(mxEvent.GESTURE,this.gestureHandler);this.init()}}mxPopupMenuHandler.prototype=new mxPopupMenu;mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler;mxPopupMenuHandler.prototype.graph=null;mxPopupMenuHandler.prototype.selectOnPopup=true;mxPopupMenuHandler.prototype.clearSelectionOnBackground=true;mxPopupMenuHandler.prototype.triggerX=null;mxPopupMenuHandler.prototype.triggerY=null;mxPopupMenuHandler.prototype.screenX=null;mxPopupMenuHandler.prototype.screenY=null;mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,(function(t){this.graph.tooltipHandler.hide()})))};mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup};mxPopupMenuHandler.prototype.mouseDown=function(t,e){if(this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())){this.hideMenu();this.triggerX=e.getGraphX();this.triggerY=e.getGraphY();this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX;this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY;this.popupTrigger=this.isPopupTrigger(e);this.inTolerance=true}};mxPopupMenuHandler.prototype.mouseMove=function(t,e){if(this.inTolerance&&this.screenX!=null&&this.screenY!=null){if(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance){this.inTolerance=false}}};mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&this.triggerX!=null&&this.triggerY!=null){var i=this.getCellForPopupEvent(e);if(this.graph.isEnabled()&&this.isSelectOnPopup(e)&&i!=null&&!this.graph.isCellSelected(i)){this.graph.setSelectionCell(i)}else if(this.clearSelectionOnBackground&&i==null){this.graph.clearSelection()}this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,e.getEvent());e.consume()}this.popupTrigger=false;this.inTolerance=false};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()};mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.gestureHandler);mxPopupMenu.prototype.destroy.apply(this)};__mxOutput.mxPopupMenuHandler=typeof mxPopupMenuHandler!=="undefined"?mxPopupMenuHandler:undefined;function mxCellMarker(t,e,i,n){mxEventSource.call(this);if(t!=null){this.graph=t;this.validColor=e!=null?e:mxConstants.DEFAULT_VALID_COLOR;this.invalidColor=i!=null?i:mxConstants.DEFAULT_INVALID_COLOR;this.hotspot=n!=null?n:mxConstants.DEFAULT_HOTSPOT;this.highlight=new mxCellHighlight(t)}}mxUtils.extend(mxCellMarker,mxEventSource);mxCellMarker.prototype.graph=null;mxCellMarker.prototype.enabled=true;mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT;mxCellMarker.prototype.hotspotEnabled=false;mxCellMarker.prototype.validColor=null;mxCellMarker.prototype.invalidColor=null;mxCellMarker.prototype.currentColor=null;mxCellMarker.prototype.validState=null;mxCellMarker.prototype.markedState=null;mxCellMarker.prototype.setEnabled=function(t){this.enabled=t};mxCellMarker.prototype.isEnabled=function(){return this.enabled};mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t};mxCellMarker.prototype.getHotspot=function(){return this.hotspot};mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t};mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled};mxCellMarker.prototype.hasValidState=function(){return this.validState!=null};mxCellMarker.prototype.getValidState=function(){return this.validState};mxCellMarker.prototype.getMarkedState=function(){return this.markedState};mxCellMarker.prototype.reset=function(){this.validState=null;if(this.markedState!=null){this.markedState=null;this.unmark()}};mxCellMarker.prototype.process=function(t){var e=null;if(this.isEnabled()){e=this.getState(t);this.setCurrentState(e,t)}return e};mxCellMarker.prototype.setCurrentState=function(t,e,i){var n=t!=null?this.isValidState(t):false;i=i!=null?i:this.getMarkerColor(e.getEvent(),t,n);if(n){this.validState=t}else{this.validState=null}if(t!=this.markedState||i!=this.currentColor){this.currentColor=i;if(t!=null&&this.currentColor!=null){this.markedState=t;this.mark()}else if(this.markedState!=null){this.markedState=null;this.unmark()}}};mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);if(i!=null){this.currentColor=e!=null?e:this.validColor;this.markedState=i;this.mark()}};mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor);this.highlight.highlight(this.markedState);this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))};mxCellMarker.prototype.unmark=function(){this.mark()};mxCellMarker.prototype.isValidState=function(t){return true};mxCellMarker.prototype.getMarkerColor=function(t,e,i){return i?this.validColor:this.invalidColor};mxCellMarker.prototype.getState=function(t){var e=this.graph.getView();var i=this.getCell(t);var n=this.getStateToMark(e.getState(i));return n!=null&&this.intersects(n,t)?n:null};mxCellMarker.prototype.getCell=function(t){return t.getCell()};mxCellMarker.prototype.getStateToMark=function(t){return t};mxCellMarker.prototype.intersects=function(t,e){if(this.hotspotEnabled){return mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)}return true};mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getModel().removeListener(this.resetHandler);this.highlight.destroy()};__mxOutput.mxCellMarker=typeof mxCellMarker!=="undefined"?mxCellMarker:undefined;function mxSelectionCellsHandler(t){mxEventSource.call(this);this.graph=t;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.refreshHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.refresh()}}));this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource);mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=true;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100;mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t};mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)};mxSelectionCellsHandler.prototype.isHandled=function(t){return this.getHandler(t)!=null};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit((function(t,e){e.reset.apply(e)}))};mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()};mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;var e=mxUtils.sortCells(this.getHandledSelectionCells(),false);for(var i=0;i<e.length;i++){var n=this.graph.view.getState(e[i]);if(n!=null){var r=t.remove(e[i]);if(r!=null){if(r.state!=n){r.destroy();r=null}else if(!this.isHandlerActive(r)){if(r.refresh!=null){r.refresh()}r.redraw()}}if(r!=null){this.handlers.put(e[i],r)}}}t.visit(mxUtils.bind(this,(function(t,e){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",e.state));e.destroy()})));for(var i=0;i<e.length;i++){var n=this.graph.view.getState(e[i]);if(n!=null){var r=this.handlers.get(e[i]);if(r==null){r=this.graph.createHandler(n);this.fireEvent(new mxEventObject(mxEvent.ADD,"state",n));this.handlers.put(e[i],r)}else{r.updateParentHighlight()}}}};mxSelectionCellsHandler.prototype.isHandlerActive=function(t){return t.index!=null};mxSelectionCellsHandler.prototype.updateHandler=function(t){var e=this.handlers.remove(t.cell);if(e!=null){var i=e.index;var n=e.startX;var r=e.startY;e.destroy();e=this.graph.createHandler(t);if(e!=null){this.handlers.put(t.cell,e);if(i!=null&&n!=null&&r!=null){e.start(n,r,i)}}}};mxSelectionCellsHandler.prototype.mouseDown=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var i=[t,e];this.handlers.visit((function(t,e){e.mouseDown.apply(e,i)}))}};mxSelectionCellsHandler.prototype.mouseMove=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var i=[t,e];this.handlers.visit((function(t,e){e.mouseMove.apply(e,i)}))}};mxSelectionCellsHandler.prototype.mouseUp=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var i=[t,e];this.handlers.visit((function(t,e){e.mouseUp.apply(e,i)}))}};mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);if(this.refreshHandler!=null){this.graph.getSelectionModel().removeListener(this.refreshHandler);this.graph.getModel().removeListener(this.refreshHandler);this.graph.getView().removeListener(this.refreshHandler);this.refreshHandler=null}};__mxOutput.mxSelectionCellsHandler=typeof mxSelectionCellsHandler!=="undefined"?mxSelectionCellsHandler:undefined;function mxConnectionHandler(t,e){mxEventSource.call(this);if(t!=null){this.graph=t;this.factoryMethod=e;this.init();this.escapeHandler=mxUtils.bind(this,(function(t,e){this.reset()}));this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}}mxUtils.extend(mxConnectionHandler,mxEventSource);mxConnectionHandler.prototype.graph=null;mxConnectionHandler.prototype.factoryMethod=true;mxConnectionHandler.prototype.moveIconFront=false;mxConnectionHandler.prototype.moveIconBack=false;mxConnectionHandler.prototype.connectImage=null;mxConnectionHandler.prototype.targetConnectImage=false;mxConnectionHandler.prototype.enabled=true;mxConnectionHandler.prototype.select=true;mxConnectionHandler.prototype.createTarget=false;mxConnectionHandler.prototype.marker=null;mxConnectionHandler.prototype.constraintHandler=null;mxConnectionHandler.prototype.error=null;mxConnectionHandler.prototype.waypointsEnabled=false;mxConnectionHandler.prototype.ignoreMouseDown=false;mxConnectionHandler.prototype.first=null;mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET);mxConnectionHandler.prototype.edgeState=null;mxConnectionHandler.prototype.changeHandler=null;mxConnectionHandler.prototype.drillHandler=null;mxConnectionHandler.prototype.mouseDownCounter=0;mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML;mxConnectionHandler.prototype.outlineConnect=false;mxConnectionHandler.prototype.livePreview=false;mxConnectionHandler.prototype.cursor=null;mxConnectionHandler.prototype.insertBeforeSource=false;mxConnectionHandler.prototype.isEnabled=function(){return this.enabled};mxConnectionHandler.prototype.setEnabled=function(t){this.enabled=t};mxConnectionHandler.prototype.isInsertBefore=function(t,e,i,n,r){return this.insertBeforeSource&&e!=i};mxConnectionHandler.prototype.isCreateTarget=function(t){return this.createTarget};mxConnectionHandler.prototype.setCreateTarget=function(t){this.createTarget=t};mxConnectionHandler.prototype.createShape=function(){var t=this.livePreview&&this.edgeState!=null?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;t.scale=this.graph.view.scale;t.pointerEvents=false;t.isDashed=true;t.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(t.node,this.graph,null);return t};mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this);this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.changeHandler=mxUtils.bind(this,(function(t){if(this.iconState!=null){this.iconState=this.graph.getView().getState(this.iconState.cell)}if(this.iconState!=null){this.redrawIcons(this.icons,this.iconState);this.constraintHandler.reset()}else if(this.previous!=null&&this.graph.view.getState(this.previous.cell)==null){this.reset()}}));this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler);this.drillHandler=mxUtils.bind(this,(function(t){this.reset()}));this.graph.addListener(mxEvent.START_EDITING,this.drillHandler);this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler);this.graph.getView().addListener(mxEvent.UP,this.drillHandler)};mxConnectionHandler.prototype.isConnectableCell=function(t){return true};mxConnectionHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph);t.hotspotEnabled=true;t.getCell=mxUtils.bind(this,(function(e){var i=mxCellMarker.prototype.getCell.apply(t,arguments);this.error=null;if(i==null&&this.currentPoint!=null){i=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y)}if(i!=null&&!this.graph.isCellConnectable(i)){var n=this.graph.getModel().getParent(i);if(this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)){i=n}}if(this.graph.isSwimlane(i)&&this.currentPoint!=null&&this.graph.hitsSwimlaneContent(i,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(i)){i=null}if(i!=null){if(this.isConnecting()){if(this.previous!=null){this.error=this.validateConnection(this.previous.cell,i);if(this.error!=null&&this.error.length==0){i=null;if(this.isCreateTarget(e.getEvent())){this.error=null}}}}else if(!this.isValidSource(i,e)){i=null}}else if(this.isConnecting()&&!this.isCreateTarget(e.getEvent())&&!this.graph.allowDanglingEdges){this.error=""}return i}));t.isValidState=mxUtils.bind(this,(function(e){if(this.isConnecting()){return this.error==null}else{return mxCellMarker.prototype.isValidState.apply(t,arguments)}}));t.getMarkerColor=mxUtils.bind(this,(function(e,i,n){return this.connectImage==null||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(t,arguments):null}));t.intersects=mxUtils.bind(this,(function(e,i){if(this.connectImage!=null||this.isConnecting()){return true}return mxCellMarker.prototype.intersects.apply(t,arguments)}));return t};mxConnectionHandler.prototype.start=function(t,e,i,n){this.previous=t;this.first=new mxPoint(e,i);this.edgeState=n!=null?n:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=t;this.marker.mark();this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))};mxConnectionHandler.prototype.isConnecting=function(){return this.first!=null&&this.shape!=null};mxConnectionHandler.prototype.isValidSource=function(t,e){return this.graph.isValidSource(t)};mxConnectionHandler.prototype.isValidTarget=function(t){return true};mxConnectionHandler.prototype.validateConnection=function(t,e){if(!this.isValidTarget(e)){return""}return this.graph.getEdgeValidationError(null,t,e)};mxConnectionHandler.prototype.getConnectImage=function(t){return this.connectImage};mxConnectionHandler.prototype.isMoveIconToFrontForState=function(t){if(t.text!=null&&t.text.node.parentNode==this.graph.container){return true}return this.moveIconFront};mxConnectionHandler.prototype.createIcons=function(t){var e=this.getConnectImage(t);if(e!=null&&t!=null){this.iconState=t;var i=[];var n=new mxRectangle(0,0,e.width,e.height);var r=new mxImageShape(n,e.src,null,null,0);r.preserveImageAspect=false;if(this.isMoveIconToFrontForState(t)){r.dialect=mxConstants.DIALECT_STRICTHTML;r.init(this.graph.container)}else{r.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML;r.init(this.graph.getView().getOverlayPane());if(this.moveIconBack&&r.node.previousSibling!=null){r.node.parentNode.insertBefore(r.node,r.node.parentNode.firstChild)}}r.node.style.cursor=mxConstants.CURSOR_CONNECT;var s=mxUtils.bind(this,(function(){return this.currentState!=null?this.currentState:t}));var l=mxUtils.bind(this,(function(t){if(!mxEvent.isConsumed(t)){this.icon=r;this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,s()))}}));mxEvent.redirectMouseEvents(r.node,this.graph,s,l);i.push(r);this.redrawIcons(i,this.iconState);return i}return null};mxConnectionHandler.prototype.redrawIcons=function(t,e){if(t!=null&&t[0]!=null&&e!=null){var i=this.getIconPosition(t[0],e);t[0].bounds.x=i.x;t[0].bounds.y=i.y;t[0].redraw()}};mxConnectionHandler.prototype.getIconPosition=function(t,e){var i=this.graph.getView().scale;var n=e.getCenterX();var r=e.getCenterY();if(this.graph.isSwimlane(e.cell)){var s=this.graph.getStartSize(e.cell);n=s.width!=0?e.x+s.width*i/2:n;r=s.height!=0?e.y+s.height*i/2:r;var l=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0);if(l!=0){var a=Math.cos(l);var o=Math.sin(l);var h=new mxPoint(e.getCenterX(),e.getCenterY());var u=mxUtils.getRotatedPoint(new mxPoint(n,r),a,o,h);n=u.x;r=u.y}}return new mxPoint(n-t.bounds.width/2,r-t.bounds.height/2)};mxConnectionHandler.prototype.destroyIcons=function(){if(this.icons!=null){for(var t=0;t<this.icons.length;t++){this.icons[t].destroy()}this.icons=null;this.icon=null;this.selectedIcon=null;this.iconState=null}};mxConnectionHandler.prototype.isStartEvent=function(t){return this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentConstraint!=null||this.previous!=null&&this.error==null&&(this.icons==null||this.icons!=null&&this.icon!=null)};mxConnectionHandler.prototype.mouseDown=function(t,e){this.mouseDownCounter++;if(this.isEnabled()&&this.graph.isEnabled()&&!e.isConsumed()&&!this.isConnecting()&&this.isStartEvent(e)){if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null){this.sourceConstraint=this.constraintHandler.currentConstraint;this.previous=this.constraintHandler.currentFocus;this.first=this.constraintHandler.currentPoint.clone()}else{this.first=new mxPoint(e.getGraphX(),e.getGraphY())}this.edgeState=this.createEdgeState(e);this.mouseDownCounter=1;if(this.waypointsEnabled&&this.shape==null){this.waypoints=null;this.shape=this.createShape();if(this.edgeState!=null){this.shape.apply(this.edgeState)}}if(this.previous==null&&this.edgeState!=null){var i=this.graph.getPointForEvent(e.getEvent());this.edgeState.cell.geometry.setTerminalPoint(i,true)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous));e.consume()}this.selectedIcon=this.icon;this.icon=null};mxConnectionHandler.prototype.isImmediateConnectSource=function(t){return!this.graph.isCellMovable(t.cell)};mxConnectionHandler.prototype.createEdgeState=function(t){return null};mxConnectionHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container);var i=t.getEvent();var n=mxEvent.getClientX(i);var r=mxEvent.getClientY(i);var s=document.documentElement;var l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0);var a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0);var o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l;var h=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||h!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,h))};mxConnectionHandler.prototype.updateCurrentState=function(t,e){this.constraintHandler.update(t,this.first==null,false,this.first==null||t.isSource(this.marker.highlight.shape)?null:e);if(this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentConstraint!=null){if(this.marker.highlight!=null&&this.marker.highlight.state!=null&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell){if(this.marker.highlight.shape.stroke!="transparent"){this.marker.highlight.shape.stroke="transparent";this.marker.highlight.repaint()}}else{this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent")}if(this.previous!=null){this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell);if(this.error==null){this.currentState=this.constraintHandler.currentFocus}if(this.error!=null||this.currentState!=null&&!this.isCellEnabled(this.currentState.cell)){this.constraintHandler.reset()}}}else{if(this.graph.isIgnoreTerminalEvent(t.getEvent())){this.marker.reset();this.currentState=null}else{this.marker.process(t);this.currentState=this.marker.getValidState()}if(this.currentState!=null&&!this.isCellEnabled(this.currentState.cell)){this.constraintHandler.reset();this.marker.reset();this.currentState=null}var i=this.isOutlineConnectEvent(t);if(this.currentState!=null&&i){if(t.isSource(this.marker.highlight.shape)){e=new mxPoint(t.getGraphX(),t.getGraphY())}var n=this.graph.getOutlineConstraint(e,this.currentState,t);this.constraintHandler.setFocus(t,this.currentState,false);this.constraintHandler.currentConstraint=n;this.constraintHandler.currentPoint=e}if(this.outlineConnect){if(this.marker.highlight!=null&&this.marker.highlight.shape!=null){var r=this.graph.view.scale;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR;this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/r/r;this.marker.highlight.repaint()}else if(this.marker.hasValidState()){if(this.graph.isCellConnectable(t.getCell())&&this.marker.getValidState()!=t.getState()){this.marker.highlight.shape.stroke="transparent";this.currentState=null}else{this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR}this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/r/r;this.marker.highlight.repaint()}}}}};mxConnectionHandler.prototype.isCellEnabled=function(t){return true};mxConnectionHandler.prototype.convertWaypoint=function(t){var e=this.graph.getView().getScale();var i=this.graph.getView().getTranslate();t.x=t.x/e-i.x;t.y=t.y/e-i.y};mxConnectionHandler.prototype.snapToPreview=function(t,e){if(!mxEvent.isAltDown(t.getEvent())&&this.previous!=null){var i=this.graph.gridSize*this.graph.view.scale/2;var n=this.sourceConstraint!=null?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());if(Math.abs(n.x-t.getGraphX())<i){e.x=n.x}if(Math.abs(n.y-t.getGraphY())<i){e.y=n.y}}};mxConnectionHandler.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&(this.ignoreMouseDown||this.first!=null||!this.graph.isMouseDown)){if(!this.isEnabled()&&this.currentState!=null){this.destroyIcons();this.currentState=null}var i=this.graph.getView();var n=i.scale;var r=i.translate;var s=new mxPoint(e.getGraphX(),e.getGraphY());this.error=null;if(this.graph.isGridEnabledEvent(e.getEvent())){s=new mxPoint((this.graph.snap(s.x/n-r.x)+r.x)*n,(this.graph.snap(s.y/n-r.y)+r.y)*n)}this.snapToPreview(e,s);this.currentPoint=s;if((this.first!=null||this.isEnabled()&&this.graph.isEnabled())&&(this.shape!=null||this.first==null||Math.abs(e.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)){this.updateCurrentState(e,s)}if(this.first!=null){var l=null;var a=s;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null){l=this.constraintHandler.currentConstraint;a=this.constraintHandler.currentPoint.clone()}else if(this.previous!=null&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())){if(Math.abs(this.previous.getCenterX()-s.x)<Math.abs(this.previous.getCenterY()-s.y)){s.x=this.previous.getCenterX()}else{s.y=this.previous.getCenterY()}}var o=this.first;if(this.selectedIcon!=null){var h=this.selectedIcon.bounds.width;var u=this.selectedIcon.bounds.height;if(this.currentState!=null&&this.targetConnectImage){var d=this.getIconPosition(this.selectedIcon,this.currentState);this.selectedIcon.bounds.x=d.x;this.selectedIcon.bounds.y=d.y}else{var p=new mxRectangle(e.getGraphX()+this.connectIconOffset.x,e.getGraphY()+this.connectIconOffset.y,h,u);this.selectedIcon.bounds=p}this.selectedIcon.redraw()}if(this.edgeState!=null){this.updateEdgeState(a,l);a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1];o=this.edgeState.absolutePoints[0]}else{if(this.currentState!=null){if(this.constraintHandler.currentConstraint==null){var m=this.getTargetPerimeterPoint(this.currentState,e);if(m!=null){a=m}}}if(this.sourceConstraint==null&&this.previous!=null){var c=this.waypoints!=null&&this.waypoints.length>0?this.waypoints[0]:a;var m=this.getSourcePerimeterPoint(this.previous,c,e);if(m!=null){o=m}}}if(this.currentState==null&&this.movePreviewAway){var m=o;if(this.edgeState!=null&&this.edgeState.absolutePoints.length>=2){var x=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];if(x!=null){m=x}}var f=a.x-m.x;var g=a.y-m.y;var v=Math.sqrt(f*f+g*g);if(v==0){return}this.originalPoint=a.clone();a.x-=f*4/v;a.y-=g*4/v}else{this.originalPoint=null}if(this.shape==null){var f=Math.abs(e.getGraphX()-this.first.x);var g=Math.abs(e.getGraphY()-this.first.y);if(f>this.graph.tolerance||g>this.graph.tolerance){this.shape=this.createShape();if(this.edgeState!=null){this.shape.apply(this.edgeState)}this.updateCurrentState(e,s)}}if(this.shape!=null){if(this.edgeState!=null){this.shape.points=this.edgeState.absolutePoints}else{var y=[o];if(this.waypoints!=null){y=y.concat(this.waypoints)}y.push(a);this.shape.points=y}this.drawPreview()}if(this.cursor!=null){this.graph.container.style.cursor=this.cursor}mxEvent.consume(e.getEvent());e.consume()}else if(!this.isEnabled()||!this.graph.isEnabled()){this.constraintHandler.reset()}else if(this.previous!=this.currentState&&this.edgeState==null){this.destroyIcons();if(this.currentState!=null&&this.error==null&&this.constraintHandler.currentConstraint==null){this.icons=this.createIcons(this.currentState);if(this.icons==null){this.currentState.setCursor(mxConstants.CURSOR_CONNECT);e.consume()}}this.previous=this.currentState}else if(this.previous==this.currentState&&this.currentState!=null&&this.icons==null&&!this.graph.isMouseDown){e.consume()}if(!this.graph.isMouseDown&&this.currentState!=null&&this.icons!=null){var C=false;var E=e.getSource();for(var S=0;S<this.icons.length&&!C;S++){C=E==this.icons[S].node||E.parentNode==this.icons[S].node}if(!C){this.updateIcons(this.currentState,this.icons,e)}}}else{this.constraintHandler.reset()}};mxConnectionHandler.prototype.updateEdgeState=function(t,e){if(this.sourceConstraint!=null&&this.sourceConstraint.point!=null){this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x;this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y}if(e!=null&&e.point!=null){this.edgeState.style[mxConstants.STYLE_ENTRY_X]=e.point.x;this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=e.point.y}else{delete this.edgeState.style[mxConstants.STYLE_ENTRY_X];delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]}this.edgeState.absolutePoints=[null,this.currentState!=null?null:t];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,true,this.sourceConstraint);if(this.currentState!=null){if(e==null){e=this.graph.getConnectionConstraint(this.edgeState,this.previous,false)}this.edgeState.setAbsoluteTerminalPoint(null,false);this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,false,e)}var i=null;if(this.waypoints!=null){i=[];for(var n=0;n<this.waypoints.length;n++){var r=this.waypoints[n].clone();this.convertWaypoint(r);i[n]=r}}this.graph.view.updatePoints(this.edgeState,i,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)};mxConnectionHandler.prototype.getTargetPerimeterPoint=function(t,e){var i=null;var n=t.view;var r=n.getPerimeterFunction(t);if(r!=null){var s=this.waypoints!=null&&this.waypoints.length>0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());var l=r(n.getPerimeterBounds(t),this.edgeState,s,false);if(l!=null){i=l}}else{i=new mxPoint(t.getCenterX(),t.getCenterY())}return i};mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null;var r=t.view;var s=r.getPerimeterFunction(t);var l=new mxPoint(t.getCenterX(),t.getCenterY());if(s!=null){var a=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);var o=-a*(Math.PI/180);if(a!=0){e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(o),Math.sin(o),l)}var h=s(r.getPerimeterBounds(t),t,e,false);if(h!=null){if(a!=0){h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-o),Math.sin(-o),l)}n=h}}else{n=l}return n};mxConnectionHandler.prototype.updateIcons=function(t,e,i){};mxConnectionHandler.prototype.isStopEvent=function(t){return t.getState()!=null};mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());var i=Math.abs(e.x-this.first.x);var n=Math.abs(e.y-this.first.y);var r=this.waypoints!=null||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance);if(r){if(this.waypoints==null){this.waypoints=[]}var s=this.graph.view.scale;var e=new mxPoint(this.graph.snap(t.getGraphX()/s)*s,this.graph.snap(t.getGraphY()/s)*s);this.waypoints.push(e)}};mxConnectionHandler.prototype.checkConstraints=function(t,e){return t==null||e==null||t.point==null||e.point==null||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter};mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e)){this.addWaypointForEvent(e);e.consume();return}var i=this.sourceConstraint;var n=this.constraintHandler.currentConstraint;var r=this.previous!=null?this.previous.cell:null;var s=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){s=this.constraintHandler.currentFocus.cell}if(s==null&&this.currentState!=null){s=this.currentState.cell}if(this.error==null&&(r==null||s==null||r!=s||this.checkConstraints(i,n))){this.connect(r,s,e.getEvent(),e.getCell())}else{if(this.previous!=null&&this.marker.validState!=null&&this.previous.cell==this.marker.validState.cell){this.graph.selectCellForEvent(this.marker.source,e.getEvent())}if(this.error!=null&&this.error.length>0){this.graph.validationAlert(this.error)}}this.destroyIcons();e.consume()}if(this.first!=null){this.reset()}};mxConnectionHandler.prototype.reset=function(){if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.cursor!=null&&this.graph.container!=null){this.graph.container.style.cursor=""}this.destroyIcons();this.marker.reset();this.constraintHandler.reset();this.originalPoint=null;this.currentPoint=null;this.edgeState=null;this.previous=null;this.error=null;this.sourceConstraint=null;this.mouseDownCounter=0;this.first=null;this.fireEvent(new mxEventObject(mxEvent.RESET))};mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(this.error==null);this.shape.redraw()};mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t);this.shape.stroke=this.getEdgeColor(t)};mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR};mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1};mxConnectionHandler.prototype.connect=function(t,e,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel();var s=false;var l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)){e=this.createTargetVertex(i,t);if(e!=null){n=this.graph.getDropTarget([e],i,n);s=true;if(n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x;o.y-=a.origin.y}}else{n=this.graph.getDefaultParent()}this.graph.addCell(e,n)}}var h=this.graph.getDefaultParent();if(t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()){h=r.getParent(t);if(t.geometry!=null&&t.geometry.relative&&(e.geometry!=null&&e.geometry.relative)){h=r.getParent(h)}}var u=null;var d=null;if(this.edgeState!=null){u=this.edgeState.cell.value;d=this.edgeState.cell.style}l=this.insertEdge(h,null,u,t,e,d);if(l!=null){this.graph.setConnectionConstraint(l,t,true,this.sourceConstraint);this.graph.setConnectionConstraint(l,e,false,this.constraintHandler.currentConstraint);if(this.edgeState!=null){r.setGeometry(l,this.edgeState.cell.geometry)}var h=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){var o=t;while(o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent){o=this.graph.model.getParent(o)}if(o!=null&&o.parent!=null&&o.parent==l.parent){r.add(h,l,o.parent.getIndex(o))}}var p=r.getGeometry(l);if(p==null){p=new mxGeometry;p.relative=true;r.setGeometry(l,p)}if(this.waypoints!=null&&this.waypoints.length>0){var m=this.graph.view.scale;var c=this.graph.view.translate;p.points=[];for(var x=0;x<this.waypoints.length;x++){var f=this.waypoints[x];p.points.push(new mxPoint(f.x/m-c.x,f.y/m-c.y))}}if(e==null){var g=this.graph.view.translate;var m=this.graph.view.scale;var f=this.originalPoint!=null?new mxPoint(this.originalPoint.x/m-g.x,this.originalPoint.y/m-g.y):new mxPoint(this.currentPoint.x/m-g.x,this.currentPoint.y/m-g.y);f.x-=this.graph.panDx/this.graph.view.scale;f.y-=this.graph.panDy/this.graph.view.scale;p.setTerminalPoint(f,false)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",l,"terminal",e,"event",i,"target",n,"terminalInserted",s))}}catch(v){mxLog.show();mxLog.debug(v.message)}finally{r.endUpdate()}if(this.select){this.selectCells(l,s?e:null)}}};mxConnectionHandler.prototype.selectCells=function(t,e){this.graph.setSelectionCell(t)};mxConnectionHandler.prototype.insertEdge=function(t,e,i,n,r,s){if(this.factoryMethod==null){return this.graph.insertEdge(t,e,i,n,r,s)}else{var l=this.createEdge(i,n,r,s);l=this.graph.addEdge(l,t,n,r);return l}};mxConnectionHandler.prototype.createTargetVertex=function(t,e){var i=this.graph.getCellGeometry(e);while(i!=null&&i.relative){e=this.graph.getModel().getParent(e);i=this.graph.getCellGeometry(e)}var n=this.graph.cloneCell(e);var i=this.graph.getModel().getGeometry(n);if(i!=null){var r=this.graph.view.translate;var s=this.graph.view.scale;var l=new mxPoint(this.currentPoint.x/s-r.x,this.currentPoint.y/s-r.y);i.x=Math.round(l.x-i.width/2-this.graph.panDx/s);i.y=Math.round(l.y-i.height/2-this.graph.panDy/s);var a=this.getAlignmentTolerance();if(a>0){var o=this.graph.view.getState(e);if(o!=null){var h=o.x/s-r.x;var u=o.y/s-r.y;if(Math.abs(h-i.x)<=a){i.x=Math.round(h)}if(Math.abs(u-i.y)<=a){i.y=Math.round(u)}}}}return n};mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance};mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(this.factoryMethod!=null){r=this.factoryMethod(e,i,n)}if(r==null){r=new mxCell(t||"");r.setEdge(true);r.setStyle(n);var s=new mxGeometry;s.relative=true;r.setGeometry(s)}return r};mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.marker!=null){this.marker.destroy();this.marker=null}if(this.constraintHandler!=null){this.constraintHandler.destroy();this.constraintHandler=null}if(this.changeHandler!=null){this.graph.getModel().removeListener(this.changeHandler);this.graph.getView().removeListener(this.changeHandler);this.changeHandler=null}if(this.drillHandler!=null){this.graph.removeListener(this.drillHandler);this.graph.getView().removeListener(this.drillHandler);this.drillHandler=null}if(this.escapeHandler!=null){this.graph.removeListener(this.escapeHandler);this.escapeHandler=null}};__mxOutput.mxConnectionHandler=typeof mxConnectionHandler!=="undefined"?mxConnectionHandler:undefined;function mxConstraintHandler(t){this.graph=t;this.resetHandler=mxUtils.bind(this,(function(t,e){if(this.currentFocus!=null&&this.graph.view.getState(this.currentFocus.cell)==null){this.reset()}else{this.redraw()}}));this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE,this.resetHandler);this.graph.addListener(mxEvent.ROOT,this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5);mxConstraintHandler.prototype.graph=null;mxConstraintHandler.prototype.enabled=true;mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR;mxConstraintHandler.prototype.isEnabled=function(){return this.enabled};mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t};mxConstraintHandler.prototype.reset=function(){if(this.focusIcons!=null){for(var t=0;t<this.focusIcons.length;t++){this.focusIcons[t].destroy()}this.focusIcons=null}if(this.focusHighlight!=null){this.focusHighlight.destroy();this.focusHighlight=null}this.currentConstraint=null;this.currentFocusArea=null;this.currentPoint=null;this.currentFocus=null;this.focusPoints=null};mxConstraintHandler.prototype.getTolerance=function(t){return this.graph.getTolerance()};mxConstraintHandler.prototype.getImageForConstraint=function(t,e,i){return this.pointImage};mxConstraintHandler.prototype.isEventIgnored=function(t,e){return false};mxConstraintHandler.prototype.isStateIgnored=function(t,e){return false};mxConstraintHandler.prototype.destroyIcons=function(){if(this.focusIcons!=null){for(var t=0;t<this.focusIcons.length;t++){this.focusIcons[t].destroy()}this.focusIcons=null;this.focusPoints=null}};mxConstraintHandler.prototype.destroyFocusHighlight=function(){if(this.focusHighlight!=null){this.focusHighlight.destroy();this.focusHighlight=null}};mxConstraintHandler.prototype.isKeepFocusEvent=function(t){return mxEvent.isShiftDown(t.getEvent())};mxConstraintHandler.prototype.getCellForEvent=function(t,e){var i=t.getCell();if(i==null&&e!=null&&(t.getGraphX()!=e.x||t.getGraphY()!=e.y)){i=this.graph.getCellAt(e.x,e.y)}if(i!=null&&!this.graph.isCellConnectable(i)){var n=this.graph.getModel().getParent(i);if(this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)){i=n}}return this.graph.isCellLocked(i)?null:i};mxConstraintHandler.prototype.update=function(t,e,i,n){if(this.isEnabled()&&!this.isEventIgnored(t)){if(this.mouseleaveHandler==null&&this.graph.container!=null){this.mouseleaveHandler=mxUtils.bind(this,(function(){this.reset()}));mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler)}var r=this.getTolerance(t);var s=n!=null?n.x:t.getGraphX();var l=n!=null?n.y:t.getGraphY();var a=new mxRectangle(s-r,l-r,2*r,2*r);var o=new mxRectangle(t.getGraphX()-r,t.getGraphY()-r,2*r,2*r);var h=this.graph.view.getState(this.getCellForEvent(t,n));if(!this.isKeepFocusEvent(t)&&(this.currentFocusArea==null||this.currentFocus==null||h!=null||!this.graph.getModel().isVertex(this.currentFocus.cell)||!mxUtils.intersects(this.currentFocusArea,o))&&h!=this.currentFocus){this.currentFocusArea=null;this.currentFocus=null;this.setFocus(t,h,e)}this.currentConstraint=null;this.currentPoint=null;var u=null;if(this.focusIcons!=null&&this.constraints!=null&&(h==null||this.currentFocus==h)){var d=o.getCenterX();var p=o.getCenterY();for(var m=0;m<this.focusIcons.length;m++){var c=d-this.focusIcons[m].bounds.getCenterX();var x=p-this.focusIcons[m].bounds.getCenterY();var f=c*c+x*x;if((this.intersects(this.focusIcons[m],o,e,i)||n!=null&&this.intersects(this.focusIcons[m],a,e,i))&&(u==null||f<u)){this.currentConstraint=this.constraints[m];this.currentPoint=this.focusPoints[m];u=f;var f=this.focusIcons[m].bounds.clone();f.grow(mxConstants.HIGHLIGHT_SIZE+1);f.width-=1;f.height-=1;if(this.focusHighlight==null){var g=this.createHighlightShape();g.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML;g.pointerEvents=false;g.init(this.graph.getView().getOverlayPane());this.focusHighlight=g;var v=mxUtils.bind(this,(function(){return this.currentFocus!=null?this.currentFocus:h}));mxEvent.redirectMouseEvents(g.node,this.graph,v)}this.focusHighlight.bounds=f;this.focusHighlight.redraw()}}}if(this.currentConstraint==null){this.destroyFocusHighlight()}}else{this.currentConstraint=null;this.currentFocus=null;this.currentPoint=null}};mxConstraintHandler.prototype.redraw=function(){if(this.currentFocus!=null&&this.constraints!=null&&this.focusIcons!=null){var t=this.graph.view.getState(this.currentFocus.cell);this.currentFocus=t;this.currentFocusArea=new mxRectangle(t.x,t.y,t.width,t.height);for(var e=0;e<this.constraints.length;e++){var i=this.graph.getConnectionPoint(t,this.constraints[e]);var n=this.getImageForConstraint(t,this.constraints[e],i);var r=new mxRectangle(Math.round(i.x-n.width/2),Math.round(i.y-n.height/2),n.width,n.height);this.focusIcons[e].bounds=r;this.focusIcons[e].redraw();this.currentFocusArea.add(this.focusIcons[e].bounds);this.focusPoints[e]=i}}};mxConstraintHandler.prototype.setFocus=function(t,e,i){this.constraints=e!=null&&!this.isStateIgnored(e,i)&&this.graph.isCellConnectable(e.cell)?this.isEnabled()?this.graph.getAllConnectionConstraints(e,i)||[]:[]:null;if(this.constraints!=null){this.currentFocus=e;this.currentFocusArea=new mxRectangle(e.x,e.y,e.width,e.height);if(this.focusIcons!=null){for(var n=0;n<this.focusIcons.length;n++){this.focusIcons[n].destroy()}this.focusIcons=null;this.focusPoints=null}this.focusPoints=[];this.focusIcons=[];for(var n=0;n<this.constraints.length;n++){var r=this.graph.getConnectionPoint(e,this.constraints[n]);var s=this.getImageForConstraint(e,this.constraints[n],r);var l=s.src;var a=new mxRectangle(Math.round(r.x-s.width/2),Math.round(r.y-s.height/2),s.width,s.height);var o=new mxImageShape(a,l);o.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;o.preserveImageAspect=false;o.init(this.graph.getView().getDecoratorPane());if(mxClient.IS_QUIRKS||document.documentMode==8){mxEvent.addListener(o.node,"dragstart",(function(t){mxEvent.consume(t);return false}))}if(o.node.previousSibling!=null){o.node.parentNode.insertBefore(o.node,o.node.parentNode.firstChild)}var h=mxUtils.bind(this,(function(){return this.currentFocus!=null?this.currentFocus:e}));o.redraw();mxEvent.redirectMouseEvents(o.node,this.graph,h);this.currentFocusArea.add(o.bounds);this.focusIcons.push(o);this.focusPoints.push(r)}this.currentFocusArea.grow(this.getTolerance(t))}else{this.destroyIcons();this.destroyFocusHighlight()}};mxConstraintHandler.prototype.createHighlightShape=function(){var t=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);t.opacity=mxConstants.HIGHLIGHT_OPACITY;return t};mxConstraintHandler.prototype.intersects=function(t,e,i,n){return mxUtils.intersects(t.bounds,e)};mxConstraintHandler.prototype.destroy=function(){this.reset();if(this.resetHandler!=null){this.graph.model.removeListener(this.resetHandler);this.graph.view.removeListener(this.resetHandler);this.graph.removeListener(this.resetHandler);this.resetHandler=null}if(this.mouseleaveHandler!=null&&this.graph.container!=null){mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler);this.mouseleaveHandler=null}};__mxOutput.mxConstraintHandler=typeof mxConstraintHandler!=="undefined"?mxConstraintHandler:undefined;function mxRubberband(t){if(t!=null){this.graph=t;this.graph.addMouseListener(this);this.forceRubberbandHandler=mxUtils.bind(this,(function(t,e){var i=e.getProperty("eventName");var n=e.getProperty("event");if(i==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(n)){var r=mxUtils.getOffset(this.graph.container);var s=mxUtils.getScrollOrigin(this.graph.container);s.x-=r.x;s.y-=r.y;this.start(n.getX()+s.x,n.getY()+s.y);n.consume(false)}}));this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler);this.panHandler=mxUtils.bind(this,(function(){this.repaint()}));this.graph.addListener(mxEvent.PAN,this.panHandler);this.gestureHandler=mxUtils.bind(this,(function(t,e){if(this.first!=null){this.reset()}}));this.graph.addListener(mxEvent.GESTURE,this.gestureHandler);if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}}mxRubberband.prototype.defaultOpacity=20;mxRubberband.prototype.enabled=true;mxRubberband.prototype.div=null;mxRubberband.prototype.sharedDiv=null;mxRubberband.prototype.currentX=0;mxRubberband.prototype.currentY=0;mxRubberband.prototype.fadeOut=false;mxRubberband.prototype.isEnabled=function(){return this.enabled};mxRubberband.prototype.setEnabled=function(t){this.enabled=t};mxRubberband.prototype.isForceRubberbandEvent=function(t){return mxEvent.isAltDown(t.getEvent())};mxRubberband.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&e.getState()==null&&!mxEvent.isMultiTouchEvent(e.getEvent())){var i=mxUtils.getOffset(this.graph.container);var n=mxUtils.getScrollOrigin(this.graph.container);n.x-=i.x;n.y-=i.y;this.start(e.getX()+n.x,e.getY()+n.y);e.consume(false)}};mxRubberband.prototype.start=function(t,e){this.first=new mxPoint(t,e);var i=this.graph.container;function n(t){var e=new mxMouseEvent(t);var n=mxUtils.convertPoint(i,e.getX(),e.getY());e.graphX=n.x;e.graphY=n.y;return e}this.dragHandler=mxUtils.bind(this,(function(t){this.mouseMove(this.graph,n(t))}));this.dropHandler=mxUtils.bind(this,(function(t){this.mouseUp(this.graph,n(t))}));if(mxClient.IS_FF){mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)}};mxRubberband.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&this.first!=null){var i=mxUtils.getScrollOrigin(this.graph.container);var n=mxUtils.getOffset(this.graph.container);i.x-=n.x;i.y-=n.y;var r=e.getX()+i.x;var s=e.getY()+i.y;var l=this.first.x-r;var a=this.first.y-s;var o=this.graph.tolerance;if(this.div!=null||Math.abs(l)>o||Math.abs(a)>o){if(this.div==null){this.div=this.createShape()}mxUtils.clearSelection();this.update(r,s);e.consume()}}};mxRubberband.prototype.createShape=function(){if(this.sharedDiv==null){this.sharedDiv=document.createElement("div");this.sharedDiv.className="mxRubberband";mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)}this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){this.sharedDiv=null}return t};mxRubberband.prototype.isActive=function(t,e){return this.div!=null&&this.div.style.display!="none"};mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset();if(i){this.execute(e.getEvent());e.consume()}};mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)};mxRubberband.prototype.reset=function(){if(this.div!=null){if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear");t.style.pointerEvents="none";t.style.opacity=0;window.setTimeout((function(){t.parentNode.removeChild(t)}),200)}else{this.div.parentNode.removeChild(this.div)}}mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dragHandler=null;this.dropHandler=null;this.currentX=0;this.currentY=0;this.first=null;this.div=null};mxRubberband.prototype.update=function(t,e){this.currentX=t;this.currentY=e;this.repaint()};mxRubberband.prototype.repaint=function(){if(this.div!=null){var t=this.currentX-this.graph.panDx;var e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t);this.y=Math.min(this.first.y,e);this.width=Math.max(this.first.x,t)-this.x;this.height=Math.max(this.first.y,e)-this.y;var i=mxClient.IS_VML?this.graph.panDx:0;var n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px";this.div.style.top=this.y+n+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1,this.height)+"px"}};mxRubberband.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;this.graph.removeMouseListener(this);this.graph.removeListener(this.forceRubberbandHandler);this.graph.removeListener(this.panHandler);this.reset();if(this.sharedDiv!=null){this.sharedDiv=null}}};__mxOutput.mxRubberband=typeof mxRubberband!=="undefined"?mxRubberband:undefined;function mxHandle(t,e,i,n){this.graph=t.view.graph;this.state=t;this.cursor=e!=null?e:this.cursor;this.image=i!=null?i:this.image;this.shape=n!=null?n:null;this.init()}mxHandle.prototype.cursor="default";mxHandle.prototype.image=null;mxHandle.prototype.ignoreGrid=false;mxHandle.prototype.getPosition=function(t){};mxHandle.prototype.setPosition=function(t,e,i){};mxHandle.prototype.execute=function(t){};mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])};mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale;var i=this.graph.view.translate;var n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);if(this.shape!=null&&this.shape.bounds!=null){n.x-=this.shape.bounds.width/e/4;n.y-=this.shape.bounds.height/e/4}var r=-mxUtils.toRadians(this.getRotation());var s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s));this.setPosition(this.state.getPaintBounds(),n,t);this.redraw()};mxHandle.prototype.positionChanged=function(){if(this.state.text!=null){this.state.text.apply(this.state)}if(this.state.shape!=null){this.state.shape.apply(this.state)}this.graph.cellRenderer.redraw(this.state,true)};mxHandle.prototype.getRotation=function(){if(this.state.shape!=null){return this.state.shape.getRotation()}return 0};mxHandle.prototype.getTotalRotation=function(){if(this.state.shape!=null){return this.state.shape.getShapeRotation()}return 0};mxHandle.prototype.init=function(){var t=this.isHtmlRequired();if(this.image!=null){this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src);this.shape.preserveImageAspect=false}else if(this.shape==null){this.shape=this.createShape(t)}this.initShape(t)};mxHandle.prototype.createShape=function(t){var e=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(e,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};mxHandle.prototype.initShape=function(t){if(t&&this.shape.isHtmlAllowed()){this.shape.dialect=mxConstants.DIALECT_STRICTHTML;this.shape.init(this.graph.container)}else{this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;if(this.cursor!=null){this.shape.init(this.graph.getView().getOverlayPane())}}mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.shape.node.style.cursor=this.cursor};mxHandle.prototype.redraw=function(){if(this.shape!=null&&this.state.shape!=null){var t=this.getPosition(this.state.getPaintBounds());if(t!=null){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale;var n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2);this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2);this.shape.redraw()}}};mxHandle.prototype.isHtmlRequired=function(){return this.state.text!=null&&this.state.text.node.parentNode==this.graph.container};mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds();var n=new mxPoint(i.getCenterX(),i.getCenterY());var r=Math.cos(e);var s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)};mxHandle.prototype.flipPoint=function(t){if(this.state.shape!=null){var e=this.state.getCellBounds();if(this.state.shape.flipH){t.x=2*e.x+e.width-t.x}if(this.state.shape.flipV){t.y=2*e.y+e.height-t.y}}return t};mxHandle.prototype.snapPoint=function(t,e){if(!e){t.x=this.graph.snap(t.x);t.y=this.graph.snap(t.y)}return t};mxHandle.prototype.setVisible=function(t){if(this.shape!=null&&this.shape.node!=null){this.shape.node.style.display=t?"":"none"}};mxHandle.prototype.reset=function(){this.setVisible(true);this.state.style=this.graph.getCellStyle(this.state.cell);this.positionChanged()};mxHandle.prototype.destroy=function(){if(this.shape!=null){this.shape.destroy();this.shape=null}};__mxOutput.mxHandle=typeof mxHandle!=="undefined"?mxHandle:undefined;function mxVertexHandler(t){if(t!=null){this.state=t;this.init();this.escapeHandler=mxUtils.bind(this,(function(t,e){if(this.livePreview&&this.index!=null){this.state.view.graph.cellRenderer.redraw(this.state,true);this.state.view.invalidate(this.state.cell);this.state.invalid=false;this.state.view.validate()}this.reset()}));this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}}mxVertexHandler.prototype.graph=null;mxVertexHandler.prototype.state=null;mxVertexHandler.prototype.singleSizer=false;mxVertexHandler.prototype.index=null;mxVertexHandler.prototype.allowHandleBoundsCheck=true;mxVertexHandler.prototype.handleImage=null;mxVertexHandler.prototype.handlesVisible=true;mxVertexHandler.prototype.tolerance=0;mxVertexHandler.prototype.rotationEnabled=false;mxVertexHandler.prototype.parentHighlightEnabled=false;mxVertexHandler.prototype.rotationRaster=true;mxVertexHandler.prototype.rotationCursor="crosshair";mxVertexHandler.prototype.livePreview=false;mxVertexHandler.prototype.movePreviewToFront=false;mxVertexHandler.prototype.manageSizers=false;mxVertexHandler.prototype.constrainGroupByChildren=false;mxVertexHandler.prototype.rotationHandleVSpacing=-16;mxVertexHandler.prototype.horizontalOffset=0;mxVertexHandler.prototype.verticalOffset=0;mxVertexHandler.prototype.init=function(){this.graph=this.state.view.graph;this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.selectionBorder=this.createSelectionShape(this.bounds);this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.selectionBorder.pointerEvents=false;this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");this.selectionBorder.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state);if(this.graph.isCellMovable(this.state.cell)){this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX)}if(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var t=this.graph.isCellResizable(this.state.cell);this.sizers=[];if(t||this.graph.isLabelMovable(this.state.cell)&&this.state.width>=2&&this.state.height>=2){var e=0;if(t){if(!this.singleSizer){this.sizers.push(this.createSizer("nw-resize",e++));this.sizers.push(this.createSizer("n-resize",e++));this.sizers.push(this.createSizer("ne-resize",e++));this.sizers.push(this.createSizer("w-resize",e++));this.sizers.push(this.createSizer("e-resize",e++));this.sizers.push(this.createSizer("sw-resize",e++));this.sizers.push(this.createSizer("s-resize",e++))}this.sizers.push(this.createSizer("se-resize",e++))}var i=this.graph.model.getGeometry(this.state.cell);if(i!=null&&!i.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)){this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR);this.sizers.push(this.labelShape)}}else if(this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2){this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR);this.sizers.push(this.labelShape)}}if(this.isRotationHandleVisible()){this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR);this.sizers.push(this.rotationShape)}this.customHandles=this.createCustomHandles();this.redraw();if(this.constrainGroupByChildren){this.updateMinBounds()}};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t.getEvent())||this.state.style[mxConstants.STYLE_ASPECT]=="fixed"};mxVertexHandler.prototype.isCenteredEvent=function(t,e){return false};mxVertexHandler.prototype.createCustomHandles=function(){return null};mxVertexHandler.prototype.updateMinBounds=function(){var t=this.graph.getChildCells(this.state.cell);if(t.length>0){this.minBounds=this.graph.view.getBounds(t);if(this.minBounds!=null){var e=this.state.view.scale;var i=this.state.view.translate;this.minBounds.x-=this.state.x;this.minBounds.y-=this.state.y;this.minBounds.x/=e;this.minBounds.y/=e;this.minBounds.width/=e;this.minBounds.height/=e;this.x0=this.state.x/e-i.x;this.y0=this.state.y/e-i.y}}};mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))};mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)};mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());e.strokewidth=this.getSelectionStrokeWidth();e.isDashed=this.isSelectionDashed();return e};mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR};mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH};mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED};mxVertexHandler.prototype.createSizer=function(t,e,i,n){i=i||mxConstants.HANDLE_SIZE;var r=new mxRectangle(0,0,i,i);var s=this.createSizerShape(r,e,n);if(s.isHtmlAllowed()&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container){s.bounds.height-=1;s.bounds.width-=1;s.dialect=mxConstants.DIALECT_STRICTHTML;s.init(this.graph.container)}else{s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;s.init(this.graph.getView().getOverlayPane())}mxEvent.redirectMouseEvents(s.node,this.graph,this.state);if(this.graph.isEnabled()){s.setCursor(t)}if(!this.isSizerVisible(e)){s.visible=false}return s};mxVertexHandler.prototype.isSizerVisible=function(t){return true};mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(this.handleImage!=null){t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height);var n=new mxImageShape(t,this.handleImage.src);n.preserveImageAspect=false;return n}else if(e==mxEvent.ROTATION_HANDLE){return new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}else{return new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}};mxVertexHandler.prototype.moveSizerTo=function(t,e,i){if(t!=null){t.bounds.x=Math.floor(e-t.bounds.width/2);t.bounds.y=Math.floor(i-t.bounds.height/2);if(t.node!=null&&t.node.style.display!="none"){t.redraw()}}};mxVertexHandler.prototype.getHandleForEvent=function(t){var e=!mxEvent.isMouseEvent(t.getEvent())?this.tolerance:1;var i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null;var n=mxUtils.bind(this,(function(e){var n=e!=null&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null;var r=n!=null?new mxRectangle(t.getGraphX()-Math.floor(n/2),t.getGraphY()-Math.floor(n/2),n,n):i;return e!=null&&(t.isSource(e)||r!=null&&mxUtils.intersects(e.bounds,r)&&e.node.style.display!="none"&&e.node.style.visibility!="hidden")}));if(n(this.rotationShape)){return mxEvent.ROTATION_HANDLE}else if(n(this.labelShape)){return mxEvent.LABEL_HANDLE}if(this.sizers!=null){for(var r=0;r<this.sizers.length;r++){if(n(this.sizers[r])){return r}}}if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var r=this.customHandles.length-1;r>=0;r--){if(n(this.customHandles[r].shape)){return mxEvent.CUSTOM_HANDLE-r}}}return null};mxVertexHandler.prototype.isCustomHandleEvent=function(t){return true};mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var i=this.getHandleForEvent(e);if(i!=null){this.start(e.getGraphX(),e.getGraphY(),i);e.consume()}}};mxVertexHandler.prototype.isLivePreviewBorder=function(){return this.state.shape!=null&&this.state.shape.fill==null&&this.state.shape.stroke==null};mxVertexHandler.prototype.start=function(t,e,i){if(this.selectionBorder!=null){this.livePreviewActive=this.livePreview&&this.graph.model.getChildCount(this.state.cell)==0;this.inTolerance=true;this.childOffsetX=0;this.childOffsetY=0;this.index=i;this.startX=t;this.startY=e;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview()){this.ghostPreview=this.createGhostPreview()}else{var n=this.state.view.graph.model;var r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))){this.parentState=this.state.view.graph.view.getState(r)}this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none";if(!this.livePreviewActive||this.isLivePreviewBorder()){this.preview=this.createSelectionShape(this.bounds);if(!(mxClient.IS_SVG&&Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")!=0)&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container){this.preview.dialect=mxConstants.DIALECT_STRICTHTML;this.preview.init(this.graph.container)}else{this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.preview.init(this.graph.view.getOverlayPane())}}if(i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition();var l=s.x-this.state.getCenterX();var a=s.y-this.state.getCenterY();this.startAngle=l!=0?Math.atan(a/l)*180/Math.PI+90:0;this.startDist=Math.sqrt(l*l+a*a)}if(this.livePreviewActive){this.hideSizers();if(i==mxEvent.ROTATION_HANDLE){this.rotationShape.node.style.display=""}else if(i==mxEvent.LABEL_HANDLE){this.labelShape.node.style.display=""}else if(this.sizers!=null&&this.sizers[i]!=null){this.sizers[i].node.style.display=""}else if(i<=mxEvent.CUSTOM_HANDLE&&this.customHandles!=null){this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(true)}var o=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var h=0;h<o.length;h++){var u=this.graph.selectionCellsHandler.getHandler(o[h]);if(u!=null){this.edgeHandlers.push(u)}}}}}};mxVertexHandler.prototype.createGhostPreview=function(){var t=this.graph.cellRenderer.createShape(this.state);t.init(this.graph.view.getOverlayPane());t.scale=this.state.view.scale;t.bounds=this.bounds;t.outline=true;return t};mxVertexHandler.prototype.setHandlesVisible=function(t){this.handlesVisible=t;if(this.sizers!=null){for(var e=0;e<this.sizers.length;e++){this.sizers[e].node.style.display=t?"":"none"}}if(this.customHandles!=null){for(var e=0;e<this.customHandles.length;e++){this.customHandles[e].setVisible(t)}}};mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(false)};mxVertexHandler.prototype.checkTolerance=function(t){if(this.inTolerance&&this.startX!=null&&this.startY!=null){if(mxEvent.isMouseEvent(t.getEvent())||Math.abs(t.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance){this.inTolerance=false}}};mxVertexHandler.prototype.updateHint=function(t){};mxVertexHandler.prototype.removeHint=function(){};mxVertexHandler.prototype.roundAngle=function(t){return Math.round(t*10)/10};mxVertexHandler.prototype.roundLength=function(t){return Math.round(t*100)/100};mxVertexHandler.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&this.index!=null){this.checkTolerance(e);if(!this.inTolerance){if(this.index<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=true;if(this.ghostPreview!=null){this.ghostPreview.apply(this.state);this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale;this.ghostPreview.isDashed=this.isSelectionDashed();this.ghostPreview.stroke=this.getSelectionColor();this.ghostPreview.redraw();if(this.selectionBounds!=null){this.selectionBorder.node.style.display="none"}}else{if(this.movePreviewToFront){this.moveToFront()}this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged()}}}else if(this.index==mxEvent.LABEL_HANDLE){this.moveLabel(e)}else{if(this.index==mxEvent.ROTATION_HANDLE){this.rotateVertex(e)}else{this.resizeVertex(e)}this.updateHint(e)}}e.consume()}else if(!this.graph.isMouseDown&&this.getHandleForEvent(e)!=null){e.consume(false)}};mxVertexHandler.prototype.isGhostPreview=function(){return this.state.view.graph.model.getChildCount(this.state.cell)>0};mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY());var i=this.graph.view.translate;var n=this.graph.view.scale;if(this.graph.isGridEnabledEvent(t.getEvent())){e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n;e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n}var r=this.rotationShape!=null?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)};mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY());var i=this.state.x+this.state.width/2-e.x;var n=this.state.y+this.state.height/2-e.y;this.currentAlpha=i!=0?Math.atan(n/i)*180/Math.PI+90:n<0?180:0;if(i>0){this.currentAlpha-=180}this.currentAlpha-=this.startAngle;if(this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){var i=e.x-this.state.getCenterX();var n=e.y-this.state.getCenterY();var r=Math.sqrt(i*i+n*n);if(r-this.startDist<2){raster=15}else if(r-this.startDist<25){raster=5}else{raster=1}this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else{this.currentAlpha=this.roundAngle(this.currentAlpha)}this.selectionBorder.rotation=this.currentAlpha;this.selectionBorder.redraw();if(this.livePreviewActive){this.redrawHandles()}};mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY());var i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var n=new mxPoint(t.getGraphX(),t.getGraphY());var r=this.graph.view.translate;var s=this.graph.view.scale;var l=Math.cos(-i);var a=Math.sin(-i);var o=n.x-this.startX;var h=n.y-this.startY;var u=l*o-a*h;var d=a*o+l*h;o=u;h=d;var p=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(p,o/s,h/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t));if(!p.relative){var m=this.graph.getMaximumGraphBounds();if(m!=null&&this.parentState!=null){m=mxRectangle.fromRectangle(m);m.x-=(this.parentState.x-r.x*s)/s;m.y-=(this.parentState.y-r.y*s)/s}if(this.graph.isConstrainChild(this.state.cell)){var c=this.graph.getCellContainmentArea(this.state.cell);if(c!=null){var x=this.graph.getOverlap(this.state.cell);if(x>0){c=mxRectangle.fromRectangle(c);c.x-=c.width*x;c.y-=c.height*x;c.width+=2*c.width*x;c.height+=2*c.height*x}if(m==null){m=c}else{m=mxRectangle.fromRectangle(m);m.intersect(c)}}}if(m!=null){if(this.unscaledBounds.x<m.x){this.unscaledBounds.width-=m.x-this.unscaledBounds.x;this.unscaledBounds.x=m.x}if(this.unscaledBounds.y<m.y){this.unscaledBounds.height-=m.y-this.unscaledBounds.y;this.unscaledBounds.y=m.y}if(this.unscaledBounds.x+this.unscaledBounds.width>m.x+m.width){this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-m.x-m.width}if(this.unscaledBounds.y+this.unscaledBounds.height>m.y+m.height){this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-m.y-m.height}}}var f=this.bounds;this.bounds=new mxRectangle((this.parentState!=null?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(this.parentState!=null?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s);if(p.relative&&this.parentState!=null){this.bounds.x+=this.state.x-this.parentState.x;this.bounds.y+=this.state.y-this.parentState.y}l=Math.cos(i);a=Math.sin(i);var g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY());var o=g.x-e.x;var h=g.y-e.y;var v=l*o-a*h;var y=a*o+l*h;var C=v-o;var E=y-h;var S=this.bounds.x-this.state.x;var b=this.bounds.y-this.state.y;var w=l*S-a*b;var T=a*S+l*b;this.bounds.x+=C;this.bounds.y+=E;this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+C/s);this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+E/s);this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width);this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height);if(!this.graph.isCellCollapsed(this.state.cell)&&(C!=0||E!=0)){this.childOffsetX=this.state.x-this.bounds.x+w;this.childOffsetY=this.state.y-this.bounds.y+T}else{this.childOffsetX=0;this.childOffsetY=0}if(!f.equals(this.bounds)){if(this.livePreviewActive){this.updateLivePreview(t)}if(this.preview!=null){this.drawPreview()}else{this.updateParentHighlight()}}};mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale;var i=this.graph.view.translate;var n=this.state.clone();this.state.x=this.bounds.x;this.state.y=this.bounds.y;this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y);this.state.width=this.bounds.width;this.state.height=this.bounds.height;this.state.absoluteOffset.x=0;this.state.absoluteOffset.y=0;var r=this.graph.getCellGeometry(this.state.cell);if(r!=null){var s=r.offset||this.EMPTY_POINT;if(s!=null&&!r.relative){this.state.absoluteOffset.x=this.state.view.scale*s.x;this.state.absoluteOffset.y=this.state.view.scale*s.y}this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,true);this.state.view.invalidate(this.state.cell);this.state.invalid=false;this.state.view.validate();this.redrawHandles();if(this.movePreviewToFront){this.moveToFront()}if(this.state.control!=null&&this.state.control.node!=null){this.state.control.node.style.visibility="hidden"}this.state.setState(n)};mxVertexHandler.prototype.moveToFront=function(){if(this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.nextSibling!=null||this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.nextSibling!=null&&(this.state.text==null||this.state.shape.node.nextSibling!=this.state.text.node)){if(this.state.shape!=null&&this.state.shape.node!=null){this.state.shape.node.parentNode.appendChild(this.state.shape.node)}if(this.state.text!=null&&this.state.text.node!=null){this.state.text.node.parentNode.appendChild(this.state.text.node)}}};mxVertexHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.state!=null){var i=new mxPoint(e.getGraphX(),e.getGraphY());var n=this.index;this.index=null;if(this.ghostPreview==null){this.state.view.invalidate(this.state.cell,false,false);this.state.view.validate()}this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){var r=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=false;this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e);if(this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-n]!=null){this.state.style=r;this.customHandles[mxEvent.CUSTOM_HANDLE-n].positionChanged()}}}else if(n==mxEvent.ROTATION_HANDLE){if(this.currentAlpha!=null){var s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);if(s!=0){this.rotateCell(this.state.cell,s)}}else{this.rotateClick()}}else{var l=this.graph.isGridEnabledEvent(e.getEvent());var a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var o=Math.cos(-a);var h=Math.sin(-a);var u=i.x-this.startX;var d=i.y-this.startY;var p=o*u-h*d;var m=h*u+o*d;u=p;d=m;var c=this.graph.view.scale;var x=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(u/c),this.roundLength(d/c),n,l,this.isConstrainedEvent(e),x)}}finally{this.graph.getModel().endUpdate()}e.consume();this.reset();this.redrawHandles()}};mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)};mxVertexHandler.prototype.rotateClick=function(){};mxVertexHandler.prototype.rotateCell=function(t,e,i){if(e!=0){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.getCurrentCellStyle(t);var s=(r[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var l=this.graph.getCellGeometry(t);if(l!=null){var a=this.graph.getCellGeometry(i);if(a!=null&&!n.isEdge(i)){l=l.clone();l.rotate(e,new mxPoint(a.width/2,a.height/2));n.setGeometry(t,l)}if(n.isVertex(t)&&!l.relative||n.isEdge(t)){var o=n.getChildCount(t);for(var h=0;h<o;h++){this.rotateCell(n.getChildAt(t,h),e,t)}}}}}};mxVertexHandler.prototype.reset=function(){if(this.sizers!=null&&this.index!=null&&this.sizers[this.index]!=null&&this.sizers[this.index].node.style.display=="none"){this.sizers[this.index].node.style.display=""}this.currentAlpha=null;this.inTolerance=null;this.index=null;if(this.preview!=null){this.preview.destroy();this.preview=null}if(this.ghostPreview!=null){this.ghostPreview.destroy();this.ghostPreview=null}if(this.livePreviewActive&&this.sizers!=null){for(var t=0;t<this.sizers.length;t++){if(this.sizers[t]!=null){this.sizers[t].node.style.display=""}}if(this.state.control!=null&&this.state.control.node!=null){this.state.control.node.style.visibility=""}}if(this.customHandles!=null){for(var t=0;t<this.customHandles.length;t++){if(this.customHandles[t].active){this.customHandles[t].active=false;this.customHandles[t].reset()}else{this.customHandles[t].setVisible(true)}}}if(this.selectionBorder!=null){this.selectionBorder.node.style.display="inline";this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview()}this.removeHint();this.redrawHandles();this.edgeHandlers=null;this.handlesVisible=true;this.unscaledBounds=null;this.livePreviewActive=null};mxVertexHandler.prototype.resizeCell=function(t,e,i,n,r,s,l){var a=this.graph.model.getGeometry(t);if(a!=null){if(n==mxEvent.LABEL_HANDLE){var o=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var h=Math.cos(o);var u=Math.sin(o);var d=this.graph.view.scale;var p=mxUtils.getRotatedPoint(new mxPoint(Math.round((this.labelShape.bounds.getCenterX()-this.startX)/d),Math.round((this.labelShape.bounds.getCenterY()-this.startY)/d)),h,u);a=a.clone();if(a.offset==null){a.offset=p}else{a.offset.x+=p.x;a.offset.y+=p.y}this.graph.model.setGeometry(t,a)}else if(this.unscaledBounds!=null){var d=this.graph.view.scale;if(this.childOffsetX!=0||this.childOffsetY!=0){this.moveChildren(t,Math.round(this.childOffsetX/d),Math.round(this.childOffsetY/d))}this.graph.resizeCell(t,this.unscaledBounds,l)}}};mxVertexHandler.prototype.moveChildren=function(t,e,i){var n=this.graph.getModel();var r=n.getChildCount(t);for(var s=0;s<r;s++){var l=n.getChildAt(t,s);var a=this.graph.getCellGeometry(l);if(a!=null){a=a.clone();a.translate(e,i);n.setGeometry(l,a)}}};mxVertexHandler.prototype.union=function(t,e,i,n,r,s,l,a,o){r=r!=null?r&&this.graph.gridEnabled:this.graph.gridEnabled;if(this.singleSizer){var h=t.x+t.width+e;var u=t.y+t.height+i;if(r){h=this.graph.snap(h/s)*s;u=this.graph.snap(u/s)*s}var d=new mxRectangle(t.x,t.y,0,0);d.add(new mxRectangle(h,u,0,0));return d}else{var p=t.width;var m=t.height;var c=t.x-l.x*s;var x=c+p;var f=t.y-l.y*s;var g=f+m;var v=c+p/2;var y=f+m/2;if(n>4){g=g+i;if(r){g=this.graph.snap(g/s)*s}else{g=Math.round(g/s)*s}}else if(n<3){f=f+i;if(r){f=this.graph.snap(f/s)*s}else{f=Math.round(f/s)*s}}if(n==0||n==3||n==5){c+=e;if(r){c=this.graph.snap(c/s)*s}else{c=Math.round(c/s)*s}}else if(n==2||n==4||n==7){x+=e;if(r){x=this.graph.snap(x/s)*s}else{x=Math.round(x/s)*s}}var C=x-c;var E=g-f;if(a){var S=this.graph.getCellGeometry(this.state.cell);if(S!=null){var b=S.width/S.height;if(n==1||n==2||n==7||n==6){C=E*b}else{E=C/b}if(n==0){c=x-C;f=g-E}}}if(o){C+=C-p;E+=E-m;var w=v-(c+C/2);var T=y-(f+E/2);c+=w;f+=T;x+=w;g+=T}if(C<0){c+=C;C=Math.abs(C)}if(E<0){f+=E;E=Math.abs(E)}var L=new mxRectangle(c+l.x*s,f+l.y*s,C,E);if(this.minBounds!=null){L.width=Math.max(L.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-L.x));L.height=Math.max(L.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-L.y))}return L}};mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview();if(!t){this.redrawHandles()}};mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0);var e=this.tolerance;if(this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)){e/=2;t.x=this.sizers[0].bounds.width+e;t.y=this.sizers[0].bounds.height+e}return t};mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds};mxVertexHandler.prototype.redrawHandles=function(){var t=this.getSizerBounds();var e=this.tolerance;this.horizontalOffset=0;this.verticalOffset=0;if(this.customHandles!=null){for(var i=0;i<this.customHandles.length;i++){var n=this.customHandles[i].shape.node.style.display;this.customHandles[i].redraw();this.customHandles[i].shape.node.style.display=n;this.customHandles[i].shape.node.style.visibility=this.handlesVisible&&this.isCustomHandleVisible(this.customHandles[i])?"":"hidden"}}if(this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null){if(this.index==null&&this.manageSizers&&this.sizers.length>=8){var r=this.getHandlePadding();this.horizontalOffset=r.x;this.verticalOffset=r.y;if(this.horizontalOffset!=0||this.verticalOffset!=0){t=new mxRectangle(t.x,t.y,t.width,t.height);t.x-=this.horizontalOffset/2;t.width+=this.horizontalOffset;t.y-=this.verticalOffset/2;t.height+=this.verticalOffset}if(this.sizers.length>=8){if(t.width<2*this.sizers[0].bounds.width+2*e||t.height<2*this.sizers[0].bounds.height+2*e){this.sizers[0].node.style.display="none";this.sizers[2].node.style.display="none";this.sizers[5].node.style.display="none";this.sizers[7].node.style.display="none"}else if(this.handlesVisible){this.sizers[0].node.style.display="";this.sizers[2].node.style.display="";this.sizers[5].node.style.display="";this.sizers[7].node.style.display=""}}}var s=t.x+t.width;var l=t.y+t.height;if(this.singleSizer){this.moveSizerTo(this.sizers[0],s,l)}else{var a=t.x+t.width/2;var o=t.y+t.height/2;if(this.sizers.length>=8){var h=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"];var u=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var d=Math.cos(u);var p=Math.sin(u);var m=Math.round(u*4/Math.PI);var c=new mxPoint(t.getCenterX(),t.getCenterY());var x=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),d,p,c);this.moveSizerTo(this.sizers[0],x.x,x.y);this.sizers[0].setCursor(h[mxUtils.mod(0+m,h.length)]);x.x=a;x.y=t.y;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[1],x.x,x.y);this.sizers[1].setCursor(h[mxUtils.mod(1+m,h.length)]);x.x=s;x.y=t.y;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[2],x.x,x.y);this.sizers[2].setCursor(h[mxUtils.mod(2+m,h.length)]);x.x=t.x;x.y=o;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[3],x.x,x.y);this.sizers[3].setCursor(h[mxUtils.mod(7+m,h.length)]);x.x=s;x.y=o;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[4],x.x,x.y);this.sizers[4].setCursor(h[mxUtils.mod(3+m,h.length)]);x.x=t.x;x.y=l;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[5],x.x,x.y);this.sizers[5].setCursor(h[mxUtils.mod(6+m,h.length)]);x.x=a;x.y=l;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[6],x.x,x.y);this.sizers[6].setCursor(h[mxUtils.mod(5+m,h.length)]);x.x=s;x.y=l;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[7],x.x,x.y);this.sizers[7].setCursor(h[mxUtils.mod(4+m,h.length)]);x.x=a+this.state.absoluteOffset.x;x.y=o+this.state.absoluteOffset.y;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[8],x.x,x.y)}else if(this.state.width>=2&&this.state.height>=2){this.moveSizerTo(this.sizers[0],a+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y)}else{this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}}if(this.rotationShape!=null){var u=mxUtils.toRadians(this.currentAlpha!=null?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");var d=Math.cos(u);var p=Math.sin(u);var c=new mxPoint(this.state.getCenterX(),this.state.getCenterY());var x=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),d,p,c);if(this.rotationShape.node!=null){this.moveSizerTo(this.rotationShape,x.x,x.y);this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":""}}if(this.selectionBorder!=null){this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")}if(this.edgeHandlers!=null){for(var i=0;i<this.edgeHandlers.length;i++){this.edgeHandlers[i].redraw()}}};mxVertexHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&this.state.view.graph.getSelectionCount()==1};mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};mxVertexHandler.prototype.isParentHighlightVisible=function(){return!this.graph.isCellSelected(this.graph.model.getParent(this.state.cell))};mxVertexHandler.prototype.updateParentHighlight=function(){if(!this.isDestroyed()){var t=this.isParentHighlightVisible();var e=this.graph.model.getParent(this.state.cell);var i=this.graph.view.getState(e);if(this.parentHighlight!=null){if(this.graph.model.isVertex(e)&&t){var n=this.parentHighlight.bounds;if(i!=null&&(n.x!=i.x||n.y!=i.y||n.width!=i.width||n.height!=i.height)){this.parentHighlight.bounds=mxRectangle.fromRectangle(i);this.parentHighlight.redraw()}}else{if(i!=null&&i.parentHighlight==this.parentHighlight){i.parentHighlight=null}this.parentHighlight.destroy();this.parentHighlight=null}}else if(this.parentHighlightEnabled&&t){if(this.graph.model.isVertex(e)&&i!=null&&i.parentHighlight==null){this.parentHighlight=this.createParentHighlightShape(i);this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.parentHighlight.pointerEvents=false;this.parentHighlight.rotation=Number(i.style[mxConstants.STYLE_ROTATION]||"0");this.parentHighlight.init(this.graph.getView().getOverlayPane());this.parentHighlight.redraw();i.parentHighlight=this.parentHighlight}}}};mxVertexHandler.prototype.drawPreview=function(){if(this.preview!=null){this.preview.bounds=this.bounds;if(this.preview.node.parentNode==this.graph.container){this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1);this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)}this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");this.preview.redraw()}this.selectionBorder.bounds=this.getSelectionBorderBounds();this.selectionBorder.redraw();this.updateParentHighlight()};mxVertexHandler.prototype.getSelectionBorderBounds=function(){return this.bounds};mxVertexHandler.prototype.isDestroyed=function(){return this.selectionBorder==null};mxVertexHandler.prototype.destroy=function(){if(this.escapeHandler!=null){this.state.view.graph.removeListener(this.escapeHandler);this.escapeHandler=null}if(this.preview!=null){this.preview.destroy();this.preview=null}if(this.parentHighlight!=null){var t=this.graph.model.getParent(this.state.cell);var e=this.graph.view.getState(t);if(e!=null&&e.parentHighlight==this.parentHighlight){e.parentHighlight=null}this.parentHighlight.destroy();this.parentHighlight=null}if(this.ghostPreview!=null){this.ghostPreview.destroy();this.ghostPreview=null}if(this.selectionBorder!=null){this.selectionBorder.destroy();this.selectionBorder=null}this.labelShape=null;this.removeHint();if(this.sizers!=null){for(var i=0;i<this.sizers.length;i++){this.sizers[i].destroy()}this.sizers=null}if(this.customHandles!=null){for(var i=0;i<this.customHandles.length;i++){this.customHandles[i].destroy()}this.customHandles=null}};__mxOutput.mxVertexHandler=typeof mxVertexHandler!=="undefined"?mxVertexHandler:undefined;function mxEdgeHandler(t){if(t!=null&&t.shape!=null){this.state=t;this.init();this.escapeHandler=mxUtils.bind(this,(function(e,i){var n=this.index!=null;this.reset();if(n){this.graph.cellRenderer.redraw(this.state,false,t.view.isRendering())}}));this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}}mxEdgeHandler.prototype.graph=null;mxEdgeHandler.prototype.state=null;mxEdgeHandler.prototype.marker=null;mxEdgeHandler.prototype.constraintHandler=null;mxEdgeHandler.prototype.error=null;mxEdgeHandler.prototype.shape=null;mxEdgeHandler.prototype.bends=null;mxEdgeHandler.prototype.labelShape=null;mxEdgeHandler.prototype.cloneEnabled=true;mxEdgeHandler.prototype.addEnabled=false;mxEdgeHandler.prototype.removeEnabled=false;mxEdgeHandler.prototype.dblClickRemoveEnabled=false;mxEdgeHandler.prototype.mergeRemoveEnabled=false;mxEdgeHandler.prototype.straightRemoveEnabled=false;mxEdgeHandler.prototype.virtualBendsEnabled=false;mxEdgeHandler.prototype.virtualBendOpacity=20;mxEdgeHandler.prototype.parentHighlightEnabled=false;mxEdgeHandler.prototype.preferHtml=false;mxEdgeHandler.prototype.allowHandleBoundsCheck=true;mxEdgeHandler.prototype.snapToTerminals=false;mxEdgeHandler.prototype.handleImage=null;mxEdgeHandler.prototype.tolerance=0;mxEdgeHandler.prototype.outlineConnect=false;mxEdgeHandler.prototype.manageLabelHandle=false;mxEdgeHandler.prototype.init=function(){this.graph=this.state.view.graph;this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.points=[];this.abspoints=this.getSelectionPoints(this.state);this.shape=this.createSelectionShape(this.abspoints);this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;this.shape.init(this.graph.getView().getOverlayPane());this.shape.pointerEvents=false;this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE);mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.preferHtml=this.state.text!=null&&this.state.text.node.parentNode==this.graph.container;if(!this.preferHtml){var t=this.state.getVisibleTerminalState(true);if(t!=null){this.preferHtml=t.text!=null&&t.text.node.parentNode==this.graph.container}if(!this.preferHtml){var e=this.state.getVisibleTerminalState(false);if(e!=null){this.preferHtml=e.text!=null&&e.text.node.parentNode==this.graph.container}}}if(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0){this.bends=this.createBends();if(this.isVirtualBendsEnabled()){this.virtualBends=this.createVirtualBends()}}this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape=this.createLabelHandleShape();this.initBend(this.labelShape);this.labelShape.setCursor(mxConstants.CURSOR_LABEL_HANDLE);this.customHandles=this.createCustomHandles();this.updateParentHighlight();this.redraw()};mxEdgeHandler.prototype.isParentHighlightVisible=mxVertexHandler.prototype.isParentHighlightVisible;mxEdgeHandler.prototype.updateParentHighlight=mxVertexHandler.prototype.updateParentHighlight;mxEdgeHandler.prototype.createCustomHandles=function(){return null};mxEdgeHandler.prototype.isVirtualBendsEnabled=function(t){return this.virtualBendsEnabled&&(this.state.style[mxConstants.STYLE_EDGE]==null||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||this.state.style[mxConstants.STYLE_NOEDGESTYLE]==1)&&mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)!="arrow"};mxEdgeHandler.prototype.isCellEnabled=function(t){return true};mxEdgeHandler.prototype.isAddPointEvent=function(t){return mxEvent.isShiftDown(t)};mxEdgeHandler.prototype.isRemovePointEvent=function(t){return mxEvent.isShiftDown(t)};mxEdgeHandler.prototype.getSelectionPoints=function(t){return t.absolutePoints};mxEdgeHandler.prototype.createParentHighlightShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());e.strokewidth=this.getSelectionStrokeWidth();e.isDashed=this.isSelectionDashed();return e};mxEdgeHandler.prototype.createSelectionShape=function(t){var e=new this.state.shape.constructor;e.outline=true;e.apply(this.state);e.isDashed=this.isSelectionDashed();e.stroke=this.getSelectionColor();e.isShadow=false;return e};mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR};mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH};mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED};mxEdgeHandler.prototype.isConnectableCell=function(t){return true};mxEdgeHandler.prototype.getCellAt=function(t,e){return!this.outlineConnect?this.graph.getCellAt(t,e):null};mxEdgeHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph);var e=this;t.getCell=function(t){var i=mxCellMarker.prototype.getCell.apply(this,arguments);if((i==e.state.cell||i==null)&&e.currentPoint!=null){i=e.graph.getCellAt(e.currentPoint.x,e.currentPoint.y)}if(i!=null&&!this.graph.isCellConnectable(i)){var n=this.graph.getModel().getParent(i);if(this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)){i=n}}var r=e.graph.getModel();if(this.graph.isSwimlane(i)&&e.currentPoint!=null&&this.graph.hitsSwimlaneContent(i,e.currentPoint.x,e.currentPoint.y)||!e.isConnectableCell(i)||(i==e.state.cell||i!=null&&!e.graph.connectableEdges&&r.isEdge(i))||r.isAncestor(e.state.cell,i)){i=null}if(!this.graph.isCellConnectable(i)){i=null}return i};t.isValidState=function(t){var i=e.graph.getModel();var n=e.graph.view.getTerminalPort(t,e.graph.view.getState(i.getTerminal(e.state.cell,!e.isSource)),!e.isSource);var r=n!=null?n.cell:null;var s=e.isSource?t.cell:r;var l=e.isSource?r:t.cell;e.error=e.validateConnection(s,l);return e.error==null};return t};mxEdgeHandler.prototype.validateConnection=function(t,e){return this.graph.getEdgeValidationError(this.state.cell,t,e)};mxEdgeHandler.prototype.createBends=function(){var t=this.state.cell;var e=[];for(var i=0;i<this.abspoints.length;i++){if(this.isHandleVisible(i)){var n=i==0;var r=i==this.abspoints.length-1;var s=n||r;if(s||this.graph.isCellBendable(t)){mxUtils.bind(this,(function(t){var n=this.createHandleShape(t);this.initBend(n,mxUtils.bind(this,mxUtils.bind(this,(function(){if(this.dblClickRemoveEnabled){this.removePoint(this.state,t)}}))));if(this.isHandleEnabled(i)){n.setCursor(s?mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE)}e.push(n);if(!s){this.points.push(new mxPoint(0,0));n.node.style.visibility="hidden"}}))(i)}}}return e};mxEdgeHandler.prototype.createVirtualBends=function(){var t=this.state.cell;var e=[];if(this.graph.isCellBendable(t)){for(var i=1;i<this.abspoints.length;i++){mxUtils.bind(this,(function(t){this.initBend(t);t.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE);e.push(t)}))(this.createHandleShape())}}return e};mxEdgeHandler.prototype.isHandleEnabled=function(t){return true};mxEdgeHandler.prototype.isHandleVisible=function(t){var e=this.state.getVisibleTerminalState(true);var i=this.state.getVisibleTerminalState(false);var n=this.graph.getCellGeometry(this.state.cell);var r=n!=null?this.graph.view.getEdgeStyle(this.state,n.points,e,i):null;return r!=mxEdgeStyle.EntityRelation||t==0||t==this.abspoints.length-1};mxEdgeHandler.prototype.createHandleShape=function(t){if(this.handleImage!=null){var e=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src);e.preserveImageAspect=false;return e}else{var i=mxConstants.HANDLE_SIZE;if(this.preferHtml){i-=1}return new mxRectangleShape(new mxRectangle(0,0,i,i),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}};mxEdgeHandler.prototype.createLabelHandleShape=function(){if(this.labelHandleImage!=null){var t=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);t.preserveImageAspect=false;return t}else{var e=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}};mxEdgeHandler.prototype.initBend=function(t,e){if(this.preferHtml){t.dialect=mxConstants.DIALECT_STRICTHTML;t.init(this.graph.container)}else{t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;t.init(this.graph.getView().getOverlayPane())}mxEvent.redirectMouseEvents(t.node,this.graph,this.state,null,null,null,e);if(mxClient.IS_QUIRKS||document.documentMode==8){mxEvent.addListener(t.node,"dragstart",(function(t){mxEvent.consume(t);return false}))}if(mxClient.IS_TOUCH){t.node.setAttribute("pointer-events","none")}};mxEdgeHandler.prototype.getHandleForEvent=function(t){var e=null;if(this.state!=null){var i=!mxEvent.isMouseEvent(t.getEvent())?this.tolerance:1;var n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(t.getGraphX()-i,t.getGraphY()-i,2*i,2*i):null;var r=null;function s(e){if(e!=null&&e.node!=null&&e.node.style.display!="none"&&e.node.style.visibility!="hidden"&&(t.isSource(e)||n!=null&&mxUtils.intersects(e.bounds,n))){var i=t.getGraphX()-e.bounds.getCenterX();var s=t.getGraphY()-e.bounds.getCenterY();var l=i*i+s*s;if(r==null||l<=r){r=l;return true}}return false}if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var l=this.customHandles.length-1;l>=0;l--){if(s(this.customHandles[l].shape)){return mxEvent.CUSTOM_HANDLE-l}}}if(t.isSource(this.state.text)||s(this.labelShape)){e=mxEvent.LABEL_HANDLE}if(this.bends!=null){for(var l=0;l<this.bends.length;l++){if(s(this.bends[l])){e=l}}}if(this.virtualBends!=null&&this.isAddVirtualBendEvent(t)){for(var l=0;l<this.virtualBends.length;l++){if(s(this.virtualBends[l])){e=mxEvent.VIRTUAL_HANDLE-l}}}}return e};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(t){return true};mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return true};mxEdgeHandler.prototype.mouseDown=function(t,e){var i=this.getHandleForEvent(e);if(this.bends!=null&&this.bends[i]!=null){var n=this.bends[i].bounds;this.snapPoint=new mxPoint(n.getCenterX(),n.getCenterY())}if(this.addEnabled&&i==null&&this.isAddPointEvent(e.getEvent())){this.addPoint(this.state,e.getEvent());e.consume()}else if(i!=null&&!e.isConsumed()&&this.graph.isEnabled()){if(this.removeEnabled&&this.isRemovePointEvent(e.getEvent())){this.removePoint(this.state,i)}else if(i!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(e.getCell())){if(i<=mxEvent.VIRTUAL_HANDLE){mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-i].node,100)}this.start(e.getX(),e.getY(),i)}e.consume()}};mxEdgeHandler.prototype.start=function(t,e,i){this.startX=t;this.startY=e;this.isSource=this.bends==null?false:i==0;this.isTarget=this.bends==null?false:i==this.bends.length-1;this.isLabel=i==mxEvent.LABEL_HANDLE;if(this.isSource||this.isTarget){var n=this.state.cell;var r=this.graph.model.getTerminal(n,this.isSource);if(r==null&&this.graph.isTerminalPointMovable(n,this.isSource)||r!=null&&this.graph.isCellDisconnectable(n,r,this.isSource)){this.index=i}}else{this.index=i}if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){for(var s=0;s<this.customHandles.length;s++){if(s!=mxEvent.CUSTOM_HANDLE-this.index){this.customHandles[s].setVisible(false)}}}}};mxEdgeHandler.prototype.clonePreviewState=function(t,e){return this.state.clone()};mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2};mxEdgeHandler.prototype.updateHint=function(t,e){};mxEdgeHandler.prototype.removeHint=function(){};mxEdgeHandler.prototype.roundLength=function(t){return Math.round(t)};mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(t){return this.snapToTerminals&&!mxEvent.isAltDown(t.getEvent())};mxEdgeHandler.prototype.getPointForEvent=function(t){var e=this.graph.getView();var i=e.scale;var n=new mxPoint(this.roundLength(t.getGraphX()/i)*i,this.roundLength(t.getGraphY()/i)*i);var r=this.getSnapToTerminalTolerance();var s=false;var l=false;if(r>0&&this.isSnapToTerminalsEvent(t)){function a(t){if(t!=null){var e=t.x;if(Math.abs(n.x-e)<r){n.x=e;s=true}var i=t.y;if(Math.abs(n.y-i)<r){n.y=i;l=true}}}function o(t){if(t!=null){a.call(this,new mxPoint(e.getRoutingCenterX(t),e.getRoutingCenterY(t)))}}o.call(this,this.state.getVisibleTerminalState(true));o.call(this,this.state.getVisibleTerminalState(false));if(this.state.absolutePoints!=null){for(var h=0;h<this.state.absolutePoints.length;h++){a.call(this,this.state.absolutePoints[h])}}}if(this.graph.isGridEnabledEvent(t.getEvent())){var u=e.translate;if(!s){n.x=(this.graph.snap(n.x/i-u.x)+u.x)*i}if(!l){n.y=(this.graph.snap(n.y/i-u.y)+u.y)*i}}return n};mxEdgeHandler.prototype.getPreviewTerminalState=function(t){this.constraintHandler.update(t,this.isSource,true,t.isSource(this.marker.highlight.shape)?null:this.currentPoint);if(this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentConstraint!=null){if(this.marker.highlight!=null&&this.marker.highlight.state!=null&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell){if(this.marker.highlight.shape.stroke!="transparent"){this.marker.highlight.shape.stroke="transparent";this.marker.highlight.repaint()}}else{this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent")}var e=this.graph.getModel();var i=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(e.getTerminal(this.state.cell,!this.isSource)),!this.isSource);var n=i!=null?i.cell:null;var r=this.isSource?this.constraintHandler.currentFocus.cell:n;var s=this.isSource?n:this.constraintHandler.currentFocus.cell;this.error=this.validateConnection(r,s);var l=null;if(this.error==null){l=this.constraintHandler.currentFocus}if(this.error!=null||l!=null&&!this.isCellEnabled(l.cell)){this.constraintHandler.reset()}return l}else if(!this.graph.isIgnoreTerminalEvent(t.getEvent())){this.marker.process(t);var a=this.marker.getValidState();if(a!=null&&!this.isCellEnabled(a.cell)){this.constraintHandler.reset();this.marker.reset()}return this.marker.getValidState()}else{this.marker.reset();return null}};mxEdgeHandler.prototype.getPreviewPoints=function(t,e){var i=this.graph.getCellGeometry(this.state.cell);var n=i.points!=null?i.points.slice():null;var r=new mxPoint(t.x,t.y);var s=null;if(!this.isSource&&!this.isTarget){this.convertPoint(r,false);if(n==null){n=[r]}else{if(this.index<=mxEvent.VIRTUAL_HANDLE){n.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,r)}if(!this.isSource&&!this.isTarget){for(var l=0;l<this.bends.length;l++){if(l!=this.index){var a=this.bends[l];if(a!=null&&mxUtils.contains(a.bounds,t.x,t.y)){if(this.index<=mxEvent.VIRTUAL_HANDLE){n.splice(mxEvent.VIRTUAL_HANDLE-this.index,1)}else{n.splice(this.index-1,1)}s=n}}}if(s==null&&this.straightRemoveEnabled&&(e==null||!mxEvent.isAltDown(e.getEvent()))){var o=this.graph.tolerance*this.graph.tolerance;var h=this.state.absolutePoints.slice();h[this.index]=t;var u=this.state.getVisibleTerminalState(true);if(u!=null){var d=this.graph.getConnectionConstraint(this.state,u,true);if(d==null||this.graph.getConnectionPoint(u,d)==null){h[0]=new mxPoint(u.view.getRoutingCenterX(u),u.view.getRoutingCenterY(u))}}var p=this.state.getVisibleTerminalState(false);if(p!=null){var d=this.graph.getConnectionConstraint(this.state,p,false);if(d==null||this.graph.getConnectionPoint(p,d)==null){h[h.length-1]=new mxPoint(p.view.getRoutingCenterX(p),p.view.getRoutingCenterY(p))}}function m(t,e){if(t>0&&t<h.length-1&&mxUtils.ptSegDistSq(h[t-1].x,h[t-1].y,h[t+1].x,h[t+1].y,e.x,e.y)<o){n.splice(t-1,1);s=n}}m(this.index,t)}}if(s==null&&this.index>mxEvent.VIRTUAL_HANDLE){n[this.index-1]=r}}}else if(this.graph.resetEdgesOnConnect){n=null}return s!=null?s:n};mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container);var i=t.getEvent();var n=mxEvent.getClientX(i);var r=mxEvent.getClientY(i);var s=document.documentElement;var l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0);var a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0);var o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l;var h=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||h!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,h))};mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(true);var l=this.isTarget?i:this.state.getVisibleTerminalState(false);var a=this.graph.getConnectionConstraint(t,s,true);var o=this.graph.getConnectionConstraint(t,l,false);var h=this.constraintHandler.currentConstraint;if(h==null&&r){if(i!=null){if(n.isSource(this.marker.highlight.shape)){e=new mxPoint(n.getGraphX(),n.getGraphY())}h=this.graph.getOutlineConstraint(e,i,n);this.constraintHandler.setFocus(n,i,this.isSource);this.constraintHandler.currentConstraint=h;this.constraintHandler.currentPoint=e}else{h=new mxConnectionConstraint}}if(this.outlineConnect&&this.marker.highlight!=null&&this.marker.highlight.shape!=null){var u=this.graph.view.scale;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent";this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/u/u;this.marker.highlight.repaint()}else if(this.marker.hasValidState()){this.marker.highlight.shape.stroke=this.graph.isCellConnectable(n.getCell())&&this.marker.getValidState()!=n.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR;this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/u/u;this.marker.highlight.repaint()}}if(this.isSource){a=h}else if(this.isTarget){o=h}if(this.isSource||this.isTarget){if(h!=null&&h.point!=null){t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=h.point.x;t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=h.point.y}else{delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]}}t.setVisibleTerminalState(s,true);t.setVisibleTerminalState(l,false);if(!this.isSource||s!=null){t.view.updateFixedTerminalPoint(t,s,true,a)}if(!this.isTarget||l!=null){t.view.updateFixedTerminalPoint(t,l,false,o)}if((this.isSource||this.isTarget)&&i==null){t.setAbsoluteTerminalPoint(e,this.isSource);if(this.marker.getMarkedState()==null){this.error=this.graph.allowDanglingEdges?null:""}}t.view.updatePoints(t,this.points,s,l);t.view.updateFloatingTerminalPoints(t,s,l)};mxEdgeHandler.prototype.mouseMove=function(t,e){if(this.index!=null&&this.marker!=null){this.currentPoint=this.getPointForEvent(e);this.error=null;if(!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&this.snapPoint!=null){if(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)){this.currentPoint.x=this.snapPoint.x}else{this.currentPoint.y=this.snapPoint.y}}if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged();if(this.shape!=null&&this.shape.node!=null){this.shape.node.style.display="none"}}}else if(this.isLabel){this.label.x=this.currentPoint.x;this.label.y=this.currentPoint.y}else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null){this.currentPoint=this.constraintHandler.currentPoint.clone()}else if(this.outlineConnect){var n=this.isSource||this.isTarget?this.isOutlineConnectEvent(e):false;if(n){i=this.marker.highlight.state}else if(i!=null&&i!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&this.marker.highlight.shape!=null){this.marker.highlight.shape.stroke="transparent";this.marker.highlight.repaint();i=null}}if(i!=null&&!this.isCellEnabled(i.cell)){i=null;this.marker.reset()}var r=this.clonePreviewState(this.currentPoint,i!=null?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=this.error==null?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s);this.abspoints=r.absolutePoints;this.active=true;this.updateHint(e,this.currentPoint)}this.drawPreview();mxEvent.consume(e.getEvent());e.consume()}else if(mxClient.IS_IE&&this.getHandleForEvent(e)!=null){e.consume(false)}};mxEdgeHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.marker!=null){if(this.shape!=null&&this.shape.node!=null){this.shape.node.style.display=""}var i=this.state.cell;var n=this.index;this.index=null;if(e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(this.error!=null){if(this.error.length>0){this.graph.validationAlert(this.error)}}else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){var s=this.graph.getModel();s.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e);if(this.shape!=null&&this.shape.node!=null){this.shape.apply(this.state);this.shape.redraw()}}finally{s.endUpdate()}}}else if(this.isLabel){this.moveLabel(this.state,this.label.x,this.label.y)}else if(this.isSource||this.isTarget){var l=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){l=this.constraintHandler.currentFocus.cell}if(l==null&&this.marker.hasValidState()&&this.marker.highlight!=null&&this.marker.highlight.shape!=null&&this.marker.highlight.shape.stroke!="transparent"&&this.marker.highlight.shape.stroke!="white"){l=this.marker.validState.cell}if(l!=null){var s=this.graph.getModel();var a=s.getParent(i);s.beginUpdate();try{if(r){var o=s.getGeometry(i);var r=this.graph.cloneCell(i);s.add(a,r,s.getChildCount(a));if(o!=null){o=o.clone();s.setGeometry(r,o)}var h=s.getTerminal(i,!this.isSource);this.graph.connectCell(r,h,!this.isSource);i=r}i=this.connect(i,l,this.isSource,r,e)}finally{s.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var u=this.abspoints[this.isSource?0:this.abspoints.length-1];u.x=this.roundLength(u.x/this.graph.view.scale-this.graph.view.translate.x);u.y=this.roundLength(u.y/this.graph.view.scale-this.graph.view.translate.y);var d=this.graph.getView().getState(this.graph.getModel().getParent(i));if(d!=null){u.x-=d.origin.x;u.y-=d.origin.y}u.x-=this.graph.panDx/this.graph.view.scale;u.y-=this.graph.panDy/this.graph.view.scale;i=this.changeTerminalPoint(i,u,this.isSource,r)}}else if(this.active){i=this.changePoints(i,this.points,r)}else{this.graph.getView().invalidate(this.state.cell);this.graph.getView().validate(this.state.cell)}}else if(this.graph.isToggleEvent(e.getEvent())){this.graph.selectCellForEvent(this.state.cell,e.getEvent())}if(this.marker!=null){this.reset();if(i!=this.state.cell){this.graph.setSelectionCell(i)}}e.consume()}};mxEdgeHandler.prototype.reset=function(){if(this.active){this.refresh()}this.error=null;this.index=null;this.label=null;this.points=null;this.snapPoint=null;this.isLabel=false;this.isSource=false;this.isTarget=false;this.active=false;if(this.livePreview&&this.sizers!=null){for(var t=0;t<this.sizers.length;t++){if(this.sizers[t]!=null){this.sizers[t].node.style.display=""}}}if(this.marker!=null){this.marker.reset()}if(this.constraintHandler!=null){this.constraintHandler.reset()}if(this.customHandles!=null){for(var t=0;t<this.customHandles.length;t++){this.customHandles[t].reset()}}this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR);this.removeHint();this.redraw()};mxEdgeHandler.prototype.setPreviewColor=function(t){if(this.shape!=null){this.shape.stroke=t}};mxEdgeHandler.prototype.convertPoint=function(t,e){var i=this.graph.getView().getScale();var n=this.graph.getView().getTranslate();if(e){t.x=this.graph.snap(t.x);t.y=this.graph.snap(t.y)}t.x=Math.round(t.x/i-n.x);t.y=Math.round(t.y/i-n.y);var r=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));if(r!=null){t.x-=r.origin.x;t.y-=r.origin.y}return t};mxEdgeHandler.prototype.moveLabel=function(t,e,i){var n=this.graph.getModel();var r=n.getGeometry(t.cell);if(r!=null){var s=this.graph.getView().scale;r=r.clone();if(r.relative){var l=this.graph.getView().getRelativePoint(t,e,i);r.x=Math.round(l.x*1e4)/1e4;r.y=Math.round(l.y);r.offset=new mxPoint(0,0);var l=this.graph.view.getPoint(t,r);r.offset=new mxPoint(Math.round((e-l.x)/s),Math.round((i-l.y)/s))}else{var a=t.absolutePoints;var o=a[0];var h=a[a.length-1];if(o!=null&&h!=null){var u=o.x+(h.x-o.x)/2;var d=o.y+(h.y-o.y)/2;r.offset=new mxPoint(Math.round((e-u)/s),Math.round((i-d)/s));r.x=0;r.y=0}}n.setGeometry(t.cell,r)}};mxEdgeHandler.prototype.connect=function(t,e,i,n,r){var s=this.graph.getModel();var l=s.getParent(t);s.beginUpdate();try{var a=this.constraintHandler.currentConstraint;if(a==null){a=new mxConnectionConstraint}this.graph.connectCell(t,e,i,a)}finally{s.endUpdate()}return t};mxEdgeHandler.prototype.changeTerminalPoint=function(t,e,i,n){var r=this.graph.getModel();r.beginUpdate();try{if(n){var s=r.getParent(t);var l=r.getTerminal(t,!i);t=this.graph.cloneCell(t);r.add(s,t,r.getChildCount(s));r.setTerminal(t,l,!i)}var a=r.getGeometry(t);if(a!=null){a=a.clone();a.setTerminalPoint(e,i);r.setGeometry(t,a);this.graph.connectCell(t,null,i,new mxConnectionConstraint)}}finally{r.endUpdate()}return t};mxEdgeHandler.prototype.changePoints=function(t,e,i){var n=this.graph.getModel();n.beginUpdate();try{if(i){var r=n.getParent(t);var s=n.getTerminal(t,true);var l=n.getTerminal(t,false);t=this.graph.cloneCell(t);n.add(r,t,n.getChildCount(r));n.setTerminal(t,s,true);n.setTerminal(t,l,false)}var a=n.getGeometry(t);if(a!=null){a=a.clone();a.points=e;n.setGeometry(t,a)}}finally{n.endUpdate()}return t};mxEdgeHandler.prototype.addPoint=function(t,e){var i=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));var n=this.graph.isGridEnabledEvent(e);this.convertPoint(i,n);this.addPointAt(t,i.x,i.y);mxEvent.consume(e)};mxEdgeHandler.prototype.addPointAt=function(t,e,i){var n=this.graph.getCellGeometry(t.cell);var r=new mxPoint(e,i);if(n!=null){n=n.clone();var s=this.graph.view.translate;var l=this.graph.view.scale;var a=new mxPoint(s.x*l,s.y*l);var o=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(o)){var h=this.graph.view.getState(o);a=new mxPoint(h.x,h.y)}var u=mxUtils.findNearestSegment(t,r.x*l+a.x,r.y*l+a.y);if(n.points==null){n.points=[r]}else{n.points.splice(u,0,r)}this.graph.getModel().setGeometry(t.cell,n);this.refresh();this.redraw()}};mxEdgeHandler.prototype.removePoint=function(t,e){if(e>0&&e<this.abspoints.length-1){var i=this.graph.getCellGeometry(this.state.cell);if(i!=null&&i.points!=null){i=i.clone();i.points.splice(e-1,1);this.graph.getModel().setGeometry(t.cell,i);this.refresh();this.redraw()}}};mxEdgeHandler.prototype.getHandleFillColor=function(t){var e=t==0;var i=this.state.cell;var n=this.graph.getModel().getTerminal(i,e);var r=mxConstants.HANDLE_FILLCOLOR;if(n!=null&&!this.graph.isCellDisconnectable(i,n,e)||n==null&&!this.graph.isTerminalPointMovable(i,e)){r=mxConstants.LOCKED_HANDLE_FILLCOLOR}else if(n!=null&&this.graph.isCellDisconnectable(i,n,e)){r=mxConstants.CONNECT_HANDLE_FILLCOLOR}return r};mxEdgeHandler.prototype.redraw=function(t){if(this.state!=null){this.abspoints=this.state.absolutePoints.slice();var e=this.graph.getModel().getGeometry(this.state.cell);if(e!=null){var i=e.points;if(this.bends!=null&&this.bends.length>0){if(i!=null){if(this.points==null){this.points=[]}for(var n=1;n<this.bends.length-1;n++){if(this.bends[n]!=null&&this.abspoints[n]!=null){this.points[n-1]=i[n-1]}}}}}this.drawPreview();if(!t){this.redrawHandles()}}};mxEdgeHandler.prototype.redrawHandles=function(){var t=this.state.cell;var e=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-e.width/2),Math.round(this.label.y-e.height/2),e.width,e.height);var i=this.graph.getLabel(t);this.labelShape.visible=i!=null&&i.length>0&&this.graph.isLabelMovable(t);if(this.bends!=null&&this.bends.length>0){var n=this.abspoints.length-1;var r=this.abspoints[0];var s=r.x;var l=r.y;e=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(l-e.height/2),e.width,e.height);this.bends[0].fill=this.getHandleFillColor(0);this.bends[0].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[0].bounds)}var a=this.abspoints[n];var o=a.x;var h=a.y;var u=this.bends.length-1;e=this.bends[u].bounds;this.bends[u].bounds=new mxRectangle(Math.floor(o-e.width/2),Math.floor(h-e.height/2),e.width,e.height);this.bends[u].fill=this.getHandleFillColor(u);this.bends[u].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[u].bounds)}this.redrawInnerBends(r,a)}if(this.abspoints!=null&&this.virtualBends!=null&&this.virtualBends.length>0){var d=this.abspoints[0];for(var p=0;p<this.virtualBends.length;p++){if(this.virtualBends[p]!=null&&this.abspoints[p+1]!=null){var m=this.abspoints[p+1];var e=this.virtualBends[p];var c=d.x+(m.x-d.x)/2;var x=d.y+(m.y-d.y)/2;e.bounds=new mxRectangle(Math.floor(c-e.bounds.width/2),Math.floor(x-e.bounds.height/2),e.bounds.width,e.bounds.height);e.redraw();mxUtils.setOpacity(e.node,this.virtualBendOpacity);d=m;if(this.manageLabelHandle){this.checkLabelHandle(e.bounds)}}}}if(this.labelShape!=null){this.labelShape.redraw()}if(this.customHandles!=null){for(var p=0;p<this.customHandles.length;p++){var f=this.customHandles[p].shape.node.style.display;this.customHandles[p].redraw();this.customHandles[p].shape.node.style.display=f;this.customHandles[p].shape.node.style.visibility=this.isCustomHandleVisible(this.customHandles[p])?"":"hidden"}}};mxEdgeHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&this.state.view.graph.getSelectionCount()==1};mxEdgeHandler.prototype.setHandlesVisible=function(t){if(this.bends!=null){for(var e=0;e<this.bends.length;e++){this.bends[e].node.style.display=t?"":"none"}}if(this.virtualBends!=null){for(var e=0;e<this.virtualBends.length;e++){this.virtualBends[e].node.style.display=t?"":"none"}}if(this.labelShape!=null){this.labelShape.node.style.display=t?"":"none"}if(this.customHandles!=null){for(var e=0;e<this.customHandles.length;e++){this.customHandles[e].setVisible(t)}}};mxEdgeHandler.prototype.redrawInnerBends=function(t,e){for(var i=1;i<this.bends.length-1;i++){if(this.bends[i]!=null){if(this.abspoints[i]!=null){var n=this.abspoints[i].x;var r=this.abspoints[i].y;var s=this.bends[i].bounds;this.bends[i].node.style.visibility="visible";this.bends[i].bounds=new mxRectangle(Math.round(n-s.width/2),Math.round(r-s.height/2),s.width,s.height);if(this.manageLabelHandle){this.checkLabelHandle(this.bends[i].bounds)}else if(this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(this.bends[i].bounds,this.labelShape.bounds)){w=mxConstants.HANDLE_SIZE+3;h=mxConstants.HANDLE_SIZE+3;this.bends[i].bounds=new mxRectangle(Math.round(n-w/2),Math.round(r-h/2),w,h)}this.bends[i].redraw()}else{this.bends[i].destroy();this.bends[i]=null}}}};mxEdgeHandler.prototype.checkLabelHandle=function(t){if(this.labelShape!=null){var e=this.labelShape.bounds;if(mxUtils.intersects(t,e)){if(t.getCenterY()<e.getCenterY()){e.y=t.y+t.height}else{e.y=t.y-e.height}}}};mxEdgeHandler.prototype.drawPreview=function(){try{if(this.isLabel){var t=this.labelShape.bounds;var e=new mxRectangle(Math.round(this.label.x-t.width/2),Math.round(this.label.y-t.height/2),t.width,t.height);if(!this.labelShape.bounds.equals(e)){this.labelShape.bounds=e;this.labelShape.redraw()}}if(this.shape!=null&&!mxUtils.equalPoints(this.shape.points,this.abspoints)){this.shape.apply(this.state);this.shape.points=this.abspoints.slice();this.shape.scale=this.state.view.scale;this.shape.isDashed=this.isSelectionDashed();this.shape.stroke=this.getSelectionColor();this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale;this.shape.isShadow=false;this.shape.redraw()}this.updateParentHighlight()}catch(i){}};mxEdgeHandler.prototype.refresh=function(){if(this.state!=null){this.abspoints=this.getSelectionPoints(this.state);this.points=[];if(this.bends!=null){this.destroyBends(this.bends);this.bends=this.createBends()}if(this.virtualBends!=null){this.destroyBends(this.virtualBends);this.virtualBends=this.createVirtualBends()}if(this.customHandles!=null){this.destroyBends(this.customHandles);this.customHandles=this.createCustomHandles()}if(this.labelShape!=null&&this.labelShape.node!=null&&this.labelShape.node.parentNode!=null){this.labelShape.node.parentNode.appendChild(this.labelShape.node)}}};mxEdgeHandler.prototype.isDestroyed=function(){return this.shape==null};mxEdgeHandler.prototype.destroyBends=function(t){if(t!=null){for(var e=0;e<t.length;e++){if(t[e]!=null){t[e].destroy()}}}};mxEdgeHandler.prototype.destroy=function(){if(this.escapeHandler!=null){this.state.view.graph.removeListener(this.escapeHandler);this.escapeHandler=null}if(this.marker!=null){this.marker.destroy();this.marker=null}if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.parentHighlight!=null){var t=this.graph.model.getParent(this.state.cell);var e=this.graph.view.getState(t);if(e!=null&&e.parentHighlight==this.parentHighlight){e.parentHighlight=null}this.parentHighlight.destroy();this.parentHighlight=null}if(this.labelShape!=null){this.labelShape.destroy();this.labelShape=null}if(this.constraintHandler!=null){this.constraintHandler.destroy();this.constraintHandler=null}this.destroyBends(this.virtualBends);this.virtualBends=null;this.destroyBends(this.customHandles);this.customHandles=null;this.destroyBends(this.bends);this.bends=null;this.removeHint()};__mxOutput.mxEdgeHandler=typeof mxEdgeHandler!=="undefined"?mxEdgeHandler:undefined;function mxElbowEdgeHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler);mxElbowEdgeHandler.prototype.flipEnabled=true;mxElbowEdgeHandler.prototype.doubleClickOrientationResource=mxClient.language!="none"?"doubleClickOrientation":"";mxElbowEdgeHandler.prototype.createBends=function(){var t=[];var e=this.createHandleShape(0);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);t.push(this.createVirtualBend(mxUtils.bind(this,(function(t){if(!mxEvent.isConsumed(t)&&this.flipEnabled){this.graph.flipEdge(this.state.cell,t);mxEvent.consume(t)}}))));this.points.push(new mxPoint(0,0));e=this.createHandleShape(2);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);return t};mxElbowEdgeHandler.prototype.createVirtualBend=function(t){var e=this.createHandleShape();this.initBend(e,t);e.setCursor(this.getCursorForBend());if(!this.graph.isCellBendable(this.state.cell)){e.node.style.display="none"}return e};mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"};mxElbowEdgeHandler.prototype.getTooltipForNode=function(t){var e=null;if(this.bends!=null&&this.bends[1]!=null&&(t==this.bends[1].node||t.parentNode==this.bends[1].node)){e=this.doubleClickOrientationResource;e=mxResources.get(e)||e}return e};mxElbowEdgeHandler.prototype.convertPoint=function(t,e){var i=this.graph.getView().getScale();var n=this.graph.getView().getTranslate();var r=this.state.origin;if(e){t.x=this.graph.snap(t.x);t.y=this.graph.snap(t.y)}t.x=Math.round(t.x/i-n.x-r.x);t.y=Math.round(t.y/i-n.y-r.y);return t};mxElbowEdgeHandler.prototype.redrawInnerBends=function(t,e){var i=this.graph.getModel().getGeometry(this.state.cell);var n=this.state.absolutePoints;var r=null;if(n.length>1){t=n[1];e=n[n.length-2]}else if(i.points!=null&&i.points.length>0){r=n[0]}if(r==null){r=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2)}else{r=new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y))}var s=this.bends[1].bounds;var l=s.width;var a=s.height;var o=new mxRectangle(Math.round(r.x-l/2),Math.round(r.y-a/2),l,a);if(this.manageLabelHandle){this.checkLabelHandle(o)}else if(this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(o,this.labelShape.bounds)){l=mxConstants.HANDLE_SIZE+3;a=mxConstants.HANDLE_SIZE+3;o=new mxRectangle(Math.floor(r.x-l/2),Math.floor(r.y-a/2),l,a)}this.bends[1].bounds=o;this.bends[1].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[1].bounds)}};__mxOutput.mxElbowEdgeHandler=typeof mxElbowEdgeHandler!=="undefined"?mxElbowEdgeHandler:undefined;function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler);mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(t!=null){var e=Math.max(1,this.graph.view.scale);if(t.length==2||t.length==3&&(Math.abs(t[0].x-t[1].x)<e&&Math.abs(t[1].x-t[2].x)<e||Math.abs(t[0].y-t[1].y)<e&&Math.abs(t[1].y-t[2].y)<e)){var i=t[0].x+(t[t.length-1].x-t[0].x)/2;var n=t[0].y+(t[t.length-1].y-t[0].y)/2;t=[t[0],new mxPoint(i,n),new mxPoint(i,n),t[t.length-1]]}}return t};mxEdgeSegmentHandler.prototype.getPreviewPoints=function(t){if(this.isSource||this.isTarget){return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments)}else{var e=this.getCurrentPoints();var i=this.convertPoint(e[0].clone(),false);t=this.convertPoint(t.clone(),false);var n=[];for(var r=1;r<e.length;r++){var s=this.convertPoint(e[r].clone(),false);if(r==this.index){if(Math.round(i.x-s.x)==0){i.x=t.x;s.x=t.x}if(Math.round(i.y-s.y)==0){i.y=t.y;s.y=t.y}}if(r<e.length-1){n.push(s)}i=s}if(n.length==1){var l=this.state.getVisibleTerminalState(true);var a=this.state.getVisibleTerminalState(false);var o=this.state.view.getScale();var h=this.state.view.getTranslate();var u=n[0].x*o+h.x;var d=n[0].y*o+h.y;if(l!=null&&mxUtils.contains(l,u,d)||a!=null&&mxUtils.contains(a,u,d)){n=[t,t]}}return n}};mxEdgeSegmentHandler.prototype.updatePreviewState=function(t,e,i,n){mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments);if(!this.isSource&&!this.isTarget){e=this.convertPoint(e.clone(),false);var r=t.absolutePoints;var s=r[0];var l=r[1];var a=[];for(var o=2;o<r.length;o++){var h=r[o];if((Math.round(s.x-l.x)!=0||Math.round(l.x-h.x)!=0)&&(Math.round(s.y-l.y)!=0||Math.round(l.y-h.y)!=0)){a.push(this.convertPoint(l.clone(),false))}s=l;l=h}var u=this.state.getVisibleTerminalState(true);var d=this.state.getVisibleTerminalState(false);var p=this.state.absolutePoints;if(a.length==0&&(Math.round(r[0].x-r[r.length-1].x)==0||Math.round(r[0].y-r[r.length-1].y)==0)){a=[e,e]}else if(r.length==5&&a.length==2&&u!=null&&d!=null&&p!=null&&Math.round(p[0].x-p[p.length-1].x)==0){var m=this.graph.getView();var c=m.getScale();var x=m.getTranslate();var f=m.getRoutingCenterY(u)/c-x.y;var g=this.graph.getConnectionConstraint(t,u,true);if(g!=null){var v=this.graph.getConnectionPoint(u,g);if(v!=null){this.convertPoint(v,false);f=v.y}}var y=m.getRoutingCenterY(d)/c-x.y;var C=this.graph.getConnectionConstraint(t,d,false);if(C){var v=this.graph.getConnectionPoint(d,C);if(v!=null){this.convertPoint(v,false);y=v.y}}a=[new mxPoint(e.x,f),new mxPoint(e.x,y)]}this.points=a;t.view.updateFixedTerminalPoints(t,u,d);t.view.updatePoints(t,this.points,u,d);t.view.updateFloatingTerminalPoints(t,u,d)}};mxEdgeSegmentHandler.prototype.connect=function(t,e,i,n,r){var s=this.graph.getModel();var l=s.getGeometry(t);var a=null;if(l!=null&&l.points!=null&&l.points.length>0){var o=this.abspoints;var h=o[0];var u=o[1];a=[];for(var d=2;d<o.length;d++){var p=o[d];if((Math.round(h.x-u.x)!=0||Math.round(u.x-p.x)!=0)&&(Math.round(h.y-u.y)!=0||Math.round(u.y-p.y)!=0)){a.push(this.convertPoint(u.clone(),false))}h=u;u=p}}s.beginUpdate();try{if(a!=null){var l=s.getGeometry(t);if(l!=null){l=l.clone();l.points=a;s.setGeometry(t,l)}}t=mxEdgeHandler.prototype.connect.apply(this,arguments)}finally{s.endUpdate()}return t};mxEdgeSegmentHandler.prototype.getTooltipForNode=function(t){return null};mxEdgeSegmentHandler.prototype.start=function(t,e,i){mxEdgeHandler.prototype.start.apply(this,arguments);if(this.bends!=null&&this.bends[i]!=null&&!this.isSource&&!this.isTarget){mxUtils.setOpacity(this.bends[i].node,100)}};mxEdgeSegmentHandler.prototype.createBends=function(){var t=[];var e=this.createHandleShape(0);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);var i=this.getCurrentPoints();if(this.graph.isCellBendable(this.state.cell)){if(this.points==null){this.points=[]}for(var n=0;n<i.length-1;n++){e=this.createVirtualBend();t.push(e);var r=Math.round(i[n].x-i[n+1].x)==0;if(Math.round(i[n].y-i[n+1].y)==0&&n<i.length-2){r=Math.round(i[n].x-i[n+2].x)==0}e.setCursor(r?"col-resize":"row-resize");this.points.push(new mxPoint(0,0))}}var e=this.createHandleShape(i.length);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);return t};mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh();mxEdgeHandler.prototype.redraw.apply(this,arguments)};mxEdgeSegmentHandler.prototype.redrawInnerBends=function(t,e){if(this.graph.isCellBendable(this.state.cell)){var i=this.getCurrentPoints();if(i!=null&&i.length>1){var n=false;if(i.length==4&&Math.round(i[1].x-i[2].x)==0&&Math.round(i[1].y-i[2].y)==0){n=true;if(Math.round(i[0].y-i[i.length-1].y)==0){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y);i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s);i[2]=new mxPoint(i[2].x,s)}}for(var l=0;l<i.length-1;l++){if(this.bends[l+1]!=null){var t=i[l];var e=i[l+1];var a=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2);var o=this.bends[l+1].bounds;this.bends[l+1].bounds=new mxRectangle(Math.floor(a.x-o.width/2),Math.floor(a.y-o.height/2),o.width,o.height);this.bends[l+1].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[l+1].bounds)}}}if(n){mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity);mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity)}}}};__mxOutput.mxEdgeSegmentHandler=typeof mxEdgeSegmentHandler!=="undefined"?mxEdgeSegmentHandler:undefined;function mxKeyHandler(t,e){if(t!=null){this.graph=t;this.target=e||document.documentElement;this.normalKeys=[];this.shiftKeys=[];this.controlKeys=[];this.controlShiftKeys=[];this.keydownHandler=mxUtils.bind(this,(function(t){this.keyDown(t)}));mxEvent.addListener(this.target,"keydown",this.keydownHandler);if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}}mxKeyHandler.prototype.graph=null;mxKeyHandler.prototype.target=null;mxKeyHandler.prototype.normalKeys=null;mxKeyHandler.prototype.shiftKeys=null;mxKeyHandler.prototype.controlKeys=null;mxKeyHandler.prototype.controlShiftKeys=null;mxKeyHandler.prototype.enabled=true;mxKeyHandler.prototype.isEnabled=function(){return this.enabled};mxKeyHandler.prototype.setEnabled=function(t){this.enabled=t};mxKeyHandler.prototype.bindKey=function(t,e){this.normalKeys[t]=e};mxKeyHandler.prototype.bindShiftKey=function(t,e){this.shiftKeys[t]=e};mxKeyHandler.prototype.bindControlKey=function(t,e){this.controlKeys[t]=e};mxKeyHandler.prototype.bindControlShiftKey=function(t,e){this.controlShiftKeys[t]=e};mxKeyHandler.prototype.isControlDown=function(t){return mxEvent.isControlDown(t)};mxKeyHandler.prototype.getFunction=function(t){if(t!=null&&!mxEvent.isAltDown(t)){if(this.isControlDown(t)){if(mxEvent.isShiftDown(t)){return this.controlShiftKeys[t.keyCode]}else{return this.controlKeys[t.keyCode]}}else{if(mxEvent.isShiftDown(t)){return this.shiftKeys[t.keyCode]}else{return this.normalKeys[t.keyCode]}}}return null};mxKeyHandler.prototype.isGraphEvent=function(t){var e=mxEvent.getSource(t);if(e==this.target||e.parentNode==this.target||this.graph.cellEditor!=null&&this.graph.cellEditor.isEventSource(t)){return true}return mxUtils.isAncestorNode(this.graph.container,e)};mxKeyHandler.prototype.keyDown=function(t){if(this.isEnabledForEvent(t)){if(t.keyCode==27){this.escape(t)}else if(!this.isEventIgnored(t)){var e=this.getFunction(t);if(e!=null){e(t);mxEvent.consume(t)}}}};mxKeyHandler.prototype.isEnabledForEvent=function(t){return this.graph.isEnabled()&&!mxEvent.isConsumed(t)&&this.isGraphEvent(t)&&this.isEnabled()};mxKeyHandler.prototype.isEventIgnored=function(t){return this.graph.isEditing()};mxKeyHandler.prototype.escape=function(t){if(this.graph.isEscapeEnabled()){this.graph.escape(t)}};mxKeyHandler.prototype.destroy=function(){if(this.target!=null&&this.keydownHandler!=null){mxEvent.removeListener(this.target,"keydown",this.keydownHandler);this.keydownHandler=null}this.target=null};__mxOutput.mxKeyHandler=typeof mxKeyHandler!=="undefined"?mxKeyHandler:undefined;function mxTooltipHandler(t,e){if(t!=null){this.graph=t;this.delay=e||500;this.graph.addMouseListener(this)}}mxTooltipHandler.prototype.zIndex=10005;mxTooltipHandler.prototype.graph=null;mxTooltipHandler.prototype.delay=null;mxTooltipHandler.prototype.ignoreTouchEvents=true;mxTooltipHandler.prototype.hideOnHover=false;mxTooltipHandler.prototype.destroyed=false;mxTooltipHandler.prototype.enabled=true;mxTooltipHandler.prototype.isEnabled=function(){return this.enabled};mxTooltipHandler.prototype.setEnabled=function(t){this.enabled=t};mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover};mxTooltipHandler.prototype.setHideOnHover=function(t){this.hideOnHover=t};mxTooltipHandler.prototype.init=function(){if(document.body!=null){this.div=document.createElement("div");this.div.className="mxTooltip";this.div.style.visibility="hidden";document.body.appendChild(this.div);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,(function(t){var e=mxEvent.getSource(t);if(e.nodeName!="A"){this.hideTooltip()}})))}};mxTooltipHandler.prototype.getStateForEvent=function(t){return t.getState()};mxTooltipHandler.prototype.mouseDown=function(t,e){this.reset(e,false);this.hideTooltip()};mxTooltipHandler.prototype.mouseMove=function(t,e){if(e.getX()!=this.lastX||e.getY()!=this.lastY){this.reset(e,true);var i=this.getStateForEvent(e);if(this.isHideOnHover()||i!=this.state||e.getSource()!=this.node&&(!this.stateSource||i!=null&&this.stateSource==(e.isSource(i.shape)||!e.isSource(i.text)))){this.hideTooltip()}}this.lastX=e.getX();this.lastY=e.getY()};mxTooltipHandler.prototype.mouseUp=function(t,e){this.reset(e,true);this.hideTooltip()};mxTooltipHandler.prototype.resetTimer=function(){if(this.thread!=null){window.clearTimeout(this.thread);this.thread=null}};mxTooltipHandler.prototype.reset=function(t,e,i){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(t.getEvent())){this.resetTimer();i=i!=null?i:this.getStateForEvent(t);if(e&&this.isEnabled()&&i!=null&&(this.div==null||this.div.style.visibility=="hidden")){var n=t.getSource();var r=t.getX();var s=t.getY();var l=t.isSource(i.shape)||t.isSource(i.text);this.thread=window.setTimeout(mxUtils.bind(this,(function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var t=this.graph.getTooltip(i,n,r,s);this.show(t,r,s);this.state=i;this.node=n;this.stateSource=l}})),this.delay)}}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){if(this.div!=null){this.div.style.visibility="hidden";this.div.innerHTML=""}};mxTooltipHandler.prototype.show=function(t,e,i){if(!this.destroyed&&t!=null&&t.length>0){if(this.div==null){this.init()}var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex;this.div.style.left=e+n.x+"px";this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px";if(!mxUtils.isNode(t)){this.div.innerHTML=t.replace(/\n/g,"<br>")}else{this.div.innerHTML="";this.div.appendChild(t)}this.div.style.visibility="";mxUtils.fit(this.div)}};mxTooltipHandler.prototype.destroy=function(){if(!this.destroyed){this.graph.removeMouseListener(this);mxEvent.release(this.div);if(this.div!=null&&this.div.parentNode!=null){this.div.parentNode.removeChild(this.div)}this.destroyed=true;this.div=null}};__mxOutput.mxTooltipHandler=typeof mxTooltipHandler!=="undefined"?mxTooltipHandler:undefined;function mxCellTracker(t,e,i){mxCellMarker.call(this,t,e);this.graph.addMouseListener(this);if(i!=null){this.getCell=i}if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}mxUtils.extend(mxCellTracker,mxCellMarker);mxCellTracker.prototype.mouseDown=function(t,e){};mxCellTracker.prototype.mouseMove=function(t,e){if(this.isEnabled()){this.process(e)}};mxCellTracker.prototype.mouseUp=function(t,e){};mxCellTracker.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;this.graph.removeMouseListener(this);mxCellMarker.prototype.destroy.apply(this)}};__mxOutput.mxCellTracker=typeof mxCellTracker!=="undefined"?mxCellTracker:undefined;function mxCellHighlight(t,e,i,n){if(t!=null){this.graph=t;this.highlightColor=e!=null?e:mxConstants.DEFAULT_VALID_COLOR;this.strokeWidth=i!=null?i:mxConstants.HIGHLIGHT_STROKEWIDTH;this.dashed=n!=null?n:false;this.opacity=mxConstants.HIGHLIGHT_OPACITY;this.repaintHandler=mxUtils.bind(this,(function(){if(this.state!=null){var t=this.graph.view.getState(this.state.cell);if(t==null){this.hide()}else{this.state=t;this.repaint()}}}));this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler);this.resetHandler=mxUtils.bind(this,(function(){this.hide()}));this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler);this.graph.getView().addListener(mxEvent.UP,this.resetHandler)}}mxCellHighlight.prototype.keepOnTop=false;mxCellHighlight.prototype.graph=null;mxCellHighlight.prototype.state=null;mxCellHighlight.prototype.spacing=2;mxCellHighlight.prototype.resetHandler=null;mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t;if(this.shape!=null){this.shape.stroke=t}};mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape();this.repaint();if(!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node){this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)}};mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);t.svgStrokeTolerance=this.graph.tolerance;t.points=this.state.absolutePoints;t.apply(this.state);t.stroke=this.highlightColor;t.opacity=this.opacity;t.isDashed=this.dashed;t.isShadow=false;t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;t.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(t.node,this.graph,this.state);if(this.graph.dialect!=mxConstants.DIALECT_SVG){t.pointerEvents=false}else{t.svgPointerEvents="stroke"}return t};mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth};mxCellHighlight.prototype.repaint=function(){if(this.state!=null&&this.shape!=null){this.shape.scale=this.state.view.scale;if(this.graph.model.isEdge(this.state.cell)){this.shape.strokewidth=this.getStrokeWidth();this.shape.points=this.state.absolutePoints;this.shape.outline=false}else{this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing);this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale;this.shape.outline=true}if(this.state.shape!=null){this.shape.setCursor(this.state.shape.getCursor())}if(mxClient.IS_QUIRKS||document.documentMode==8){if(this.shape.stroke=="transparent"){this.shape.stroke="white";this.shape.opacity=1}else{this.shape.opacity=this.opacity}}this.shape.redraw()}};mxCellHighlight.prototype.hide=function(){this.highlight(null)};mxCellHighlight.prototype.highlight=function(t){if(this.state!=t){if(this.shape!=null){this.shape.destroy();this.shape=null}this.state=t;if(this.state!=null){this.drawHighlight()}}};mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=false;if(this.shape!=null&&document.elementFromPoint!=null&&!mxClient.IS_QUIRKS){var n=document.elementFromPoint(t,e);while(n!=null){if(n==this.shape.node){i=true;break}n=n.parentNode}}return i};mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getView().removeListener(this.repaintHandler);this.graph.getModel().removeListener(this.repaintHandler);if(this.shape!=null){this.shape.destroy();this.shape=null}};__mxOutput.mxCellHighlight=typeof mxCellHighlight!=="undefined"?mxCellHighlight:undefined;function mxDefaultKeyHandler(t){if(t!=null){this.editor=t;this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(i){e.apply(this,arguments);t.hideProperties();t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",i))}}}mxDefaultKeyHandler.prototype.editor=null;mxDefaultKeyHandler.prototype.handler=null;mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(e)}));if(i){this.handler.bindControlKey(t,n)}else{this.handler.bindKey(t,n)}};mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy();this.handler=null};__mxOutput.mxDefaultKeyHandler=typeof mxDefaultKeyHandler!=="undefined"?mxDefaultKeyHandler:undefined;function mxDefaultPopupMenu(t){this.config=t}mxDefaultPopupMenu.prototype.imageBasePath=null;mxDefaultPopupMenu.prototype.config=null;mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(this.config!=null){var r=this.createConditions(t,i,n);var s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}};mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,l){var a=false;while(s!=null){if(s.nodeName=="add"){var o=s.getAttribute("if");if(o==null||r[o]){var h=s.getAttribute("as");h=mxResources.get(h)||h;var u=mxUtils.eval(mxUtils.getTextContent(s));var d=s.getAttribute("action");var p=s.getAttribute("icon");var m=s.getAttribute("iconCls");var c=s.getAttribute("enabled-if");var x=c==null||r[c];if(a){e.addSeparator(l);a=false}if(p!=null&&this.imageBasePath){p=this.imageBasePath+p}var f=this.addAction(e,t,h,p,u,d,i,l,m,x);this.addItems(t,e,i,n,r,s.firstChild,f)}}else if(s.nodeName=="separator"){a=true}s=s.nextSibling}};mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,l,a,o,h){var u=function(t){if(typeof r=="function"){r.call(e,e,l,t)}if(s!=null){e.execute(s,l,t)}};return t.addItem(i,n,u,a,o,h)};mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel();var r=n.getChildCount(e);var s=[];s["nocell"]=e==null;s["ncells"]=t.graph.getSelectionCount()>1;s["notRoot"]=n.getRoot()!=n.getParent(t.graph.getDefaultParent());s["cell"]=e!=null;var l=e!=null&&t.graph.getSelectionCount()==1;s["nonEmpty"]=l&&r>0;s["expandable"]=l&&t.graph.isCellFoldable(e,false);s["collapsable"]=l&&t.graph.isCellFoldable(e,true);s["validRoot"]=l&&t.graph.isValidRoot(e);s["emptyValidRoot"]=s["validRoot"]&&r==0;s["swimlane"]=l&&t.graph.isSwimlane(e);var a=this.config.getElementsByTagName("condition");for(var o=0;o<a.length;o++){var h=mxUtils.eval(mxUtils.getTextContent(a[o]));var u=a[o].getAttribute("name");if(u!=null&&typeof h=="function"){s[u]=h(t,e,i)}}return s};__mxOutput.mxDefaultPopupMenu=typeof mxDefaultPopupMenu!=="undefined"?mxDefaultPopupMenu:undefined;function mxDefaultToolbar(t,e){this.editor=e;if(t!=null&&e!=null){this.init(t)}}mxDefaultToolbar.prototype.editor=null;mxDefaultToolbar.prototype.toolbar=null;mxDefaultToolbar.prototype.resetHandler=null;mxDefaultToolbar.prototype.spacing=4;mxDefaultToolbar.prototype.connectOnDrop=false;mxDefaultToolbar.prototype.init=function(t){if(t!=null){this.toolbar=new mxToolbar(t);this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,(function(t,e){var i=e.getProperty("function");if(i!=null){this.editor.insertFunction=mxUtils.bind(this,(function(){i.apply(this,arguments);this.toolbar.resetMode()}))}else{this.editor.insertFunction=null}})));this.resetHandler=mxUtils.bind(this,(function(){if(this.toolbar!=null){this.toolbar.resetMode(true)}}));this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler);this.editor.addListener(mxEvent.ESCAPE,this.resetHandler)}};mxDefaultToolbar.prototype.addItem=function(t,e,i,n){var r=mxUtils.bind(this,(function(){if(i!=null&&i.length>0){this.editor.execute(i)}}));return this.toolbar.addItem(t,e,r,n)};mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif";this.toolbar.addSeparator(t)};mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()};mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)};mxDefaultToolbar.prototype.addActionOption=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(i)}));this.addOption(t,e,n)};mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)};mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,(function(){this.editor.setMode(i);if(r!=null){r(this.editor)}}));return this.toolbar.addSwitchMode(t,e,s,n)};mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var l=mxUtils.bind(this,(function(){if(typeof i=="function"){return i()}else if(i!=null){return this.editor.graph.cloneCell(i)}return null}));var a=mxUtils.bind(this,(function(t,e){if(typeof r=="function"){r(this.editor,l(),t,e)}else{this.drop(l(),t,e)}this.toolbar.resetMode();mxEvent.consume(t)}));var o=this.toolbar.addMode(t,e,a,n,null,s);var h=function(t,e,i){a(e,i)};this.installDropHandler(o,h);return o};mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph;var r=n.getModel();if(i==null||r.isEdge(i)||!this.connectOnDrop||!n.isCellConnectable(i)){while(i!=null&&!n.isValidDropTarget(i,[t],e)){i=r.getParent(i)}this.insert(t,e,i)}else{this.connect(t,e,i)}};mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e);var s=mxEvent.getClientY(e);var l=mxUtils.convertPoint(n.container,r,s);if(n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)){return n.splitEdge(i,[t],null,l.x,l.y)}else{return this.editor.addVertex(i,t,l.x,l.y)}}return null};mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph;var r=n.getModel();if(i!=null&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var l=r.getGeometry(i);var a=r.getGeometry(t).clone();a.x=l.x+(l.width-a.width)/2;a.y=l.y+(l.height-a.height)/2;var o=this.spacing*n.gridSize;var h=r.getDirectedEdgeCount(i,true)*20;if(this.editor.horizontalFlow){a.x+=(a.width+l.width)/2+o+h}else{a.y+=(a.height+l.height)/2+o+h}t.setGeometry(a);var u=r.getParent(i);n.addCell(t,u);n.constrainChild(t);s=this.editor.createEdge(i,t);if(r.getGeometry(s)==null){var d=new mxGeometry;d.relative=true;r.setGeometry(s,d)}n.addEdge(s,u,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]);n.scrollCellToVisible(t)}};mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,(function(r){i.style.width=2*t.offsetWidth+"px";i.style.height=2*t.offsetHeight+"px";mxUtils.makeDraggable(t,this.editor.graph,e,i);mxEvent.removeListener(i,"load",n)}));if(mxClient.IS_IE){n()}else{mxEvent.addListener(i,"load",n)}};mxDefaultToolbar.prototype.destroy=function(){if(this.resetHandler!=null){this.editor.graph.removeListener("dblclick",this.resetHandler);this.editor.removeListener("escape",this.resetHandler);this.resetHandler=null}if(this.toolbar!=null){this.toolbar.destroy();this.toolbar=null}};__mxOutput.mxDefaultToolbar=typeof mxDefaultToolbar!=="undefined"?mxDefaultToolbar:undefined;function mxEditor(t){this.actions=[];this.addActions();if(document.body!=null){this.cycleAttributeValues=[];this.popupHandler=new mxDefaultPopupMenu;this.undoManager=new mxUndoManager;this.graph=this.createGraph();this.toolbar=this.createToolbar();this.keyHandler=new mxDefaultKeyHandler(this);this.configure(t);this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName;if(this.onInit!=null){this.onInit()}if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}}if(mxLoadResources){mxResources.add(mxClient.basePath+"/resources/editor")}else{mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor")}mxEditor.prototype=new mxEventSource;mxEditor.prototype.constructor=mxEditor;mxEditor.prototype.askZoomResource=mxClient.language!="none"?"askZoom":"";mxEditor.prototype.lastSavedResource=mxClient.language!="none"?"lastSaved":"";mxEditor.prototype.currentFileResource=mxClient.language!="none"?"currentFile":"";mxEditor.prototype.propertiesResource=mxClient.language!="none"?"properties":"";mxEditor.prototype.tasksResource=mxClient.language!="none"?"tasks":"";mxEditor.prototype.helpResource=mxClient.language!="none"?"help":"";mxEditor.prototype.outlineResource=mxClient.language!="none"?"outline":"";mxEditor.prototype.outline=null;mxEditor.prototype.graph=null;mxEditor.prototype.graphRenderHint=null;mxEditor.prototype.toolbar=null;mxEditor.prototype.status=null;mxEditor.prototype.popupHandler=null;mxEditor.prototype.undoManager=null;mxEditor.prototype.keyHandler=null;mxEditor.prototype.actions=null;mxEditor.prototype.dblClickAction="edit";mxEditor.prototype.swimlaneRequired=false;mxEditor.prototype.disableContextMenu=true;mxEditor.prototype.insertFunction=null;mxEditor.prototype.forcedInserting=false;mxEditor.prototype.templates=null;mxEditor.prototype.defaultEdge=null;mxEditor.prototype.defaultEdgeStyle=null;mxEditor.prototype.defaultGroup=null;mxEditor.prototype.groupBorderSize=null;mxEditor.prototype.filename=null;mxEditor.prototype.linefeed="&#xa;";mxEditor.prototype.postParameterName="xml";mxEditor.prototype.escapePostData=true;mxEditor.prototype.urlPost=null;mxEditor.prototype.urlImage=null;mxEditor.prototype.horizontalFlow=false;mxEditor.prototype.layoutDiagram=false;mxEditor.prototype.swimlaneSpacing=0;mxEditor.prototype.maintainSwimlanes=false;mxEditor.prototype.layoutSwimlanes=false;mxEditor.prototype.cycleAttributeValues=null;mxEditor.prototype.cycleAttributeIndex=0;mxEditor.prototype.cycleAttributeName="fillColor";mxEditor.prototype.tasks=null;mxEditor.prototype.tasksWindowImage=null;mxEditor.prototype.tasksTop=20;mxEditor.prototype.help=null;mxEditor.prototype.helpWindowImage=null;mxEditor.prototype.urlHelp=null;mxEditor.prototype.helpWidth=300;mxEditor.prototype.helpHeight=260;mxEditor.prototype.propertiesWidth=240;mxEditor.prototype.propertiesHeight=null;mxEditor.prototype.movePropertiesDialog=false;mxEditor.prototype.validating=false;mxEditor.prototype.modified=false;mxEditor.prototype.isModified=function(){return this.modified};mxEditor.prototype.setModified=function(t){this.modified=t};mxEditor.prototype.addActions=function(){this.addAction("save",(function(t){t.save()}));this.addAction("print",(function(t){var e=new mxPrintPreview(t.graph,1);e.open()}));this.addAction("show",(function(t){mxUtils.show(t.graph,null,10,10)}));this.addAction("exportImage",(function(t){var e=t.getUrlImage();if(e==null||mxClient.IS_LOCAL){t.execute("show")}else{var i=mxUtils.getViewXml(t.graph,1);var n=mxUtils.getXml(i,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}));this.addAction("refresh",(function(t){t.graph.refresh()}));this.addAction("cut",(function(t){if(t.graph.isEnabled()){mxClipboard.cut(t.graph)}}));this.addAction("copy",(function(t){if(t.graph.isEnabled()){mxClipboard.copy(t.graph)}}));this.addAction("paste",(function(t){if(t.graph.isEnabled()){mxClipboard.paste(t.graph)}}));this.addAction("delete",(function(t){if(t.graph.isEnabled()){t.graph.removeCells()}}));this.addAction("group",(function(t){if(t.graph.isEnabled()){t.graph.setSelectionCell(t.groupCells())}}));this.addAction("ungroup",(function(t){if(t.graph.isEnabled()){t.graph.setSelectionCells(t.graph.ungroupCells())}}));this.addAction("removeFromParent",(function(t){if(t.graph.isEnabled()){t.graph.removeCellsFromParent()}}));this.addAction("undo",(function(t){if(t.graph.isEnabled()){t.undo()}}));this.addAction("redo",(function(t){if(t.graph.isEnabled()){t.redo()}}));this.addAction("zoomIn",(function(t){t.graph.zoomIn()}));this.addAction("zoomOut",(function(t){t.graph.zoomOut()}));this.addAction("actualSize",(function(t){t.graph.zoomActual()}));this.addAction("fit",(function(t){t.graph.fit()}));this.addAction("showProperties",(function(t,e){t.showProperties(e)}));this.addAction("selectAll",(function(t){if(t.graph.isEnabled()){t.graph.selectAll()}}));this.addAction("selectNone",(function(t){if(t.graph.isEnabled()){t.graph.clearSelection()}}));this.addAction("selectVertices",(function(t){if(t.graph.isEnabled()){t.graph.selectVertices()}}));this.addAction("selectEdges",(function(t){if(t.graph.isEnabled()){t.graph.selectEdges()}}));this.addAction("edit",(function(t,e){if(t.graph.isEnabled()&&t.graph.isCellEditable(e)){t.graph.startEditingAtCell(e)}}));this.addAction("toBack",(function(t,e){if(t.graph.isEnabled()){t.graph.orderCells(true)}}));this.addAction("toFront",(function(t,e){if(t.graph.isEnabled()){t.graph.orderCells(false)}}));this.addAction("enterGroup",(function(t,e){t.graph.enterGroup(e)}));this.addAction("exitGroup",(function(t){t.graph.exitGroup()}));this.addAction("home",(function(t){t.graph.home()}));this.addAction("selectPrevious",(function(t){if(t.graph.isEnabled()){t.graph.selectPreviousCell()}}));this.addAction("selectNext",(function(t){if(t.graph.isEnabled()){t.graph.selectNextCell()}}));this.addAction("selectParent",(function(t){if(t.graph.isEnabled()){t.graph.selectParentCell()}}));this.addAction("selectChild",(function(t){if(t.graph.isEnabled()){t.graph.selectChildCell()}}));this.addAction("collapse",(function(t){if(t.graph.isEnabled()){t.graph.foldCells(true)}}));this.addAction("collapseAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(true,false,e)}}));this.addAction("expand",(function(t){if(t.graph.isEnabled()){t.graph.foldCells(false)}}));this.addAction("expandAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(false,false,e)}}));this.addAction("bold",(function(t){if(t.graph.isEnabled()){t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}}));this.addAction("italic",(function(t){if(t.graph.isEnabled()){t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}}));this.addAction("underline",(function(t){if(t.graph.isEnabled()){t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}}));this.addAction("alignCellsLeft",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_LEFT)}}));this.addAction("alignCellsCenter",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_CENTER)}}));this.addAction("alignCellsRight",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_RIGHT)}}));this.addAction("alignCellsTop",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_TOP)}}));this.addAction("alignCellsMiddle",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_MIDDLE)}}));this.addAction("alignCellsBottom",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_BOTTOM)}}));this.addAction("alignFontLeft",(function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}));this.addAction("alignFontCenter",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}}));this.addAction("alignFontRight",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}}));this.addAction("alignFontTop",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}}));this.addAction("alignFontMiddle",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}}));this.addAction("alignFontBottom",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}}));this.addAction("zoom",(function(t){var e=t.graph.getView().scale*100;var i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;if(!isNaN(i)){t.graph.getView().setScale(i)}}));this.addAction("toggleTasks",(function(t){if(t.tasks!=null){t.tasks.setVisible(!t.tasks.isVisible())}else{t.showTasks()}}));this.addAction("toggleHelp",(function(t){if(t.help!=null){t.help.setVisible(!t.help.isVisible())}else{t.showHelp()}}));this.addAction("toggleOutline",(function(t){if(t.outline==null){t.showOutline()}else{t.outline.setVisible(!t.outline.isVisible())}}));this.addAction("toggleConsole",(function(t){mxLog.setVisible(!mxLog.isVisible())}))};mxEditor.prototype.configure=function(t){if(t!=null){var e=new mxCodec(t.ownerDocument);e.decode(t,this);this.resetHistory()}};mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"};mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime();this.undoManager.clear();this.ignoredChanges=0;this.setModified(false)};mxEditor.prototype.addAction=function(t,e){this.actions[t]=e};mxEditor.prototype.execute=function(t,e,i){var n=this.actions[t];if(n!=null){try{var r=arguments;r[0]=this;n.apply(this,r)}catch(s){mxUtils.error("Cannot execute "+t+": "+s.message,280,true);throw s}}else{mxUtils.error("Cannot find action "+t,280,true)}};mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e};mxEditor.prototype.getTemplate=function(t){return this.templates[t]};mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);t.setTooltips(true);t.setPanning(true);this.installDblClickHandler(t);this.installUndoHandler(t);this.installDrillHandler(t);this.installChangeHandler(t);this.installInsertHandler(t);t.popupMenuHandler.factoryMethod=mxUtils.bind(this,(function(t,e,i){return this.createPopupMenu(t,e,i)}));t.connectionHandler.factoryMethod=mxUtils.bind(this,(function(t,e){return this.createEdge(t,e)}));this.createSwimlaneManager(t);this.createLayoutManager(t);return t};mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,false);e.isHorizontal=mxUtils.bind(this,(function(){return this.horizontalFlow}));e.isEnabled=mxUtils.bind(this,(function(){return this.maintainSwimlanes}));return e};mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t);var i=this;e.getLayout=function(e){var n=null;var r=i.graph.getModel();if(r.getParent(e)!=null){if(i.layoutSwimlanes&&t.isSwimlane(e)){if(i.swimlaneLayout==null){i.swimlaneLayout=i.createSwimlaneLayout()}n=i.swimlaneLayout}else if(i.layoutDiagram&&(t.isValidRoot(e)||r.getParent(r.getParent(e))==null)){if(i.diagramLayout==null){i.diagramLayout=i.createDiagramLayout()}n=i.diagramLayout}}return n};return e};mxEditor.prototype.setGraphContainer=function(t){if(this.graph.container==null){this.graph.init(t);this.rubberband=new mxRubberband(this.graph);if(this.disableContextMenu){mxEvent.disableContextMenu(t)}if(mxClient.IS_QUIRKS){new mxDivResizer(t)}}};mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,(function(e,i){var n=i.getProperty("cell");if(n!=null&&t.isEnabled()&&this.dblClickAction!=null){this.execute(this.dblClickAction,n);i.consume()}})))};mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,(function(t,e){var i=e.getProperty("edit");this.undoManager.undoableEditHappened(i)}));t.getModel().addListener(mxEvent.UNDO,e);t.getView().addListener(mxEvent.UNDO,e);var i=function(e,i){var n=i.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(n))};this.undoManager.addListener(mxEvent.UNDO,i);this.undoManager.addListener(mxEvent.REDO,i)};mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.ROOT))}));t.getView().addListener(mxEvent.DOWN,e);t.getView().addListener(mxEvent.UP,e)};mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,(function(e,i){this.setModified(true);if(this.validating==true){t.validateGraph()}var n=i.getProperty("edit").changes;for(var r=0;r<n.length;r++){var s=n[r];if(s instanceof mxRootChange||s instanceof mxValueChange&&s.cell==this.graph.model.root||s instanceof mxCellAttributeChange&&s.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}}));t.getModel().addListener(mxEvent.CHANGE,e)};mxEditor.prototype.installInsertHandler=function(t){var e=this;var i={mouseDown:function(t,i){if(e.insertFunction!=null&&!i.isPopupTrigger()&&(e.forcedInserting||i.getState()==null)){e.graph.clearSelection();e.insertFunction(i.getEvent(),i.getCell());this.isActive=true;i.consume()}},mouseMove:function(t,e){if(this.isActive){e.consume()}},mouseUp:function(t,e){if(this.isActive){this.isActive=false;e.consume()}}};t.addMouseListener(i)};mxEditor.prototype.createDiagramLayout=function(){var t=this.graph.gridSize;var e=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*t,2*t);e.isVertexIgnored=function(t){return!e.graph.isSwimlane(t)};return e};mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)};mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)};mxEditor.prototype.setToolbarContainer=function(t){this.toolbar.init(t);if(mxClient.IS_QUIRKS){new mxDivResizer(t)}};mxEditor.prototype.setStatusContainer=function(t){if(this.status==null){this.status=t;this.addListener(mxEvent.SAVE,mxUtils.bind(this,(function(){var t=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+t)})));this.addListener(mxEvent.OPEN,mxUtils.bind(this,(function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})));if(mxClient.IS_QUIRKS){new mxDivResizer(t)}}};mxEditor.prototype.setStatus=function(t){if(this.status!=null&&t!=null){this.status.innerHTML=t}};mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,(function(e){t.innerHTML=this.getTitle()})));if(mxClient.IS_QUIRKS){new mxDivResizer(t)}};mxEditor.prototype.treeLayout=function(t,e){if(t!=null){var i=new mxCompactTreeLayout(this.graph,e);i.execute(t)}};mxEditor.prototype.getTitle=function(){var t="";var e=this.graph;var i=e.getCurrentRoot();while(i!=null&&e.getModel().getParent(e.getModel().getParent(i))!=null){if(e.isValidRoot(i)){t=" > "+e.convertValueToString(i)+t}i=e.getModel().getParent(i)}var n=this.getRootTitle();return n+t};mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)};mxEditor.prototype.undo=function(){this.undoManager.undo()};mxEditor.prototype.redo=function(){this.undoManager.redo()};mxEditor.prototype.groupCells=function(){var t=this.groupBorderSize!=null?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)};mxEditor.prototype.createGroup=function(){var t=this.graph.getModel();return t.cloneCell(this.defaultGroup)};mxEditor.prototype.open=function(t){if(t!=null){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement);this.filename=t;this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}};mxEditor.prototype.readGraphModel=function(t){var e=new mxCodec(t.ownerDocument);e.decode(t,this.graph.getModel());this.resetHistory()};mxEditor.prototype.save=function(t,e){t=t||this.getUrlPost();if(t!=null&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i);this.setModified(false)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))};mxEditor.prototype.postDiagram=function(t,e){if(this.escapePostData){e=encodeURIComponent(e)}mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,(function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))})))};mxEditor.prototype.writeGraphModel=function(t){t=t!=null?t:this.linefeed;var e=new mxCodec;var i=e.encode(this.graph.getModel());return mxUtils.getXml(i,t)};mxEditor.prototype.getUrlPost=function(){return this.urlPost};mxEditor.prototype.getUrlImage=function(){return this.urlImage};mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]);this.graph.getStylesheet().putCellStyle(t,i);this.graph.refresh()};mxEditor.prototype.showProperties=function(t){t=t||this.graph.getSelectionCell();if(t==null){t=this.graph.getCurrentRoot();if(t==null){t=this.graph.getModel().getRoot()}}if(t!=null){this.graph.stopEditing(true);var e=mxUtils.getOffset(this.graph.container);var i=e.x+10;var n=e.y;if(this.properties!=null&&!this.movePropertiesDialog){i=this.properties.getX();n=this.properties.getY()}else{var r=this.graph.getCellBounds(t);if(r!=null){i+=r.x+Math.min(200,r.width);n+=r.y}}this.hideProperties();var s=this.createProperties(t);if(s!=null){this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,false);this.properties.setVisible(true)}}};mxEditor.prototype.isPropertiesVisible=function(){return this.properties!=null};mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel();var i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties");var r=n.addText("ID",t.getId());r.setAttribute("readonly","true");var s=null;var l=null;var a=null;var o=null;var h=null;if(e.isVertex(t)){s=e.getGeometry(t);if(s!=null){l=n.addText("top",s.y);a=n.addText("left",s.x);o=n.addText("width",s.width);h=n.addText("height",s.height)}}var u=e.getStyle(t);var d=n.addText("Style",u||"");var p=i.attributes;var m=[];for(var c=0;c<p.length;c++){var x=p[c].value;m[c]=n.addTextarea(p[c].nodeName,x,p[c].nodeName=="label"?4:2)}var f=mxUtils.bind(this,(function(){this.hideProperties();e.beginUpdate();try{if(s!=null){s=s.clone();s.x=parseFloat(a.value);s.y=parseFloat(l.value);s.width=parseFloat(o.value);s.height=parseFloat(h.value);e.setGeometry(t,s)}if(d.value.length>0){e.setStyle(t,d.value)}else{e.setStyle(t,null)}for(var i=0;i<p.length;i++){var n=new mxCellAttributeChange(t,p[i].nodeName,m[i].value);e.execute(n)}if(this.graph.isAutoSizeCell(t)){this.graph.updateCellSize(t)}}finally{e.endUpdate()}}));var g=mxUtils.bind(this,(function(){this.hideProperties()}));n.addButtons(f,g);return n.table}return null};mxEditor.prototype.hideProperties=function(){if(this.properties!=null){this.properties.destroy();this.properties=null}};mxEditor.prototype.showTasks=function(){if(this.tasks==null){var t=document.createElement("div");t.style.padding="4px";t.style.paddingLeft="20px";var e=document.body.clientWidth;var i=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200);i.setClosable(true);i.destroyOnClose=false;var n=mxUtils.bind(this,(function(e){mxEvent.release(t);t.innerHTML="";this.createTasks(t)}));this.graph.getModel().addListener(mxEvent.CHANGE,n);this.graph.getSelectionModel().addListener(mxEvent.CHANGE,n);this.graph.addListener(mxEvent.ROOT,n);if(this.tasksWindowImage!=null){i.setImage(this.tasksWindowImage)}this.tasks=i;this.createTasks(t)}this.tasks.setVisible(true)};mxEditor.prototype.refreshTasks=function(t){if(this.tasks!=null){var t=this.tasks.content;mxEvent.release(t);t.innerHTML="";this.createTasks(t)}};mxEditor.prototype.createTasks=function(t){};mxEditor.prototype.showHelp=function(t){if(this.help==null){var e=document.createElement("iframe");e.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp);e.setAttribute("height","100%");e.setAttribute("width","100%");e.setAttribute("frameBorder","0");e.style.backgroundColor="white";var i=document.body.clientWidth;var n=document.body.clientHeight||document.documentElement.clientHeight;var r=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,e,(i-this.helpWidth)/2,(n-this.helpHeight)/3,this.helpWidth,this.helpHeight);r.setMaximizable(true);r.setClosable(true);r.destroyOnClose=false;r.setResizable(true);if(this.helpWindowImage!=null){r.setImage(this.helpWindowImage)}if(mxClient.IS_NS){var s=function(t){var i=r.div.offsetHeight;e.setAttribute("height",i-26+"px")};r.addListener(mxEvent.RESIZE_END,s);r.addListener(mxEvent.MAXIMIZE,s);r.addListener(mxEvent.NORMALIZE,s);r.addListener(mxEvent.SHOW,s)}this.help=r}this.help.setVisible(true)};mxEditor.prototype.showOutline=function(){var t=this.outline==null;if(t){var e=document.createElement("div");e.style.overflow="hidden";e.style.position="relative";e.style.width="100%";e.style.height="100%";e.style.background="white";e.style.cursor="move";if(document.documentMode==8){e.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=100)"}var i=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,false);var n=new mxOutline(this.graph,e);i.setClosable(true);i.setResizable(true);i.destroyOnClose=false;i.addListener(mxEvent.RESIZE_END,(function(){n.update()}));this.outline=i;this.outline.outline=n}this.outline.setVisible(true);this.outline.outline.update(true)};mxEditor.prototype.setMode=function(t){if(t=="select"){this.graph.panningHandler.useLeftButtonForPanning=false;this.graph.setConnectable(false)}else if(t=="connect"){this.graph.panningHandler.useLeftButtonForPanning=false;this.graph.setConnectable(true)}else if(t=="pan"){this.graph.panningHandler.useLeftButtonForPanning=true;this.graph.setConnectable(false)}};mxEditor.prototype.createPopupMenu=function(t,e,i){this.popupHandler.createMenu(this,t,e,i)};mxEditor.prototype.createEdge=function(t,e){var i=null;if(this.defaultEdge!=null){var n=this.graph.getModel();i=n.cloneCell(this.defaultEdge)}else{i=new mxCell("");i.setEdge(true);var r=new mxGeometry;r.relative=true;i.setGeometry(r)}var s=this.getEdgeStyle();if(s!=null){i.setStyle(s)}return i};mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle};mxEditor.prototype.consumeCycleAttribute=function(t){return this.cycleAttributeValues!=null&&this.cycleAttributeValues.length>0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null};mxEditor.prototype.cycleAttribute=function(t){if(this.cycleAttributeName!=null){var e=this.consumeCycleAttribute(t);if(e!=null){t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}}};mxEditor.prototype.addVertex=function(t,e,i,n){var r=this.graph.getModel();while(t!=null&&!this.graph.isValidDropTarget(t)){t=r.getParent(t)}t=t!=null?t:this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale;var l=r.getGeometry(e);var a=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting){t=null}else if(t==null&&this.swimlaneRequired){return null}else if(t!=null&&a!=null){var o=this.graph.getView().getState(t);if(o!=null){i-=o.origin.x*s;n-=o.origin.y*s;if(this.graph.isConstrainedMoving){var h=l.width;var u=l.height;var d=o.x+o.width;if(i+h>d){i-=i+h-d}d=o.y+o.height;if(n+u>d){n-=n+u-d}}}else if(a!=null){i-=a.x*s;n-=a.y*s}}l=l.clone();l.x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2);l.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2);e.setGeometry(l);if(t==null){t=this.graph.getDefaultParent()}this.cycleAttribute(e);this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t));r.beginUpdate();try{e=this.graph.addCell(e,t);if(e!=null){this.graph.constrainChild(e);this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e))}}finally{r.endUpdate()}if(e!=null){this.graph.setSelectionCell(e);this.graph.scrollCellToVisible(e);this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))}return e};mxEditor.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;if(this.tasks!=null){this.tasks.destroy()}if(this.outline!=null){this.outline.destroy()}if(this.properties!=null){this.properties.destroy()}if(this.keyHandler!=null){this.keyHandler.destroy()}if(this.rubberband!=null){this.rubberband.destroy()}if(this.toolbar!=null){this.toolbar.destroy()}if(this.graph!=null){this.graph.destroy()}this.status=null;this.templates=null}};__mxOutput.mxEditor=typeof mxEditor!=="undefined"?mxEditor:undefined;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(t!=null){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);if(i!=e){mxCodecRegistry.addAlias(i,e)}}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(t!=null){var i=mxUtils.getFunctionName(t);var n=mxCodecRegistry.aliases[i];if(n!=null){i=n}e=mxCodecRegistry.codecs[i];if(e==null){try{e=new mxObjectCodec(new t);mxCodecRegistry.register(e)}catch(r){}}}return e}};__mxOutput.mxCodecRegistry=typeof mxCodecRegistry!=="undefined"?mxCodecRegistry:undefined;function mxCodec(t){this.document=t||mxUtils.createXmlDocument();this.objects=[]}mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.encodeDefaults=false;mxCodec.prototype.putObject=function(t,e){this.objects[t]=e;return e};mxCodec.prototype.getObject=function(t){var e=null;if(t!=null){e=this.objects[t];if(e==null){e=this.lookup(t);if(e==null){var i=this.getElementById(t);if(i!=null){e=this.decode(i)}}}}return e};mxCodec.prototype.lookup=function(t){return null};mxCodec.prototype.getElementById=function(t){this.updateElements();return this.elements[t]};mxCodec.prototype.updateElements=function(){if(this.elements==null){this.elements=new Object;if(this.document.documentElement!=null){this.addElement(this.document.documentElement)}}};mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(e!=null){if(this.elements[e]==null){this.elements[e]=t}else if(this.elements[e]!=t){throw new Error(e+": Duplicate ID")}}}t=t.firstChild;while(t!=null){this.addElement(t);t=t.nextSibling}};mxCodec.prototype.getId=function(t){var e=null;if(t!=null){e=this.reference(t);if(e==null&&t instanceof mxCell){e=t.getId();if(e==null){e=mxCellPath.create(t);if(e.length==0){e="root"}}}}return e};mxCodec.prototype.reference=function(t){return null};mxCodec.prototype.encode=function(t){var e=null;if(t!=null&&t.constructor!=null){var i=mxCodecRegistry.getCodec(t.constructor);if(i!=null){e=i.encode(this,t)}else{if(mxUtils.isNode(t)){e=mxUtils.importNode(this.document,t,true)}else{mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}}}return e};mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch(s){}var r=mxCodecRegistry.getCodec(n);if(r!=null){i=r.decode(this,t,e)}else{i=t.cloneNode(true);i.removeAttribute("as")}}return i};mxCodec.prototype.encodeCell=function(t,e,i){e.appendChild(this.encode(t));if(i==null||i){var n=t.getChildCount();for(var r=0;r<n;r++){this.encodeCell(t.getChildAt(r),e)}}};mxCodec.prototype.isCellCodec=function(t){if(t!=null&&typeof t.isCellCodec=="function"){return t.isCellCodec()}return false};mxCodec.prototype.decodeCell=function(t,e){e=e!=null?e:true;var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=mxCodecRegistry.getCodec(t.nodeName);if(!this.isCellCodec(n)){var r=t.firstChild;while(r!=null&&!this.isCellCodec(n)){n=mxCodecRegistry.getCodec(r.nodeName);r=r.nextSibling}}if(!this.isCellCodec(n)){n=mxCodecRegistry.getCodec(mxCell)}i=n.decode(this,t);if(e){this.insertIntoGraph(i)}}return i};mxCodec.prototype.insertIntoGraph=function(t){var e=t.parent;var i=t.getTerminal(true);var n=t.getTerminal(false);t.setTerminal(null,false);t.setTerminal(null,true);t.parent=null;if(e!=null){if(e==t){throw new Error(e.id+": Self Reference")}else{e.insert(t)}}if(i!=null){i.insertEdge(t,true)}if(n!=null){n.insertEdge(t,false)}};mxCodec.prototype.setAttribute=function(t,e,i){if(e!=null&&i!=null){t.setAttribute(e,i)}};__mxOutput.mxCodec=typeof mxCodec!=="undefined"?mxCodec:undefined;function mxObjectCodec(t,e,i,n){this.template=t;this.exclude=e!=null?e:[];this.idrefs=i!=null?i:[];this.mapping=n!=null?n:[];this.reverse=new Object;for(var r in this.mapping){this.reverse[this.mapping[r]]=r}}mxObjectCodec.allowEval=false;mxObjectCodec.prototype.template=null;mxObjectCodec.prototype.exclude=null;mxObjectCodec.prototype.idrefs=null;mxObjectCodec.prototype.mapping=null;mxObjectCodec.prototype.reverse=null;mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)};mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor};mxObjectCodec.prototype.getFieldName=function(t){if(t!=null){var e=this.reverse[t];if(e!=null){t=e}}return t};mxObjectCodec.prototype.getAttributeName=function(t){if(t!=null){var e=this.mapping[t];if(e!=null){t=e}}return t};mxObjectCodec.prototype.isExcluded=function(t,e,i,n){return e==mxObjectIdentity.FIELD_NAME||mxUtils.indexOf(this.exclude,e)>=0};mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0};mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());e=this.beforeEncode(t,e,i);this.encodeObject(t,e,i);return this.afterEncode(t,e,i)};mxObjectCodec.prototype.encodeObject=function(t,e,i){t.setAttribute(i,"id",t.getId(e));for(var n in e){var r=n;var s=e[r];if(s!=null&&!this.isExcluded(e,r,s,true)){if(mxUtils.isInteger(r)){r=null}this.encodeValue(t,e,r,s,i)}}};mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(n!=null){if(this.isReference(e,i,n,true)){var s=t.getId(n);if(s==null){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);return}n=s}var l=this.template[i];if(i==null||t.encodeDefaults||l!=n){i=this.getAttributeName(i);this.writeAttribute(t,e,i,n,r)}}};mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){if(typeof n!="object"){this.writePrimitiveAttribute(t,e,i,n,r)}else{this.writeComplexAttribute(t,e,i,n,r)}};mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){n=this.convertAttributeToXml(t,e,i,n,r);if(i==null){var s=t.document.createElement("add");if(typeof n=="function"){s.appendChild(t.document.createTextNode(n))}else{t.setAttribute(s,"value",n)}r.appendChild(s)}else if(typeof n!="function"){t.setAttribute(r,i,n)}};mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);if(s!=null){if(i!=null){s.setAttribute("as",i)}r.appendChild(s)}else{mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)}};mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){if(this.isBooleanAttribute(t,e,i,n)){n=n==true?"1":"0"}return n};mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return typeof n.length=="undefined"&&(n==true||n==false)};mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;if(this.isNumericAttribute(t,e,i)){n=parseFloat(n);if(isNaN(n)||!isFinite(n)){n=0}}return n};mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){var n=i.constructor==mxGeometry&&(e.name=="x"||e.name=="y"||e.name=="width"||e.name=="height")||i.constructor==mxPoint&&(e.name=="x"||e.name=="y")||mxUtils.isNumeric(e.value);return n};mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e};mxObjectCodec.prototype.afterEncode=function(t,e,i){return i};mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id");var r=t.objects[n];if(r==null){r=i||this.cloneTemplate();if(n!=null){t.putObject(n,r)}}e=this.beforeDecode(t,e,r);this.decodeNode(t,e,r);return this.afterDecode(t,e,r)};mxObjectCodec.prototype.decodeNode=function(t,e,i){if(e!=null){this.decodeAttributes(t,e,i);this.decodeChildren(t,e,i)}};mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(n!=null){for(var r=0;r<n.length;r++){this.decodeAttribute(t,n[r],i)}}};mxObjectCodec.prototype.isIgnoredAttribute=function(t,e,i){return e.nodeName=="as"||e.nodeName=="id"};mxObjectCodec.prototype.decodeAttribute=function(t,e,i){if(!this.isIgnoredAttribute(t,e,i)){var n=e.nodeName;var r=this.convertAttributeFromXml(t,e,i);var s=this.getFieldName(n);if(this.isReference(i,s,r,false)){var l=t.getObject(r);if(l==null){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+n+"="+r);return}r=l}if(!this.isExcluded(i,n,r,false)){i[n]=r}}};mxObjectCodec.prototype.decodeChildren=function(t,e,i){var n=e.firstChild;while(n!=null){var r=n.nextSibling;if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,n,i)){this.decodeChild(t,n,i)}n=r}};mxObjectCodec.prototype.decodeChild=function(t,e,i){var n=this.getFieldName(e.getAttribute("as"));if(n==null||!this.isExcluded(i,n,e,false)){var r=this.getFieldTemplate(i,n,e);var s=null;if(e.nodeName=="add"){s=e.getAttribute("value");if(s==null&&mxObjectCodec.allowEval){s=mxUtils.eval(mxUtils.getTextContent(e))}}else{s=t.decode(e,r)}try{this.addObjectValue(i,n,s,r)}catch(l){throw new Error(l.message+" for "+e.nodeName)}}};mxObjectCodec.prototype.getFieldTemplate=function(t,e,i){var n=t[e];if(n instanceof Array&&n.length>0){n=null}return n};mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){if(i!=null&&i!=n){if(e!=null&&e.length>0){t[e]=i}else{t.push(i)}}};mxObjectCodec.prototype.processInclude=function(t,e,i){if(e.nodeName=="include"){var n=e.getAttribute("name");if(n!=null){try{var r=mxUtils.load(n).getDocumentElement();if(r!=null){t.decode(r,i)}}catch(s){}}return true}return false};mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e};mxObjectCodec.prototype.afterDecode=function(t,e,i){return i};__mxOutput.mxObjectCodec=typeof mxObjectCodec!=="undefined"?mxObjectCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);t.isCellCodec=function(){return true};t.isNumericAttribute=function(t,e,i){return e.nodeName!=="value"&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};t.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&e=="value"&&i.nodeType==mxConstants.NODETYPE_ELEMENT};t.afterEncode=function(t,e,i){if(e.value!=null&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var n=i;i=mxUtils.importNode(t.document,e.value,true);i.appendChild(n);var r=n.getAttribute("id");i.setAttribute("id",r);n.removeAttribute("id")}return i};t.beforeDecode=function(t,e,i){var n=e.cloneNode(true);var r=this.getName();if(e.nodeName!=r){var s=e.getElementsByTagName(r)[0];if(s!=null&&s.parentNode==e){mxUtils.removeWhitespace(s,true);mxUtils.removeWhitespace(s,false);s.parentNode.removeChild(s);n=s}else{n=null}i.value=e.cloneNode(true);var l=i.value.getAttribute("id");if(l!=null){i.setId(l);i.value.removeAttribute("id")}}else{i.setId(e.getAttribute("id"))}if(n!=null){for(var a=0;a<this.idrefs.length;a++){var o=this.idrefs[a];var h=n.getAttribute(o);if(h!=null){n.removeAttribute(o);var u=t.objects[h]||t.lookup(h);if(u==null){var d=t.getElementById(h);if(d!=null){var p=mxCodecRegistry.codecs[d.nodeName]||this;u=p.decode(t,d)}}i[o]=u}}}return n};return t}());__mxOutput.mxCellCodec=typeof mxCellCodec!=="undefined"?mxCellCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphModel);t.encodeObject=function(t,e,i){var n=t.document.createElement("root");t.encodeCell(e.getRoot(),n);i.appendChild(n)};t.decodeChild=function(t,e,i){if(e.nodeName=="root"){this.decodeRoot(t,e,i)}else{mxObjectCodec.prototype.decodeChild.apply(this,arguments)}};t.decodeRoot=function(t,e,i){var n=null;var r=e.firstChild;while(r!=null){var s=t.decodeCell(r);if(s!=null&&s.getParent()==null){n=s}r=r.nextSibling}if(n!=null){i.setRoot(n)}};return t}());__mxOutput.mxModelCodec=typeof mxModelCodec!=="undefined"?mxModelCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxRootChange,["model","previous","root"]);t.afterEncode=function(t,e,i){t.encodeCell(e.root,i);return i};t.beforeDecode=function(t,e,i){if(e.firstChild!=null&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){e=e.cloneNode(true);var n=e.firstChild;i.root=t.decodeCell(n,false);var r=n.nextSibling;n.parentNode.removeChild(n);n=r;while(n!=null){r=n.nextSibling;t.decodeCell(n);n.parentNode.removeChild(n);n=r}}return e};t.afterDecode=function(t,e,i){i.previous=i.root;return i};return t}());__mxOutput.mxRootChangeCodec=typeof mxRootChangeCodec!=="undefined"?mxRootChangeCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);t.isReference=function(t,e,i,n){if(e=="child"&&(!n||t.model.contains(t.previous))){return true}return mxUtils.indexOf(this.idrefs,e)>=0};t.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&i!=null&&(e=="previous"||e=="parent")&&!t.model.contains(i)};t.afterEncode=function(t,e,i){if(this.isReference(e,"child",e.child,true)){i.setAttribute("child",t.getId(e.child))}else{t.encodeCell(e.child,i)}return i};t.beforeDecode=function(t,e,i){if(e.firstChild!=null&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){e=e.cloneNode(true);var n=e.firstChild;i.child=t.decodeCell(n,false);var r=n.nextSibling;n.parentNode.removeChild(n);n=r;while(n!=null){r=n.nextSibling;if(n.nodeType==mxConstants.NODETYPE_ELEMENT){var s=n.getAttribute("id");if(t.lookup(s)==null){t.decodeCell(n)}}n.parentNode.removeChild(n);n=r}}else{var l=e.getAttribute("child");i.child=t.getObject(l)}return e};t.afterDecode=function(t,e,i){if(i.child!=null){if(i.child.parent!=null&&i.previous!=null&&i.child.parent!=i.previous){i.previous=i.child.parent}i.child.parent=i.previous;i.previous=i.parent;i.previousIndex=i.index}return i};return t}());__mxOutput.mxChildChangeCodec=typeof mxChildChangeCodec!=="undefined"?mxChildChangeCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);t.afterDecode=function(t,e,i){i.previous=i.terminal;return i};return t}());__mxOutput.mxTerminalChangeCodec=typeof mxTerminalChangeCodec!=="undefined"?mxTerminalChangeCodec:undefined;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);i.afterDecode=function(t,i,n){if(mxUtils.isNode(n.cell)){n.cell=t.decodeCell(n.cell,false)}n.previous=n[e];return n};return i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value"));mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style"));mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed"));mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value"));__mxOutput.mxGenericChangeCodec=typeof mxGenericChangeCodec!=="undefined"?mxGenericChangeCodec:undefined;mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])}());__mxOutput.mxGraphCodec=typeof mxGraphCodec!=="undefined"?mxGraphCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())};t.encodeCell=function(t,e,i){var n=e.graph.getModel();var r=e.getState(i);var s=n.getParent(i);if(s==null||r!=null){var l=n.getChildCount(i);var a=e.graph.getCellGeometry(i);var o=null;if(s==n.getRoot()){o="layer"}else if(s==null){o="graph"}else if(n.isEdge(i)){o="edge"}else if(l>0&&a!=null){o="group"}else if(n.isVertex(i)){o="vertex"}if(o!=null){var h=t.document.createElement(o);var u=e.graph.getLabel(i);if(u!=null){h.setAttribute("label",e.graph.getLabel(i));if(e.graph.isHtmlLabel(i)){h.setAttribute("html",true)}}if(s==null){var d=e.getGraphBounds();if(d!=null){h.setAttribute("x",Math.round(d.x));h.setAttribute("y",Math.round(d.y));h.setAttribute("width",Math.round(d.width));h.setAttribute("height",Math.round(d.height))}h.setAttribute("scale",e.scale)}else if(r!=null&&a!=null){for(var p in r.style){var m=r.style[p];if(typeof m=="function"&&typeof m=="object"){m=mxStyleRegistry.getName(m)}if(m!=null&&typeof m!="function"&&typeof m!="object"){h.setAttribute(p,m)}}var c=r.absolutePoints;if(c!=null&&c.length>0){var x=Math.round(c[0].x)+","+Math.round(c[0].y);for(var p=1;p<c.length;p++){x+=" "+Math.round(c[p].x)+","+Math.round(c[p].y)}h.setAttribute("points",x)}else{h.setAttribute("x",Math.round(r.x));h.setAttribute("y",Math.round(r.y));h.setAttribute("width",Math.round(r.width));h.setAttribute("height",Math.round(r.height))}var f=r.absoluteOffset;if(f!=null){if(f.x!=0){h.setAttribute("dx",Math.round(f.x))}if(f.y!=0){h.setAttribute("dy",Math.round(f.y))}}}for(var p=0;p<l;p++){var g=this.encodeCell(t,e,n.getChildAt(i,p));if(g!=null){h.appendChild(g)}}}}return h};return t}());__mxOutput.mxGraphViewCodec=typeof mxGraphViewCodec!=="undefined"?mxGraphViewCodec:undefined;var mxStylesheetCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxStylesheet);t.encode=function(t,e){var i=t.document.createElement(this.getName());for(var n in e.styles){var r=e.styles[n];var s=t.document.createElement("add");if(n!=null){s.setAttribute("as",n);for(var l in r){var a=this.getStringValue(l,r[l]);if(a!=null){var o=t.document.createElement("add");o.setAttribute("value",a);o.setAttribute("as",l);s.appendChild(o)}}if(s.childNodes.length>0){i.appendChild(s)}}}return i};t.getStringValue=function(t,e){var i=typeof e;if(i=="function"){e=mxStyleRegistry.getName(e)}else if(i=="object"){e=null}return e};t.decode=function(t,e,i){var n=i||new this.template.constructor;var r=e.getAttribute("id");if(r!=null){t.objects[r]=n}e=e.firstChild;while(e!=null){if(!this.processInclude(t,e,n)&&e.nodeName=="add"){var s=e.getAttribute("as");if(s!=null){var l=e.getAttribute("extend");var a=l!=null?mxUtils.clone(n.styles[l]):null;if(a==null){if(l!=null){mxLog.warn("mxStylesheetCodec.decode: stylesheet "+l+" not found to extend")}a=new Object}var o=e.firstChild;while(o!=null){if(o.nodeType==mxConstants.NODETYPE_ELEMENT){var h=o.getAttribute("as");if(o.nodeName=="add"){var u=mxUtils.getTextContent(o);var d=null;if(u!=null&&u.length>0&&mxStylesheetCodec.allowEval){d=mxUtils.eval(u)}else{d=o.getAttribute("value");if(mxUtils.isNumeric(d)){d=parseFloat(d)}}if(d!=null){a[h]=d}}else if(o.nodeName=="remove"){delete a[h]}}o=o.nextSibling}n.putCellStyle(s,a)}}e=e.nextSibling}return n};return t}());mxStylesheetCodec.allowEval=true;__mxOutput.mxStylesheetCodec=typeof mxStylesheetCodec!=="undefined"?mxStylesheetCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);t.encode=function(t,e){return null};t.decode=function(t,e,i){if(i!=null){e=e.firstChild;while(e!=null){if(!this.processInclude(t,e,i)&&e.nodeName=="add"){var n=e.getAttribute("as");var r=e.getAttribute("action");var s=e.getAttribute("control");i.bindAction(n,r,s)}e=e.nextSibling}}return i};return t}());__mxOutput.mxDefaultKeyHandlerCodec=typeof mxDefaultKeyHandlerCodec!=="undefined"?mxDefaultKeyHandlerCodec:undefined;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);t.encode=function(t,e){return null};t.decode=function(t,e,i){if(i!=null){var n=i.editor;e=e.firstChild;while(e!=null){if(e.nodeType==mxConstants.NODETYPE_ELEMENT){if(!this.processInclude(t,e,i)){if(e.nodeName=="separator"){i.addSeparator()}else if(e.nodeName=="br"){i.toolbar.addBreak()}else if(e.nodeName=="hr"){i.toolbar.addLine()}else if(e.nodeName=="add"){var r=e.getAttribute("as");r=mxResources.get(r)||r;var s=e.getAttribute("icon");var l=e.getAttribute("pressedIcon");var a=e.getAttribute("action");var o=e.getAttribute("mode");var h=e.getAttribute("template");var u=e.getAttribute("toggle")!="0";var d=mxUtils.getTextContent(e);var p=null;if(a!=null){p=i.addItem(r,s,a,l)}else if(o!=null){var m=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;p=i.addMode(r,s,o,l,m)}else if(h!=null||d!=null&&d.length>0){var c=n.templates[h];var x=e.getAttribute("style");if(c!=null&&x!=null){c=n.graph.cloneCell(c);c.setStyle(x)}var f=null;if(d!=null&&d.length>0&&mxDefaultToolbarCodec.allowEval){f=mxUtils.eval(d)}p=i.addPrototype(r,s,c,l,f,u)}else{var g=mxUtils.getChildNodes(e);if(g.length>0){if(s==null){var v=i.addActionCombo(r);for(var y=0;y<g.length;y++){var C=g[y];if(C.nodeName=="separator"){i.addOption(v,"---")}else if(C.nodeName=="add"){var E=C.getAttribute("as");var S=C.getAttribute("action");i.addActionOption(v,E,S)}}}else{var b=null;var w=function(){var t=n.templates[b.value];if(t!=null){var e=t.clone();var i=b.options[b.selectedIndex].cellStyle;if(i!=null){e.setStyle(i)}return e}else{mxLog.warn("Template "+t+" not found")}return null};var T=i.addPrototype(r,s,w,null,null,u);b=i.addCombo();mxEvent.addListener(b,"change",(function(){i.toolbar.selectMode(T,(function(t){var e=mxUtils.convertPoint(n.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t));return n.addVertex(null,m(),e.x,e.y)}));i.toolbar.noReset=false}));for(var y=0;y<g.length;y++){var C=g[y];if(C.nodeName=="separator"){i.addOption(b,"---")}else if(C.nodeName=="add"){var E=C.getAttribute("as");var L=C.getAttribute("template");var A=i.addOption(b,E,L||h);A.cellStyle=C.getAttribute("style")}}}}}if(p!=null){var M=e.getAttribute("id");if(M!=null&&M.length>0){p.setAttribute("id",M)}}}}}e=e.nextSibling}}return i};return t}());mxDefaultToolbarCodec.allowEval=true;__mxOutput.mxDefaultToolbarCodec=typeof mxDefaultToolbarCodec!=="undefined"?mxDefaultToolbarCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);t.encode=function(t,e){return null};t.decode=function(t,e,i){var n=e.getElementsByTagName("include")[0];if(n!=null){this.processInclude(t,n,i)}else if(i!=null){i.config=e}return i};return t}());__mxOutput.mxDefaultPopupMenuCodec=typeof mxDefaultPopupMenuCodec!=="undefined"?mxDefaultPopupMenuCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);t.afterDecode=function(t,e,i){var n=e.getAttribute("defaultEdge");if(n!=null){e.removeAttribute("defaultEdge");i.defaultEdge=i.templates[n]}var r=e.getAttribute("defaultGroup");if(r!=null){e.removeAttribute("defaultGroup");i.defaultGroup=i.templates[r]}return i};t.decodeChild=function(t,e,i){if(e.nodeName=="Array"){var n=e.getAttribute("as");if(n=="templates"){this.decodeTemplates(t,e,i);return}}else if(e.nodeName=="ui"){this.decodeUi(t,e,i);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)};t.decodeUi=function(t,e,i){var n=e.firstChild;while(n!=null){if(n.nodeName=="add"){var r=n.getAttribute("as");var s=n.getAttribute("element");var l=n.getAttribute("style");var a=null;if(s!=null){a=document.getElementById(s);if(a!=null&&l!=null){a.style.cssText+=";"+l}}else{var o=parseInt(n.getAttribute("x"));var h=parseInt(n.getAttribute("y"));var u=n.getAttribute("width");var d=n.getAttribute("height");a=document.createElement("div");a.style.cssText=l;var p=new mxWindow(mxResources.get(r)||r,a,o,h,u,d,false,true);p.setVisible(true)}if(r=="graph"){i.setGraphContainer(a)}else if(r=="toolbar"){i.setToolbarContainer(a)}else if(r=="title"){i.setTitleContainer(a)}else if(r=="status"){i.setStatusContainer(a)}else if(r=="map"){i.setMapContainer(a)}}else if(n.nodeName=="resource"){mxResources.add(n.getAttribute("basename"))}else if(n.nodeName=="stylesheet"){mxClient.link("stylesheet",n.getAttribute("name"))}n=n.nextSibling}};t.decodeTemplates=function(t,e,i){if(i.templates==null){i.templates=[]}var n=mxUtils.getChildNodes(e);for(var r=0;r<n.length;r++){var s=n[r].getAttribute("as");var l=n[r].firstChild;while(l!=null&&l.nodeType!=1){l=l.nextSibling}if(l!=null){i.templates[s]=t.decodeCell(l)}}};return t}());__mxOutput.mxEditorCodec=typeof mxEditorCodec!=="undefined"?mxEditorCodec:undefined;return __mxOutput}}))}));var CommonStyleTokens;(function(t){t.HANDLE_COLOR="#4ba3d4";t.HANDLE_SIZE=4;t.PREVIEW_COLOR="#5bb2ff";t.EDGE_SELECTION_COLOR="red";t.HIGHLIGHT_CONNECTION_COLOR="#ffb754";t.GUIDE_COLOR=t.PREVIEW_COLOR;t.GUIDE_STROKE_WIDTH=2;t.DROP_TARGET_COLOR=t.GUIDE_COLOR})(CommonStyleTokens||(CommonStyleTokens={}));var w$1=window;w$1.mxLoadResources=false;w$1.mxForceIncludes=false;w$1.mxResourceExtension=undefined;w$1.mxLoadStylesheets=false;w$1.mxBasePath=getAssetPath("./assets");var mx=exports("m",build({}));mx.mxConstants.HANDLE_STROKECOLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.HANDLE_FILLCOLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.HANDLE_SIZE=CommonStyleTokens.HANDLE_SIZE;mx.mxConstants.VERTEX_SELECTION_COLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.EDGE_SELECTION_COLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.DEFAULT_VALID_COLOR=CommonStyleTokens.HIGHLIGHT_CONNECTION_COLOR;mx.mxConstants.VALID_COLOR=CommonStyleTokens.HIGHLIGHT_CONNECTION_COLOR;mx.mxConstants.GUIDE_COLOR=CommonStyleTokens.GUIDE_COLOR;mx.mxConstants.GUIDE_STROKEWIDTH=CommonStyleTokens.GUIDE_STROKE_WIDTH;mx.mxConstants.DROP_TARGET_COLOR=CommonStyleTokens.DROP_TARGET_COLOR;mx.mxUrlConverter.prototype.isRelativeUrl=function(t){return t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"&&t.substring(0,7)!="gxjs://"};mx.mxMarker.addMarker("oval",(function(t,e,i,n,r,s,l,a,o,h){var u=l/2;var d=n.clone();d.x-=r*(u+1);d.y-=s*(u+1);return function(){t.ellipse(d.x-u,d.y-u,l,l);if(h){t.fillAndStroke()}else{t.stroke()}}}));mx.mxEdgeHandler.prototype.snapToTerminals=true;var _SYM_SVG_GROUPS=Symbol("svgGrpups");var svgCanvas=mx.mxSvgCanvas2D.prototype;svgCanvas[_SYM_SVG_GROUPS]=[];svgCanvas._getCurrentSvgGroup=function(){var t=svgCanvas[_SYM_SVG_GROUPS];if(t.length>0)return t[t.length-1];return this.root};svgCanvas.beginSvgGroup=function(t){if(t===void 0){t={}}var e=this.createElement("g");for(var i=0,n=Object.getOwnPropertyNames(t);i<n.length;i++){var r=n[i];e.setAttribute(r,t[r])}var s=this._getCurrentSvgGroup();s.appendChild(e);var l=svgCanvas[_SYM_SVG_GROUPS];l.push(e)};svgCanvas.closeSvgGroup=function(){var t=svgCanvas[_SYM_SVG_GROUPS];if(t.length>0)return t.pop()};svgCanvas.addSvgElement=function(t,e){if(e===void 0){e={}}var i=this.createElement(t);this._getCurrentSvgGroup().appendChild(i);this.node=i;this.updateFill();this.updateStroke();for(var n=0,r=Object.getOwnPropertyNames(e);n<r.length;n++){var s=r[n];var l=e[s];if(l!==undefined)i.setAttribute(s,l)}return i};var Cell=function(t){__extends(e,t);function e(e,i,n){var r=t.call(this,i!==null&&i!==void 0?i:{},n)||this;r._descriptor=e;r.setId(Guid.newInstance().toString());return r}Object.defineProperty(e.prototype,"descriptor",{get:function(){return this._descriptor},enumerable:false,configurable:true});e.prototype.setAttribute=function(t,e){var i=this.getValue();i[t]=e};e.prototype.getAttribute=function(t){var e=this.getValue();return e[t]};e.prototype.getSlot=function(t){if(this.descriptor.isSlot&&t===this.descriptor.slotId)return this;if(this.children){for(var i=0,n=this.children;i<n.length;i++){var r=n[i];if(r instanceof e&&!r.descriptor.isDiagramElement&&r.descriptor.isSlot&&r.descriptor.slotId===t){return r}}}return null};e.prototype.getParentDiagramElement=function(){var t=this.getParent();while(t&&(!(t instanceof e)||!t.descriptor.isDiagramElement))t=t.getParent();return t};e.prototype.getDiagramElements=function(){var t=[];if(this.descriptor.isSlot&&this.children){for(var i=0,n=this.children;i<n.length;i++){var r=n[i];if(r instanceof e&&r.descriptor.isDiagramElement)t.push(r)}}return t};e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._descriptor=this._descriptor;return e};e.prototype.cloneValue=function(){var t=this.getValue();return Object.assign({},t)};return e}(mx.mxCell);exports("C",Cell);Cell.prototype.mxTransient=__spreadArrays(Cell.prototype.mxTransient,["_descriptor"]);var _LABEL_ATTR="label";var CellDescriptor=function(){function t(e){var i,n,r;this._isDiagramElement=e.isDiagramElement!==undefined?e.isDiagramElement:true;this._id=e.id;this._baseName=e.baseName;this._icon=e.icon;this._isVertex=(i=e.isVertex)!==null&&i!==void 0?i:false;this._isEdge=(n=e.isEdge)!==null&&n!==void 0?n:false;this._isSlot=!!e.isSlot;this._slotId=this._isSlot?e.slotId||t.DEFAULT_SLOT_NAME:null;this._labelAttribute=e.labelAttribute;this._nameAttribute=e.nameAttribute;this._resizable=e.resizable;if(this._isVertex&&!e.size)this._size={width:100,height:50};else this._size=e.size;this._labelOffset=e.labelOffset;this._style=e.style;this._shape=e.shape;this._radialMenu=e.radialMenu;this._value=(r=e.value)!==null&&r!==void 0?r:{};this._factory=e.factory}Object.defineProperty(t.prototype,"isDiagramElement",{get:function(){return this._isDiagramElement},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"baseName",{get:function(){return this._baseName},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isVertex",{get:function(){return this._isVertex},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEdge",{get:function(){return this._isEdge},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isSlot",{get:function(){return this._isSlot},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"slotId",{get:function(){return this._slotId},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"labelAttribute",{get:function(){var t;return(t=this._labelAttribute)!==null&&t!==void 0?t:_LABEL_ATTR},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"nameAttribute",{get:function(){return this._nameAttribute||this.labelAttribute},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"labelOffset",{get:function(){return this._labelOffset},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"style",{get:function(){return this._style},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"shape",{get:function(){return this._shape},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:false,configurable:true});t.prototype.getRadialMenu=function(t,e){if(typeof this._radialMenu==="function")return this._radialMenu.call(this,t,e);return this._radialMenu};t.prototype.isResizable=function(t,e){if(typeof this._resizable==="function")return this._resizable.call(this,t,e);if(typeof this._resizable==="boolean")return this._resizable;return true};t.prototype.getDefaultStyle=function(){var t;var e=this.isVertex?"defaultVertex":"defaultEdge";return((t=this.style)!==null&&t!==void 0?t:e)+";"+(this.shape?mx.mxConstants.STYLE_SHAPE+"="+this.id.toString():"")};t.prototype.newInstance=function(t){return this._factory?this._factory(this,t):new Cell(this,t.value,t.geometry)};t.prototype.toString=function(){return this.id.toString()+", "+this.baseName};return t}();exports("a",CellDescriptor);CellDescriptor.DEFAULT_SLOT_NAME="Children";var EventType;(function(t){t["ChildChange"]="ChildChange";t["CachedPropertiesChange"]="CachedPropertiesChange";t["TerminalChange"]="TerminalChange";t["GraphicalPropertiesChange"]="GraphicalPropertiesChange"})(EventType||(EventType={}));var EventConverter=function(){function t(){}t.convert=function(e,i){var n=[];for(var r=0,s=e.properties.changes;r<s.length;r++){var l=s[r];var a=null;switch(l.constructor.name){case mxEventType.ChildChange:a=t.convertChildChange(l,i);break;case mxEventType.ValueChange:a=t.convertValueChange(l);break;case mxEventType.GeometryChange:a=t.convertGeometryChange(l,i);break;case mxEventType.TerminalChange:a=t.convertTerminalChange(l);break}if(a)n.push(a)}return n};t.convertChildChange=function(e,i){if(e.child instanceof Cell){var n=e.child;var r=null,s=void 0;if(e.parent){if(e.parent instanceof Cell){var l=e.child.getParentDiagramElement();r=l.id;s=e.parent.descriptor.slotId}else r=Guid.EMPTY.toString()}return{type:EventType.ChildChange,args:{parentGuid:r,parentSlotId:s,guid:n.id,type:n.descriptor.id,properties:n.getValue(),graphicalProperties:t.convertGeometry(n,i),index:e.index}}}return null};t.convertValueChange=function(t){if(t.cell instanceof Cell){return{type:EventType.CachedPropertiesChange,args:{guid:t.cell.id,properties:t.cell.getValue()}}}return null};t.convertGeometryChange=function(e,i){if(e.cell instanceof Cell){var n=e.geometry;if(n.offset){var r=i.view.getState(e.cell,true);var s=i.view.getTranslate();var l=Object.assign({},r.absoluteOffset);l.x-=s.x;l.y-=s.y}return{type:EventType.GraphicalPropertiesChange,args:{guid:e.cell.id,properties:t.convertGeometry(e.cell,i)}}}return null};t.convertTerminalChange=function(t){if(t.cell instanceof Cell){return{type:EventType.TerminalChange,args:{guid:t.cell.id,terminalGuid:t.terminal?t.terminal.id:null,source:t.source}}}};t.convertGeometry=function(t,e){return e.getCellGraphicalProperties(t)};return t}();var mxEventType;(function(t){t["ChildChange"]="mxChildChange";t["ValueChange"]="mxValueChange";t["TerminalChange"]="mxTerminalChange";t["GeometryChange"]="mxGeometryChange"})(mxEventType||(mxEventType={}));var CellEditor=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.init=function(){t.prototype.init.call(this);var e=this;e.textarea.className+=" native-key-bindings"};return e}(mx.mxCellEditor);var ConnectionHandler=function(t){__extends(e,t);function e(e,i){var n=t.call(this,e,i)||this;n.createTarget=true;return n}e.prototype.createMarker=function(){var e=t.prototype.createMarker.call(this);e.intersects=mx.mxUtils.bind(this,(function(t,e){if(this.connectImage!=null||this.isConnecting()){return true}return false}));return e};e.prototype.createEdgeState=function(){var t=this.graph.createEdge(null,null,null,null,null,"defaultEdge");var e=new mx.mxGeometry;e.relative=false;t.setGeometry(e);return new mx.mxCellState(this.graph.view,t,this.graph.getCellStyle(t))};e.prototype.createTargetVertex=function(t,e){if(!this.currentVertexType)return null;var i=this.graph.newCellInstance({type:this.currentVertexType,assignName:true});var n=this.graph.getModel().getGeometry(i);if(n!=null){var r=this.graph.view.translate;var s=this.graph.view.scale;var l=new mx.mxPoint(this.currentPoint.x/s-r.x,this.currentPoint.y/s-r.y);n.x=Math.round(l.x-n.width/2);n.y=Math.round(l.y-n.height/2)}this.currentVertexType=null;return i};e.prototype.mouseDown=function(e,i){this._firstMouseUp=false;return t.prototype.mouseDown.call(this,e,i)};e.prototype.mouseUp=function(e,i){var n=this;if(this.previous){var r=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){r=this.constraintHandler.currentFocus.cell}if(r==null&&n.currentState!=null){r=n.currentState.cell}if(!this._firstMouseUp&&!r){this._firstMouseUp=true;this.graph.isMouseDown=true;i.consume(null);return}}this.graph.isMouseDown=false;return t.prototype.mouseUp.call(this,e,i)};e.prototype.reset=function(){this._firstMouseUp=false;this.graph.isMouseDown=false;t.prototype.reset.call(this)};e.prototype.connect=function(t,e,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel();var s=false;var l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)){e=this.createTargetVertex(i,t);if(e!=null){n=this.graph.getDropTarget([e],i,n);s=true;if(n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x;o.y-=a.origin.y}}else{n=this.graph.getDefaultParent()}this.graph.addCell(e,n)}else if(!this.graph.allowDanglingEdges){return}}var h=this.graph.getDefaultParent();if(t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()){h=r.getParent(t);if(t.geometry!=null&&t.geometry.relative&&(e.geometry!=null&&e.geometry.relative)){h=r.getParent(h)}}var u=null;var d=null;if(this.edgeState!=null){u=this.edgeState.cell.value;d=this.edgeState.cell.style}l=this.insertEdge(h,null,u,t,e,d);if(l!=null){this.graph.setConnectionConstraint(l,t,true,this.sourceConstraint);this.graph.setConnectionConstraint(l,e,false,this.constraintHandler.currentConstraint);if(this.edgeState!=null){r.setGeometry(l,this.edgeState.cell.geometry)}var h=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){var o=t;while(o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent){o=this.graph.model.getParent(o)}if(o!=null&&o.parent!=null&&o.parent==l.parent){r.add(h,l,o.parent.getIndex(o))}}var p=r.getGeometry(l);if(p==null){p=new mx.mxGeometry;p.relative=true;r.setGeometry(l,p)}if(this.waypoints!=null&&this.waypoints.length>0){var m=this.graph.view.scale;var c=this.graph.view.translate;p.points=[];for(var x=0;x<this.waypoints.length;x++){var f=this.waypoints[x];p.points.push(new mx.mxPoint(f.x/m-c.x,f.y/m-c.y))}}if(e==null){var g=this.graph.view.translate;var m=this.graph.view.scale;var f=this.originalPoint!=null?new mx.mxPoint(this.originalPoint.x/m-g.x,this.originalPoint.y/m-g.y):new mx.mxPoint(this.currentPoint.x/m-g.x,this.currentPoint.y/m-g.y);f.x-=this.graph.panDx/this.graph.view.scale;f.y-=this.graph.panDy/this.graph.view.scale;p.setTerminalPoint(f,false)}this.fireEvent(new mx.mxEventObject(mx.mxEvent.CONNECT,"cell",l,"terminal",e,"event",i,"target",n,"terminalInserted",s))}}catch(v){mx.mxLog.show()}finally{r.endUpdate()}if(this.select){this.selectCells(l,s?e:null)}}};return e}(mx.mxConnectionHandler);var Utils=function(){function t(){}t.convertToBoolean=function(t){return t&&t.toLowerCase()==="true"};t.convertToAbsolutePosition=function(e,i){return t.convertPosition(e,i,false)};t.convertToRelativePosition=function(e,i){return t.convertPosition(e,i,true)};t.convertPosition=function(t,e,i){var n=e.x;var r=e.y;var s=t;while(s){var l=s.getGeometry();if(l){if(i){n-=l.x;r-=l.y}else{n+=l.x;r+=l.y}}s=s.getParent()}return{x:n,y:r}};t.getObjectProperties=function(t){return Object.keys(t).map((function(e){return{name:e,value:t[e]}}))};t.setObjectProperties=function(t,e){e.forEach((function(e){return t[e.name]=e.value}));return t};t.getDpi=function(){var t=document.body.appendChild(document.createElement("DIV"));t.style.width="1in";t.style.padding="0";var e=t.offsetWidth;t.parentNode.removeChild(t);return e};t.convertFontSizeToPixels=function(e,i){var n;if(typeof e==="string")n=parseFloat(e);else n=e;switch(i){case"in":return t.getDpi()*n;case"pt":return n/.75}return n};t.cellOfType=function(e,i){if(typeof i==="string")i=[i];if(t.isValidCell(e)){var n=e.descriptor;for(var r=0,s=i;r<s.length;r++){var l=s[r];if(l===n.id)return n.id===l}}return false};t.isValidCell=function(t){return t instanceof Cell};return t}();exports("U",Utils);var GraphHandler=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;i.previewColor=CommonStyleTokens.PREVIEW_COLOR;return i}e.prototype.shouldRemoveCellsFromParent=function(t,e,i){return false};e.prototype.mouseDown=function(e,i){var n=this.graph;if(i.getEvent().button===2){if(!i.isConsumed()&&this.isEnabled()&&this.isEnabled()&&i.getState()!=null&&!mx.mxEvent.isMultiTouchEvent(i.getEvent())){var r=this.getInitialCellForEvent(i);if(this.isSelectEnabled()&&!n.selectionModel.isSelected(r))n.selectCellForEvent(r,i.getEvent())}n.isMouseDown=false;return}return t.prototype.mouseDown.call(this,e,i)};e.prototype.getPointInSegment=function(t,e,i){var n=15;if(e.x<t.x||e.y<t.y){var r=t;t=e;e=r}if(t.y===e.y&&i.x>=t.x&&i.x<=e.x&&Math.abs(t.y-i.y)<n){return{x:i.x,y:t.y}}if(t.x===e.x&&i.y>=t.y&&i.y<=e.y&&Math.abs(t.x-i.x)<n){return{x:t.x,y:i.y}}return null};e.prototype.mouseUp=function(e,i){if(i.getEvent().button===2)return;var n=this;var r=n.cell;if(!r)return t.prototype.mouseUp.call(this,e,i);var s=n.graph;var l=n.target;if(r!=null&&n.first!=null&&(n.shape!=null||n.livePreviewUsed)&&n.currentDx!=null&&n.currentDy!=null&&s.isSplitEnabled()&&s.isSplitTarget(l,n.cells,i.getEvent())){s.view.revalidate();var a=s.view.getState(l,true);var o=l.getParent();var h=a.absolutePoints.slice(0);var u=s.view.getTranslate();var d={x:i.getGraphX()-u.x,y:i.getGraphY()-u.y};d=Utils.convertToRelativePosition(o,d);if(h&&h.length>=2){var p=[];for(var m=0,c=h;m<c.length;m++){var x=c[m];var f={x:x.x-u.x,y:x.y-u.y};f=Utils.convertToRelativePosition(o,f);p.push(f)}var g=this.getPointInSegment(p[0],p[1],d);if(!g)g=this.getPointInSegment(p[p.length-2],p[p.length-1],d);if(g){s.model.beginUpdate();try{t.prototype.mouseUp.call(this,e,i);var v=r.getGeometry().clone();v.x=g.x-v.width/2;v.y=g.y-v.height/2;s.model.setGeometry(r,v)}finally{s.model.endUpdate()}return}}}t.prototype.mouseUp.call(this,e,i)};e.prototype.mouseMove=function(t,e){var i=this;var n=i.graph;if(!e.isConsumed()&&n.isMouseDown&&i.cell!=null&&i.first!=null&&i.bounds!=null&&!i.suspended){if(mx.mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var r=this.getDelta(e);var s=n.tolerance;if(i.shape!=null||i.livePreviewActive||Math.abs(r.x)>s||Math.abs(r.y)>s){if(i.highlight==null){i.highlight=new mx.mxCellHighlight(n,mx.mxConstants.DROP_TARGET_COLOR,3,undefined)}var l=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled();var a=n.isGridEnabledEvent(e.getEvent());var o=e.getCell();var h=true;var u=null;i.cloning=l;if(n.isDropEnabled()&&i.highlightEnabled&&i.cells.indexOf(o)<0){u=n.getDropTarget(i.cells,e.getEvent(),o,l)}var d=n.getView().getState(u);var p=false;if(d!=null&&(n.model.getParent(i.cell)!=u||l)){if(i.target!=u){i.target=u;this.setHighlightColor(mx.mxConstants.DROP_TARGET_COLOR)}p=true}else{i.target=null;if(i.connectOnDrop&&o!=null&&i.cells.length==1&&n.getModel().isVertex(o)&&n.isCellConnectable(o)){d=n.getView().getState(o);if(d!=null){var m=n.getEdgeValidationError(null,i.cell,o);var c=m==null?mx.mxConstants.VALID_COLOR:mx.mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(c);p=true}}}if(d!=null&&p){i.highlight.highlight(d)}else{i.highlight.hide()}if(i.livePreviewActive&&l){i.resetLivePreview();i.livePreviewActive=false}else if(i.maxLivePreview>=i.cellCount&&!i.livePreviewActive&&i.allowLivePreview){if(!l||!i.livePreviewActive){i.setHandlesVisibleForCells(n.getSelectionCells(),false);i.livePreviewActive=true;i.livePreviewUsed=true}}else if(!i.livePreviewUsed&&i.shape==null){i.shape=this.createPreviewShape(i.bounds)}if(i.guide!=null&&this.useGuidesForEvent(e)){r=i.guide.move(i.bounds,r,a,l);h=false}else{r=n.snapDelta(r,i.bounds,!a,false,false)}if(i.guide!=null&&h){i.guide.hide()}if(n.isConstrainedEvent(e.getEvent())){if(Math.abs(r.x)>Math.abs(r.y)){r.y=0}else{r.x=0}}if(i.currentDx!=r.x||i.currentDy!=r.y){i.currentDx=r.x;i.currentDy=r.y;i.updatePreview()}}this.updateHint(e);this.consumeMouseEvent(mx.mxEvent.MOUSE_MOVE,e);mx.mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&i.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!n.isMouseDown){var x=n.getCursorForMouseEvent(e);if(x==null&&n.isEnabled()&&n.isCellMovable(e.getCell())){if(n.getModel().isEdge(e.getCell())){x=mx.mxConstants.CURSOR_MOVABLE_EDGE}else{x=mx.mxConstants.CURSOR_MOVABLE_VERTEX}}if(x!=null&&e.sourceState!=null){e.sourceState.setCursor(x)}}};return e}(mx.mxGraphHandler);var PanningHandler=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.isPanningTrigger=function(t){var e=t.getEvent();var i=navigator.platform==="MacIntel"?mx.mxEvent.isMetaDown(e):mx.mxEvent.isControlDown(e);return this.useLeftButtonForPanning&&t.getState()==null&&mx.mxEvent.isLeftMouseButton(e)||i&&!mx.mxEvent.isShiftDown(e)};return e}(mx.mxPanningHandler);var _HANDLER_PADDING=10;var VertexToolHandler=function(t){__extends(e,t);function e(e){return t.call(this,e)||this}e.prototype.init=function(){var e=this;var i,n,r,s,l,a;t.prototype.init.call(this);var o=this.graph;var h=this.state;if(o.getSelectionCount()>1)return;this._createPanel();var u=h.cell;var d=u.descriptor;this._mouseListener=function(){return e._onShapeClick()};(n=(i=h.shape)===null||i===void 0?void 0:i.node)===null||n===void 0?void 0:n.addEventListener("click",this._mouseListener);this._keyListener=function(t){return e._onKeyDown(t)};document.addEventListener("keydown",this._keyListener);if(d){var p=d.getRadialMenu(o,u);if(p){var m=this._createGroup();for(var c=0,x=p.newVertexTypes||[];c<x.length;c++){var f=x[c];this._createNewVertexTool(m,o.getCellDescriptor(f))}if((r=p.customTools)===null||r===void 0?void 0:r.mainMenu){var g=this._createGroup();for(var v=0,y=(s=p.customTools)===null||s===void 0?void 0:s.mainMenu;v<y.length;v++){var C=y[v];var E=this._createMenuItem(g,C.icon);this._setCustomToolCallback(E,C)}}if(((l=p.customTools)===null||l===void 0?void 0:l.subMenuMain)||p.customTools.subMenuTop||p.newEdge||p.delete){var S=this._createGroup();if(p.newEdge===undefined||p.newEdge)this._createNewEdgeTool(S);if(p.delete===undefined||p.delete)this._createDeleteTool(S);if((a=p.customTools)===null||a===void 0?void 0:a.subMenuMain)this._createCustomToolsPad(S,p)}}}this.graph.container.appendChild(this.domNode);this._redrawTools()};e.prototype.redraw=function(){t.prototype.redraw.call(this);this._redrawTools()};e.prototype._redrawTools=function(){var t=this.state;if(t!=null&&this.domNode!=null){var e=4;this.domNode.style.left=t.x+t.width+e+"px";this.domNode.style.top=t.y+"px"}};e.prototype.createSelectionShape=function(e){var i=t.prototype.createSelectionShape.call(this,e);i.style={dashPattern:"2 2"};return i};e.prototype.getSelectionBounds=function(t){return new mx.mxRectangle(Math.round(t.x-_HANDLER_PADDING/2),Math.round(t.y-_HANDLER_PADDING/2),Math.round(t.width+_HANDLER_PADDING),Math.round(t.height+_HANDLER_PADDING))};e.prototype.getHandlePadding=function(){return new mx.mxPoint(_HANDLER_PADDING,_HANDLER_PADDING)};e.prototype.destroy=function(){var e,i;var n=this.state;(i=(e=n.shape)===null||e===void 0?void 0:e.node)===null||i===void 0?void 0:i.removeEventListener("click",this);document.removeEventListener("keydown",this._keyListener);t.prototype.destroy.call(this);this._destroyPanel()};e.prototype._destroyPanel=function(){var t;if(this.domNode!=null){(t=this.domNode.parentNode)===null||t===void 0?void 0:t.removeChild(this.domNode);this.domNode=null}};e.prototype._createPanel=function(){this.domNode=document.createElement("div");this.domNode.classList.add("radial-menu-pad");return this.domNode};e.prototype._createGroup=function(){var t=document.createElement("div");t.classList.add("group");this.domNode.appendChild(t);return t};e.prototype._createNewVertexTool=function(t,e){var i=this.graph;var n=this.state;var r=this._createMenuItem(t,e.icon);mx.mxEvent.addGestureListeners(r,(function(t){var r=mx.mxUtils.convertPoint(i.container,mx.mxEvent.getClientX(t),mx.mxEvent.getClientY(t));i.connectionHandler.currentVertexType=e.id;i.connectionHandler.start(n,r.x,r.y);i.isMouseDown=true;i.isMouseTrigger=mx.mxEvent.isMouseEvent(t);mx.mxEvent.consume(t)}),null,null)};e.prototype._createNewEdgeTool=function(t){var e=this.graph;var i=this.state;var n=this._createMenuItem(t,"bpmn-icon-connection");mx.mxEvent.addGestureListeners(n,(function(t){var n=mx.mxUtils.convertPoint(e.container,mx.mxEvent.getClientX(t),mx.mxEvent.getClientY(t));e.connectionHandler.currentVertexType=null;e.connectionHandler.start(i,n.x,n.y);e.isMouseDown=true;e.isMouseTrigger=mx.mxEvent.isMouseEvent(t);mx.mxEvent.consume(t)}),null,null)};e.prototype._createDeleteTool=function(t){var e=this.graph;var i=this.state;var n=this._createMenuItem(t,"bpmn-icon-trash");mx.mxEvent.addGestureListeners(n,(function(t){e.getModel().remove(i.cell)}),null,null)};e.prototype._createCustomToolsPad=function(t,e){var i,n,r;var s=document.createElement("div");s.style.display="none";s.classList.add("custom-tools-pad");t.appendChild(s);var l=document.createElement("div");l.classList.add("secondary-tools");s.appendChild(l);for(var a=0,o=((i=e.customTools)===null||i===void 0?void 0:i.subMenuTop)||[];a<o.length;a++){var h=o[a];var u=document.createElement("span");u.classList.add("secondary-tool");u.classList.add(""+h.icon);this._setCustomToolCallback(u,h);l.appendChild(u)}var d=document.createElement("div");d.classList.add("main-tools");s.appendChild(d);var p=function(t){var e=document.createElement("div");e.classList.add("main-tool");d.appendChild(e);var i=document.createElement("span");i.classList.add("icon");var n=(r=t.icon)===null||r===void 0?void 0:r.split(" ");if(n)n.forEach((function(t){return i.classList.add(t)}));e.appendChild(i);var s=document.createElement("span");s.classList.add("text");s.innerHTML=""+t.label;e.appendChild(s);m._setCustomToolCallback(e,t)};var m=this;for(var c=0,x=((n=e.customTools)===null||n===void 0?void 0:n.subMenuMain)||[];c<x.length;c++){var h=x[c];p(h)}var f=this._createMenuItem(t,"bpmn-icon-screw-wrench");mx.mxEvent.addGestureListeners(f,(function(t){if(s.style.display==="none")s.style.display="block";else s.style.display="none"}),null,null)};e.prototype._setCustomToolCallback=function(t,e){var i=this;mx.mxEvent.addGestureListeners(t,(function(){var t=i.graph;var n=i.state.cell;if(e.value){t.getModel().setValue(n,Object.assign({},n.getValue(),e.value))}i._toglePanel();if(e.execute)e.execute(t,n)}),null,null)};e.prototype._createMenuItem=function(t,e,i){var n=document.createElement("div");n.classList.add("item");n.classList.add(e);t.appendChild(n);return n};e.prototype._toglePanel=function(){if(this.domNode){if(this.domNode.style.display==="none")this._showPanel();else this._hidePanel()}};e.prototype._showPanel=function(){if(this.domNode)this.domNode.style.display="block"};e.prototype._hidePanel=function(){if(this.domNode)this.domNode.style.display="none"};e.prototype._createImage=function(t){return mx.mxUtils.createImage(t)};e.prototype._onShapeClick=function(){if(!this._firstClick){this._firstClick=true;return}this._toglePanel()};e.prototype._onKeyDown=function(t){if(t.keyCode===27)this._hidePanel()};return e}(mx.mxVertexHandler);var _NAME_REGEX=/([^\d]*)([\d]*)/g;var Graph=function(t){__extends(e,t);function e(e){var i=t.call(this,e.container)||this;i.resetEdgesOnMove=true;i._editorHelper=e.editorHelper;i.dropEnabled=true;i.installCellDescriptors(e.cellDescriptors);if(e.defaultEdgeDescriptorId){var n=i.getCellDescriptor(e.defaultEdgeDescriptorId);if(n.isEdge)i._defaultEdgeDescriptor=n;else throw Error("Default edge descriptor is not an edge")}i.installGlobalStyles(e.globalStyles);if(e.bottomPad)i.createBottomPad(e.bottomPad);return i}e.prototype.installCellDescriptors=function(t){this._cellDescriptors=new Map;if(!t)return;for(var e=0,i=t;e<i.length;e++){var n=i[e];this._cellDescriptors.set(n.id.toString(),n);if(n.shape)mx.mxCellRenderer.registerShape(n.id.toString(),n.shape)}};e.prototype.installGlobalStyles=function(t){if(!t)return;for(var e=0,i=t;e<i.length;e++){var n=i[e];this.getStylesheet().putCellStyle(n.name,n.value)}};e.prototype.createBottomPad=function(t){};e.prototype.createGraphHandler=function(){return new GraphHandler(this)};e.prototype.createConnectionHandler=function(){var t=this;return new ConnectionHandler(this,(function(){var e=new mx.mxGeometry;e.relative=false;var i;if(t._defaultEdgeDescriptor){i=new Cell(t._defaultEdgeDescriptor,{},e)}else i=new mx.mxCell("",e,"defaultEdge");i.setEdge(true);return i}))};e.prototype.createPanningHandler=function(){return new PanningHandler(this)};e.prototype.createPanningManager=function(){var t=new mx.mxPanningManager(this);t.border=50;return t};e.prototype.createHandler=function(e){if(e!=null&&this.model.isVertex(e.cell)){return new VertexToolHandler(e)}return t.prototype.createHandler.call(this,e)};e.prototype.createCellEditor=function(){return new CellEditor(this)};Object.defineProperty(e.prototype,"editorHelper",{get:function(){return this._editorHelper},enumerable:false,configurable:true});e.prototype.transaction=function(t){this.getModel().beginUpdate();try{t()}finally{this.getModel().endUpdate()}};e.prototype.getCellIndexInParent=function(t){var e=t.parent;if(e){for(var i=0;i<e.children.length;i++){if(e.getChildAt(i)===t)return i}}return-1};e.prototype.getCellDescriptor=function(t){return this._cellDescriptors.get(t)};e.prototype.newCellInstance=function(t){var e,i;var n;if(typeof t.type==="string")n=this.getCellDescriptor(t.type);else n=t.type;if(!n)throw Error("Unknown cell descriptor: '"+t.type.toString()+"'");var r=(e=t.geometry)!==null&&e!==void 0?e:new mx.mxGeometry;if(n.size){r.width=r.width||n.size.width;r.height=r.height||n.size.height}var s=n.labelOffset;if(s)r.offset=new mx.mxPoint(s.width,s.height);var l=n.newInstance({graph:this,value:{},geometry:r});l.setVertex(n.isVertex);l.setEdge(n.isEdge);l.setStyle(n.getDefaultStyle());this.setCellValue(l,(i=t.value)!==null&&i!==void 0?i:{});if(t.assignName&&n.nameAttribute&&n.baseName&&!l.getValue()[n.nameAttribute]){var a=this.getNewCellName(n.baseName+"1");l.setAttribute(n.nameAttribute,a)}return l};e.prototype.setCellValue=function(t,e){this.getModel().setValue(t,e)};e.prototype.setCellGraphicalProperties=function(t,e,i){var n=this;if(i===void 0){i=true}var r;if(t.isEdge()&&(!t.source||!t.target))return;var s=this.convertLogicalPointToPixels(t,{x:e.x,y:e.y});var l=t.isEdge()?new mx.mxGeometry:new mx.mxGeometry(s.x,s.y,this.convertLogicalToPixels(t,e.width),this.convertLogicalToPixels(t,e.height));var a=t.getStyle();if(e.fromPoint){var o=t.source.geometry;var h=this.convertPixelsPointToLogical(t.source,{x:o.x,y:o.y});a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_EXIT_X,(e.fromPoint.x-h.x)/o.width);a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_EXIT_Y,(e.fromPoint.y-h.y)/o.height)}if(e.toPoint){var u=t.target.geometry;var d=this.convertPixelsPointToLogical(t.source,{x:u.x,y:u.y});a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_ENTRY_X,(e.toPoint.x-d.x)/u.width);a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_ENTRY_Y,(e.toPoint.y-d.y)/u.height)}t.setStyle(a);l.relative=false;if(e.points&&e.points.length>0){l.points=e.points.map((function(e){var i=n.convertLogicalPointToPixels(t,e);return new mx.mxPoint(i.x,i.y)}))}if(e.labelPosition){var p=void 0;if(t.isEdge()&&t.source&&t.target){if(((r=e.points)===null||r===void 0?void 0:r.length)>0)p=this._getPointListCenter(e.points);else{var m=this._getTerminalLogicalPointFromStyle(t,true);var c=this._getTerminalLogicalPointFromStyle(t,false);p=this._getPointListCenter([m,c])}}else p={x:e.x+e.width/2,y:e.y+e.height/2};l.offset=new mx.mxPoint(e.labelPosition.x-p.x,e.labelPosition.y-p.y)}this.model.setGeometry(t,l);if(i){var x=this.view.getState(t);if(x&&x.shape)x.shape.redraw()}};e.prototype.getCellGraphicalProperties=function(t){var e=this;var i=t.getGeometry();var n=i.x!==undefined&&i.y!==undefined?this.convertPixelsPointToLogical(t,{x:i.x,y:i.y}):undefined;var r=i.width!==undefined&&i.height!==undefined?{width:this.convertPixelsToLogical(t,i.width),height:this.convertPixelsToLogical(t,i.height)}:undefined;var s=i.offset&&!isNaN(i.offset.x)&&!isNaN(i.offset.y)?{x:i.offset.x,y:i.offset.y}:undefined;var l=n&&r&&s?{x:n.x+r.width/2+s.x,y:n.y+r.height/2+s.y}:undefined;var a=i.points?i.points.map((function(i){return e.convertPixelsPointToLogical(t,i)})):null;var o,h;var u=t.source;var d=t.target;if(t.isEdge()&&u&&d){var p=void 0;if((a===null||a===void 0?void 0:a.length)>0){var m=this._getTerminalLogicalPoint(u,a[0],true,true);if(m&&(m.x!==a[0].x||m.y!==a[0].y)){a.unshift(m)}var c=this._getTerminalLogicalPoint(d,a[a.length-1],true,false);if(c&&(c.x!==a[a.length-1].x||c.y!==a[a.length-1].y)){a.push(c)}this._insertExtraPointsInEdgeForCompatibiityWithGXWin(a);p=this._getPointListCenter(a)}else{o=this._getTerminalLogicalPointFromStyle(t,true);h=this._getTerminalLogicalPointFromStyle(t,false);p=this._getPointListCenter([o,h])}if(s&&p)l={x:p.x+s.x,y:p.y+s.y}}return{x:n===null||n===void 0?void 0:n.x,y:n===null||n===void 0?void 0:n.y,width:r===null||r===void 0?void 0:r.width,height:r===null||r===void 0?void 0:r.height,points:a,labelPosition:l,fromPoint:o,toPoint:h}};e.prototype._insertExtraPointsInEdgeForCompatibiityWithGXWin=function(t){if(t.length>=2){if(Math.abs(t[0].x-t[1].x)>10){if(t[0].x<t[1].x)t.splice(1,0,{x:t[0].x+10,y:t[0].y});else t.splice(1,0,{x:t[0].x-10,y:t[0].y})}if(Math.abs(t[0].y-t[1].y)>10){if(t[0].y<t[1].y)t.splice(1,0,{x:t[0].x,y:t[0].y+10});else t.splice(1,0,{x:t[0].x,y:t[0].y-10})}var e=t[t.length-2];var i=t[t.length-1];if(Math.abs(e.x-i.x)>10){if(e.x<i.x)t.splice(t.length-1,0,{x:i.x-10,y:e.y});else t.splice(t.length-1,0,{x:i.x+10,y:e.y})}if(Math.abs(e.y-i.y)>10){if(e.y<i.y)t.splice(t.length-1,0,{x:e.x,y:i.y-10});else t.splice(t.length-1,0,{x:e.x,y:i.y+10})}}};e.prototype._getTerminalLogicalPointFromStyle=function(t,e){var i=this.getCellStyle(t);var n;if(e&&i[mx.mxConstants.STYLE_EXIT_X]&&i[mx.mxConstants.STYLE_EXIT_Y]){n={x:Number.parseFloat(i[mx.mxConstants.STYLE_EXIT_X]),y:Number.parseFloat(i[mx.mxConstants.STYLE_EXIT_Y])}}else if(!e&&i[mx.mxConstants.STYLE_ENTRY_X]&&i[mx.mxConstants.STYLE_ENTRY_Y]){n={x:Number.parseFloat(i[mx.mxConstants.STYLE_ENTRY_X]),y:Number.parseFloat(i[mx.mxConstants.STYLE_ENTRY_Y])}}var r=t.source.getGeometry();var s={position:this.convertPixelsPointToLogical(t.source,{x:r.x,y:r.y}),size:{width:this.convertPixelsToLogical(t.source,r.width),height:this.convertPixelsToLogical(t,r.height)}};var l=t.target.getGeometry();var a={position:this.convertPixelsPointToLogical(t.target,{x:l.x,y:l.y}),size:{width:this.convertPixelsToLogical(t.target,l.width),height:this.convertPixelsToLogical(t,l.height)}};if(n){var o=e?s:a;return{x:o.position.x+n.x*o.size.width,y:o.position.y+n.y*o.size.height}}if(e)return this._getAutoTerminalPoint(s,a,e);return this._getAutoTerminalPoint(a,s,e)};e.prototype._getPointListCenter=function(t){var e={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY};var i={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY};for(var n=0,r=t;n<r.length;n++){var s=r[n];if(e.x>s.x)e.x=s.x;if(e.y>s.y)e.y=s.y;if(i.x<s.x)i.x=s.x;if(i.y<s.y)i.y=s.y}return{x:e.x+(i.x-e.x)/2,y:e.y+(i.y-e.y)/2}};e.prototype._getAutoTerminalPoint=function(t,e,i){if(i){if(t.position.y>e.position.y+e.size.height){if(t.position.x+t.size.width<e.position.x)return this._getMiddlePoint(t,"middleRight");if(t.position.x>e.position.x+e.size.width)return this._getMiddlePoint(t,"middleLeft");return this._getMiddlePoint(t,"middleTop")}if(t.position.x+t.size.width<e.position.x)return this._getMiddlePoint(t,"middleRight");if(t.position.x>e.position.x+e.size.width)return this._getMiddlePoint(t,"middleLeft");return this._getMiddlePoint(t,"middleBottom")}if(t.position.y>e.position.y+e.size.height)return this._getMiddlePoint(t,"middleTop");if(t.position.y+t.size.height<e.position.y)return this._getMiddlePoint(t,"middleBottom");if(t.position.x>e.position.x+e.size.width)return this._getMiddlePoint(t,"middleLeft");return this._getMiddlePoint(t,"middleRight")};e.prototype._getMiddlePoint=function(t,e){switch(e){case"middleTop":return{x:t.position.x+t.size.width/2,y:t.position.y};case"middleBottom":return{x:t.position.x+t.size.width/2,y:t.position.y+t.size.height};case"middleLeft":return{x:t.position.x,y:t.position.y+t.size.height/2};case"middleRight":return{x:t.position.x+t.size.width,y:t.position.y+t.size.height/2}}};e.prototype._getTerminalLogicalPoint=function(t,e,i,n){var r=this._getPerimeter(t);var s=t.getGeometry();if(r&&s){var l=new mx.mxPoint(e.x,e.y);var a=this.convertPixelsPointToLogical(t,{x:s.x,y:s.y});var o=new mx.mxRectangle(a.x,a.y,s.width,s.height);var h=r(o,{style:this.getCellStyle(t)},l,i);if(i){var u=3;if(Math.abs(e.x-h.x)<u&&Math.abs(e.y-h.y)<u)return e}return h}};e.prototype._getPerimeter=function(t){var e=this.getCellStyle(t);var i=e[mx.mxConstants.STYLE_PERIMETER];if(typeof i==="function")return i;if(typeof i==="string")return mx.mxStyleRegistry.getValue(i)};e.prototype.convertLogicalPointToPixels=function(t,e){return{x:this.convertLogicalToPixels(t,e.x),y:this.convertLogicalToPixels(t,e.y)}};e.prototype.convertPixelsPointToLogical=function(t,e){return{x:this.convertPixelsToLogical(t,e.x),y:this.convertPixelsToLogical(t,e.y)}};e.prototype.convertLogicalOffsetToPixels=function(t,e){return e};e.prototype.convertPixelsOffsetToLogical=function(t,e){return e};e.prototype.convertLogicalToPixels=function(t,e){return e};e.prototype.convertPixelsToLogical=function(t,e){return e};e.prototype.getNewCellName=function(t){var e;var i=false;var n;var r=t.match(_NAME_REGEX);if(r&&r.length==3){t=r[1];e=parseInt(r[2]);n=""+t+e}else{e=1;n=t}do{i=true;for(var s=0,l=this.getAllCells();s<l.length;s++){var a=l[s];if(a instanceof Cell&&a.descriptor.baseName&&a.descriptor.nameAttribute){var o=a.getValue()[a.descriptor.nameAttribute];if(o&&o.toLowerCase()===n.toLowerCase()){i=false;n=""+t+ ++e;break}}}}while(!i);return n};e.prototype.getCellsOfType=function(t){return this.getAllCells((function(e){return Utils.cellOfType(e,t)}))};e.prototype.getAllCells=function(t){var e=[];var i=[this.model.getRoot()];while(i.length>0){var n=i.shift();if(!t||t(n))e.push(n);if(n.children){for(var r=0,s=n.children;r<s.length;r++){var l=s[r];i.push(l)}}}return e};e.prototype.selectCellForEvent=function(e,i){if(e instanceof Cell&&!e.descriptor.isDiagramElement)e=e.getParentDiagramElement();return t.prototype.selectCellForEvent.call(this,e,i)};e.prototype.getDropTarget=function(e,i,n,r){var s=t.prototype.getDropTarget.call(this,e,i,n,r);if(!s)s=this.getDefaultParent();return s};e.prototype.isExtendParentsOnAdd=function(t){return false};e.prototype.isExtendParent=function(t){return true};e.prototype.isConstrainChild=function(t){return true};e.prototype.isCellLocked=function(t){return false};e.prototype.isCellDisconnectable=function(t,e,i){return true};e.prototype.isCellResizable=function(e){if(e instanceof Cell){var i=e.descriptor;return i.isResizable(this,e)}return t.prototype.isCellResizable.call(this,e)};e.prototype.isGridEnabledEvent=function(t){if(this.gridEnabled)return true;return false};e.prototype.convertValueToString=function(e){if(e instanceof Cell){var i=e.getValue();if(i&&typeof i==="object"){var n=e.descriptor;var r=n.labelAttribute;return i[r]}}return t.prototype.convertValueToString.call(this,e)};e.prototype.cellLabelChanged=function(e,i,n){if(e instanceof Cell&&e.value&&typeof e.value==="object"){var r=e.cloneValue();r[e.descriptor.labelAttribute]=i;i=r}t.prototype.cellLabelChanged.call(this,e,i,n)};e.prototype.getAllConnectionConstraints=function(t){if(t!=null&&t.shape!=null){if(t.shape.stencil!=null){if(t.shape.stencil!=null){return t.shape.stencil.constraints}}else if(t.shape.constraints!=null){return t.shape.constraints}}return null};e.prototype.getState=function(){return{elements:this.getElementsState(this.getDefaultParent().children)}};e.prototype.getElementsState=function(t){var e=[];for(var i=0,n=t;i<n.length;i++){var r=n[i];if(r instanceof Cell)e.push(this.getElementState(r))}return e};e.prototype.getElementState=function(t){var e=t.getTerminal(true);var i=t.getTerminal(false);return{guid:t.id,type:t.descriptor.id,properties:t.cloneValue(),graphicalProperties:this.getCellGraphicalProperties(t),fromGuid:t.isEdge()&&e instanceof Cell?e.id:null,toGuid:t.isEdge()&&i instanceof Cell?i.id:null,slots:this.getSlotsState(t)}};e.prototype.getSlotsState=function(t){var e=[];if(t.descriptor.isSlot)e.push(this.getSlotState(t));if(t.children){for(var i=0,n=t.children;i<n.length;i++){var r=n[i];if(r instanceof Cell&&r.descriptor.isSlot&&!r.descriptor.isDiagramElement){e.push(this.getSlotState(r))}}}return e};e.prototype.getSlotState=function(t){var e=this;return{id:t.descriptor.slotId,elements:t.getDiagramElements().map((function(t){return e.getElementState(t)}))}};e.prototype.setState=function(t){var e=this;this.settingState=true;try{this.transaction((function(){e.model.clear();if(t!=null)e.addElementsFromState(t.elements)}))}finally{this.settingState=false}};e.prototype.addElementsFromState=function(t,e,i,n){var r=this;this.prepareElementsState(t,i,n);this.transaction((function(){var i=[];for(var n=0,s=t;n<s.length;n++){var l=s[n];r.addElementFromState(l,e);i.push(l)}while(i.length>0){var a=i.shift();var o=r.model.getCell(a.guid);r.setElementDelayedState(o,a);if(a.slots){for(var h=0,u=a.slots;h<u.length;h++){var d=u[h];for(var p=0,m=d.elements;p<m.length;p++){var l=m[p];i.push(l)}}}}}))};e.prototype.addElementFromState=function(t,e){var i;var n=this.newCellInstance({type:t.type});n.setId(t.guid.toString());this.addCell(n,e);this.setCellValue(n,(i=t.properties)!==null&&i!==void 0?i:{});this.setCellGraphicalProperties(n,t.graphicalProperties);if(t.slots){for(var r=0,s=t.slots;r<s.length;r++){var l=s[r];this.setSlotState(n,l)}}};e.prototype.prepareElementsState=function(t,e,i){var n=new Map;var r=[];var s=t.slice(0);while(s.length>0){var l=s.shift();if(e||this.model.getCell(l.guid))this.reassignElementStateGuids(l,n);if(i){var a=l.graphicalProperties;if(a.x!==undefined)a.x+=i.width;if(a.y!==undefined)a.y+=i.height;if(a.points){for(var o=0,h=a.points;o<h.length;o++){var u=h[o];u.x+=i.width;u.y+=i.height}}}if(l.fromGuid&&l.toGuid)r.push(l);if(l.slots){for(var d=0,p=l.slots;d<p.length;d++){var m=p[d];if(m.elements)m.elements.forEach((function(t){return s.push(t)}))}}}for(var c=0,x=r;c<x.length;c++){var f=x[c];f.fromGuid=n.get(f.fromGuid)||f.fromGuid;f.toGuid=n.get(f.toGuid)||f.toGuid}return t};e.prototype.reassignElementStateGuids=function(t,e){var i=Guid.newInstance().toString();e.set(t.guid,i);t.guid=i};e.prototype.setElementDelayedState=function(t,e){if(t.isEdge()){var i=this.model.getCell(e.fromGuid.toString());this.model.setTerminal(t,i,true);var n=this.model.getCell(e.toGuid.toString());this.model.setTerminal(t,n,false);this.setCellGraphicalProperties(t,e.graphicalProperties)}};e.prototype.setSlotState=function(t,e){var i=t.getSlot(e.id);if(i){for(var n=0,r=e.elements;n<r.length;n++){var s=r[n];this.addElementFromState(s,i)}}};return e}(mx.mxGraph);exports("G",Graph);var KeyCodes;(function(t){t[t["UP"]=38]="UP";t[t["DOWN"]=40]="DOWN";t[t["LEFT"]=37]="LEFT";t[t["RIGHT"]=39]="RIGHT";t[t["TAB"]=9]="TAB";t[t["ENTER"]=13]="ENTER";t[t["ESC"]=27]="ESC";t[t["DELETE"]=46]="DELETE";t[t["BACKSPACE"]=8]="BACKSPACE";t[t["SHIFT"]=16]="SHIFT";t[t["CONTROL"]=17]="CONTROL";t[t["ALT"]=18]="ALT";t[t["META"]=91]="META";t[t["CAPS_LOCK"]=20]="CAPS_LOCK";t[t["SPACE"]=32]="SPACE";t[t["F1"]=112]="F1";t[t["F2"]=113]="F2";t[t["F3"]=114]="F3";t[t["F4"]=115]="F4";t[t["F5"]=116]="F5";t[t["F6"]=117]="F6";t[t["F7"]=118]="F7";t[t["F8"]=119]="F8";t[t["F9"]=120]="F9";t[t["F10"]=121]="F10";t[t["F11"]=122]="F11";t[t["F12"]=123]="F12"})(KeyCodes||(KeyCodes={}));var UndoManager=function(t){__extends(e,t);function e(){var e=t.apply(this,arguments)||this;e.enabled=true;return e}e.prototype.undoableEditHappened=function(e){if(this.enabled)t.prototype.undoableEditHappened.call(this,e)};return e}(mx.mxUndoManager);var DEFAULT_CLIPBOARD_FORMAT="DiagramEditor";var MAX_UNDO_LENGTH=1e3;var MOVE_SELECTION_DELTA=10;var MOVE_SELECTION_SHORT_DELTA=1;var COPY_OFFSET={width:20,height:20};var Editor=function(t){__extends(e,t);function e(e){var i=t.call(this)||this;i._guid=Guid.newInstance();i.container=e.container;i.clipboardFormat=e.clipboardFormat||DEFAULT_CLIPBOARD_FORMAT;i.graph=i.createGraph(e);mx.mxConstants.LABEL_HANDLE_SIZE=8;mx.mxEvent.disableContextMenu(i.container);i.initialize(e);return i}e.prototype.createGraph=function(t){return new Graph(t)};e.prototype.initialize=function(t){var e=this;this.graph.setAllowDanglingEdges(false);this.graph.vertexLabelsMovable=true;this.graph.resizeContainer=false;if(t.guides)this.installGuides();if(t.undoManager)this.installUndoManager();if(t.keyManager)this.installKeyHandler();if(t.externalDrop){mx.mxEvent.addListener(this.container,"dragover",(function(t){return e.onDragOver(t)}));mx.mxEvent.addListener(this.container,"drop",(function(t){return e.onDropOver(t)}))}this.graph.graphHandler.scrollOnMove=!!t.scrollOnMove;this.graph.setResizeContainer(!!t.resizeContainer);this.graph.setGridEnabled(!!t.grid);if(t.gridSize!==undefined)this.graph.gridSize=t.gridSize;this.graph.setConnectable(!!t.connectable);this.graph.setPanning(!!t.panning);this.graph.allowAutoPanning=!!t.autoPanning;this.graph.panningHandler.useLeftButtonForPanning=false;if(t.rubberBand)this.installRubberBand();this.graph.getSelectionModel().addListener(mx.mxEvent.CHANGE,(function(){return e.onGraphSelectionChange()}));this.graph.getModel().addListener(mx.mxEvent.CHANGE,(function(t,i){return e.onGraphChange(i)}))};e.prototype.installGuides=function(){var t=mx.mxGraphHandler;t.prototype.guidesEnabled=true;t.prototype.useGuidesForEvent=function(t){return!mx.mxEvent.isAltDown(t.getEvent())}};e.prototype.installUndoManager=function(){var t=this;this.undoManager=new UndoManager(MAX_UNDO_LENGTH);var e=function(e,i){return t.undoManager.undoableEditHappened(i.getProperty("edit"))};this.graph.getModel().addListener(mx.mxEvent.UNDO,e);this.graph.getView().addListener(mx.mxEvent.UNDO,e);var i=function(e,i){var n=i.getProperty("edit").changes;t.graph.setSelectionCells(t.graph.getSelectionCellsForChanges(n))};this.undoManager.addListener(mx.mxEvent.UNDO,i);this.undoManager.addListener(mx.mxEvent.REDO,i)};e.prototype.installKeyHandler=function(){var t=this;this.keyHandler=new mx.mxKeyHandler(this.graph);this.keyHandler.getFunction=function(e){if(e!=null){return mx.mxEvent.isControlDown(e)||mx.mxClient.IS_MAC&&e.metaKey?t.keyHandler.controlKeys[e.keyCode]:t.keyHandler.normalKeys[e.keyCode]}return null};this.keyHandler.bindKey(KeyCodes.LEFT,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindKey(KeyCodes.RIGHT,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindKey(KeyCodes.UP,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindKey(KeyCodes.DOWN,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindControlKey("Z".charCodeAt(0),(function(e){return t.onUndoRedo(e)}));this.keyHandler.bindControlKey("C".charCodeAt(0),(function(e){return t.copyToClipboard()}));this.keyHandler.bindControlKey("V".charCodeAt(0),(function(e){return t.pasteFromClipboard()}));this.keyHandler.bindKey(KeyCodes.BACKSPACE,(function(){return t.deleteSelection()}));this.keyHandler.bindKey(KeyCodes.DELETE,(function(){return t.deleteSelection()}))};e.prototype.installRubberBand=function(){var t=this;this.rubberBand=new mx.mxRubberband(this.graph);var e=this.rubberBand.mouseDown;this.rubberBand.mouseDown=function(i,n){if(n.getEvent().button===2){t.rubberBand.reset();mx.mxEvent.consume(n.getEvent(),true,true);return}e.call(t.rubberBand,i,n)}};e.prototype.setProperties=function(t,e,i){this._pauseGraphChangeEvents=true;this.undoManager.enabled=false;try{var n=this.graph.getModel().getCell(t);if(n){if(e)this.graph.setCellValue(n,e);if(i)this.graph.setCellGraphicalProperties(n,i,false);var r=this.graph.view.getState(n);if(r)r.shape.redraw()}}finally{this.undoManager.enabled=true;this._pauseGraphChangeEvents=false}};Object.defineProperty(e.prototype,"clipboard",{get:function(){var t=this.graph.editorHelper;if(t)return t.clipboard},enumerable:false,configurable:true});e.prototype.copyToClipboard=function(t){var e=this.clipboard;if(e){t=t||this.graph.getSelectionCells();var i=this.graph.getExportableCells(this.graph.model.getTopmostCells(t));var n=this.graph.getElementsState(i);e.write(JSON.stringify({format:this.clipboardFormat,editorGuid:this._guid.toString(),content:n}))}};e.prototype.pasteFromClipboard=function(){var t=this.clipboard;if(t){var e=t.read();if(e){var i=JSON.parse(e);if(i.format===this.clipboardFormat){var n=new Guid(i.editorGuid);if(Guid.equals(n,this._guid)){this.graph.addElementsFromState(i.content,this.getParentForPaste(),false,COPY_OFFSET)}else this.graph.addElementsFromState(i.content,this.getParentForPaste(),true)}}}};e.prototype.undo=function(){if(this.undoManager.canUndo())this.undoManager.undo()};e.prototype.redo=function(){if(this.undoManager.canRedo())this.undoManager.redo()};e.prototype.getParentForPaste=function(){return null};e.prototype.moveSelection=function(t,e){var i=this;this.graph.transaction((function(){if(!i.graph.isSelectionEmpty())i.graph.moveCells(i.graph.getSelectionCells(),t,e)}))};e.prototype.deleteSelection=function(){var t=this;this.graph.transaction((function(){if(!t.graph.isSelectionEmpty()){t.graph.removeCells(t.graph.getSelectionCells())}}))};e.prototype.onGraphChange=function(t){var i=this;if(this._pauseGraphChangeEvents)return;setTimeout((function(){var n=EventConverter.convert(t,i.graph);if(n.length>0)i.fireEvent(new mx.mxEventObject(e.EVENT_MODEL_CHANGED,"data",n),i)}),100)};e.prototype.onGraphSelectionChange=function(){var t=this.graph.getSelectionCells();var i=[];for(var n=0,r=t;n<r.length;n++){var s=r[n];if(s instanceof Cell)i.push(s.id)}this.fireEvent(new mx.mxEventObject(e.EVENT_SELECTION_CHANGED,"data",i)),this};e.prototype.onUndoRedo=function(t){if(t.shiftKey)this.redo();else this.undo()};e.prototype.onMoveSelection=function(t){var e=0;var i=0;switch(t.keyCode){case KeyCodes.LEFT:e=-1;break;case KeyCodes.RIGHT:e=1;break;case KeyCodes.UP:i=-1;break;case KeyCodes.DOWN:i=1;break}var n=this.graph.gridEnabled?this.graph.gridSize:1;var r=t.shiftKey?n*MOVE_SELECTION_SHORT_DELTA:n*MOVE_SELECTION_DELTA;e=e*r;i=i*r;this.moveSelection(e,i)};e.prototype.onDragOver=function(t){if(this.graph.isEnabled()){t.stopPropagation();t.preventDefault()}};e.prototype.onDropOver=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,n,r;var s=this;return __generator(this,(function(l){switch(l.label){case 0:e=t.dataTransfer.getData("text");i={};if(!this.graph.editorHelper)return[3,2];return[4,this.graph.editorHelper.getNewElementProperties(e)];case 1:i=l.sent();if(!i)return[2];l.label=2;case 2:this.graph.transaction((function(){var r=s.graph.getCellDescriptor(e);t.stopPropagation();t.preventDefault();var l=r.size;var a=mx.mxUtils.convertPoint(s.graph.container,mx.mxEvent.getClientX(t),mx.mxEvent.getClientY(t));var o=s.graph.view.translate;var h=s.graph.view.scale;var u,d;if(s.centerExternalDropOnMousePointer){u=s.graph.snap(a.x/h-o.x-l.width/2);d=s.graph.snap(a.y/h-o.y-l.height/2)}else{u=s.graph.snap(a.x/h-o.x);d=s.graph.snap(a.y/h-o.y)}var p=s.getDropTarget(u,d);if(p){u-=p.geometry.x;d-=p.geometry.y}n=s.graph.newCellInstance({type:e,value:i,geometry:new mx.mxGeometry(u,d,l.width,l.height),assignName:true});s.graph.addCell(n,p)}));r=this.graph.view.getState(n);if(r&&r.shape)r.shape.redraw();return[2]}}))}))};Object.defineProperty(e.prototype,"centerExternalDropOnMousePointer",{get:function(){return true},enumerable:false,configurable:true});e.prototype.getDropTarget=function(t,e){return null};e.prototype.setState=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this._pauseGraphChangeEvents=true;this.undoManager.enabled=false;e.label=1;case 1:e.trys.push([1,,3,4]);return[4,this.graph.setState(t)];case 2:e.sent();this.onAfterSetState();return[3,4];case 3:this._pauseGraphChangeEvents=false;this.undoManager.enabled=true;return[7];case 4:return[2]}}))}))};e.prototype.getState=function(){return this.graph.getState()};e.prototype.onAfterSetState=function(){};return e}(mx.mxEventSource);exports("E",Editor);Editor.EVENT_MODEL_CHANGED="modelChanged";Editor.EVENT_SELECTION_CHANGED="selectionChanged"}}}));
1
+ var __extends=this&&this.__extends||function(){var t=function(e,i){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i]};return t(e,i)};return function(e,i){t(e,i);function n(){this.constructor=e}e.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function l(t){try{o(n.next(t))}catch(e){s(e)}}function a(t){try{o(n["throw"](t))}catch(e){s(e)}}function o(t){t.done?i(t.value):r(t.value).then(l,a)}o((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(t){return function(e){return o([t,e])}}function o(l){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(s=l[0]&2?r["return"]:l[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;if(r=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;r=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){i.label=l[1];break}if(l[0]===6&&i.label<s[1]){i.label=s[1];s=l;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(l);break}if(s[2])i.ops.pop();i.trys.pop();continue}l=e.call(t,i)}catch(a){l=[6,a];r=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var n=Array(t),r=0,e=0;e<i;e++)for(var s=arguments[e],l=0,a=s.length;l<a;l++,r++)n[r]=s[l];return n};System.register(["./p-cf51be4b.system.js"],(function(exports){"use strict";var getAssetPath;return{setters:[function(t){getAssetPath=t.g}],execute:function(){var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function createCommonjsModule(t,e,i){return i={path:e,exports:{},require:function(t,e){return commonjsRequire()}},t(i,i.exports),i.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var rng;var crypto=typeof commonjsGlobal!=="undefined"&&(commonjsGlobal.crypto||commonjsGlobal.msCrypto);if(crypto&&crypto.getRandomValues){var rnds8=new Uint8Array(16);rng=function t(){crypto.getRandomValues(rnds8);return rnds8}}if(!rng){var rnds=new Array(16);rng=function(){for(var t=0,e;t<16;t++){if((t&3)===0)e=Math.random()*4294967296;rnds[t]=e>>>((t&3)<<3)&255}return rnds}}var rngBrowser=rng;var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+256).toString(16).substr(1)}function bytesToUuid(t,e){var i=e||0;var n=byteToHex;return n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+"-"+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]+n[t[i++]]}var bytesToUuid_1=bytesToUuid;var _seedBytes=rngBrowser();var _nodeId=[_seedBytes[0]|1,_seedBytes[1],_seedBytes[2],_seedBytes[3],_seedBytes[4],_seedBytes[5]];var _clockseq=(_seedBytes[6]<<8|_seedBytes[7])&16383;var _lastMSecs=0,_lastNSecs=0;function v1(t,e,i){var n=e&&i||0;var r=e||[];t=t||{};var s=t.clockseq!==undefined?t.clockseq:_clockseq;var l=t.msecs!==undefined?t.msecs:(new Date).getTime();var a=t.nsecs!==undefined?t.nsecs:_lastNSecs+1;var o=l-_lastMSecs+(a-_lastNSecs)/1e4;if(o<0&&t.clockseq===undefined){s=s+1&16383}if((o<0||l>_lastMSecs)&&t.nsecs===undefined){a=0}if(a>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=l;_lastNSecs=a;_clockseq=s;l+=122192928e5;var h=((l&268435455)*1e4+a)%4294967296;r[n++]=h>>>24&255;r[n++]=h>>>16&255;r[n++]=h>>>8&255;r[n++]=h&255;var u=l/4294967296*1e4&268435455;r[n++]=u>>>8&255;r[n++]=u&255;r[n++]=u>>>24&15|16;r[n++]=u>>>16&255;r[n++]=s>>>8|128;r[n++]=s&255;var d=t.node||_nodeId;for(var p=0;p<6;++p){r[n+p]=d[p]}return e?e:bytesToUuid_1(r)}var v1_1=v1;function v4(t,e,i){var n=e&&i||0;if(typeof t=="string"){e=t=="binary"?new Array(16):null;t=null}t=t||{};var r=t.random||(t.rng||rngBrowser)();r[6]=r[6]&15|64;r[8]=r[8]&63|128;if(e){for(var s=0;s<16;++s){e[n+s]=r[s]}}return e||bytesToUuid_1(r)}var v4_1=v4;var uuid=v4_1;uuid.v1=v1_1;uuid.v4=v4_1;var uuidBrowser=uuid;var _EMPTY="00000000-0000-0000-0000-000000000000";var Guid=function(){function t(t){this._value=t}t.prototype.equals=function(e){if(!(e instanceof t))return false;return this.toString()===e.toString()};t.prototype.toString=function(){if(this._value){return this._value.toUpperCase()}};t.newInstance=function(){return new t(uuidBrowser.v4())};Object.defineProperty(t,"EMPTY",{get:function(){return new t(_EMPTY)},enumerable:false,configurable:true});t.equals=function(e,i){if(!(e instanceof t)||!(i instanceof t)){return!e&&!i}return e.equals(i)};return t}();var build=createCommonjsModule((function(module){(function(t,e){if(module.exports){module.exports=e()}else{t.mxgraph=e()}})(commonjsGlobal,(function(){return function(opts){for(var name in opts){this[name]=opts[name]}var __mxOutput={};var mxClient={VERSION:"4.2.2",IS_IE:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:navigator.userAgent!=null&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:navigator.userAgent!=null&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE")>=0&&(document.documentMode==null||document.documentMode==5),IS_EM:"spellcheck"in document.createElement("textarea")&&document.documentMode==8,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent!=null&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent!=null&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:navigator.userAgent!=null&&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.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:window.chrome!=null&&chrome.app!=null&&chrome.app.runtime!=null,IS_FF:typeof InstallTrigger!=="undefined",IS_MT: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.")<0,IS_VML:navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER",IS_SVG:navigator.appName.toUpperCase()!="MICROSOFT INTERNET EXPLORER",NO_FO:!document.createElementNS||document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!="[object SVGForeignObjectElement]"||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:window.PointerEvent!=null&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,i,n){i=i||document;if(mxClient.IS_IE6){i.write('<link rel="'+t+'" href="'+e+'" charset="UTF-8" type="text/css"/>')}else{var r=i.createElement("link");r.setAttribute("rel",t);r.setAttribute("href",e);r.setAttribute("charset","UTF-8");r.setAttribute("type","text/css");if(n){r.setAttribute("id",n)}var s=i.getElementsByTagName("head")[0];s.appendChild(r)}},loadResources:function(t,e){var i=mxClient.defaultBundles.length;function n(){if(--i==0){t()}}for(var r=0;r<mxClient.defaultBundles.length;r++){mxResources.add(mxClient.defaultBundles[r],e,n)}},include:function(t){document.write('<script src="'+t+'"><\/script>')}};if(typeof mxLoadResources=="undefined"){mxLoadResources=true}if(typeof mxForceIncludes=="undefined"){mxForceIncludes=false}if(typeof mxResourceExtension=="undefined"){mxResourceExtension=".txt"}if(typeof mxLoadStylesheets=="undefined"){mxLoadStylesheets=true}if(typeof mxBasePath!="undefined"&&mxBasePath.length>0){if(mxBasePath.substring(mxBasePath.length-1)=="/"){mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)}mxClient.basePath=mxBasePath}else{mxClient.basePath="."}if(typeof mxImageBasePath!="undefined"&&mxImageBasePath.length>0){if(mxImageBasePath.substring(mxImageBasePath.length-1)=="/"){mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)}mxClient.imageBasePath=mxImageBasePath}else{mxClient.imageBasePath=mxClient.basePath+"/images"}if(typeof mxLanguage!="undefined"&&mxLanguage!=null){mxClient.language=mxLanguage}else{mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language}if(typeof mxDefaultLanguage!="undefined"&&mxDefaultLanguage!=null){mxClient.defaultLanguage=mxDefaultLanguage}else{mxClient.defaultLanguage="en"}if(mxLoadStylesheets){mxClient.link("stylesheet",mxClient.basePath+"/css/common.css")}if(typeof mxLanguages!="undefined"&&mxLanguages!=null){mxClient.languages=mxLanguages}if(mxClient.IS_VML){if(mxClient.IS_SVG){mxClient.IS_VML=false}else{if(document.namespaces!=null){if(document.documentMode==8){document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML");document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")}else{document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml");document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office")}}if(mxClient.IS_QUIRKS&&document.styleSheets.length>=30){(function(){var t=document.createElement("style");t.type="text/css";t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}";document.getElementsByTagName("head")[0].appendChild(t)})()}else{document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}"}if(mxLoadStylesheets){mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css")}}}if(mxForceIncludes||!(module.exports!=null)){mxClient.include(mxClient.basePath+"/js/util/mxLog.js");mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js");mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js");mxClient.include(mxClient.basePath+"/js/util/mxResources.js");mxClient.include(mxClient.basePath+"/js/util/mxPoint.js");mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js");mxClient.include(mxClient.basePath+"/js/util/mxEffects.js");mxClient.include(mxClient.basePath+"/js/util/mxUtils.js");mxClient.include(mxClient.basePath+"/js/util/mxConstants.js");mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js");mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js");mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js");mxClient.include(mxClient.basePath+"/js/util/mxEvent.js");mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js");mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js");mxClient.include(mxClient.basePath+"/js/util/mxWindow.js");mxClient.include(mxClient.basePath+"/js/util/mxForm.js");mxClient.include(mxClient.basePath+"/js/util/mxImage.js");mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js");mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js");mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js");mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js");mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js");mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js");mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js");mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js");mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js");mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js");mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js");mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js");mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js");mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js");mxClient.include(mxClient.basePath+"/js/util/mxGuide.js");mxClient.include(mxClient.basePath+"/js/shape/mxShape.js");mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js");mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js");mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js");mxClient.include(mxClient.basePath+"/js/shape/mxActor.js");mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js");mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js");mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js");mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js");mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js");mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js");mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js");mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js");mxClient.include(mxClient.basePath+"/js/shape/mxText.js");mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js");mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js");mxClient.include(mxClient.basePath+"/js/shape/mxLine.js");mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js");mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js");mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js");mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js");mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js");mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js");mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js");mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js");mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js");mxClient.include(mxClient.basePath+"/js/model/mxCell.js");mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js");mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js");mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js");mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js");mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js");mxClient.include(mxClient.basePath+"/js/view/mxCellState.js");mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js");mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js");mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js");mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js");mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js");mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js");mxClient.include(mxClient.basePath+"/js/view/mxGraph.js");mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js");mxClient.include(mxClient.basePath+"/js/view/mxOutline.js");mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js");mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js");mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js");mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js");mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js");mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js");mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js");mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js");mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js");mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js");mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js");mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js");mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js");mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js");mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js");mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js");mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js");mxClient.include(mxClient.basePath+"/js/io/mxCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js");mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")}__mxOutput.mxClient=typeof mxClient!=="undefined"?mxClient:undefined;var mxLog={consoleName:"Console",TRACE:false,DEBUG:true,WARN:true,buffer:"",init:function(){if(mxLog.window==null&&document.body!=null){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION;var e=document.createElement("table");e.setAttribute("width","100%");e.setAttribute("height","100%");var i=document.createElement("tbody");var n=document.createElement("tr");var r=document.createElement("td");r.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;if(mxClient.IS_NS&&document.compatMode!="BackCompat"){mxLog.textarea.style.width="99%"}else{mxLog.textarea.style.width="100%"}r.appendChild(mxLog.textarea);n.appendChild(r);i.appendChild(n);n=document.createElement("tr");mxLog.td=document.createElement("td");mxLog.td.style.verticalAlign="top";mxLog.td.setAttribute("height","30px");n.appendChild(mxLog.td);i.appendChild(n);e.appendChild(i);mxLog.addButton("Info",(function(t){mxLog.info()}));mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)}));mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE;if(mxLog.TRACE){mxLog.debug("Tracing enabled")}else{mxLog.debug("Tracing disabled")}}));mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}));mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(e){mxUtils.alert(e)}}));mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var s=0;var l=0;if(typeof window.innerWidth==="number"){s=window.innerHeight;l=window.innerWidth}else{s=document.documentElement.clientHeight||document.body.clientHeight;l=document.body.clientWidth}mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-210),300,160);mxLog.window.setMaximizable(true);mxLog.window.setScrollable(false);mxLog.window.setResizable(true);mxLog.window.setClosable(true);mxLog.window.destroyOnClose=false;if((mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&document.compatMode!="BackCompat"||document.documentMode==11){var a=mxLog.window.getElement();var o=function(t,e){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,o);mxLog.window.addListener(mxEvent.MAXIMIZE,o);mxLog.window.addListener(mxEvent.NORMALIZE,o);mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var i=document.createElement("button");mxUtils.write(i,t);mxEvent.addListener(i,"click",e);mxLog.td.appendChild(i)},isVisible:function(){if(mxLog.window!=null){return mxLog.window.isVisible()}return false},show:function(){mxLog.setVisible(true)},setVisible:function(t){if(mxLog.window==null){mxLog.init()}if(mxLog.window!=null){mxLog.window.setVisible(t)}},enter:function(t){if(mxLog.TRACE){mxLog.writeln("Entering "+t);return(new Date).getTime()}},leave:function(t,e){if(mxLog.TRACE){var i=e!=0?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+i)}},debug:function(){if(mxLog.DEBUG){mxLog.writeln.apply(this,arguments)}},warn:function(){if(mxLog.WARN){mxLog.writeln.apply(this,arguments)}},write:function(){var t="";for(var e=0;e<arguments.length;e++){t+=arguments[e];if(e<arguments.length-1){t+=" "}}if(mxLog.textarea!=null){mxLog.textarea.value=mxLog.textarea.value+t;if(navigator.userAgent!=null&&navigator.userAgent.indexOf("Presto/2.5")>=0){mxLog.textarea.style.visibility="hidden";mxLog.textarea.style.visibility="visible"}mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight}else{mxLog.buffer+=t}},writeln:function(){var t="";for(var e=0;e<arguments.length;e++){t+=arguments[e];if(e<arguments.length-1){t+=" "}}mxLog.write(t+"\n")}};__mxOutput.mxLog=typeof mxLog!=="undefined"?mxLog:undefined;var mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(t){if(t!=null){if(t[mxObjectIdentity.FIELD_NAME]==null){if(typeof t==="object"){var e=mxUtils.getFunctionName(t.constructor);t[mxObjectIdentity.FIELD_NAME]=e+"#"+mxObjectIdentity.counter++}else if(typeof t==="function"){t[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++}}return t[mxObjectIdentity.FIELD_NAME]}return null},clear:function(t){if(typeof t==="object"||typeof t==="function"){delete t[mxObjectIdentity.FIELD_NAME]}}};__mxOutput.mxObjectIdentity=typeof mxObjectIdentity!=="undefined"?mxObjectIdentity:undefined;function mxDictionary(){this.clear()}mxDictionary.prototype.map=null;mxDictionary.prototype.clear=function(){this.map={}};mxDictionary.prototype.get=function(t){var e=mxObjectIdentity.get(t);return this.map[e]};mxDictionary.prototype.put=function(t,e){var i=mxObjectIdentity.get(t);var n=this.map[i];this.map[i]=e;return n};mxDictionary.prototype.remove=function(t){var e=mxObjectIdentity.get(t);var i=this.map[e];delete this.map[e];return i};mxDictionary.prototype.getKeys=function(){var t=[];for(var e in this.map){t.push(e)}return t};mxDictionary.prototype.getValues=function(){var t=[];for(var e in this.map){t.push(this.map[e])}return t};mxDictionary.prototype.visit=function(t){for(var e in this.map){t(e,this.map[e])}};__mxOutput.mxDictionary=typeof mxDictionary!=="undefined"?mxDictionary:undefined;var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:false,loadDefaultBundle:true,loadSpecialBundle:true,isLanguageSupported:function(t){if(mxClient.languages!=null){return mxUtils.indexOf(mxClient.languages,t)>=0}return true},getDefaultBundle:function(t,e){if(mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)){return t+mxResources.extension}else{return null}},getSpecialBundle:function(t,e){if(mxClient.languages==null||!this.isLanguageSupported(e)){var i=e.indexOf("-");if(i>0){e=e.substring(0,i)}}if(mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage){return t+"_"+e+mxResources.extension}else{return null}},add:function(t,e,i){e=e!=null?e:mxClient.language!=null?mxClient.language.toLowerCase():mxConstants.NONE;if(e!=mxConstants.NONE){var n=mxResources.getDefaultBundle(t,e);var r=mxResources.getSpecialBundle(t,e);var s=function(){if(r!=null){if(i){mxUtils.get(r,(function(t){mxResources.parse(t.getText());i()}),(function(){i()}))}else{try{var t=mxUtils.load(r);if(t.isReady()){mxResources.parse(t.getText())}}catch(e){}}}else if(i!=null){i()}};if(n!=null){if(i){mxUtils.get(n,(function(t){mxResources.parse(t.getText());s()}),(function(){s()}))}else{try{var l=mxUtils.load(n);if(l.isReady()){mxResources.parse(l.getText())}s()}catch(a){}}}else{s()}}},parse:function(t){if(t!=null){var e=t.split("\n");for(var i=0;i<e.length;i++){if(e[i].charAt(0)!="#"){var n=e[i].indexOf("=");if(n>0){var r=e[i].substring(0,n);var s=e[i].length;if(e[i].charCodeAt(s-1)==13){s--}var l=e[i].substring(n+1,s);if(this.resourcesEncoded){l=l.replace(/\\(?=u[a-fA-F\d]{4})/g,"%");mxResources.resources[r]=unescape(l)}else{mxResources.resources[r]=l}}}}}},get:function(t,e,i){var n=mxResources.resources[t];if(n==null){n=i}if(n!=null&&e!=null){n=mxResources.replacePlaceholders(n,e)}return n},replacePlaceholders:function(t,e){var i=[];var n=null;for(var r=0;r<t.length;r++){var s=t.charAt(r);if(s=="{"){n=""}else if(n!=null&&s=="}"){n=parseInt(n)-1;if(n>=0&&n<e.length){i.push(e[n])}n=null}else if(n!=null){n+=s}else{i.push(s)}}return i.join("")},loadResources:function(t){mxResources.add(mxClient.basePath+"/resources/editor",null,(function(){mxResources.add(mxClient.basePath+"/resources/graph",null,t)}))}};__mxOutput.mxResources=typeof mxResources!=="undefined"?mxResources:undefined;function mxPoint(t,e){this.x=t!=null?t:0;this.y=e!=null?e:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(t){return t!=null&&t.x==this.x&&t.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};__mxOutput.mxPoint=typeof mxPoint!=="undefined"?mxPoint:undefined;function mxRectangle(t,e,i,n){mxPoint.call(this,t,e);this.width=i!=null?i:0;this.height=n!=null?n:0}mxRectangle.prototype=new mxPoint;mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(t,e,i,n){this.x=t;this.y=e;this.width=i;this.height=n};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(t!=null){var e=Math.min(this.x,t.x);var i=Math.min(this.y,t.y);var n=Math.max(this.x+this.width,t.x+t.width);var r=Math.max(this.y+this.height,t.y+t.height);this.x=e;this.y=i;this.width=n-e;this.height=r-i}};mxRectangle.prototype.intersect=function(t){if(t!=null){var e=this.x+this.width;var i=t.x+t.width;var n=this.y+this.height;var r=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,i)-this.x;this.height=Math.min(n,r)-this.y}};mxRectangle.prototype.grow=function(t){this.x-=t;this.y-=t;this.width+=2*t;this.height+=2*t;return 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;var e=this.width;this.width=this.height;this.height=e};mxRectangle.prototype.equals=function(t){return t!=null&&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)};__mxOutput.mxRectangle=typeof mxRectangle!=="undefined"?mxRectangle:undefined;var mxEffects={animateChanges:function(t,e,i){var n=10;var r=0;var s=function(){var a=false;for(var o=0;o<e.length;o++){var h=e[o];if(h instanceof mxGeometryChange||h instanceof mxTerminalChange||h instanceof mxValueChange||h instanceof mxChildChange||h instanceof mxStyleChange){var u=t.getView().getState(h.cell||h.child,false);if(u!=null){a=true;if(h.constructor!=mxGeometryChange||t.model.isEdge(h.cell)){mxUtils.setOpacity(u.shape.node,100*r/n)}else{var d=t.getView().scale;var p=(h.geometry.x-h.previous.x)*d;var m=(h.geometry.y-h.previous.y)*d;var c=(h.geometry.width-h.previous.width)*d;var x=(h.geometry.height-h.previous.height)*d;if(r==0){u.x-=p;u.y-=m;u.width-=c;u.height-=x}else{u.x+=p/n;u.y+=m/n;u.width+=c/n;u.height+=x/n}t.cellRenderer.redraw(u);mxEffects.cascadeOpacity(t,h.cell,100*r/n)}}}}if(r<n&&a){r++;window.setTimeout(s,l)}else if(i!=null){i()}};var l=30;s()},cascadeOpacity:function(t,e,i){var n=t.model.getChildCount(e);for(var r=0;r<n;r++){var s=t.model.getChildAt(e,r);var l=t.getView().getState(s);if(l!=null){mxUtils.setOpacity(l.shape.node,i);mxEffects.cascadeOpacity(t,s,i)}}var a=t.model.getEdges(e);if(a!=null){for(var r=0;r<a.length;r++){var o=t.getView().getState(a[r]);if(o!=null){mxUtils.setOpacity(o.shape.node,i)}}}},fadeOut:function(t,e,i,n,r,s){n=n||40;r=r||30;var l=e||100;mxUtils.setOpacity(t,l);if(s||s==null){var a=function(){l=Math.max(l-n,0);mxUtils.setOpacity(t,l);if(l>0){window.setTimeout(a,r)}else{t.style.visibility="hidden";if(i&&t.parentNode){t.parentNode.removeChild(t)}}};window.setTimeout(a,r)}else{t.style.visibility="hidden";if(i&&t.parentNode){t.parentNode.removeChild(t)}}}};__mxOutput.mxEffects=typeof mxEffects!=="undefined"?mxEffects:undefined;var mxUtils={errorResource:mxClient.language!="none"?"error":"",closeResource:mxClient.language!="none"?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){if(t.style!=null){t.style.cursor=""}var e=t.childNodes;if(e!=null){var i=e.length;for(var n=0;n<i;n+=1){mxUtils.removeCursors(e[n])}}},getCurrentStyle:function(){if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<9)){return function(t){return t!=null?t.currentStyle:null}}else{return function(t){return t!=null?window.getComputedStyle(t,""):null}}}(),parseCssNumber:function(t){if(t=="thin"){t="2"}else if(t=="medium"){t="4"}else if(t=="thick"){t="6"}t=parseFloat(t);if(isNaN(t)){t=0}return t},setPrefixedStyle:function(){var t=null;if(mxClient.IS_OT){t="O"}else if(mxClient.IS_SF||mxClient.IS_GC){t="Webkit"}else if(mxClient.IS_MT){t="Moz"}else if(mxClient.IS_IE&&document.documentMode>=9&&document.documentMode<10){t="ms"}return function(e,i,n){e[i]=n;if(t!=null&&i.length>0){i=t+i.substring(0,1).toUpperCase()+i.substring(1);e[i]=n}}}(),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return e!=null&&(e.overflow=="scroll"||e.overflow=="auto")},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0){try{eval("var _mxJavaScriptExpression="+expr);result=_mxJavaScriptExpression;_mxJavaScriptExpression=null}catch(e){mxLog.warn(e.message+" while evaluating "+expr)}}else{try{result=eval(expr)}catch(e){mxLog.warn(e.message+" while evaluating "+expr)}}return result},findNode:function(t,e,i){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=t.getAttribute(e);if(n!=null&&n==i){return t}}t=t.firstChild;while(t!=null){var r=mxUtils.findNode(t,e,i);if(r!=null){return r}t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(t!=null){if(t.name!=null){e=t.name}else{e=mxUtils.trim(t.toString());if(/^function\s/.test(e)){e=mxUtils.ltrim(e.substring(9));var i=e.indexOf("(");if(i>0){e=e.substring(0,i)}}}}return e},indexOf:function(t,e){if(t!=null&&e!=null){for(var i=0;i<t.length;i++){if(t[i]==e){return i}}}return-1},forEach:function(t,e){if(t!=null&&e!=null){for(var i=0;i<t.length;i++){e(t[i])}}return t},remove:function(t,e){var i=null;if(typeof e=="object"){var n=mxUtils.indexOf(e,t);while(n>=0){e.splice(n,1);i=t;n=mxUtils.indexOf(e,t)}}for(var r in e){if(e[r]==t){delete e[r];i=t}}return i},isNode:function(t,e,i,n){if(t!=null&&!isNaN(t.nodeType)&&(e==null||t.nodeName.toLowerCase()==e.toLowerCase())){return i==null||t.getAttribute(i)==n}return false},isAncestorNode:function(t,e){var i=e;while(i!=null){if(i==t){return true}i=i.parentNode}return false},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;var i=[];var n=t.firstChild;while(n!=null){if(n.nodeType==e){i.push(n)}n=n.nextSibling}return i},importNode:function(t,e,i){if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<10)){return mxUtils.importNodeImplementation(t,e,i)}else{return t.importNode(e,i)}},importNodeImplementation:function(t,e,i){switch(e.nodeType){case 1:{var n=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0){for(var r=0;r<e.attributes.length;r++){n.setAttribute(e.attributes[r].nodeName,e.getAttribute(e.attributes[r].nodeName))}}if(i&&e.childNodes&&e.childNodes.length>0){for(var r=0;r<e.childNodes.length;r++){n.appendChild(mxUtils.importNodeImplementation(t,e.childNodes[r],i))}}return n}case 3:case 4:case 8:{return t.createTextNode(e.nodeValue!=null?e.nodeValue:e.value)}}},createXmlDocument:function(){var t=null;if(document.implementation&&document.implementation.createDocument){t=document.implementation.createDocument("","",null)}else if("ActiveXObject"in window){t=mxUtils.createMsXmlDocument()}return t},createMsXmlDocument:function(){var t=new ActiveXObject("Microsoft.XMLDOM");t.async=false;t.validateOnParse=false;t.resolveExternals=false;return t},parseXml:function(){if(window.DOMParser){return function(t){var e=new DOMParser;return e.parseFromString(t,"text/xml")}}else{return function(t){var e=mxUtils.createMsXmlDocument();e.loadXML(t);return e}}}(),clearSelection:function(){if(document.selection){return function(){document.selection.empty()}}else if(window.getSelection){return function(){if(window.getSelection().empty){window.getSelection().empty()}else if(window.getSelection().removeAllRanges){window.getSelection().removeAllRanges()}}}else{return function(){}}}(),removeWhitespace:function(t,e){var i=e?t.previousSibling:t.nextSibling;while(i!=null&&i.nodeType==mxConstants.NODETYPE_TEXT){var n=e?i.previousSibling:i.nextSibling;var r=mxUtils.getTextContent(i);if(mxUtils.trim(r).length==0){i.parentNode.removeChild(i)}i=n}},htmlEntities:function(t,e){t=String(t||"");t=t.replace(/&/g,"&amp;");t=t.replace(/"/g,"&quot;");t=t.replace(/\'/g,"&#39;");t=t.replace(/</g,"&lt;");t=t.replace(/>/g,"&gt;");if(e==null||e){t=t.replace(/\n/g,"&#xa;")}return t},isVml:function(t){return t!=null&&t.tagUrn=="urn:schemas-microsoft-com:vml"},getXml:function(t,e){var i="";if(mxClient.IS_IE||mxClient.IS_IE11){i=mxUtils.getPrettyXml(t,"","","")}else if(window.XMLSerializer!=null){var n=new XMLSerializer;i=n.serializeToString(t)}else if(t.xml!=null){i=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n")}e=e||"&#xa;";i=i.replace(/\n/g,e);return i},getPrettyXml:function(t,e,i,n,r){var s=[];if(t!=null){e=e!=null?e:" ";i=i!=null?i:"";n=n!=null?n:"\n";if(t.namespaceURI!=null&&t.namespaceURI!=r){r=t.namespaceURI;if(t.getAttribute("xmlns")==null){t.setAttribute("xmlns",t.namespaceURI)}}if(t.nodeType==mxConstants.NODETYPE_DOCUMENT){s.push(mxUtils.getPrettyXml(t.documentElement,e,i,n,r))}else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var l=t.firstChild;if(l!=null){while(l!=null){s.push(mxUtils.getPrettyXml(l,e,i,n,r));l=l.nextSibling}}}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){var a=mxUtils.getTextContent(t);if(a.length>0){s.push(i+"\x3c!--"+a+"--\x3e"+n)}}else if(t.nodeType==mxConstants.NODETYPE_TEXT){var a=mxUtils.trim(mxUtils.getTextContent(t));if(a.length>0){s.push(i+mxUtils.htmlEntities(a,false)+n)}}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var a=mxUtils.getTextContent(t);if(a.length>0){s.push(i+"<![CDATA["+a+"]]"+n)}}else{s.push(i+"<"+t.nodeName);var o=t.attributes;if(o!=null){for(var h=0;h<o.length;h++){var u=mxUtils.htmlEntities(o[h].value);s.push(" "+o[h].nodeName+'="'+u+'"')}}var l=t.firstChild;if(l!=null){s.push(">"+n);while(l!=null){s.push(mxUtils.getPrettyXml(l,e,i+e,n,r));l=l.nextSibling}s.push(i+"</"+t.nodeName+">"+n)}else{s.push(" />"+n)}}}return s.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"];var i=[];function n(t){if(t.length==1&&(t[0].nodeName=="BR"||t[0].innerHTML=="\n")){return}for(var r=0;r<t.length;r++){var s=t[r];if(s.nodeName=="BR"||s.innerHTML=="\n"||(t.length==1||r==0)&&(s.nodeName=="DIV"&&s.innerHTML.toLowerCase()=="<br>")){i.push("\n")}else{if(s.nodeType===3||s.nodeType===4){if(s.nodeValue.length>0){i.push(s.nodeValue)}}else if(s.nodeType!==8&&s.childNodes.length>0){n(s.childNodes)}if(r<t.length-1&&mxUtils.indexOf(e,t[r+1].nodeName)>=0){i.push("\n")}}}}n(t);return i.join("")},replaceTrailingNewlines:function(t,e){var i="";while(t.length>0&&t.charAt(t.length-1)=="\n"){t=t.substring(0,t.length-1);i+=e}return t+i},getTextContent:function(t){if(mxClient.IS_IE&&t.innerText!==undefined){return t.innerText}else{return t!=null?t[t.textContent===undefined?"text":"textContent"]:""}},setTextContent:function(t,e){if(t.innerText!==undefined){t.innerText=e}else{t[t.textContent===undefined?"text":"textContent"]=e}},getInnerHtml:function(){if(mxClient.IS_IE){return function(t){if(t!=null){return t.innerHTML}return""}}else{return function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}}(),getOuterHtml:function(){if(mxClient.IS_IE){return function(t){if(t!=null){if(t.outerHTML!=null){return t.outerHTML}else{var e=[];e.push("<"+t.nodeName);var i=t.attributes;if(i!=null){for(var n=0;n<i.length;n++){var r=i[n].value;if(r!=null&&r.length>0){e.push(" ");e.push(i[n].nodeName);e.push('="');e.push(r);e.push('"')}}}if(t.innerHTML.length==0){e.push("/>")}else{e.push(">");e.push(t.innerHTML);e.push("</"+t.nodeName+">")}return e.join("")}}return""}}else{return function(t){if(t!=null){var e=new XMLSerializer;return e.serializeToString(t)}return""}}}(),write:function(t,e){var i=t.ownerDocument;var n=i.createTextNode(e);if(t!=null){t.appendChild(n)}return n},writeln:function(t,e){var i=t.ownerDocument;var n=i.createTextNode(e);if(t!=null){t.appendChild(n);t.appendChild(document.createElement("br"))}return n},br:function(t,e){e=e||1;var i=null;for(var n=0;n<e;n++){if(t!=null){i=t.ownerDocument.createElement("br");t.appendChild(i)}}return i},button:function(t,e,i){i=i!=null?i:document;var n=i.createElement("button");mxUtils.write(n,t);mxEvent.addListener(n,"click",(function(t){e(t)}));return n},para:function(t,e){var i=document.createElement("p");mxUtils.write(i,e);if(t!=null){t.appendChild(i)}return i},addTransparentBackgroundFilter:function(t){t.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(t,e,i,n,r){return mxUtils.link(t,e,(function(){i.execute(n)}),r)},linkInvoke:function(t,e,i,n,r,s){return mxUtils.link(t,e,(function(){i[n](r)}),s)},link:function(t,e,i,n){var r=document.createElement("span");r.style.color="blue";r.style.textDecoration="underline";r.style.cursor="pointer";if(n!=null){r.style.paddingLeft=n+"px"}mxEvent.addListener(r,"click",i);mxUtils.write(r,e);if(t!=null){t.appendChild(r)}return r},getDocumentSize:function(){var t=document.body;var e=document.documentElement;try{return new mxRectangle(0,0,t.clientWidth||e.clientWidth,Math.max(t.clientHeight||0,e.clientHeight))}catch(i){return new mxRectangle}},fit:function(t){var e=mxUtils.getDocumentSize();var i=parseInt(t.offsetLeft);var n=parseInt(t.offsetWidth);var r=mxUtils.getDocumentScrollOrigin(t.ownerDocument);var s=r.x;var l=r.y;var a=s+e.width;if(i+n>a){t.style.left=Math.max(s,a-n)+"px"}var o=parseInt(t.offsetTop);var h=parseInt(t.offsetHeight);var u=l+e.height;if(o+h>u){t.style.top=Math.max(l,u-h)+"px"}},load:function(t){var e=new mxXmlRequest(t,null,"GET",false);e.send();return e},get:function(t,e,i,n,r,s,l){var a=new mxXmlRequest(t,null,"GET");var o=a.setRequestHeaders;if(l){a.setRequestHeaders=function(t,e){o.apply(this,arguments);for(var i in l){t.setRequestHeader(i,l[i])}}}if(n!=null){a.setBinary(n)}a.send(e,i,r,s);return a},getAll:function(t,e,i){var n=t.length;var r=[];var s=0;var l=function(){if(s==0&&i!=null){i()}s++};for(var a=0;a<t.length;a++){(function(t,i){mxUtils.get(t,(function(t){var s=t.getStatus();if(s<200||s>299){l()}else{r[i]=t;n--;if(n==0){e(r)}}}),l)})(t[a],a)}if(n==0){e(r)}},post:function(t,e,i,n){return new mxXmlRequest(t,e).send(i,n)},submit:function(t,e,i,n){return new mxXmlRequest(t,e).simulate(i,n)},loadInto:function(t,e,i){if(mxClient.IS_IE){e.onreadystatechange=function(){if(e.readyState==4){i()}}}else{e.addEventListener("load",i,false)}e.load(t)},getValue:function(t,e,i){var n=t!=null?t[e]:null;if(n==null){n=i}return n},getNumber:function(t,e,i){var n=t!=null?t[e]:null;if(n==null){n=i||0}return Number(n)},getColor:function(t,e,i){var n=t!=null?t[e]:null;if(n==null){n=i}else if(n==mxConstants.NONE){n=null}return n},clone:function(t,e,i){i=i!=null?i:false;var n=null;if(t!=null&&typeof t.constructor=="function"){n=new t.constructor;for(var r in t){if(r!=mxObjectIdentity.FIELD_NAME&&(e==null||mxUtils.indexOf(e,r)<0)){if(!i&&typeof t[r]=="object"){n[r]=mxUtils.clone(t[r])}else{n[r]=t[r]}}}}return n},equalPoints:function(t,e){if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!=e.length){return false}else if(t!=null&&e!=null){for(var i=0;i<t.length;i++){if(t[i]!=null&&e[i]==null||t[i]==null&&e[i]!=null||t[i]!=null&&e[i]!=null&&(t[i].x!=e[i].x||t[i].y!=e[i].y)){return false}}}return true},equalEntries:function(t,e){var i=0;if(t==null&&e!=null||t!=null&&e==null||t!=null&&e!=null&&t.length!=e.length){return false}else if(t!=null&&e!=null){for(var n in e){i++}for(var n in t){i--;if((!mxUtils.isNaN(t[n])||!mxUtils.isNaN(e[n]))&&t[n]!=e[n]){return false}}}return i==0},removeDuplicates:function(t){var e=new mxDictionary;var i=[];for(var n=0;n<t.length;n++){if(!e.get(t[n])){i.push(t[n]);e.put(t[n],true)}}return i},isNaN:function(t){return typeof t=="number"&&isNaN(t)},extend:function(t,e){var i=function(){};i.prototype=e.prototype;t.prototype=new i;t.prototype.constructor=t},toString:function(t){var e="";for(var i in t){try{if(t[i]==null){e+=i+" = [null]\n"}else if(typeof t[i]=="function"){e+=i+" => [Function]\n"}else if(typeof t[i]=="object"){var n=mxUtils.getFunctionName(t[i].constructor);e+=i+" => ["+n+"]\n"}else{e+=i+" = "+t[i]+"\n"}}catch(r){e+=i+"="+r.message}}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return t*180/Math.PI},arcToCurves:function(t,e,i,n,r,s,l,a,o){a-=t;o-=e;if(i===0||n===0){return j}var h=l;var u=r;i=Math.abs(i);n=Math.abs(n);var d=-a/2;var p=-o/2;var m=Math.cos(u*Math.PI/180);var c=Math.sin(u*Math.PI/180);var x=m*d+c*p;var f=-1*c*d+m*p;var g=x*x;var v=f*f;var y=i*i;var C=n*n;var E=g/y+v/C;var S;if(E>1){i=Math.sqrt(E)*i;n=Math.sqrt(E)*n;S=0}else{var b=1;if(s===h){b=-1}S=b*Math.sqrt((y*C-y*v-C*g)/(y*v+C*g))}var w=S*i*f/n;var T=-1*S*n*x/i;var L=m*w-c*T+a/2;var A=c*w+m*T+o/2;var M=Math.atan2((f-T)/n,(x-w)/i)-Math.atan2(0,1);var _=M>=0?M:2*Math.PI+M;M=Math.atan2((-f-T)/n,(-x-w)/i)-Math.atan2((f-T)/n,(x-w)/i);var O=M>=0?M:2*Math.PI+M;if(h==0&&O>0){O-=2*Math.PI}else if(h!=0&&O<0){O+=2*Math.PI}var I=O*2/Math.PI;var P=Math.ceil(I<0?-1*I:I);var R=O/P;var H=8/3*Math.sin(R/4)*Math.sin(R/4)/Math.sin(R/2);var N=m*i;var D=m*n;var G=c*i;var U=c*n;var V=Math.cos(_);var k=Math.sin(_);var F=-H*(N*k+U*V);var B=-H*(G*k-D*V);var Y=0;var z=0;var j=[];for(var X=0;X<P;++X){_+=R;V=Math.cos(_);k=Math.sin(_);Y=N*V-U*k+L;z=G*V+D*k+A;var W=-H*(N*k+U*V);var K=-H*(G*k-D*V);var Z=X*6;j[Z]=Number(F+t);j[Z+1]=Number(B+e);j[Z+2]=Number(Y-W+t);j[Z+3]=Number(z-K+e);j[Z+4]=Number(Y+t);j[Z+5]=Number(z+e);F=Y+W;B=z+K}return j},getBoundingBox:function(t,e,i){var n=null;if(t!=null&&e!=null&&e!=0){var r=mxUtils.toRadians(e);var s=Math.cos(r);var l=Math.sin(r);i=i!=null?i:new mxPoint(t.x+t.width/2,t.y+t.height/2);var a=new mxPoint(t.x,t.y);var o=new mxPoint(t.x+t.width,t.y);var h=new mxPoint(o.x,t.y+t.height);var u=new mxPoint(t.x,h.y);a=mxUtils.getRotatedPoint(a,s,l,i);o=mxUtils.getRotatedPoint(o,s,l,i);h=mxUtils.getRotatedPoint(h,s,l,i);u=mxUtils.getRotatedPoint(u,s,l,i);n=new mxRectangle(a.x,a.y,0,0);n.add(new mxRectangle(o.x,o.y,0,0));n.add(new mxRectangle(h.x,h.y,0,0));n.add(new mxRectangle(u.x,u.y,0,0))}return n},getRotatedPoint:function(t,e,i,n){n=n!=null?n:new mxPoint;var r=t.x-n.x;var s=t.y-n.y;var l=r*e-s*i;var a=s*e+r*i;return new mxPoint(l+n.x,a+n.y)},getPortConstraints:function(t,e,i,n){var r=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(e.style,i?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(r==null){return n}else{var s=r.toString();var l=mxConstants.DIRECTION_MASK_NONE;var a=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0);var o=0;if(a==1){o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0)}var h=0;if(o>45){h=1;if(o>=135){h=2}}else if(o<-45){h=3;if(o<=-135){h=2}}if(s.indexOf(mxConstants.DIRECTION_NORTH)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:l|=mxConstants.DIRECTION_MASK_EAST;break;case 2:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:l|=mxConstants.DIRECTION_MASK_WEST;break}}if(s.indexOf(mxConstants.DIRECTION_WEST)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_WEST;break;case 1:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:l|=mxConstants.DIRECTION_MASK_EAST;break;case 3:l|=mxConstants.DIRECTION_MASK_SOUTH;break}}if(s.indexOf(mxConstants.DIRECTION_SOUTH)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:l|=mxConstants.DIRECTION_MASK_WEST;break;case 2:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:l|=mxConstants.DIRECTION_MASK_EAST;break}}if(s.indexOf(mxConstants.DIRECTION_EAST)>=0){switch(h){case 0:l|=mxConstants.DIRECTION_MASK_EAST;break;case 1:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:l|=mxConstants.DIRECTION_MASK_WEST;break;case 3:l|=mxConstants.DIRECTION_MASK_NORTH;break}}return l}},reversePortConstraints:function(t){var e=0;e=(t&mxConstants.DIRECTION_MASK_WEST)<<3;e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1;e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1;e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3;return e},findNearestSegment:function(t,e,i){var n=-1;if(t.absolutePoints.length>0){var r=t.absolutePoints[0];var s=null;for(var l=1;l<t.absolutePoints.length;l++){var a=t.absolutePoints[l];var o=mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,i);if(s==null||o<s){s=o;n=l-1}r=a}}return n},getDirectedBounds:function(t,e,i,n,r){var s=mxUtils.getValue(i,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);n=n!=null?n:mxUtils.getValue(i,mxConstants.STYLE_FLIPH,false);r=r!=null?r:mxUtils.getValue(i,mxConstants.STYLE_FLIPV,false);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)));if(r&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||n&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST)){var l=e.x;e.x=e.width;e.width=l}if(n&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||r&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST)){var l=e.y;e.y=e.height;e.height=l}var a=mxRectangle.fromRectangle(e);if(s==mxConstants.DIRECTION_SOUTH){a.y=e.x;a.x=e.height;a.width=e.y;a.height=e.width}else if(s==mxConstants.DIRECTION_WEST){a.y=e.height;a.x=e.width;a.width=e.x;a.height=e.y}else if(s==mxConstants.DIRECTION_NORTH){a.y=e.width;a.x=e.y;a.width=e.height;a.height=e.x}return new mxRectangle(t.x+a.x,t.y+a.y,t.width-a.width-a.x,t.height-a.height-a.y)},getPerimeterPoint:function(t,e,i){var n=null;for(var r=0;r<t.length-1;r++){var s=mxUtils.intersection(t[r].x,t[r].y,t[r+1].x,t[r+1].y,e.x,e.y,i.x,i.y);if(s!=null){var l=i.x-s.x;var a=i.y-s.y;var o={p:s,distSq:a*a+l*l};if(o!=null&&(n==null||n.distSq>o.distSq)){n=o}}}return n!=null?n.p:null},rectangleIntersectsSegment:function(t,e,i){var n=t.y;var r=t.x;var s=n+t.height;var l=r+t.width;var a=e.x;var o=i.x;if(e.x>i.x){a=i.x;o=e.x}if(o>l){o=l}if(a<r){a=r}if(a>o){return false}var h=e.y;var u=i.y;var d=i.x-e.x;if(Math.abs(d)>1e-7){var p=(i.y-e.y)/d;var m=e.y-p*e.x;h=p*a+m;u=p*o+m}if(h>u){var c=u;u=h;h=c}if(u>s){u=s}if(h<n){h=n}if(h>u){return false}return true},contains:function(t,e,i){return t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i},intersects:function(t,e){var i=t.width;var n=t.height;var r=e.width;var s=e.height;if(r<=0||s<=0||i<=0||n<=0){return false}var l=t.x;var a=t.y;var o=e.x;var h=e.y;r+=o;s+=h;i+=l;n+=a;return(r<o||r>l)&&(s<h||s>a)&&(i<l||i>o)&&(n<a||n>h)},intersectsHotspot:function(t,e,i,n,r,s){n=n!=null?n:1;r=r!=null?r:0;s=s!=null?s:0;if(n>0){var l=t.getCenterX();var a=t.getCenterY();var o=t.width;var h=t.height;var u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;if(u>0){if(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,true)){a=t.y+u/2;h=u}else{l=t.x+u/2;o=u}}o=Math.max(r,o*n);h=Math.max(r,h*n);if(s>0){o=Math.min(o,s);h=Math.min(h,s)}var d=new mxRectangle(l-o/2,a-h/2,o,h);var p=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(p!=0){var m=Math.cos(-p);var c=Math.sin(-p);var l=new mxPoint(t.getCenterX(),t.getCenterY());var x=mxUtils.getRotatedPoint(new mxPoint(e,i),m,c,l);e=x.x;i=x.y}return mxUtils.contains(d,e,i)}return true},getOffset:function(t,e){var i=0;var n=0;var r=false;var s=t;var l=document.body;var a=document.documentElement;while(s!=null&&s!=l&&s!=a&&!r){var o=mxUtils.getCurrentStyle(s);if(o!=null){r=r||o.position=="fixed"}s=s.parentNode}if(!e&&!r){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);i+=h.x;n+=h.y}var u=t.getBoundingClientRect();if(u!=null){i+=u.left;n+=u.top}return new mxPoint(i,n)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS){return new mxPoint(t.body.scrollLeft,t.body.scrollTop)}else{var e=t.defaultView||t.parentWindow;var i=e!=null&&window.pageXOffset!==undefined?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft;var n=e!=null&&window.pageYOffset!==undefined?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return new mxPoint(i,n)}},getScrollOrigin:function(t,e,i){e=e!=null?e:false;i=i!=null?i:true;var n=t!=null?t.ownerDocument:document;var r=n.body;var s=n.documentElement;var l=new mxPoint;var a=false;while(t!=null&&t!=r&&t!=s){if(!isNaN(t.scrollLeft)&&!isNaN(t.scrollTop)){l.x+=t.scrollLeft;l.y+=t.scrollTop}var o=mxUtils.getCurrentStyle(t);if(o!=null){a=a||o.position=="fixed"}t=e?t.parentNode:null}if(!a&&i){var h=mxUtils.getDocumentScrollOrigin(n);l.x+=h.x;l.y+=h.y}return l},convertPoint:function(t,e,i){var n=mxUtils.getScrollOrigin(t,false);var r=mxUtils.getOffset(t);r.x-=n.x;r.y-=n.y;return new mxPoint(e-r.x,i-r.y)},ltrim:function(t,e){e=e||"\\s";return t!=null?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){e=e||"\\s";return t!=null?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&(typeof t!="string"||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,i,n,r,s,l,a){var o=(a-s)*(i-t)-(l-r)*(n-e);var h=(l-r)*(e-s)-(a-s)*(t-r);var u=(i-t)*(e-s)-(n-e)*(t-r);var d=h/o;var p=u/o;if(d>=0&&d<=1&&p>=0&&p<=1){var m=t+d*(i-t);var c=e+d*(n-e);return new mxPoint(m,c)}return null},ptSegDistSq:function(t,e,i,n,r,s){i-=t;n-=e;r-=t;s-=e;var l=r*i+s*n;var a;if(l<=0){a=0}else{r=i-r;s=n-s;l=r*i+s*n;if(l<=0){a=0}else{a=l*l/(i*i+n*n)}}var o=r*r+s*s-a;if(o<0){o=0}return o},ptLineDist:function(t,e,i,n,r,s){return Math.abs((n-e)*r-(i-t)*s+i*e-n*t)/Math.sqrt((n-e)*(n-e)+(i-t)*(i-t))},relativeCcw:function(t,e,i,n,r,s){i-=t;n-=e;r-=t;s-=e;var l=r*n-s*i;if(l==0){l=r*i+s*n;if(l>0){r-=i;s-=n;l=r*i+s*n;if(l<0){l=0}}}return l<0?-1:l>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,i){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,i,n,r,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){if(mxUtils.isVml(t)){if(e>=100){t.style.filter=""}else{t.style.filter="alpha(opacity="+e/5+")"}}else if(mxClient.IS_IE&&(typeof document.documentMode==="undefined"||document.documentMode<9)){if(e>=100){t.style.filter=""}else{t.style.filter="alpha(opacity="+e+")"}}else{t.style.opacity=e/100}},createImage:function(t){var e=null;if(mxClient.IS_IE6&&document.compatMode!="CSS1Compat"){e=document.createElement(mxClient.VML_PREFIX+":image");e.setAttribute("src",t);e.style.borderStyle="none"}else{e=document.createElement("img");e.setAttribute("src",t);e.setAttribute("border","0")}return e},sortCells:function(t,e){e=e!=null?e:true;var i=new mxDictionary;t.sort((function(t,n){var r=i.get(t);if(r==null){r=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR);i.put(t,r)}var s=i.get(n);if(s==null){s=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR);i.put(n,s)}var l=mxCellPath.compare(r,s);return l==0?0:l>0==e?1:-1}));return t},getStylename:function(t){if(t!=null){var e=t.split(";");var i=e[0];if(i.indexOf("=")<0){return i}}return""},getStylenames:function(t){var e=[];if(t!=null){var i=t.split(";");for(var n=0;n<i.length;n++){if(i[n].indexOf("=")<0){e.push(i[n])}}}return e},indexOfStylename:function(t,e){if(t!=null&&e!=null){var i=t.split(";");var n=0;for(var r=0;r<i.length;r++){if(i[r]==e){return n}n+=i[r].length+1}}return-1},addStylename:function(t,e){if(mxUtils.indexOfStylename(t,e)<0){if(t==null){t=""}else if(t.length>0&&t.charAt(t.length-1)!=";"){t+=";"}t+=e}return t},removeStylename:function(t,e){var i=[];if(t!=null){var n=t.split(";");for(var r=0;r<n.length;r++){if(n[r]!=e){i.push(n[r])}}}return i.join(";")},removeAllStylenames:function(t){var e=[];if(t!=null){var i=t.split(";");for(var n=0;n<i.length;n++){if(i[n].indexOf("=")>=0){e.push(i[n])}}}return e.join(";")},setCellStyles:function(t,e,i,n){if(e!=null&&e.length>0){t.beginUpdate();try{for(var r=0;r<e.length;r++){if(e[r]!=null){var s=mxUtils.setStyle(t.getStyle(e[r]),i,n);t.setStyle(e[r],s)}}}finally{t.endUpdate()}}},setStyle:function(t,e,i){var n=i!=null&&(typeof i.length=="undefined"||i.length>0);if(t==null||t.length==0){if(n){t=e+"="+i+";"}}else{if(t.substring(0,e.length+1)==e+"="){var r=t.indexOf(";");if(n){t=e+"="+i+(r<0?";":t.substring(r))}else{t=r<0||r==t.length-1?"":t.substring(r+1)}}else{var s=t.indexOf(";"+e+"=");if(s<0){if(n){var l=t.charAt(t.length-1)==";"?"":";";t=t+l+e+"="+i+";"}}else{var r=t.indexOf(";",s+1);if(n){t=t.substring(0,s+1)+e+"="+i+(r<0?";":t.substring(r))}else{t=t.substring(0,s)+(r<0?";":t.substring(r))}}}}return t},setCellStyleFlags:function(t,e,i,n,r){if(e!=null&&e.length>0){t.beginUpdate();try{for(var s=0;s<e.length;s++){if(e[s]!=null){var l=mxUtils.setStyleFlag(t.getStyle(e[s]),i,n,r);t.setStyle(e[s],l)}}}finally{t.endUpdate()}}},setStyleFlag:function(t,e,i,n){if(t==null||t.length==0){if(n||n==null){t=e+"="+i}else{t=e+"=0"}}else{var r=t.indexOf(e+"=");if(r<0){var s=t.charAt(t.length-1)==";"?"":";";if(n||n==null){t=t+s+e+"="+i}else{t=t+s+e+"=0"}}else{var l=t.indexOf(";",r);var a="";if(l<0){a=t.substring(r+e.length+1)}else{a=t.substring(r+e.length+1,l)}if(n==null){a=parseInt(a)^i}else if(n){a=parseInt(a)|i}else{a=parseInt(a)&~i}t=t.substring(0,r)+e+"="+a+(l>=0?t.substring(l):"")}}return t},getAlignmentAsPoint:function(t,e){var i=-.5;var n=-.5;if(t==mxConstants.ALIGN_LEFT){i=0}else if(t==mxConstants.ALIGN_RIGHT){i=-1}if(e==mxConstants.ALIGN_TOP){n=0}else if(e==mxConstants.ALIGN_BOTTOM){n=-1}return new mxPoint(i,n)},getSizeForString:function(t,e,i,n,r){e=e!=null?e:mxConstants.DEFAULT_FONTSIZE;i=i!=null?i:mxConstants.DEFAULT_FONTFAMILY;var s=document.createElement("div");s.style.fontFamily=i;s.style.fontSize=Math.round(e)+"px";s.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px";if(r!=null){if((r&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){s.style.fontWeight="bold"}if((r&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){s.style.fontStyle="italic"}var l=[];if((r&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){l.push("underline")}if((r&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){l.push("line-through")}if(l.length>0){s.style.textDecoration=l.join(" ")}}s.style.position="absolute";s.style.visibility="hidden";s.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";s.style.zoom="1";if(n!=null){s.style.width=n+"px";s.style.whiteSpace="normal"}else{s.style.whiteSpace="nowrap"}s.innerHTML=t;document.body.appendChild(s);var a=new mxRectangle(0,0,s.offsetWidth,s.offsetHeight);document.body.removeChild(s);return a},getViewXml:function(t,e,i,n,r){n=n!=null?n:0;r=r!=null?r:0;e=e!=null?e:1;if(i==null){var s=t.getModel();i=[s.getRoot()]}var l=t.getView();var a=null;var o=l.isEventsEnabled();l.setEventsEnabled(false);var h=l.drawPane;var u=l.overlayPane;if(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.canvas.appendChild(l.overlayPane)}else{l.drawPane=l.drawPane.cloneNode(false);l.canvas.appendChild(l.drawPane);l.overlayPane=l.overlayPane.cloneNode(false);l.canvas.appendChild(l.overlayPane)}var d=l.getTranslate();l.translate=new mxPoint(n,r);var p=new mxTemporaryCellStates(t.getView(),e,i);try{var m=new mxCodec;a=m.encode(t.getView())}finally{p.destroy();l.translate=d;l.canvas.removeChild(l.drawPane);l.canvas.removeChild(l.overlayPane);l.drawPane=h;l.overlayPane=u;l.setEventsEnabled(o)}return a},getScaleForPageCount:function(t,e,i,n){if(t<1){return 1}i=i!=null?i:mxConstants.PAGE_FORMAT_A4_PORTRAIT;n=n!=null?n:0;var r=i.width-n*2;var s=i.height-n*2;var l=e.getGraphBounds().clone();var a=e.getView().getScale();l.width/=a;l.height/=a;var o=l.width;var h=l.height;var u=1;var d=r/s;var p=o/h;var m=p/d;var c=Math.sqrt(t);var x=Math.sqrt(m);var f=c*x;var g=c/x;if(f<1&&g>t){var v=g/t;g=t;f/=v}if(g<1&&f>t){var v=f/t;f=t;g/=v}var y=Math.ceil(f)*Math.ceil(g);var C=0;while(y>t){var E=Math.floor(f)/f;var S=Math.floor(g)/g;if(E==1){E=Math.floor(f-1)/f}if(S==1){S=Math.floor(g-1)/g}var v=1;if(E>S){v=E}else{v=S}f=f*v;g=g*v;y=Math.ceil(f)*Math.ceil(g);C++;if(C>10){break}}var b=r*f;u=b/o;return u*.99999},show:function(t,e,i,n,r,s){i=i!=null?i:0;n=n!=null?n:0;if(e==null){var l=window.open();e=l.document}else{e.open()}if(document.documentMode==9){e.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e')}var a=t.getGraphBounds();var o=Math.ceil(i-a.x);var h=Math.ceil(n-a.y);if(r==null){r=Math.ceil(a.width+i)+Math.ceil(Math.ceil(a.x)-a.x)}if(s==null){s=Math.ceil(a.height+n)+Math.ceil(Math.ceil(a.y)-a.y)}if(mxClient.IS_IE||document.documentMode==11){var u="<html><head>";var d=document.getElementsByTagName("base");for(var p=0;p<d.length;p++){u+=d[p].outerHTML}u+="<style>";for(var p=0;p<document.styleSheets.length;p++){try{u+=document.styleSheets[p].cssText}catch(C){}}u+='</style></head><body style="margin:0px;">';u+='<div style="position:absolute;overflow:hidden;width:'+r+"px;height:"+s+'px;"><div style="position:relative;left:'+o+"px;top:"+h+'px;">';u+=t.container.innerHTML;u+="</div></div></body><html>";e.writeln(u);e.close()}else{e.writeln("<html><head>");var d=document.getElementsByTagName("base");for(var p=0;p<d.length;p++){e.writeln(mxUtils.getOuterHtml(d[p]))}var m=document.getElementsByTagName("link");for(var p=0;p<m.length;p++){e.writeln(mxUtils.getOuterHtml(m[p]))}var c=document.getElementsByTagName("style");for(var p=0;p<c.length;p++){e.writeln(mxUtils.getOuterHtml(c[p]))}e.writeln('</head><body style="margin:0px;"></body></html>');e.close();var x=e.createElement("div");x.position="absolute";x.overflow="hidden";x.style.width=r+"px";x.style.height=s+"px";var f=e.createElement("div");f.style.position="absolute";f.style.left=o+"px";f.style.top=h+"px";var g=t.container.firstChild;var v=null;while(g!=null){var y=g.cloneNode(true);if(g==t.view.drawPane.ownerSVGElement){x.appendChild(y);v=y}else{f.appendChild(y)}g=g.nextSibling}e.body.appendChild(x);if(f.firstChild!=null){e.body.appendChild(f)}if(v!=null){v.style.minWidth="";v.style.minHeight="";v.firstChild.setAttribute("transform","translate("+o+","+h+")")}}mxUtils.removeCursors(e.body);return e},printScreen:function(t){var e=window.open();var i=t.getGraphBounds();mxUtils.show(t,e.document);var n=function(){e.focus();e.print();e.close()};if(mxClient.IS_GC){e.setTimeout(n,500)}else{n()}},popup:function(t,e){if(e){var i=document.createElement("div");i.style.overflow="scroll";i.style.width="636px";i.style.height="460px";var n=document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,false).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");i.appendChild(n);var r=document.body.clientWidth;var s=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight);var l=new mxWindow("Popup Window",i,r/2-320,s/2-240,640,480,false,true);l.setClosable(true);l.setVisible(true)}else{if(mxClient.IS_NS){var l=window.open();l.document.writeln("<pre>"+mxUtils.htmlEntities(t)+"</pre");l.document.close()}else{var l=window.open();var n=l.document.createElement("pre");n.innerHTML=mxUtils.htmlEntities(t,false).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");l.document.body.appendChild(n)}}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,e!=null?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,i,n){var r=document.createElement("div");r.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",n||mxUtils.errorImage);s.setAttribute("valign","bottom");s.style.verticalAlign="middle";r.appendChild(s);r.appendChild(document.createTextNode(" "));r.appendChild(document.createTextNode(" "));r.appendChild(document.createTextNode(" "));mxUtils.write(r,t);var l=document.body.clientWidth;var a=document.body.clientHeight||document.documentElement.clientHeight;var o=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,r,(l-e)/2,a/4,e,null,false,true);if(i){mxUtils.br(r);var h=document.createElement("p");var u=document.createElement("button");if(mxClient.IS_IE){u.style.cssText="float:right"}else{u.setAttribute("style","float:right")}mxEvent.addListener(u,"click",(function(t){o.destroy()}));mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource);h.appendChild(u);r.appendChild(h);mxUtils.br(r);o.setClosable(true)}o.setVisible(true);return o},makeDraggable:function(t,e,i,n,r,s,l,a,o,h){var u=new mxDragSource(t,i);u.dragOffset=new mxPoint(r!=null?r:0,s!=null?s:mxConstants.TOOLTIP_VERTICAL_OFFSET);u.autoscroll=l;u.setGuidesEnabled(false);if(o!=null){u.highlightDropTargets=o}if(h!=null){u.getDropTarget=h}u.getGraphForEvent=function(t){return typeof e=="function"?e(t):e};if(n!=null){u.createDragElement=function(){return n.cloneNode(true)};if(a){u.createPreviewElement=function(t){var e=n.cloneNode(true);var i=parseInt(e.style.width);var r=parseInt(e.style.height);e.style.width=Math.round(i*t.view.scale)+"px";e.style.height=Math.round(r*t.view.scale)+"px";return e}}}return u}};__mxOutput.mxUtils=typeof mxUtils!=="undefined"?mxUtils:undefined;var 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_VML:"vml",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:true,EDGE_SELECTION_DASHED:true,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:false,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_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_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};__mxOutput.mxConstants=typeof mxConstants!=="undefined"?mxConstants:undefined;function mxEventObject(t){this.name=t;this.properties=[];for(var e=1;e<arguments.length;e+=2){if(arguments[e+1]!=null){this.properties[arguments[e]]=arguments[e+1]}}}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=false;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(t){return this.properties[t]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=true};__mxOutput.mxEventObject=typeof mxEventObject!=="undefined"?mxEventObject:undefined;function mxMouseEvent(t,e){this.evt=t;this.state=e;this.sourceState=e}mxMouseEvent.prototype.consumed=false;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(t){if(t!=null){return mxUtils.isAncestorNode(t.node,this.getSource())}return false};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};mxMouseEvent.prototype.getState=function(){return this.state};mxMouseEvent.prototype.getCell=function(){var t=this.getState();if(t!=null){return t.cell}return null};mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())};mxMouseEvent.prototype.isConsumed=function(){return this.consumed};mxMouseEvent.prototype.consume=function(t){t=t!=null?t:this.evt.touches!=null||mxEvent.isMouseEvent(this.evt);if(t&&this.evt.preventDefault){this.evt.preventDefault()}if(mxClient.IS_IE){this.evt.returnValue=true}this.consumed=true};__mxOutput.mxMouseEvent=typeof mxMouseEvent!=="undefined"?mxMouseEvent:undefined;function mxEventSource(t){this.setEventSource(t)}mxEventSource.prototype.eventListeners=null;mxEventSource.prototype.eventsEnabled=true;mxEventSource.prototype.eventSource=null;mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled};mxEventSource.prototype.setEventsEnabled=function(t){this.eventsEnabled=t};mxEventSource.prototype.getEventSource=function(){return this.eventSource};mxEventSource.prototype.setEventSource=function(t){this.eventSource=t};mxEventSource.prototype.addListener=function(t,e){if(this.eventListeners==null){this.eventListeners=[]}this.eventListeners.push(t);this.eventListeners.push(e)};mxEventSource.prototype.removeListener=function(t){if(this.eventListeners!=null){var e=0;while(e<this.eventListeners.length){if(this.eventListeners[e+1]==t){this.eventListeners.splice(e,2)}else{e+=2}}}};mxEventSource.prototype.fireEvent=function(t,e){if(this.eventListeners!=null&&this.isEventsEnabled()){if(t==null){t=new mxEventObject}if(e==null){e=this.getEventSource()}if(e==null){e=this}var i=[e,t];for(var n=0;n<this.eventListeners.length;n+=2){var r=this.eventListeners[n];if(r==null||r==t.getName()){this.eventListeners[n+1].apply(this,i)}}}};__mxOutput.mxEventSource=typeof mxEventSource!=="undefined"?mxEventSource:undefined;var mxEvent={addListener:function(){var t=function(t,e,i){if(t.mxListenerList==null){t.mxListenerList=[]}var n={name:e,f:i};t.mxListenerList.push(n)};if(window.addEventListener){return function(e,i,n){e.addEventListener(i,n,false);t(e,i,n)}}else{return function(e,i,n){e.attachEvent("on"+i,n);t(e,i,n)}}}(),removeListener:function(){var t=function(t,e,i){if(t.mxListenerList!=null){var n=t.mxListenerList.length;for(var r=0;r<n;r++){var s=t.mxListenerList[r];if(s.f==i){t.mxListenerList.splice(r,1);break}}if(t.mxListenerList.length==0){t.mxListenerList=null}}};if(window.removeEventListener){return function(e,i,n){e.removeEventListener(i,n,false);t(e,i,n)}}else{return function(e,i,n){e.detachEvent("on"+i,n);t(e,i,n)}}}(),removeAllListeners:function(t){var e=t.mxListenerList;if(e!=null){while(e.length>0){var i=e[0];mxEvent.removeListener(t,i.name,i.f)}}},addGestureListeners:function(t,e,i,n){if(e!=null){mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e)}if(i!=null){mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i)}if(n!=null){mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n)}if(!mxClient.IS_POINTER&&mxClient.IS_TOUCH){if(e!=null){mxEvent.addListener(t,"touchstart",e)}if(i!=null){mxEvent.addListener(t,"touchmove",i)}if(n!=null){mxEvent.addListener(t,"touchend",n)}}},removeGestureListeners:function(t,e,i,n){if(e!=null){mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e)}if(i!=null){mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",i)}if(n!=null){mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",n)}if(!mxClient.IS_POINTER&&mxClient.IS_TOUCH){if(e!=null){mxEvent.removeListener(t,"touchstart",e)}if(i!=null){mxEvent.removeListener(t,"touchmove",i)}if(n!=null){mxEvent.removeListener(t,"touchend",n)}}},redirectMouseEvents:function(t,e,i,n,r,s,l){var a=function(t){return typeof i=="function"?i(t):i};mxEvent.addGestureListeners(t,(function(t){if(n!=null){n(t)}else if(!mxEvent.isConsumed(t)){e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,a(t)))}}),(function(t){if(r!=null){r(t)}else if(!mxEvent.isConsumed(t)){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,a(t)))}}),(function(t){if(s!=null){s(t)}else if(!mxEvent.isConsumed(t)){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,a(t)))}}));mxEvent.addListener(t,"dblclick",(function(t){if(l!=null){l(t)}else if(!mxEvent.isConsumed(t)){var i=a(t);e.dblClick(t,i!=null?i.cell:null)}}))},release:function(t){try{if(t!=null){mxEvent.removeAllListeners(t);var e=t.childNodes;if(e!=null){var i=e.length;for(var n=0;n<i;n+=1){mxEvent.release(e[n])}}}}catch(r){}},addMouseWheelListener:function(t,e){if(t!=null){var i=function(e){if(e==null){e=window.event}if(e.ctrlKey){e.preventDefault()}if(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5){t(e,e.deltaY==0?-e.deltaX>0:-e.deltaY>0)}};e=e!=null?e:window;if(mxClient.IS_SF&&!mxClient.IS_TOUCH){var n=1;mxEvent.addListener(e,"gesturestart",(function(t){mxEvent.consume(t);n=1}));mxEvent.addListener(e,"gesturechange",(function(e){mxEvent.consume(e);var i=n-e.scale;if(Math.abs(i)>.2){t(e,i<0,true);n=e.scale}}));mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}else{var r=[];var s=0;var l=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(t){if(!mxEvent.isMouseEvent(t)&&t.pointerId!=null){r.push(t)}})),mxUtils.bind(this,(function(e){if(!mxEvent.isMouseEvent(e)&&r.length==2){for(var i=0;i<r.length;i++){if(e.pointerId==r[i].pointerId){r[i]=e;break}}var n=Math.abs(r[0].clientX-r[1].clientX);var a=Math.abs(r[0].clientY-r[1].clientY);var o=Math.abs(n-s);var h=Math.abs(a-l);if(o>mxEvent.PINCH_THRESHOLD||h>mxEvent.PINCH_THRESHOLD){var u=r[0].clientX+(r[1].clientX-r[0].clientX)/2;var d=r[0].clientY+(r[1].clientY-r[0].clientY)/2;t(r[0],o>h?n>s:a>l,true,u,d);s=n;l=a}}})),mxUtils.bind(this,(function(t){r=[];s=0;l=0})))}mxEvent.addListener(e,"wheel",i)}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){if(t.preventDefault){t.preventDefault()}return false}))},getSource:function(t){return t.srcElement!=null?t.srcElement:t.target},isConsumed:function(t){return t.isConsumed!=null&&t.isConsumed},isTouchEvent:function(t){return t.pointerType!=null?t.pointerType=="touch"||t.pointerType===t.MSPOINTER_TYPE_TOUCH:t.mozInputSource!=null?t.mozInputSource==5:t.type.indexOf("touch")==0},isPenEvent:function(t){return t.pointerType!=null?t.pointerType=="pen"||t.pointerType===t.MSPOINTER_TYPE_PEN:t.mozInputSource!=null?t.mozInputSource==2:t.type.indexOf("pen")==0},isMultiTouchEvent:function(t){return t.type!=null&&t.type.indexOf("touch")==0&&t.touches!=null&&t.touches.length>1},isMouseEvent:function(t){return t.pointerType!=null?t.pointerType=="mouse"||t.pointerType===t.MSPOINTER_TYPE_MOUSE:t.mozInputSource!=null?t.mozInputSource==1:t.type.indexOf("mouse")==0},isLeftMouseButton:function(t){if("buttons"in t&&(t.type=="mousedown"||t.type=="mousemove")){return t.buttons==1}else if("which"in t){return t.which===1}else{return t.button===1}},isMiddleMouseButton:function(t){if("which"in t){return t.which===2}else{return t.button===4}},isRightMouseButton:function(t){if("which"in t){return t.which===3}else{return t.button===2}},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return t!=null?t.shiftKey:false},isAltDown:function(t){return t!=null?t.altKey:false},isControlDown:function(t){return t!=null?t.ctrlKey:false},isMetaDown:function(t){return t!=null?t.metaKey:false},getMainEvent:function(t){if((t.type=="touchstart"||t.type=="touchmove")&&t.touches!=null&&t.touches[0]!=null){t=t.touches[0]}else if(t.type=="touchend"&&t.changedTouches!=null&&t.changedTouches[0]!=null){t=t.changedTouches[0]}return t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,i){e=e!=null?e:true;i=i!=null?i:true;if(e){if(t.preventDefault){if(i){t.stopPropagation()}t.preventDefault()}else if(i){t.cancelBubble=true}}t.isConsumed=true;if(!t.preventDefault){t.returnValue=false}},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10};__mxOutput.mxEvent=typeof mxEvent!=="undefined"?mxEvent:undefined;function mxXmlRequest(t,e,i,n,r,s){this.url=t;this.params=e;this.method=i||"POST";this.async=n!=null?n:true;this.username=r;this.password=s}mxXmlRequest.prototype.url=null;mxXmlRequest.prototype.params=null;mxXmlRequest.prototype.method=null;mxXmlRequest.prototype.async=null;mxXmlRequest.prototype.binary=false;mxXmlRequest.prototype.withCredentials=false;mxXmlRequest.prototype.username=null;mxXmlRequest.prototype.password=null;mxXmlRequest.prototype.request=null;mxXmlRequest.prototype.decodeSimulateValues=false;mxXmlRequest.prototype.isBinary=function(){return this.binary};mxXmlRequest.prototype.setBinary=function(t){this.binary=t};mxXmlRequest.prototype.getText=function(){return this.request.responseText};mxXmlRequest.prototype.isReady=function(){return this.request.readyState==4};mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();if(t!=null){return t.documentElement}return null};mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;if(document.documentMode>=9||t==null||t.documentElement==null){t=mxUtils.parseXml(this.request.responseText)}return t};mxXmlRequest.prototype.getStatus=function(){return this.request!=null?this.request.status:null};mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest){return function(){var t=new XMLHttpRequest;if(this.isBinary()&&t.overrideMimeType){t.overrideMimeType("text/plain; charset=x-user-defined")}return t}}else if(typeof ActiveXObject!="undefined"){return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}}();mxXmlRequest.prototype.send=function(t,e,i,n){this.request=this.create();if(this.request!=null){if(t!=null){this.request.onreadystatechange=mxUtils.bind(this,(function(){if(this.isReady()){t(this);this.request.onreadystatechange=null}}))}this.request.open(this.method,this.url,this.async,this.username,this.password);this.setRequestHeaders(this.request,this.params);if(window.XMLHttpRequest&&this.withCredentials){this.request.withCredentials="true"}if(!mxClient.IS_QUIRKS&&(document.documentMode==null||document.documentMode>9)&&window.XMLHttpRequest&&i!=null&&n!=null){this.request.timeout=i;this.request.ontimeout=n}this.request.send(this.params)}};mxXmlRequest.prototype.setRequestHeaders=function(t,e){if(e!=null){t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}};mxXmlRequest.prototype.simulate=function(t,e){t=t||document;var i=null;if(t==document){i=window.onbeforeunload;window.onbeforeunload=null}var n=t.createElement("form");n.setAttribute("method",this.method);n.setAttribute("action",this.url);if(e!=null){n.setAttribute("target",e)}n.style.display="none";n.style.visibility="hidden";var r=this.params.indexOf("&")>0?this.params.split("&"):this.params.split();for(var s=0;s<r.length;s++){var l=r[s].indexOf("=");if(l>0){var a=r[s].substring(0,l);var o=r[s].substring(l+1);if(this.decodeSimulateValues){o=decodeURIComponent(o)}var h=t.createElement("textarea");h.setAttribute("wrap","off");h.setAttribute("name",a);mxUtils.write(h,o);n.appendChild(h)}}t.body.appendChild(n);n.submit();if(n.parentNode!=null){n.parentNode.removeChild(n)}if(i!=null){window.onbeforeunload=i}};__mxOutput.mxXmlRequest=typeof mxXmlRequest!=="undefined"?mxXmlRequest:undefined;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return mxClipboard.getCells()==null},cut:function(t,e){e=mxClipboard.copy(t,e);mxClipboard.insertCount=0;mxClipboard.removeCells(t,e);return e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var i=t.getExportableCells(t.model.getTopmostCells(e));mxClipboard.insertCount=1;mxClipboard.setCells(t.cloneCells(i));return i},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var i=mxClipboard.insertCount*mxClipboard.STEPSIZE;var n=t.getDefaultParent();e=t.importCells(e,i,i,n);mxClipboard.insertCount++;t.setSelectionCells(e)}return e}};__mxOutput.mxClipboard=typeof mxClipboard!=="undefined"?mxClipboard:undefined;function mxWindow(t,e,i,n,r,s,l,a,o,h){if(e!=null){l=l!=null?l:true;this.content=e;this.init(i,n,r,s,h);this.installMaximizeHandler();this.installMinimizeHandler();this.installCloseHandler();this.setMinimizable(l);this.setTitle(t);if(a==null||a){this.installMoveHandler()}if(o!=null&&o.parentNode!=null){o.parentNode.replaceChild(this.div,o)}else{document.body.appendChild(this.div)}}}mxWindow.prototype=new mxEventSource;mxWindow.prototype.constructor=mxWindow;mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif";mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif";mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif";mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif";mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif";mxWindow.prototype.visible=false;mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40);mxWindow.prototype.destroyOnClose=true;mxWindow.prototype.contentHeightCorrection=document.documentMode==8||document.documentMode==7?6:2;mxWindow.prototype.title=null;mxWindow.prototype.content=null;mxWindow.prototype.init=function(t,e,i,n,r){r=r!=null?r:"mxWindow";this.div=document.createElement("div");this.div.className=r;this.div.style.left=t+"px";this.div.style.top=e+"px";this.table=document.createElement("table");this.table.className=r;if(mxClient.IS_POINTER){this.div.style.touchAction="none"}if(i!=null){if(!mxClient.IS_QUIRKS){this.div.style.width=i+"px"}this.table.style.width=i+"px"}if(n!=null){if(!mxClient.IS_QUIRKS){this.div.style.height=n+"px"}this.table.style.height=n+"px"}var s=document.createElement("tbody");var l=document.createElement("tr");this.title=document.createElement("td");this.title.className=r+"Title";this.buttons=document.createElement("div");this.buttons.style.position="absolute";this.buttons.style.display="inline-block";this.buttons.style.right="4px";this.buttons.style.top="5px";this.title.appendChild(this.buttons);l.appendChild(this.title);s.appendChild(l);l=document.createElement("tr");this.td=document.createElement("td");this.td.className=r+"Pane";if(document.documentMode==7){this.td.style.height="100%"}this.contentWrapper=document.createElement("div");this.contentWrapper.className=r+"Pane";this.contentWrapper.style.width="100%";this.contentWrapper.appendChild(this.content);if(mxClient.IS_QUIRKS||this.content.nodeName.toUpperCase()!="DIV"){this.contentWrapper.style.height="100%"}this.td.appendChild(this.contentWrapper);l.appendChild(this.td);s.appendChild(l);this.table.appendChild(s);this.div.appendChild(this.table);var a=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,a);mxEvent.addGestureListeners(this.table,a);this.hide()};mxWindow.prototype.setTitle=function(t){var e=this.title.firstChild;while(e!=null){var i=e.nextSibling;if(e.nodeType==mxConstants.NODETYPE_TEXT){e.parentNode.removeChild(e)}e=i}mxUtils.write(this.title,t||"");this.title.appendChild(this.buttons)};mxWindow.prototype.setScrollable=function(t){if(navigator.userAgent==null||navigator.userAgent.indexOf("Presto/2.5")<0){if(t){this.contentWrapper.style.overflow="auto"}else{this.contentWrapper.style.overflow="hidden"}}};mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement());var e=t!=null?t.zIndex:3;if(mxWindow.activeWindow){var i=mxWindow.activeWindow.getElement();if(i!=null&&i.style!=null){i.style.zIndex=e}}var n=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1;mxWindow.activeWindow=this;this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",n))}};mxWindow.prototype.getElement=function(){return this.div};mxWindow.prototype.fit=function(){mxUtils.fit(this.div)};mxWindow.prototype.isResizable=function(){if(this.resize!=null){return this.resize.style.display!="none"}return false};mxWindow.prototype.setResizable=function(t){if(t){if(this.resize==null){this.resize=document.createElement("img");this.resize.style.position="absolute";this.resize.style.bottom="2px";this.resize.style.right="2px";this.resize.setAttribute("src",this.resizeImage);this.resize.style.cursor="nw-resize";var e=null;var i=null;var n=null;var r=null;var s=mxUtils.bind(this,(function(t){this.activate();e=mxEvent.getClientX(t);i=mxEvent.getClientY(t);n=this.div.offsetWidth;r=this.div.offsetHeight;mxEvent.addGestureListeners(document,null,l,a);this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t));mxEvent.consume(t)}));var l=mxUtils.bind(this,(function(t){if(e!=null&&i!=null){var s=mxEvent.getClientX(t)-e;var l=mxEvent.getClientY(t)-i;this.setSize(n+s,r+l);this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t));mxEvent.consume(t)}}));var a=mxUtils.bind(this,(function(t){if(e!=null&&i!=null){e=null;i=null;mxEvent.removeGestureListeners(document,null,l,a);this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t));mxEvent.consume(t)}}));mxEvent.addGestureListeners(this.resize,s,l,a);this.div.appendChild(this.resize)}else{this.resize.style.display="inline"}}else if(this.resize!=null){this.resize.style.display="none"}};mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t);e=Math.max(this.minimumSize.height,e);if(!mxClient.IS_QUIRKS){this.div.style.width=t+"px";this.div.style.height=e+"px"}this.table.style.width=t+"px";this.table.style.height=e+"px";if(!mxClient.IS_QUIRKS){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}};mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"};mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)};mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img");this.minimize.setAttribute("src",this.minimizeImage);this.minimize.setAttribute("title","Minimize");this.minimize.style.cursor="pointer";this.minimize.style.marginLeft="2px";this.minimize.style.display="none";this.buttons.appendChild(this.minimize);var t=false;var e=null;var i=null;var n=mxUtils.bind(this,(function(n){this.activate();if(!t){t=true;this.minimize.setAttribute("src",this.normalizeImage);this.minimize.setAttribute("title","Normalize");this.contentWrapper.style.display="none";e=this.maximize.style.display;this.maximize.style.display="none";i=this.table.style.height;var r=this.getMinimumSize();if(r.height>0){if(!mxClient.IS_QUIRKS){this.div.style.height=r.height+"px"}this.table.style.height=r.height+"px"}if(r.width>0){if(!mxClient.IS_QUIRKS){this.div.style.width=r.width+"px"}this.table.style.width=r.width+"px"}if(this.resize!=null){this.resize.style.visibility="hidden"}this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",n))}else{t=false;this.minimize.setAttribute("src",this.minimizeImage);this.minimize.setAttribute("title","Minimize");this.contentWrapper.style.display="";this.maximize.style.display=e;if(!mxClient.IS_QUIRKS){this.div.style.height=i}this.table.style.height=i;if(this.resize!=null){this.resize.style.visibility=""}this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",n))}mxEvent.consume(n)}));mxEvent.addGestureListeners(this.minimize,n)};mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"};mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img");this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title","Maximize");this.maximize.style.cursor="default";this.maximize.style.marginLeft="2px";this.maximize.style.cursor="pointer";this.maximize.style.display="none";this.buttons.appendChild(this.maximize);var t=false;var e=null;var i=null;var n=null;var r=null;var s=null;var l=mxUtils.bind(this,(function(l){this.activate();if(this.maximize.style.display!="none"){if(!t){t=true;this.maximize.setAttribute("src",this.normalizeImage);this.maximize.setAttribute("title","Normalize");this.contentWrapper.style.display="";s=this.minimize.style.display;this.minimize.style.display="none";e=parseInt(this.div.style.left);i=parseInt(this.div.style.top);n=this.table.style.height;r=this.table.style.width;this.div.style.left="0px";this.div.style.top="0px";var a=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(!mxClient.IS_QUIRKS){this.div.style.width=document.body.clientWidth-2+"px";this.div.style.height=a-2+"px"}this.table.style.width=document.body.clientWidth-2+"px";this.table.style.height=a-2+"px";if(this.resize!=null){this.resize.style.visibility="hidden"}if(!mxClient.IS_QUIRKS){var o=mxUtils.getCurrentStyle(this.contentWrapper);if(o.overflow=="auto"||this.resize!=null){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}}this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",l))}else{t=false;this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title","Maximize");this.contentWrapper.style.display="";this.minimize.style.display=s;this.div.style.left=e+"px";this.div.style.top=i+"px";if(!mxClient.IS_QUIRKS){this.div.style.height=n;this.div.style.width=r;var o=mxUtils.getCurrentStyle(this.contentWrapper);if(o.overflow=="auto"||this.resize!=null){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}}this.table.style.height=n;this.table.style.width=r;if(this.resize!=null){this.resize.style.visibility=""}this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",l))}mxEvent.consume(l)}}));mxEvent.addGestureListeners(this.maximize,l);mxEvent.addListener(this.title,"dblclick",l)};mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move";mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t);var i=mxEvent.getClientY(t);var n=this.getX();var r=this.getY();var s=mxUtils.bind(this,(function(t){var s=mxEvent.getClientX(t)-e;var l=mxEvent.getClientY(t)-i;this.setLocation(n+s,r+l);this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t));mxEvent.consume(t)}));var l=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,s,l);this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t));mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,s,l);this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t));mxEvent.consume(t)})));if(mxClient.IS_POINTER){this.title.style.touchAction="none"}};mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px";this.div.style.top=e+"px"};mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)};mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)};mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img");this.closeImg.setAttribute("src",this.closeImage);this.closeImg.setAttribute("title","Close");this.closeImg.style.marginLeft="2px";this.closeImg.style.cursor="pointer";this.closeImg.style.display="none";this.buttons.appendChild(this.closeImg);mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t));if(this.destroyOnClose){this.destroy()}else{this.setVisible(false)}mxEvent.consume(t)})))};mxWindow.prototype.setImage=function(t){this.image=document.createElement("img");this.image.setAttribute("src",t);this.image.setAttribute("align","left");this.image.style.marginRight="4px";this.image.style.marginLeft="0px";this.image.style.marginTop="-2px";this.title.insertBefore(this.image,this.title.firstChild)};mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"};mxWindow.prototype.isVisible=function(){if(this.div!=null){return this.div.style.display!="none"}return false};mxWindow.prototype.setVisible=function(t){if(this.div!=null&&this.isVisible()!=t){if(t){this.show()}else{this.hide()}}};mxWindow.prototype.show=function(){this.div.style.display="";this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);if(!mxClient.IS_QUIRKS&&(t.overflow=="auto"||this.resize!=null)&&this.contentWrapper.style.display!="none"){this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"}this.fireEvent(new mxEventObject(mxEvent.SHOW))};mxWindow.prototype.hide=function(){this.div.style.display="none";this.fireEvent(new mxEventObject(mxEvent.HIDE))};mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY));if(this.div!=null){mxEvent.release(this.div);this.div.parentNode.removeChild(this.div);this.div=null}this.title=null;this.content=null;this.contentWrapper=null};__mxOutput.mxWindow=typeof mxWindow!=="undefined"?mxWindow:undefined;function mxForm(t){this.table=document.createElement("table");this.table.className=t;this.body=document.createElement("tbody");this.table.appendChild(this.body)}mxForm.prototype.table=null;mxForm.prototype.body=false;mxForm.prototype.getTable=function(){return this.table};mxForm.prototype.addButtons=function(t,e){var i=document.createElement("tr");var n=document.createElement("td");i.appendChild(n);n=document.createElement("td");var r=document.createElement("button");mxUtils.write(r,mxResources.get("ok")||"OK");n.appendChild(r);mxEvent.addListener(r,"click",(function(){t()}));r=document.createElement("button");mxUtils.write(r,mxResources.get("cancel")||"Cancel");n.appendChild(r);mxEvent.addListener(r,"click",(function(){e()}));i.appendChild(n);this.body.appendChild(i)};mxForm.prototype.addText=function(t,e,i){var n=document.createElement("input");n.setAttribute("type",i||"text");n.value=e;return this.addField(t,n)};mxForm.prototype.addCheckbox=function(t,e){var i=document.createElement("input");i.setAttribute("type","checkbox");this.addField(t,i);if(e){i.checked=true}return i};mxForm.prototype.addTextarea=function(t,e,i){var n=document.createElement("textarea");if(mxClient.IS_NS){i--}n.setAttribute("rows",i||2);n.value=e;return this.addField(t,n)};mxForm.prototype.addCombo=function(t,e,i){var n=document.createElement("select");if(i!=null){n.setAttribute("size",i)}if(e){n.setAttribute("multiple","true")}return this.addField(t,n)};mxForm.prototype.addOption=function(t,e,i,n){var r=document.createElement("option");mxUtils.writeln(r,e);r.setAttribute("value",i);if(n){r.setAttribute("selected",n)}t.appendChild(r)};mxForm.prototype.addField=function(t,e){var i=document.createElement("tr");var n=document.createElement("td");mxUtils.write(n,t);i.appendChild(n);n=document.createElement("td");n.appendChild(e);i.appendChild(n);this.body.appendChild(i);return e};__mxOutput.mxForm=typeof mxForm!=="undefined"?mxForm:undefined;function mxImage(t,e,i){this.src=t;this.width=e;this.height=i}mxImage.prototype.src=null;mxImage.prototype.width=null;mxImage.prototype.height=null;__mxOutput.mxImage=typeof mxImage!=="undefined"?mxImage:undefined;function mxDivResizer(t,e){if(t.nodeName.toLowerCase()=="div"){if(e==null){e=window}this.div=t;var i=mxUtils.getCurrentStyle(t);if(i!=null){this.resizeWidth=i.width=="auto";this.resizeHeight=i.height=="auto"}mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){if(!this.handlingResize){this.handlingResize=true;this.resize();this.handlingResize=false}})));this.resize()}}mxDivResizer.prototype.resizeWidth=true;mxDivResizer.prototype.resizeHeight=true;mxDivResizer.prototype.handlingResize=false;mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth();var e=this.getDocumentHeight();var i=parseInt(this.div.style.left);var n=parseInt(this.div.style.right);var r=parseInt(this.div.style.top);var s=parseInt(this.div.style.bottom);if(this.resizeWidth&&!isNaN(i)&&!isNaN(n)&&i>=0&&n>=0&&t-n-i>0){this.div.style.width=t-n-i+"px"}if(this.resizeHeight&&!isNaN(r)&&!isNaN(s)&&r>=0&&s>=0&&e-r-s>0){this.div.style.height=e-r-s+"px"}};mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth};mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight};__mxOutput.mxDivResizer=typeof mxDivResizer!=="undefined"?mxDivResizer:undefined;function mxDragSource(t,e){this.element=t;this.dropHandler=e;mxEvent.addGestureListeners(t,mxUtils.bind(this,(function(t){this.mouseDown(t)})));mxEvent.addListener(t,"dragstart",(function(t){mxEvent.consume(t)}));this.eventConsumer=function(t,e){var i=e.getProperty("eventName");var n=e.getProperty("event");if(i!=mxEvent.MOUSE_DOWN){n.consume()}}}mxDragSource.prototype.element=null;mxDragSource.prototype.dropHandler=null;mxDragSource.prototype.dragOffset=null;mxDragSource.prototype.dragElement=null;mxDragSource.prototype.previewElement=null;mxDragSource.prototype.previewOffset=null;mxDragSource.prototype.enabled=true;mxDragSource.prototype.currentGraph=null;mxDragSource.prototype.currentDropTarget=null;mxDragSource.prototype.currentPoint=null;mxDragSource.prototype.currentGuide=null;mxDragSource.prototype.currentHighlight=null;mxDragSource.prototype.autoscroll=true;mxDragSource.prototype.guidesEnabled=true;mxDragSource.prototype.gridEnabled=true;mxDragSource.prototype.highlightDropTargets=true;mxDragSource.prototype.dragElementZIndex=100;mxDragSource.prototype.dragElementOpacity=70;mxDragSource.prototype.checkEventSource=true;mxDragSource.prototype.isEnabled=function(){return this.enabled};mxDragSource.prototype.setEnabled=function(t){this.enabled=t};mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled};mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t};mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled};mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t};mxDragSource.prototype.getGraphForEvent=function(t){return null};mxDragSource.prototype.getDropTarget=function(t,e,i,n){return t.getCellAt(e,i)};mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(true)};mxDragSource.prototype.createPreviewElement=function(t){return null};mxDragSource.prototype.isActive=function(){return this.mouseMoveHandler!=null};mxDragSource.prototype.reset=function(){if(this.currentGraph!=null){this.dragExit(this.currentGraph);this.currentGraph=null}this.removeDragElement();this.removeListeners();this.stopDrag()};mxDragSource.prototype.mouseDown=function(t){if(this.enabled&&!mxEvent.isConsumed(t)&&this.mouseMoveHandler==null){this.startDrag(t);this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove);this.mouseUpHandler=mxUtils.bind(this,this.mouseUp);mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);if(mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)){this.eventSource=mxEvent.getSource(t);mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)}}};mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t);this.dragElement.style.position="absolute";this.dragElement.style.zIndex=this.dragElementZIndex;mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);if(this.checkEventSource&&mxClient.IS_SVG){this.dragElement.style.pointerEvents="none"}};mxDragSource.prototype.stopDrag=function(){this.removeDragElement()};mxDragSource.prototype.removeDragElement=function(){if(this.dragElement!=null){if(this.dragElement.parentNode!=null){this.dragElement.parentNode.removeChild(this.dragElement)}this.dragElement=null}};mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)};mxDragSource.prototype.graphContainsEvent=function(t,e){var i=mxEvent.getClientX(e);var n=mxEvent.getClientY(e);var r=mxUtils.getOffset(t.container);var s=mxUtils.getScrollOrigin();var l=this.getElementForEvent(e);if(this.checkEventSource){while(l!=null&&l!=t.container){l=l.parentNode}}return l!=null&&i>=r.x-s.x&&n>=r.y-s.y&&i<=r.x-s.x+t.container.offsetWidth&&n<=r.y-s.y+t.container.offsetHeight};mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(e!=null&&!this.graphContainsEvent(e,t)){e=null}if(e!=this.currentGraph){if(this.currentGraph!=null){this.dragExit(this.currentGraph,t)}this.currentGraph=e;if(this.currentGraph!=null){this.dragEnter(this.currentGraph,t)}}if(this.currentGraph!=null){this.dragOver(this.currentGraph,t)}if(this.dragElement!=null&&(this.previewElement==null||this.previewElement.style.visibility!="visible")){var i=mxEvent.getClientX(t);var n=mxEvent.getClientY(t);if(this.dragElement.parentNode==null){document.body.appendChild(this.dragElement)}this.dragElement.style.visibility="visible";if(this.dragOffset!=null){i+=this.dragOffset.x;n+=this.dragOffset.y}var r=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=i+r.x+"px";this.dragElement.style.top=n+r.y+"px"}else if(this.dragElement!=null){this.dragElement.style.visibility="hidden"}mxEvent.consume(t)};mxDragSource.prototype.mouseUp=function(t){if(this.currentGraph!=null){if(this.currentPoint!=null&&(this.previewElement==null||this.previewElement.style.visibility!="hidden")){var e=this.currentGraph.view.scale;var i=this.currentGraph.view.translate;var n=this.currentPoint.x/e-i.x;var r=this.currentPoint.y/e-i.y;this.drop(this.currentGraph,t,this.currentDropTarget,n,r)}this.dragExit(this.currentGraph);this.currentGraph=null}this.stopDrag();this.removeListeners();mxEvent.consume(t)};mxDragSource.prototype.removeListeners=function(){if(this.eventSource!=null){mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler);this.eventSource=null}mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);this.mouseMoveHandler=null;this.mouseUpHandler=null};mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=true;t.isMouseTrigger=mxEvent.isMouseEvent(e);this.previewElement=this.createPreviewElement(t);if(this.previewElement!=null&&this.checkEventSource&&mxClient.IS_SVG){this.previewElement.style.pointerEvents="none"}if(this.isGuidesEnabled()&&this.previewElement!=null){this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())}if(this.highlightDropTargets){this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)}t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)};mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null;this.currentPoint=null;t.isMouseDown=false;t.removeListener(this.eventConsumer);if(this.previewElement!=null){if(this.previewElement.parentNode!=null){this.previewElement.parentNode.removeChild(this.previewElement)}this.previewElement=null}if(this.currentGuide!=null){this.currentGuide.destroy();this.currentGuide=null}if(this.currentHighlight!=null){this.currentHighlight.destroy();this.currentHighlight=null}};mxDragSource.prototype.dragOver=function(t,e){var i=mxUtils.getOffset(t.container);var n=mxUtils.getScrollOrigin(t.container);var r=mxEvent.getClientX(e)-i.x+n.x-t.panDx;var s=mxEvent.getClientY(e)-i.y+n.y-t.panDy;if(t.autoScroll&&(this.autoscroll==null||this.autoscroll)){t.scrollPointToVisible(r,s,t.autoExtend)}if(this.currentHighlight!=null&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,r,s,e);var l=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(l)}if(this.previewElement!=null){if(this.previewElement.parentNode==null){t.container.appendChild(this.previewElement);this.previewElement.style.zIndex="3";this.previewElement.style.position="absolute"}var a=this.isGridEnabled()&&t.isGridEnabledEvent(e);var o=true;if(this.currentGuide!=null&&this.currentGuide.isEnabledForEvent(e)){var h=parseInt(this.previewElement.style.width);var u=parseInt(this.previewElement.style.height);var d=new mxRectangle(0,0,h,u);var p=new mxPoint(r,s);p=this.currentGuide.move(d,p,a,true);o=false;r=p.x;s=p.y}else if(a){var m=t.view.scale;var c=t.view.translate;var x=t.gridSize/2;r=(t.snap(r/m-c.x-x)+c.x)*m;s=(t.snap(s/m-c.y-x)+c.y)*m}if(this.currentGuide!=null&&o){this.currentGuide.hide()}if(this.previewOffset!=null){r+=this.previewOffset.x;s+=this.previewOffset.y}this.previewElement.style.left=Math.round(r)+"px";this.previewElement.style.top=Math.round(s)+"px";this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(r,s)};mxDragSource.prototype.drop=function(t,e,i,n,r){this.dropHandler.apply(this,arguments);if(t.container.style.visibility!="hidden"){t.container.focus()}};__mxOutput.mxDragSource=typeof mxDragSource!=="undefined"?mxDragSource:undefined;function mxToolbar(t){this.container=t}mxToolbar.prototype=new mxEventSource;mxToolbar.prototype.constructor=mxToolbar;mxToolbar.prototype.container=null;mxToolbar.prototype.enabled=true;mxToolbar.prototype.noReset=false;mxToolbar.prototype.updateDefaultMode=true;mxToolbar.prototype.addItem=function(t,e,i,n,r,s){var l=document.createElement(e!=null?"img":"button");var a=r||(s!=null?"mxToolbarMode":"mxToolbarItem");l.className=a;l.setAttribute("src",e);if(t!=null){if(e!=null){l.setAttribute("title",t)}else{mxUtils.write(l,t)}}this.container.appendChild(l);if(i!=null){mxEvent.addListener(l,"click",i);if(mxClient.IS_TOUCH){mxEvent.addListener(l,"touchend",i)}}var o=mxUtils.bind(this,(function(t){if(n!=null){l.setAttribute("src",e)}else{l.style.backgroundColor=""}}));mxEvent.addGestureListeners(l,mxUtils.bind(this,(function(t){if(n!=null){l.setAttribute("src",n)}else{l.style.backgroundColor="gray"}if(s!=null){if(this.menu==null){this.menu=new mxPopupMenu;this.menu.init()}var e=this.currentImg;if(this.menu.isMenuShowing()){this.menu.hideMenu()}if(e!=l){this.currentImg=l;this.menu.factoryMethod=s;var i=new mxPoint(l.offsetLeft,l.offsetTop+l.offsetHeight);this.menu.popup(i.x,i.y,null,t);if(this.menu.isMenuShowing()){l.className=a+"Selected";this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this);l.className=a;this.currentImg=null}}}}})),null,o);mxEvent.addListener(l,"mouseout",o);return l};mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline";e.className="mxToolbarComboContainer";var i=document.createElement("select");i.className=t||"mxToolbarCombo";e.appendChild(i);this.container.appendChild(e);return i};mxToolbar.prototype.addActionCombo=function(t,e){var i=document.createElement("select");i.className=e||"mxToolbarCombo";this.addOption(i,t,null);mxEvent.addListener(i,"change",(function(t){var e=i.options[i.selectedIndex];i.selectedIndex=0;if(e.funct!=null){e.funct(t)}}));this.container.appendChild(i);return i};mxToolbar.prototype.addOption=function(t,e,i){var n=document.createElement("option");mxUtils.writeln(n,e);if(typeof i=="function"){n.funct=i}else{n.setAttribute("value",i)}t.appendChild(n);return n};mxToolbar.prototype.addSwitchMode=function(t,e,i,n,r){var s=document.createElement("img");s.initialClassName=r||"mxToolbarMode";s.className=s.initialClassName;s.setAttribute("src",e);s.altIcon=n;if(t!=null){s.setAttribute("title",t)}mxEvent.addListener(s,"click",mxUtils.bind(this,(function(t){var e=this.selectedMode.altIcon;if(e!=null){this.selectedMode.altIcon=this.selectedMode.getAttribute("src");this.selectedMode.setAttribute("src",e)}else{this.selectedMode.className=this.selectedMode.initialClassName}if(this.updateDefaultMode){this.defaultMode=s}this.selectedMode=s;var e=s.altIcon;if(e!=null){s.altIcon=s.getAttribute("src");s.setAttribute("src",e)}else{s.className=s.initialClassName+"Selected"}this.fireEvent(new mxEventObject(mxEvent.SELECT));i()})));this.container.appendChild(s);if(this.defaultMode==null){this.defaultMode=s;this.selectMode(s);i()}return s};mxToolbar.prototype.addMode=function(t,e,i,n,r,s){s=s!=null?s:true;var l=document.createElement(e!=null?"img":"button");l.initialClassName=r||"mxToolbarMode";l.className=l.initialClassName;l.setAttribute("src",e);l.altIcon=n;if(t!=null){l.setAttribute("title",t)}if(this.enabled&&s){mxEvent.addListener(l,"click",mxUtils.bind(this,(function(t){this.selectMode(l,i);this.noReset=false})));mxEvent.addListener(l,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(l,i);this.noReset=true})));if(this.defaultMode==null){this.defaultMode=l;this.defaultFunction=i;this.selectMode(l,i)}}this.container.appendChild(l);return l};mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){if(this.selectedMode!=null){var i=this.selectedMode.altIcon;if(i!=null){this.selectedMode.altIcon=this.selectedMode.getAttribute("src");this.selectedMode.setAttribute("src",i)}else{this.selectedMode.className=this.selectedMode.initialClassName}}this.selectedMode=t;var i=this.selectedMode.altIcon;if(i!=null){this.selectedMode.altIcon=this.selectedMode.getAttribute("src");this.selectedMode.setAttribute("src",i)}else{this.selectedMode.className=this.selectedMode.initialClassName+"Selected"}this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}};mxToolbar.prototype.resetMode=function(t){if((t||!this.noReset)&&this.selectedMode!=this.defaultMode){this.selectMode(this.defaultMode,this.defaultFunction)}};mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)};mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)};mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px";t.setAttribute("size","1");this.container.appendChild(t)};mxToolbar.prototype.destroy=function(){mxEvent.release(this.container);this.container=null;this.defaultMode=null;this.defaultFunction=null;this.selectedMode=null;if(this.menu!=null){this.menu.destroy()}};__mxOutput.mxToolbar=typeof mxToolbar!=="undefined"?mxToolbar:undefined;function mxUndoableEdit(t,e){this.source=t;this.changes=[];this.significant=e!=null?e:true}mxUndoableEdit.prototype.source=null;mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=false;mxUndoableEdit.prototype.redone=false;mxUndoableEdit.prototype.isEmpty=function(){return this.changes.length==0};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(t){this.changes.push(t)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){};mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));var t=this.changes.length;for(var e=t-1;e>=0;e--){var i=this.changes[e];if(i.execute!=null){i.execute()}else if(i.undo!=null){i.undo()}this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}this.undone=true;this.redone=false;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));var t=this.changes.length;for(var e=0;e<t;e++){var i=this.changes[e];if(i.execute!=null){i.execute()}else if(i.redo!=null){i.redo()}this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",i))}this.undone=false;this.redone=true;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};__mxOutput.mxUndoableEdit=typeof mxUndoableEdit!=="undefined"?mxUndoableEdit:undefined;function mxUndoManager(t){this.size=t!=null?t:100;this.clear()}mxUndoManager.prototype=new mxEventSource;mxUndoManager.prototype.constructor=mxUndoManager;mxUndoManager.prototype.size=null;mxUndoManager.prototype.history=null;mxUndoManager.prototype.indexOfNextAdd=0;mxUndoManager.prototype.isEmpty=function(){return this.history.length==0};mxUndoManager.prototype.clear=function(){this.history=[];this.indexOfNextAdd=0;this.fireEvent(new mxEventObject(mxEvent.CLEAR))};mxUndoManager.prototype.canUndo=function(){return this.indexOfNextAdd>0};mxUndoManager.prototype.undo=function(){while(this.indexOfNextAdd>0){var t=this.history[--this.indexOfNextAdd];t.undo();if(t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}};mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length};mxUndoManager.prototype.redo=function(){var t=this.history.length;while(this.indexOfNextAdd<t){var e=this.history[this.indexOfNextAdd++];e.redo();if(e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",e));break}}};mxUndoManager.prototype.undoableEditHappened=function(t){this.trim();if(this.size>0&&this.size==this.history.length){this.history.shift()}this.history.push(t);this.indexOfNextAdd=this.history.length;this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))};mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd){var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd);for(var e=0;e<t.length;e++){t[e].die()}}};__mxOutput.mxUndoManager=typeof mxUndoManager!=="undefined"?mxUndoManager:undefined;var mxUrlConverter=function(){};mxUrlConverter.prototype.enabled=true;mxUrlConverter.prototype.baseUrl=null;mxUrlConverter.prototype.baseDomain=null;mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host;this.baseUrl=this.baseDomain+location.pathname;var t=this.baseUrl.lastIndexOf("/");if(t>0){this.baseUrl=this.baseUrl.substring(0,t+1)}};mxUrlConverter.prototype.isEnabled=function(){return this.enabled};mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t};mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl};mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t};mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain};mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t};mxUrlConverter.prototype.isRelativeUrl=function(t){return t!=null&&t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"};mxUrlConverter.prototype.convert=function(t){if(this.isEnabled()&&this.isRelativeUrl(t)){if(this.getBaseUrl()==null){this.updateBaseUrl()}if(t.charAt(0)=="/"){t=this.getBaseDomain()+t}else{t=this.getBaseUrl()+t}}return t};__mxOutput.mxUrlConverter=typeof mxUrlConverter!=="undefined"?mxUrlConverter:undefined;function mxPanningManager(t){this.thread=null;this.active=false;this.tdx=0;this.tdy=0;this.t0x=0;this.t0y=0;this.dx=0;this.dy=0;this.scrollbars=false;this.scrollLeft=0;this.scrollTop=0;this.mouseListener={mouseDown:function(t,e){},mouseMove:function(t,e){},mouseUp:mxUtils.bind(this,(function(t,e){if(this.active){this.stop()}}))};t.addMouseListener(this.mouseListener);this.mouseUpListener=mxUtils.bind(this,(function(){if(this.active){this.stop()}}));mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,(function(){this.scrollbars=mxUtils.hasScrollbars(t.container);this.scrollLeft=t.container.scrollLeft;this.scrollTop=t.container.scrollTop;return window.setInterval(mxUtils.bind(this,(function(){this.tdx-=this.dx;this.tdy-=this.dy;if(this.scrollbars){var e=-t.container.scrollLeft-Math.ceil(this.dx);var i=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(e,i);t.panDx=this.scrollLeft-t.container.scrollLeft;t.panDy=this.scrollTop-t.container.scrollTop;t.fireEvent(new mxEventObject(mxEvent.PAN))}else{t.panGraph(this.getDx(),this.getDy())}})),this.delay)}));this.isActive=function(){return active};this.getDx=function(){return Math.round(this.tdx)};this.getDy=function(){return Math.round(this.tdy)};this.start=function(){this.t0x=t.view.translate.x;this.t0y=t.view.translate.y;this.active=true};this.panTo=function(i,n,r,s){if(!this.active){this.start()}this.scrollLeft=t.container.scrollLeft;this.scrollTop=t.container.scrollTop;r=r!=null?r:0;s=s!=null?s:0;var l=t.container;this.dx=i+r-l.scrollLeft-l.clientWidth;if(this.dx<0&&Math.abs(this.dx)<this.border){this.dx=this.border+this.dx}else if(this.handleMouseOut){this.dx=Math.max(this.dx,0)}else{this.dx=0}if(this.dx==0){this.dx=i-l.scrollLeft;if(this.dx>0&&this.dx<this.border){this.dx=this.dx-this.border}else if(this.handleMouseOut){this.dx=Math.min(0,this.dx)}else{this.dx=0}}this.dy=n+s-l.scrollTop-l.clientHeight;if(this.dy<0&&Math.abs(this.dy)<this.border){this.dy=this.border+this.dy}else if(this.handleMouseOut){this.dy=Math.max(this.dy,0)}else{this.dy=0}if(this.dy==0){this.dy=n-l.scrollTop;if(this.dy>0&&this.dy<this.border){this.dy=this.dy-this.border}else if(this.handleMouseOut){this.dy=Math.min(0,this.dy)}else{this.dy=0}}if(this.dx!=0||this.dy!=0){this.dx*=this.damper;this.dy*=this.damper;if(this.thread==null){this.thread=e()}}else if(this.thread!=null){window.clearInterval(this.thread);this.thread=null}};this.stop=function(){if(this.active){this.active=false;if(this.thread!=null){window.clearInterval(this.thread);this.thread=null}this.tdx=0;this.tdy=0;if(!this.scrollbars){var e=t.panDx;var i=t.panDy;if(e!=0||i!=0){t.panGraph(0,0);t.view.setTranslate(this.t0x+e/t.view.scale,this.t0y+i/t.view.scale)}}else{t.panDx=0;t.panDy=0;t.fireEvent(new mxEventObject(mxEvent.PAN))}}};this.destroy=function(){t.removeMouseListener(this.mouseListener);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}mxPanningManager.prototype.damper=1/6;mxPanningManager.prototype.delay=10;mxPanningManager.prototype.handleMouseOut=true;mxPanningManager.prototype.border=0;__mxOutput.mxPanningManager=typeof mxPanningManager!=="undefined"?mxPanningManager:undefined;function mxPopupMenu(t){this.factoryMethod=t;if(t!=null){this.init()}}mxPopupMenu.prototype=new mxEventSource;mxPopupMenu.prototype.constructor=mxPopupMenu;mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif";mxPopupMenu.prototype.zIndex=10006;mxPopupMenu.prototype.factoryMethod=null;mxPopupMenu.prototype.useLeftButtonForPopup=false;mxPopupMenu.prototype.enabled=true;mxPopupMenu.prototype.itemCount=0;mxPopupMenu.prototype.autoExpand=false;mxPopupMenu.prototype.smartSeparators=false;mxPopupMenu.prototype.labels=true;mxPopupMenu.prototype.init=function(){this.table=document.createElement("table");this.table.className="mxPopupMenu";this.tbody=document.createElement("tbody");this.table.appendChild(this.tbody);this.div=document.createElement("div");this.div.className="mxPopupMenu";this.div.style.display="inline";this.div.style.zIndex=this.zIndex;this.div.appendChild(this.table);mxEvent.disableContextMenu(this.div)};mxPopupMenu.prototype.isEnabled=function(){return this.enabled};mxPopupMenu.prototype.setEnabled=function(t){this.enabled=t};mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())};mxPopupMenu.prototype.addItem=function(t,e,i,n,r,s,l,a){n=n||this;this.itemCount++;if(n.willAddSeparator){if(n.containsItems){this.addSeparator(n,true)}n.willAddSeparator=false}n.containsItems=true;var o=document.createElement("tr");o.className="mxPopupMenuItem";var h=document.createElement("td");h.className="mxPopupMenuIcon";if(e!=null){var u=document.createElement("img");u.src=e;h.appendChild(u)}else if(r!=null){var d=document.createElement("div");d.className=r;h.appendChild(d)}o.appendChild(h);if(this.labels){var p=document.createElement("td");p.className="mxPopupMenuItem"+(s!=null&&!s?" mxDisabled":"");mxUtils.write(p,t);p.align="left";o.appendChild(p);var m=document.createElement("td");m.className="mxPopupMenuItem"+(s!=null&&!s?" mxDisabled":"");m.style.paddingRight="6px";m.style.textAlign="right";o.appendChild(m);if(n.div==null){this.createSubmenu(n)}}n.tbody.appendChild(o);if(l!=false&&s!=false){var c=null;mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){this.eventReceiver=o;if(n.activeRow!=o&&n.activeRow!=n){if(n.activeRow!=null&&n.activeRow.div.parentNode!=null){this.hideSubmenu(n)}if(o.div!=null){this.showSubmenu(n,o);n.activeRow=o}}if(document.selection!=null&&(mxClient.IS_QUIRKS||document.documentMode==8)){c=document.selection.createRange()}mxEvent.consume(t)})),mxUtils.bind(this,(function(t){if(n.activeRow!=o&&n.activeRow!=n){if(n.activeRow!=null&&n.activeRow.div.parentNode!=null){this.hideSubmenu(n)}if(this.autoExpand&&o.div!=null){this.showSubmenu(n,o);n.activeRow=o}}if(!a){o.className="mxPopupMenuItemHover"}})),mxUtils.bind(this,(function(t){if(this.eventReceiver==o){if(n.activeRow!=o){this.hideMenu()}if(c!=null){try{c.select()}catch(e){}c=null}if(i!=null){i(t)}}this.eventReceiver=null;mxEvent.consume(t)})));if(!a){mxEvent.addListener(o,"mouseout",mxUtils.bind(this,(function(t){o.className="mxPopupMenuItem"})))}}return o};mxPopupMenu.prototype.addCheckmark=function(t,e){var i=t.firstChild.nextSibling;i.style.backgroundImage="url('"+e+"')";i.style.backgroundRepeat="no-repeat";i.style.backgroundPosition="2px 50%"};mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table");t.table.className="mxPopupMenu";t.tbody=document.createElement("tbody");t.table.appendChild(t.tbody);t.div=document.createElement("div");t.div.className="mxPopupMenu";t.div.style.position="absolute";t.div.style.display="inline";t.div.style.zIndex=this.zIndex;t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage);td=t.firstChild.nextSibling.nextSibling;td.appendChild(e)};mxPopupMenu.prototype.showSubmenu=function(t,e){if(e.div!=null){e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px";e.div.style.top=t.div.offsetTop+e.offsetTop+"px";document.body.appendChild(e.div);var i=parseInt(e.div.offsetLeft);var n=parseInt(e.div.offsetWidth);var r=mxUtils.getDocumentScrollOrigin(document);var s=document.body;var l=document.documentElement;var a=r.x+(s.clientWidth||l.clientWidth);if(i+n>a){e.div.style.left=Math.max(0,t.div.offsetLeft-n+(mxClient.IS_IE?6:-6))+"px"}mxUtils.fit(e.div)}};mxPopupMenu.prototype.addSeparator=function(t,e){t=t||this;if(this.smartSeparators&&!e){t.willAddSeparator=true}else if(t.tbody!=null){t.willAddSeparator=false;var i=document.createElement("tr");var n=document.createElement("td");n.className="mxPopupMenuIcon";n.style.padding="0 0 0 0px";i.appendChild(n);var r=document.createElement("td");r.style.padding="0 0 0 0px";r.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1");r.appendChild(s);i.appendChild(r);t.tbody.appendChild(i)}};mxPopupMenu.prototype.popup=function(t,e,i,n){if(this.div!=null&&this.tbody!=null&&this.factoryMethod!=null){this.div.style.left=t+"px";this.div.style.top=e+"px";while(this.tbody.firstChild!=null){mxEvent.release(this.tbody.firstChild);this.tbody.removeChild(this.tbody.firstChild)}this.itemCount=0;this.factoryMethod(this,i,n);if(this.itemCount>0){this.showMenu();this.fireEvent(new mxEventObject(mxEvent.SHOW))}}};mxPopupMenu.prototype.isMenuShowing=function(){return this.div!=null&&this.div.parentNode==document.body};mxPopupMenu.prototype.showMenu=function(){if(document.documentMode>=9){this.div.style.filter="none"}document.body.appendChild(this.div);mxUtils.fit(this.div)};mxPopupMenu.prototype.hideMenu=function(){if(this.div!=null){if(this.div.parentNode!=null){this.div.parentNode.removeChild(this.div)}this.hideSubmenu(this);this.containsItems=false;this.fireEvent(new mxEventObject(mxEvent.HIDE))}};mxPopupMenu.prototype.hideSubmenu=function(t){if(t.activeRow!=null){this.hideSubmenu(t.activeRow);if(t.activeRow.div.parentNode!=null){t.activeRow.div.parentNode.removeChild(t.activeRow.div)}t.activeRow=null}};mxPopupMenu.prototype.destroy=function(){if(this.div!=null){mxEvent.release(this.div);if(this.div.parentNode!=null){this.div.parentNode.removeChild(this.div)}this.div=null}};__mxOutput.mxPopupMenu=typeof mxPopupMenu!=="undefined"?mxPopupMenu:undefined;function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.graphModelChanged(e.getProperty("edit").changes)}}));this.setGraph(t)}mxAutoSaveManager.prototype=new mxEventSource;mxAutoSaveManager.prototype.constructor=mxAutoSaveManager;mxAutoSaveManager.prototype.graph=null;mxAutoSaveManager.prototype.autoSaveDelay=10;mxAutoSaveManager.prototype.autoSaveThrottle=2;mxAutoSaveManager.prototype.autoSaveThreshold=5;mxAutoSaveManager.prototype.ignoredChanges=0;mxAutoSaveManager.prototype.lastSnapshot=0;mxAutoSaveManager.prototype.enabled=true;mxAutoSaveManager.prototype.changeHandler=null;mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled};mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t};mxAutoSaveManager.prototype.setGraph=function(t){if(this.graph!=null){this.graph.getModel().removeListener(this.changeHandler)}this.graph=t;if(this.graph!=null){this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}};mxAutoSaveManager.prototype.save=function(){};mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=(new Date).getTime();var i=(e-this.lastSnapshot)/1e3;if(i>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&i>this.autoSaveThrottle){this.save();this.reset()}else{this.ignoredChanges++}};mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime();this.ignoredChanges=0};mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)};__mxOutput.mxAutoSaveManager=typeof mxAutoSaveManager!=="undefined"?mxAutoSaveManager:undefined;function mxAnimation(t){this.delay=t!=null?t:20}mxAnimation.prototype=new mxEventSource;mxAnimation.prototype.constructor=mxAnimation;mxAnimation.prototype.delay=null;mxAnimation.prototype.thread=null;mxAnimation.prototype.isRunning=function(){return this.thread!=null};mxAnimation.prototype.startAnimation=function(){if(this.thread==null){this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay)}};mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))};mxAnimation.prototype.stopAnimation=function(){if(this.thread!=null){window.clearInterval(this.thread);this.thread=null;this.fireEvent(new mxEventObject(mxEvent.DONE))}};__mxOutput.mxAnimation=typeof mxAnimation!=="undefined"?mxAnimation:undefined;function mxMorphing(t,e,i,n){mxAnimation.call(this,n);this.graph=t;this.steps=e!=null?e:6;this.ease=i!=null?i:1.5}mxMorphing.prototype=new mxAnimation;mxMorphing.prototype.constructor=mxMorphing;mxMorphing.prototype.graph=null;mxMorphing.prototype.steps=null;mxMorphing.prototype.step=0;mxMorphing.prototype.ease=null;mxMorphing.prototype.cells=null;mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(this.cells!=null){for(var e=0;e<this.cells.length;e++){this.animateCell(this.cells[e],t,false)}}else{this.animateCell(this.graph.getModel().getRoot(),t,true)}this.show(t);if(t.isEmpty()||this.step++>=this.steps){this.stopAnimation()}};mxMorphing.prototype.show=function(t){t.show()};mxMorphing.prototype.animateCell=function(t,e,i){var n=this.graph.getView().getState(t);var r=null;if(n!=null){r=this.getDelta(n);if(this.graph.getModel().isVertex(t)&&(r.x!=0||r.y!=0)){var s=this.graph.view.getTranslate();var l=this.graph.view.getScale();r.x+=s.x*l;r.y+=s.y*l;e.moveState(n,-r.x/this.ease,-r.y/this.ease)}}if(i&&!this.stopRecursion(n,r)){var a=this.graph.getModel().getChildCount(t);for(var o=0;o<a;o++){this.animateCell(this.graph.getModel().getChildAt(t,o),e,i)}}};mxMorphing.prototype.stopRecursion=function(t,e){return e!=null&&(e.x!=0||e.y!=0)};mxMorphing.prototype.getDelta=function(t){var e=this.getOriginForCell(t.cell);var i=this.graph.getView().getTranslate();var n=this.graph.getView().getScale();var r=t.x/n-i.x;var s=t.y/n-i.y;return new mxPoint((e.x-r)*n,(e.y-s)*n)};mxMorphing.prototype.getOriginForCell=function(t){var e=null;if(t!=null){var i=this.graph.getModel().getParent(t);var n=this.graph.getCellGeometry(t);e=this.getOriginForCell(i);if(n!=null){if(n.relative){var r=this.graph.getCellGeometry(i);if(r!=null){e.x+=n.x*r.width;e.y+=n.y*r.height}}else{e.x+=n.x;e.y+=n.y}}}if(e==null){var s=this.graph.view.getTranslate();e=new mxPoint(-s.x,-s.y)}return e};__mxOutput.mxMorphing=typeof mxMorphing!=="undefined"?mxMorphing:undefined;function mxImageBundle(t){this.images=[];this.alt=t!=null?t:false}mxImageBundle.prototype.images=null;mxImageBundle.prototype.alt=null;mxImageBundle.prototype.putImage=function(t,e,i){this.images[t]={value:e,fallback:i}};mxImageBundle.prototype.getImage=function(t){var e=null;if(t!=null){var i=this.images[t];if(i!=null){e=this.alt?i.fallback:i.value}}return e};__mxOutput.mxImageBundle=typeof mxImageBundle!=="undefined"?mxImageBundle:undefined;function mxImageExport(){}mxImageExport.prototype.includeOverlays=false;mxImageExport.prototype.drawState=function(t,e){if(t!=null){this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawCellState.apply(this,arguments)})));if(this.includeOverlays){this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawOverlays.apply(this,arguments)})))}}};mxImageExport.prototype.visitStatesRecursive=function(t,e,i){if(t!=null){i(t,e);var n=t.view.graph;var r=n.model.getChildCount(t.cell);for(var s=0;s<r;s++){var l=n.view.getState(n.model.getChildAt(t.cell,s));this.visitStatesRecursive(l,e,i)}}};mxImageExport.prototype.getLinkForCellState=function(t,e){return null};mxImageExport.prototype.drawCellState=function(t,e){var i=this.getLinkForCellState(t,e);if(i!=null){e.setLink(i)}this.drawShape(t,e);this.drawText(t,e);if(i!=null){e.setLink(null)}};mxImageExport.prototype.drawShape=function(t,e){if(t.shape instanceof mxShape&&t.shape.checkBounds()){e.save();t.shape.beforePaint(e);t.shape.paint(e);t.shape.afterPaint(e);e.restore()}};mxImageExport.prototype.drawText=function(t,e){if(t.text!=null&&t.text.checkBounds()){e.save();t.text.beforePaint(e);t.text.paint(e);t.text.afterPaint(e);e.restore()}};mxImageExport.prototype.drawOverlays=function(t,e){if(t.overlays!=null){t.overlays.visit((function(t,i){if(i instanceof mxShape){i.paint(e)}}))}};__mxOutput.mxImageExport=typeof mxImageExport!=="undefined"?mxImageExport:undefined;function mxAbstractCanvas2D(){this.converter=this.createUrlConverter();this.reset()}mxAbstractCanvas2D.prototype.state=null;mxAbstractCanvas2D.prototype.states=null;mxAbstractCanvas2D.prototype.path=null;mxAbstractCanvas2D.prototype.rotateHtml=true;mxAbstractCanvas2D.prototype.lastX=0;mxAbstractCanvas2D.prototype.lastY=0;mxAbstractCanvas2D.prototype.moveOp="M";mxAbstractCanvas2D.prototype.lineOp="L";mxAbstractCanvas2D.prototype.quadOp="Q";mxAbstractCanvas2D.prototype.curveOp="C";mxAbstractCanvas2D.prototype.closeOp="Z";mxAbstractCanvas2D.prototype.pointerEvents=false;mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter};mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState();this.states=[]};mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:false,dashPattern:"3 3",fixDash:false,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:false,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}};mxAbstractCanvas2D.prototype.format=function(t){return Math.round(parseFloat(t))};mxAbstractCanvas2D.prototype.addOp=function(){if(this.path!=null){this.path.push(arguments[0]);if(arguments.length>2){var t=this.state;for(var e=2;e<arguments.length;e+=2){this.lastX=arguments[e-1];this.lastY=arguments[e];this.path.push(this.format((this.lastX+t.dx)*t.scale));this.path.push(this.format((this.lastY+t.dy)*t.scale))}}}};mxAbstractCanvas2D.prototype.rotatePoint=function(t,e,i,n,r){var s=i*(Math.PI/180);return mxUtils.getRotatedPoint(new mxPoint(t,e),Math.cos(s),Math.sin(s),new mxPoint(n,r))};mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state)};mxAbstractCanvas2D.prototype.restore=function(){if(this.states.length>0){this.state=this.states.pop()}};mxAbstractCanvas2D.prototype.setLink=function(t){};mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t;this.state.strokeWidth*=t};mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t;this.state.dy+=e};mxAbstractCanvas2D.prototype.rotate=function(t,e,i,n,r){};mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t};mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t};mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t};mxAbstractCanvas2D.prototype.setFillColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fillColor=t;this.state.gradientColor=null};mxAbstractCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,l,a,o){var h=this.state;h.fillColor=t;h.gradientFillAlpha=a!=null?a:1;h.gradientColor=e;h.gradientAlpha=o!=null?o:1;h.gradientDirection=l};mxAbstractCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE){t=null}this.state.strokeColor=t};mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t};mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t;this.state.fixDash=e};mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t};mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t};mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t};mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t};mxAbstractCanvas2D.prototype.setFontColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fontColor=t};mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fontBackgroundColor=t};mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){if(t==mxConstants.NONE){t=null}this.state.fontBorderColor=t};mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)};mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t};mxAbstractCanvas2D.prototype.setFontStyle=function(t){if(t==null){t=0}this.state.fontStyle=t};mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t};mxAbstractCanvas2D.prototype.setShadowColor=function(t){if(t==mxConstants.NONE){t=null}this.state.shadowColor=t};mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t};mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t;this.state.shadowDy=e};mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0;this.lastY=0;this.path=[]};mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)};mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)};mxAbstractCanvas2D.prototype.quadTo=function(t,e,i,n){this.addOp(this.quadOp,t,e,i,n)};mxAbstractCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){this.addOp(this.curveOp,t,e,i,n,r,s)};mxAbstractCanvas2D.prototype.arcTo=function(t,e,i,n,r,s,l){var a=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,i,n,r,s,l);if(a!=null){for(var o=0;o<a.length;o+=6){this.curveTo(a[o],a[o+1],a[o+2],a[o+3],a[o+4],a[o+5])}}};mxAbstractCanvas2D.prototype.close=function(t,e,i,n,r,s){this.addOp(this.closeOp)};mxAbstractCanvas2D.prototype.end=function(){};__mxOutput.mxAbstractCanvas2D=typeof mxAbstractCanvas2D!=="undefined"?mxAbstractCanvas2D:undefined;function mxXmlCanvas2D(t){mxAbstractCanvas2D.call(this);this.root=t;this.writeDefaults()}mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D);mxXmlCanvas2D.prototype.textEnabled=true;mxXmlCanvas2D.prototype.compressed=true;mxXmlCanvas2D.prototype.writeDefaults=function(){var t;t=this.createElement("fontfamily");t.setAttribute("family",mxConstants.DEFAULT_FONTFAMILY);this.root.appendChild(t);t=this.createElement("fontsize");t.setAttribute("size",mxConstants.DEFAULT_FONTSIZE);this.root.appendChild(t);t=this.createElement("shadowcolor");t.setAttribute("color",mxConstants.SHADOWCOLOR);this.root.appendChild(t);t=this.createElement("shadowalpha");t.setAttribute("alpha",mxConstants.SHADOW_OPACITY);this.root.appendChild(t);t=this.createElement("shadowoffset");t.setAttribute("dx",mxConstants.SHADOW_OFFSET_X);t.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y);this.root.appendChild(t)};mxXmlCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))};mxXmlCanvas2D.prototype.createElement=function(t){return this.root.ownerDocument.createElement(t)};mxXmlCanvas2D.prototype.save=function(){if(this.compressed){mxAbstractCanvas2D.prototype.save.apply(this,arguments)}this.root.appendChild(this.createElement("save"))};mxXmlCanvas2D.prototype.restore=function(){if(this.compressed){mxAbstractCanvas2D.prototype.restore.apply(this,arguments)}this.root.appendChild(this.createElement("restore"))};mxXmlCanvas2D.prototype.scale=function(t){var e=this.createElement("scale");e.setAttribute("scale",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.translate=function(t,e){var i=this.createElement("translate");i.setAttribute("dx",this.format(t));i.setAttribute("dy",this.format(e));this.root.appendChild(i)};mxXmlCanvas2D.prototype.rotate=function(t,e,i,n,r){var s=this.createElement("rotate");if(t!=0||e||i){s.setAttribute("theta",this.format(t));s.setAttribute("flipH",e?"1":"0");s.setAttribute("flipV",i?"1":"0");s.setAttribute("cx",this.format(n));s.setAttribute("cy",this.format(r));this.root.appendChild(s)}};mxXmlCanvas2D.prototype.setAlpha=function(t){if(this.compressed){if(this.state.alpha==t){return}mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var e=this.createElement("alpha");e.setAttribute("alpha",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setFillAlpha=function(t){if(this.compressed){if(this.state.fillAlpha==t){return}mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var e=this.createElement("fillalpha");e.setAttribute("alpha",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setStrokeAlpha=function(t){if(this.compressed){if(this.state.strokeAlpha==t){return}mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var e=this.createElement("strokealpha");e.setAttribute("alpha",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setFillColor=function(t){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fillColor==t){return}mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var e=this.createElement("fillcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setGradient=function(t,e,i,n,r,s,l,a,o){if(t!=null&&e!=null){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var h=this.createElement("gradient");h.setAttribute("c1",t);h.setAttribute("c2",e);h.setAttribute("x",this.format(i));h.setAttribute("y",this.format(n));h.setAttribute("w",this.format(r));h.setAttribute("h",this.format(s));if(l!=null){h.setAttribute("direction",l)}if(a!=null){h.setAttribute("alpha1",a)}if(o!=null){h.setAttribute("alpha2",o)}this.root.appendChild(h)}};mxXmlCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.strokeColor==t){return}mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var e=this.createElement("strokecolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setStrokeWidth=function(t){if(this.compressed){if(this.state.strokeWidth==t){return}mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var e=this.createElement("strokewidth");e.setAttribute("width",this.format(t));this.root.appendChild(e)};mxXmlCanvas2D.prototype.setDashed=function(t,e){if(this.compressed){if(this.state.dashed==t){return}mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var i=this.createElement("dashed");i.setAttribute("dashed",t?"1":"0");if(e!=null){i.setAttribute("fixDash",e?"1":"0")}this.root.appendChild(i)};mxXmlCanvas2D.prototype.setDashPattern=function(t){if(this.compressed){if(this.state.dashPattern==t){return}mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var e=this.createElement("dashpattern");e.setAttribute("pattern",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setLineCap=function(t){if(this.compressed){if(this.state.lineCap==t){return}mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var e=this.createElement("linecap");e.setAttribute("cap",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setLineJoin=function(t){if(this.compressed){if(this.state.lineJoin==t){return}mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var e=this.createElement("linejoin");e.setAttribute("join",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setMiterLimit=function(t){if(this.compressed){if(this.state.miterLimit==t){return}mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var e=this.createElement("miterlimit");e.setAttribute("limit",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setFontColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fontColor==t){return}mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var e=this.createElement("fontcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontBackgroundColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fontBackgroundColor==t){return}mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var e=this.createElement("fontbackgroundcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontBorderColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE){t=null}if(this.compressed){if(this.state.fontBorderColor==t){return}mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var e=this.createElement("fontbordercolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontSize=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==t){return}mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var e=this.createElement("fontsize");e.setAttribute("size",t);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontFamily=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==t){return}mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var e=this.createElement("fontfamily");e.setAttribute("family",t);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setFontStyle=function(t){if(this.textEnabled){if(t==null){t=0}if(this.compressed){if(this.state.fontStyle==t){return}mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var e=this.createElement("fontstyle");e.setAttribute("style",t);this.root.appendChild(e)}};mxXmlCanvas2D.prototype.setShadow=function(t){if(this.compressed){if(this.state.shadow==t){return}mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var e=this.createElement("shadow");e.setAttribute("enabled",t?"1":"0");this.root.appendChild(e)};mxXmlCanvas2D.prototype.setShadowColor=function(t){if(this.compressed){if(t==mxConstants.NONE){t=null}if(this.state.shadowColor==t){return}mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var e=this.createElement("shadowcolor");e.setAttribute("color",t!=null?t:mxConstants.NONE);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setShadowAlpha=function(t){if(this.compressed){if(this.state.shadowAlpha==t){return}mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var e=this.createElement("shadowalpha");e.setAttribute("alpha",t);this.root.appendChild(e)};mxXmlCanvas2D.prototype.setShadowOffset=function(t,e){if(this.compressed){if(this.state.shadowDx==t&&this.state.shadowDy==e){return}mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var i=this.createElement("shadowoffset");i.setAttribute("dx",t);i.setAttribute("dy",e);this.root.appendChild(i)};mxXmlCanvas2D.prototype.rect=function(t,e,i,n){var r=this.createElement("rect");r.setAttribute("x",this.format(t));r.setAttribute("y",this.format(e));r.setAttribute("w",this.format(i));r.setAttribute("h",this.format(n));this.root.appendChild(r)};mxXmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){var l=this.createElement("roundrect");l.setAttribute("x",this.format(t));l.setAttribute("y",this.format(e));l.setAttribute("w",this.format(i));l.setAttribute("h",this.format(n));l.setAttribute("dx",this.format(r));l.setAttribute("dy",this.format(s));this.root.appendChild(l)};mxXmlCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.createElement("ellipse");r.setAttribute("x",this.format(t));r.setAttribute("y",this.format(e));r.setAttribute("w",this.format(i));r.setAttribute("h",this.format(n));this.root.appendChild(r)};mxXmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r);var o=this.createElement("image");o.setAttribute("x",this.format(t));o.setAttribute("y",this.format(e));o.setAttribute("w",this.format(i));o.setAttribute("h",this.format(n));o.setAttribute("src",r);o.setAttribute("aspect",s?"1":"0");o.setAttribute("flipH",l?"1":"0");o.setAttribute("flipV",a?"1":"0");this.root.appendChild(o)};mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastX=0;this.lastY=0};mxXmlCanvas2D.prototype.moveTo=function(t,e){var i=this.createElement("move");i.setAttribute("x",this.format(t));i.setAttribute("y",this.format(e));this.root.appendChild(i);this.lastX=t;this.lastY=e};mxXmlCanvas2D.prototype.lineTo=function(t,e){var i=this.createElement("line");i.setAttribute("x",this.format(t));i.setAttribute("y",this.format(e));this.root.appendChild(i);this.lastX=t;this.lastY=e};mxXmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.createElement("quad");r.setAttribute("x1",this.format(t));r.setAttribute("y1",this.format(e));r.setAttribute("x2",this.format(i));r.setAttribute("y2",this.format(n));this.root.appendChild(r);this.lastX=i;this.lastY=n};mxXmlCanvas2D.prototype.curveTo=function(t,e,i,n,r,s){var l=this.createElement("curve");l.setAttribute("x1",this.format(t));l.setAttribute("y1",this.format(e));l.setAttribute("x2",this.format(i));l.setAttribute("y2",this.format(n));l.setAttribute("x3",this.format(r));l.setAttribute("y3",this.format(s));this.root.appendChild(l);this.lastX=r;this.lastY=s};mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))};mxXmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,h,u,d,p){if(this.textEnabled&&r!=null){if(mxUtils.isNode(r)){r=mxUtils.getOuterHtml(r)}var m=this.createElement("text");m.setAttribute("x",this.format(t));m.setAttribute("y",this.format(e));m.setAttribute("w",this.format(i));m.setAttribute("h",this.format(n));m.setAttribute("str",r);if(s!=null){m.setAttribute("align",s)}if(l!=null){m.setAttribute("valign",l)}m.setAttribute("wrap",a?"1":"0");if(o==null){o=""}m.setAttribute("format",o);if(h!=null){m.setAttribute("overflow",h)}if(u!=null){m.setAttribute("clip",u?"1":"0")}if(d!=null){m.setAttribute("rotation",d)}if(p!=null){m.setAttribute("dir",p)}this.root.appendChild(m)}};mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))};mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))};mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))};__mxOutput.mxXmlCanvas2D=typeof mxXmlCanvas2D!=="undefined"?mxXmlCanvas2D:undefined;function mxSvgCanvas2D(t,e){mxAbstractCanvas2D.call(this);this.root=t;this.gradients=[];this.defs=null;this.styleEnabled=e!=null?e:false;var i=null;if(t.ownerDocument!=document){var n=t;while(n!=null&&n.nodeName!="svg"){n=n.parentNode}i=n}if(i!=null){var r=i.getElementsByTagName("defs");if(r.length>0){this.defs=i.getElementsByTagName("defs")[0]}if(this.defs==null){this.defs=this.createElement("defs");if(i.firstChild!=null){i.insertBefore(this.defs,i.firstChild)}else{i.appendChild(this.defs)}}if(this.styleEnabled){this.defs.appendChild(this.createStyle())}}}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&typeof DOMParser==="function"&&typeof XMLSerializer==="function";if(mxSvgCanvas2D.prototype.useDomParser){try{var t=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=t!=null}catch(e){mxSvgCanvas2D.prototype.useDomParser=false}}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&document.getElementsByTagName("base").length>0})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=true;mxSvgCanvas2D.prototype.textEnabled=true;mxSvgCanvas2D.prototype.foEnabled=true;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.cacheOffsetSize=true;mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))};mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href;var e=t.lastIndexOf("#");if(e>0){t=t.substring(0,e)}return t};mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments);this.gradients=[]};mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");e.setAttribute("type","text/css");mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}");return e};mxSvgCanvas2D.prototype.createElement=function(t,e){if(this.root.ownerDocument.createElementNS!=null){return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t)}else{var i=this.root.ownerDocument.createElement(t);if(e!=null){i.setAttribute("xmlns",e)}return i}};mxSvgCanvas2D.prototype.getAlternateText=function(t,e,i,n,r,s,l,a,o,h,u,d,p){return s!=null?this.foAltText:null};mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,i,n,r,s,l,a,o,h,u,d,p){var m=this.getAlternateText(t,e,i,n,r,s,l,a,o,h,u,d,p);var c=this.state;if(m!=null&&c.fontSize>0){var x=a==mxConstants.ALIGN_TOP?1:a==mxConstants.ALIGN_BOTTOM?0:.3;var f=l==mxConstants.ALIGN_RIGHT?"end":l==mxConstants.ALIGN_LEFT?"start":"middle";var g=this.createElement("text");g.setAttribute("x",Math.round(e+c.dx));g.setAttribute("y",Math.round(i+c.dy+x*c.fontSize));g.setAttribute("fill",c.fontColor||"black");g.setAttribute("font-family",c.fontFamily);g.setAttribute("font-size",Math.round(c.fontSize)+"px");if(f!="start"){g.setAttribute("text-anchor",f)}if((c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){g.setAttribute("font-weight","bold")}if((c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){g.setAttribute("font-style","italic")}var v=[];if((c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){v.push("underline")}if((c.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){v.push("line-through")}if(v.length>0){g.setAttribute("text-decoration",v.join(" "))}mxUtils.write(g,m);return g}else{return null}};mxSvgCanvas2D.prototype.createGradientId=function(t,e,i,n,r){if(t.charAt(0)=="#"){t=t.substring(1)}if(e.charAt(0)=="#"){e=e.substring(1)}t=t.toLowerCase()+"-"+i;e=e.toLowerCase()+"-"+n;var s=null;if(r==null||r==mxConstants.DIRECTION_SOUTH){s="s"}else if(r==mxConstants.DIRECTION_EAST){s="e"}else{var l=t;t=e;e=l;if(r==mxConstants.DIRECTION_NORTH){s="s"}else if(r==mxConstants.DIRECTION_WEST){s="e"}}return"mx-gradient-"+t+"-"+e+"-"+s};mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,i,n,r){var s=this.createGradientId(t,e,i,n,r);var l=this.gradients[s];if(l==null){var a=this.root.ownerSVGElement;var o=0;var h=s+"-"+o;if(a!=null){l=a.ownerDocument.getElementById(h);while(l!=null&&l.ownerSVGElement!=a){h=s+"-"+o++;l=a.ownerDocument.getElementById(h)}}else{h="id"+ ++this.refCount}if(l==null){l=this.createSvgGradient(t,e,i,n,r);l.setAttribute("id",h);if(this.defs!=null){this.defs.appendChild(l)}else{a.appendChild(l)}}this.gradients[s]=l}return l.getAttribute("id")};mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,i,n,r){var s=this.createElement("linearGradient");s.setAttribute("x1","0%");s.setAttribute("y1","0%");s.setAttribute("x2","0%");s.setAttribute("y2","0%");if(r==null||r==mxConstants.DIRECTION_SOUTH){s.setAttribute("y2","100%")}else if(r==mxConstants.DIRECTION_EAST){s.setAttribute("x2","100%")}else if(r==mxConstants.DIRECTION_NORTH){s.setAttribute("y1","100%")}else if(r==mxConstants.DIRECTION_WEST){s.setAttribute("x1","100%")}var l=i<1?";stop-opacity:"+i:"";var a=this.createElement("stop");a.setAttribute("offset","0%");a.setAttribute("style","stop-color:"+t+l);s.appendChild(a);l=n<1?";stop-opacity:"+n:"";a=this.createElement("stop");a.setAttribute("offset","100%");a.setAttribute("style","stop-color:"+e+l);s.appendChild(a);return s};mxSvgCanvas2D.prototype.addNode=function(t,e){var i=this.node;var n=this.state;if(i!=null){if(i.nodeName=="path"){if(this.path!=null&&this.path.length>0){i.setAttribute("d",this.path.join(" "))}else{return}}if(t&&n.fillColor!=null){this.updateFill()}else if(!this.styleEnabled){if(i.nodeName=="ellipse"&&mxClient.IS_FF){i.setAttribute("fill","transparent")}else{i.setAttribute("fill","none")}t=false}if(e&&n.strokeColor!=null){this.updateStroke()}else if(!this.styleEnabled){i.setAttribute("stroke","none")}if(n.transform!=null&&n.transform.length>0){i.setAttribute("transform",n.transform)}if(n.shadow){this.root.appendChild(this.createShadow(i))}if(this.strokeTolerance>0&&!t){this.root.appendChild(this.createTolerance(i))}if(this.pointerEvents){i.setAttribute("pointer-events",this.pointerEventsValue)}else if(!this.pointerEvents&&this.originalRoot==null){i.setAttribute("pointer-events","none")}if(i.nodeName!="rect"&&i.nodeName!="path"&&i.nodeName!="ellipse"||i.getAttribute("fill")!="none"&&i.getAttribute("fill")!="transparent"||i.getAttribute("stroke")!="none"||i.getAttribute("pointer-events")!="none"){this.root.appendChild(i)}this.node=null}};mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if(t.alpha<1||t.fillAlpha<1){this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha)}if(t.fillColor!=null){if(t.gradientColor!=null){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var i=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+i+"#"+e+")")}else{this.node.setAttribute("fill","url(#"+e+")")}}else{this.node.setAttribute("fill",String(t.fillColor).toLowerCase())}}};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase());if(t.alpha<1||t.strokeAlpha<1){this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha)}var e=this.getCurrentStrokeWidth();if(e!=1){this.node.setAttribute("stroke-width",e)}if(this.node.nodeName=="path"){this.updateStrokeAttributes()}if(t.dashed){this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))}};mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(t.lineJoin!=null&&t.lineJoin!="miter"){this.node.setAttribute("stroke-linejoin",t.lineJoin)}if(t.lineCap!=null){var e=t.lineCap;if(e=="flat"){e="butt"}if(e!="butt"){this.node.setAttribute("stroke-linecap",e)}}if(t.miterLimit!=null&&(!this.styleEnabled||t.miterLimit!=10)){this.node.setAttribute("stroke-miterlimit",t.miterLimit)}};mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if(typeof this.state.dashPattern==="string"){var i=this.state.dashPattern.split(" ");if(i.length>0){for(var n=0;n<i.length;n++){e[n]=Number(i[n])*t}}}return e.join(" ")};mxSvgCanvas2D.prototype.createTolerance=function(t){var e=t.cloneNode(true);var i=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;e.setAttribute("pointer-events","stroke");e.setAttribute("visibility","hidden");e.removeAttribute("stroke-dasharray");e.setAttribute("stroke-width",i);e.setAttribute("fill","none");e.setAttribute("stroke",mxClient.IS_OT?"none":"white");return e};mxSvgCanvas2D.prototype.createShadow=function(t){var e=t.cloneNode(true);var i=this.state;if(e.getAttribute("fill")!="none"&&(!mxClient.IS_FF||e.getAttribute("fill")!="transparent")){e.setAttribute("fill",i.shadowColor)}if(e.getAttribute("stroke")!="none"){e.setAttribute("stroke",i.shadowColor)}e.setAttribute("transform","translate("+this.format(i.shadowDx*i.scale)+","+this.format(i.shadowDy*i.scale)+")"+(i.transform||""));e.setAttribute("opacity",i.shadowAlpha);return e};mxSvgCanvas2D.prototype.setLink=function(t){if(t==null){this.root=this.originalRoot}else{this.originalRoot=this.root;var e=this.createElement("a");if(e.setAttributeNS==null||this.root.ownerDocument!=document&&document.documentMode==null){e.setAttribute("xlink:href",t)}else{e.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",t)}this.root.appendChild(e);this.root=e}};mxSvgCanvas2D.prototype.rotate=function(t,e,i,n,r){if(t!=0||e||i){var s=this.state;n+=s.dx;r+=s.dy;n*=s.scale;r*=s.scale;s.transform=s.transform||"";if(e&&i){t+=180}else if(e!=i){var l=e?n:0;var a=e?-1:1;var o=i?r:0;var h=i?-1:1;s.transform+="translate("+this.format(l)+","+this.format(o)+")"+"scale("+this.format(a)+","+this.format(h)+")"+"translate("+this.format(-l)+","+this.format(-o)+")"}if(e?!i:i){t*=-1}if(t!=0){s.transform+="rotate("+this.format(t)+","+this.format(n)+","+this.format(r)+")"}s.rotation=s.rotation+t;s.rotationCx=n;s.rotationCy=r}};mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createElement("path")};mxSvgCanvas2D.prototype.rect=function(t,e,i,n){var r=this.state;var s=this.createElement("rect");s.setAttribute("x",this.format((t+r.dx)*r.scale));s.setAttribute("y",this.format((e+r.dy)*r.scale));s.setAttribute("width",this.format(i*r.scale));s.setAttribute("height",this.format(n*r.scale));this.node=s};mxSvgCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.rect(t,e,i,n);if(r>0){this.node.setAttribute("rx",this.format(r*this.state.scale))}if(s>0){this.node.setAttribute("ry",this.format(s*this.state.scale))}};mxSvgCanvas2D.prototype.ellipse=function(t,e,i,n){var r=this.state;var s=this.createElement("ellipse");s.setAttribute("cx",this.format((t+i/2+r.dx)*r.scale));s.setAttribute("cy",this.format((e+n/2+r.dy)*r.scale));s.setAttribute("rx",i/2*r.scale);s.setAttribute("ry",n/2*r.scale);this.node=s};mxSvgCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){r=this.converter.convert(r);s=s!=null?s:true;l=l!=null?l:false;a=a!=null?a:false;var o=this.state;t+=o.dx;e+=o.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*o.scale)+this.imageOffset);h.setAttribute("y",this.format(e*o.scale)+this.imageOffset);h.setAttribute("width",this.format(i*o.scale));h.setAttribute("height",this.format(n*o.scale));if(h.setAttributeNS==null){h.setAttribute("xlink:href",r)}else{h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",r)}if(!s){h.setAttribute("preserveAspectRatio","none")}if(o.alpha<1||o.fillAlpha<1){h.setAttribute("opacity",o.alpha*o.fillAlpha)}var u=this.state.transform||"";if(l||a){var d=1;var p=1;var m=0;var c=0;if(l){d=-1;m=-i-2*t}if(a){p=-1;c=-n-2*e}u+="scale("+d+","+p+")translate("+m*o.scale+","+c*o.scale+")"}if(u.length>0){h.setAttribute("transform",u)}if(!this.pointerEvents){h.setAttribute("pointer-events","none")}this.root.appendChild(h)};mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");if(e!=null){t=(new XMLSerializer).serializeToString(e.body);if(t.substring(0,5)=="<body"){t=t.substring(t.indexOf(">",5)+1)}if(t.substring(t.length-7,t.length)=="</body>"){t=t.substring(0,t.length-7)}}}else if(document.implementation!=null&&document.implementation.createDocument!=null){var i=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);var n=i.createElement("body");i.documentElement.appendChild(n);var r=document.createElement("div");r.innerHTML=t;var s=r.firstChild;while(s!=null){var l=s.nextSibling;n.appendChild(i.adoptNode(s));s=l}return n.innerHTML}else{var a=document.createElement("textarea");a.innerHTML=t.replace(/&amp;/g,"&amp;amp;").replace(/&#60;/g,"&amp;lt;").replace(/&#62;/g,"&amp;gt;").replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;");t=a.value.replace(/&/g,"&amp;").replace(/&amp;lt;/g,"&lt;").replace(/&amp;gt;/g,"&gt;").replace(/&amp;amp;/g,"&amp;").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return t};mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(!mxUtils.isNode(e)){e="<div><div>"+this.convertHtml(e)+"</div></div>"}if(!mxClient.IS_IE&&!mxClient.IS_IE11&&document.createElementNS){var i=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var n=document.createElement("div");var r=n.cloneNode(false);if(this.root.ownerDocument!=document){n.appendChild(e.cloneNode(true))}else{n.appendChild(e)}r.appendChild(n);i.appendChild(r)}else{i.innerHTML=e}return i}else{if(mxUtils.isNode(e)){e="<div><div>"+mxUtils.getXml(e)+"</div></div>"}e='<div xmlns="http://www.w3.org/1999/xhtml">'+e+"</div>";return mxUtils.parseXml(e).documentElement}};mxSvgCanvas2D.prototype.updateText=function(t,e,i,n,r,s,l,a,o,h,u){if(u!=null&&u.firstChild!=null&&u.firstChild.firstChild!=null){this.updateTextNodes(t,e,i,n,r,s,l,a,o,h,u.firstChild)}};mxSvgCanvas2D.prototype.addForeignObject=function(t,e,i,n,r,s,l,a,o,h,u,d,p,m,c){var x=this.createElement("g");var f=this.createElement("foreignObject");f.setAttribute("style","overflow: visible; text-align: left;");f.setAttribute("pointer-events","none");if(m.ownerDocument!=document){m=mxUtils.importNodeImplementation(f.ownerDocument,m,true)}f.appendChild(m);x.appendChild(f);this.updateTextNodes(t,e,i,n,s,l,a,h,u,d,x);if(this.root.ownerDocument!=document){var g=this.createAlternateContent(f,t,e,i,n,r,s,l,a,o,h,u,d);if(g!=null){f.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var v=this.createElement("switch");v.appendChild(f);v.appendChild(g);x.appendChild(v)}}c.appendChild(x)};mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,i,n,r,s,l,a,o,h,u){var d=this.state.scale;mxSvgCanvas2D.createCss(i+2,n,r,s,l,a,o,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(s==mxConstants.ALIGN_TOP?"flex-start":s==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; "+"justify-content: unsafe "+(r==mxConstants.ALIGN_LEFT?"flex-start":r==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),d,mxUtils.bind(this,(function(i,n,r,s,l){t+=this.state.dx;e+=this.state.dy;var a=u.firstChild;var o=a.firstChild;var p=o.firstChild;var m=p.firstChild;var c=(this.rotateHtml?this.state.rotation:0)+(h!=null?h:0);var x=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(d!=1?"scale("+d+")":"");m.setAttribute("style",l);p.setAttribute("style",s);a.setAttribute("width",Math.ceil(1/Math.min(1,d)*100)+"%");a.setAttribute("height",Math.ceil(1/Math.min(1,d)*100)+"%");var f=Math.round(e+n);if(f<0){a.setAttribute("y",f)}else{a.removeAttribute("y");r+="padding-top: "+f+"px; "}o.setAttribute("style",r+"margin-left: "+Math.round(t+i)+"px;");x+=c!=0?"rotate("+c+" "+t+" "+e+")":"";if(x!=""){u.setAttribute("transform",x)}else{u.removeAttribute("transform")}if(this.state.alpha!=1){u.setAttribute("opacity",this.state.alpha)}else{u.removeAttribute("opacity")}})))};mxSvgCanvas2D.createCss=function(t,e,i,n,r,s,l,a,o,h,u,d,p){var m="box-sizing: border-box; font-size: 0; text-align: "+(i==mxConstants.ALIGN_LEFT?"left":i==mxConstants.ALIGN_RIGHT?"right":"center")+"; ";var c=mxUtils.getAlignmentAsPoint(i,n);var x="overflow: hidden; ";var f="width: 1px; ";var g="height: 1px; ";var v=c.x*t;var y=c.y*e;if(l){f="width: "+Math.round(t)+"px; ";m+="max-height: "+Math.round(e)+"px; ";y=0}else if(s=="fill"){f="width: "+Math.round(t)+"px; ";g="height: "+Math.round(e)+"px; ";u+="width: 100%; height: 100%; ";m+=f+g}else if(s=="width"){f="width: "+Math.round(t)+"px; ";u+="width: 100%; ";m+=f;y=0;if(e>0){m+="max-height: "+Math.round(e)+"px; "}}else{x="";y=0}var C="";if(a!=null){C+="background-color: "+a+"; "}if(o!=null){C+="border: 1px solid "+o+"; "}if(x==""||l){u+=C}else{m+=C}if(r&&t>0){u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ";f="width: "+Math.round(t)+"px; ";if(x!=""&&s!="fill"){y=0}}else{u+="white-space: nowrap; ";if(x==""){v=0}}p(v,y,h+f+g,m+x,u,x)};mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state;var e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection;var i="display: inline-block; font-size: "+t.fontSize+"px; "+"font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"none")+"; ";if((t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){i+="font-weight: bold; "}if((t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){i+="font-style: italic; "}var n=[];if((t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){n.push("underline")}if((t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){n.push("line-through")}if(n.length>0){i+="text-decoration: "+n.join(" ")+"; "}return i};mxSvgCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,h,u,d,p){if(this.textEnabled&&r!=null){d=d!=null?d:0;if(this.foEnabled&&o=="html"){var m=this.createDiv(r);if(m!=null){if(p!=null){m.setAttribute("dir",p)}this.addForeignObject(t,e,i,n,r,s,l,a,o,h,u,d,p,m,this.root)}}else{this.plainText(t+this.state.dx,e+this.state.dy,i,n,r,s,l,a,h,u,d,p)}}};mxSvgCanvas2D.prototype.createClip=function(t,e,i,n){t=Math.round(t);e=Math.round(e);i=Math.round(i);n=Math.round(n);var r="mx-clip-"+t+"-"+e+"-"+i+"-"+n;var s=0;var l=r+"-"+s;while(document.getElementById(l)!=null){l=r+"-"+ ++s}clip=this.createElement("clipPath");clip.setAttribute("id",l);var a=this.createElement("rect");a.setAttribute("x",t);a.setAttribute("y",e);a.setAttribute("width",i);a.setAttribute("height",n);clip.appendChild(a);return clip};mxSvgCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,h,u,d){u=u!=null?u:0;var p=this.state;var m=p.fontSize;var c=this.createElement("g");var x=p.transform||"";this.updateFont(c);if(!this.pointerEvents&&this.originalRoot==null){c.setAttribute("pointer-events","none")}if(u!=0){x+="rotate("+u+","+this.format(t*p.scale)+","+this.format(e*p.scale)+")"}if(d!=null){c.setAttribute("direction",d)}if(h&&i>0&&n>0){var f=t;var g=e;if(s==mxConstants.ALIGN_CENTER){f-=i/2}else if(s==mxConstants.ALIGN_RIGHT){f-=i}if(o!="fill"){if(l==mxConstants.ALIGN_MIDDLE){g-=n/2}else if(l==mxConstants.ALIGN_BOTTOM){g-=n}}var v=this.createClip(f*p.scale-2,g*p.scale-2,i*p.scale+4,n*p.scale+4);if(this.defs!=null){this.defs.appendChild(v)}else{this.root.appendChild(v)}if(!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var y=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c.setAttribute("clip-path","url("+y+"#"+v.getAttribute("id")+")")}else{c.setAttribute("clip-path","url(#"+v.getAttribute("id")+")")}}var C=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";if(C!="start"){c.setAttribute("text-anchor",C)}if(!this.styleEnabled||m!=mxConstants.DEFAULT_FONTSIZE){c.setAttribute("font-size",m*p.scale+"px")}if(x.length>0){c.setAttribute("transform",x)}if(p.alpha<1){c.setAttribute("opacity",p.alpha)}var E=r.split("\n");var S=Math.round(m*mxConstants.LINE_HEIGHT);var b=m+(E.length-1)*S;var g=e+m-1;if(l==mxConstants.ALIGN_MIDDLE){if(o=="fill"){g-=n/2}else{var w=(this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b)/2;g-=w}}else if(l==mxConstants.ALIGN_BOTTOM){if(o=="fill"){g-=n}else{var w=this.matchHtmlAlignment&&h&&n>0?Math.min(b,n):b;g-=w+1}}for(var T=0;T<E.length;T++){if(E[T].length>0&&mxUtils.trim(E[T]).length>0){var L=this.createElement("text");L.setAttribute("x",this.format(t*p.scale)+this.textOffset);L.setAttribute("y",this.format(g*p.scale)+this.textOffset);mxUtils.write(L,E[T]);c.appendChild(L)}g+=S}this.root.appendChild(c);this.addTextBackground(c,r,t,e,i,o=="fill"?n:b,s,l,o)};mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor);if(!this.styleEnabled||e.fontFamily!=mxConstants.DEFAULT_FONTFAMILY){t.setAttribute("font-family",e.fontFamily)}if((e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){t.setAttribute("font-weight","bold")}if((e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){t.setAttribute("font-style","italic")}var i=[];if((e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){i.push("underline")}if((e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){i.push("line-through")}if(i.length>0){t.setAttribute("text-decoration",i.join(" "))}};mxSvgCanvas2D.prototype.addTextBackground=function(t,e,i,n,r,s,l,a,o){var h=this.state;if(h.fontBackgroundColor!=null||h.fontBorderColor!=null){var u=null;if(o=="fill"||o=="width"){if(l==mxConstants.ALIGN_CENTER){i-=r/2}else if(l==mxConstants.ALIGN_RIGHT){i-=r}if(a==mxConstants.ALIGN_MIDDLE){n-=s/2}else if(a==mxConstants.ALIGN_BOTTOM){n-=s}u=new mxRectangle((i+1)*h.scale,n*h.scale,(r-2)*h.scale,(s+2)*h.scale)}else if(t.getBBox!=null&&this.root.ownerDocument==document){try{u=t.getBBox();var d=mxClient.IS_IE&&mxClient.IS_SVG;u=new mxRectangle(u.x,u.y+(d?0:1),u.width,u.height+(d?1:0))}catch(x){}}if(u==null||u.width==0||u.height==0){var p=document.createElement("div");p.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;p.style.fontSize=h.fontSize+"px";p.style.fontFamily=h.fontFamily;p.style.whiteSpace="nowrap";p.style.position="absolute";p.style.visibility="hidden";p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";p.style.zoom="1";if((h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){p.style.fontWeight="bold"}if((h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){p.style.fontStyle="italic"}e=mxUtils.htmlEntities(e,false);p.innerHTML=e.replace(/\n/g,"<br/>");document.body.appendChild(p);var r=p.offsetWidth;var s=p.offsetHeight;p.parentNode.removeChild(p);if(l==mxConstants.ALIGN_CENTER){i-=r/2}else if(l==mxConstants.ALIGN_RIGHT){i-=r}if(a==mxConstants.ALIGN_MIDDLE){n-=s/2}else if(a==mxConstants.ALIGN_BOTTOM){n-=s}u=new mxRectangle((i+1)*h.scale,(n+2)*h.scale,r*h.scale,(s+1)*h.scale)}if(u!=null){var m=this.createElement("rect");m.setAttribute("fill",h.fontBackgroundColor||"none");m.setAttribute("stroke",h.fontBorderColor||"none");m.setAttribute("x",Math.floor(u.x-1));m.setAttribute("y",Math.floor(u.y-1));m.setAttribute("width",Math.ceil(u.width+2));m.setAttribute("height",Math.ceil(u.height));var c=h.fontBorderColor!=null?Math.max(1,this.format(h.scale)):0;m.setAttribute("stroke-width",c);if(this.root.ownerDocument==document&&mxUtils.mod(c,2)==1){m.setAttribute("transform","translate(0.5, 0.5)")}t.insertBefore(m,t.firstChild)}}};mxSvgCanvas2D.prototype.stroke=function(){this.addNode(false,true)};mxSvgCanvas2D.prototype.fill=function(){this.addNode(true,false)};mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(true,true)};__mxOutput.mxSvgCanvas2D=typeof mxSvgCanvas2D!=="undefined"?mxSvgCanvas2D:undefined;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this);this.root=t};mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D);mxVmlCanvas2D.prototype.node=null;mxVmlCanvas2D.prototype.textEnabled=true;mxVmlCanvas2D.prototype.moveOp="m";mxVmlCanvas2D.prototype.lineOp="l";mxVmlCanvas2D.prototype.curveOp="c";mxVmlCanvas2D.prototype.closeOp="x";mxVmlCanvas2D.prototype.rotatedHtmlBackground="";mxVmlCanvas2D.prototype.vmlScale=1;mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)};mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)};mxVmlCanvas2D.prototype.addNode=function(t,e){var i=this.node;var n=this.state;if(i!=null){if(i.nodeName=="shape"){if(this.path!=null&&this.path.length>0){i.path=this.path.join(" ")+" e";i.style.width=this.root.style.width;i.style.height=this.root.style.height;i.coordsize=parseInt(i.style.width)+" "+parseInt(i.style.height)}else{return}}i.strokeweight=this.format(Math.max(1,n.strokeWidth*n.scale/this.vmlScale))+"px";if(n.shadow){this.root.appendChild(this.createShadow(i,t&&n.fillColor!=null,e&&n.strokeColor!=null))}if(e&&n.strokeColor!=null){i.stroked="true";i.strokecolor=n.strokeColor}else{i.stroked="false"}i.appendChild(this.createStroke());if(t&&n.fillColor!=null){i.appendChild(this.createFill())}else if(this.pointerEvents&&(i.nodeName!="shape"||this.path[this.path.length-1]==this.closeOp)){i.appendChild(this.createTransparentFill())}else{i.filled="false"}this.root.appendChild(i)}};mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");t.src=mxClient.imageBasePath+"/transparent.gif";t.type="tile";return t};mxVmlCanvas2D.prototype.createFill=function(){var t=this.state;var e=this.createVmlElement("fill");e.color=t.fillColor;if(t.gradientColor!=null){e.type="gradient";e.method="none";e.color2=t.gradientColor;var i=180-t.rotation;if(t.gradientDirection==mxConstants.DIRECTION_WEST){i-=90+(this.root.style.flip=="x"?180:0)}else if(t.gradientDirection==mxConstants.DIRECTION_EAST){i+=90+(this.root.style.flip=="x"?180:0)}else if(t.gradientDirection==mxConstants.DIRECTION_NORTH){i-=180+(this.root.style.flip=="y"?-180:0)}else{i+=this.root.style.flip=="y"?-180:0}if(this.root.style.flip=="x"||this.root.style.flip=="y"){i*=-1}e.angle=mxUtils.mod(i,360);e.opacity=t.alpha*t.gradientFillAlpha*100+"%";e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else if(t.alpha<1||t.fillAlpha<1){e.opacity=t.alpha*t.fillAlpha*100+"%"}return e};mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state;var e=this.createVmlElement("stroke");e.endcap=t.lineCap||"flat";e.joinstyle=t.lineJoin||"miter";e.miterlimit=t.miterLimit||"10";if(t.alpha<1||t.strokeAlpha<1){e.opacity=t.alpha*t.strokeAlpha*100+"%"}if(t.dashed){e.dashstyle=this.getVmlDashStyle()}return e};mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if(typeof this.state.dashPattern==="string"){var e=this.state.dashPattern.split(" ");if(e.length>0&&e[0]==1){t="0 2"}}return t};mxVmlCanvas2D.prototype.createShadow=function(t,e,i){var n=this.state;var r=-n.rotation*(Math.PI/180);var s=Math.cos(r);var l=Math.sin(r);var a=n.shadowDx*n.scale;var o=n.shadowDy*n.scale;if(this.root.style.flip=="x"){a*=-1}else if(this.root.style.flip=="y"){o*=-1}var h=t.cloneNode(true);h.style.marginLeft=Math.round(a*s-o*l)+"px";h.style.marginTop=Math.round(a*l+o*s)+"px";if(document.documentMode==8){h.strokeweight=t.strokeweight;if(t.nodeName=="shape"){h.path=this.path.join(" ")+" e";h.style.width=this.root.style.width;h.style.height=this.root.style.height;h.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height)}}if(i){h.strokecolor=n.shadowColor;h.appendChild(this.createShadowStroke())}else{h.stroked="false"}if(e){h.appendChild(this.createShadowFill())}else{h.filled="false"}return h};mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");t.color=this.state.shadowColor;t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%";return t};mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%";return t};mxVmlCanvas2D.prototype.rotate=function(t,e,i,n,r){if(e&&i){t+=180}else if(e){this.root.style.flip="x"}else if(i){this.root.style.flip="y"}if(e?!i:i){t*=-1}this.root.style.rotation=t;this.state.rotation=this.state.rotation+t;this.state.rotationCx=n;this.state.rotationCy=r};mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createVmlElement("shape");this.node.style.position="absolute"};mxVmlCanvas2D.prototype.quadTo=function(t,e,i,n){var r=this.state;var s=(this.lastX+r.dx)*r.scale;var l=(this.lastY+r.dy)*r.scale;var a=(t+r.dx)*r.scale;var o=(e+r.dy)*r.scale;var h=(i+r.dx)*r.scale;var u=(n+r.dy)*r.scale;var d=s+2/3*(a-s);var p=l+2/3*(o-l);var m=h+2/3*(a-h);var c=u+2/3*(o-u);this.path.push("c "+this.format(d)+" "+this.format(p)+" "+this.format(m)+" "+this.format(c)+" "+this.format(h)+" "+this.format(u));this.lastX=h/r.scale-r.dx;this.lastY=u/r.scale-r.dy};mxVmlCanvas2D.prototype.createRect=function(t,e,i,n,r){var s=this.state;var l=this.createVmlElement(t);l.style.position="absolute";l.style.left=this.format((e+s.dx)*s.scale)+"px";l.style.top=this.format((i+s.dy)*s.scale)+"px";l.style.width=this.format(n*s.scale)+"px";l.style.height=this.format(r*s.scale)+"px";return l};mxVmlCanvas2D.prototype.rect=function(t,e,i,n){this.node=this.createRect("rect",t,e,i,n)};mxVmlCanvas2D.prototype.roundrect=function(t,e,i,n,r,s){this.node=this.createRect("roundrect",t,e,i,n);this.node.setAttribute("arcsize",Math.max(r*100/i,s*100/n)+"%")};mxVmlCanvas2D.prototype.ellipse=function(t,e,i,n){this.node=this.createRect("oval",t,e,i,n)};mxVmlCanvas2D.prototype.image=function(t,e,i,n,r,s,l,a){var o=null;if(!s){o=this.createRect("image",t,e,i,n);o.src=r}else{o=this.createRect("rect",t,e,i,n);o.stroked="false";var h=this.createVmlElement("fill");h.aspect=s?"atmost":"ignore";h.rotate="true";h.type="frame";h.src=r;o.appendChild(h)}if(l&&a){o.style.rotation="180"}else if(l){o.style.flip="x"}else if(a){o.style.flip="y"}if(this.state.alpha<1||this.state.fillAlpha<1){o.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"}this.root.appendChild(o)};mxVmlCanvas2D.prototype.createDiv=function(t,e,i,n){var r=this.createElement("div");var s=this.state;var l="";if(s.fontBackgroundColor!=null){l+="background-color:"+mxUtils.htmlEntities(s.fontBackgroundColor)+";"}if(s.fontBorderColor!=null){l+="border:1px solid "+mxUtils.htmlEntities(s.fontBorderColor)+";"}if(mxUtils.isNode(t)){r.appendChild(t)}else{if(n!="fill"&&n!="width"){var a=this.createElement("div");a.style.cssText=l;a.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a.style.zoom="1";a.style.textDecoration="inherit";a.innerHTML=t;r.appendChild(a)}else{r.style.cssText=l;r.innerHTML=t}}var o=r.style;o.fontSize=s.fontSize/this.vmlScale+"px";o.fontFamily=s.fontFamily;o.color=s.fontColor;o.verticalAlign="top";o.textAlign=e||"left";o.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT;if((s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){o.fontWeight="bold"}if((s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){o.fontStyle="italic"}if((s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){o.textDecoration="underline"}return r};mxVmlCanvas2D.prototype.text=function(t,e,i,n,r,s,l,a,o,h,u,d,p){if(this.textEnabled&&r!=null){var m=this.state;if(o=="html"){if(m.rotation!=null){var c=this.rotatePoint(t,e,m.rotation,m.rotationCx,m.rotationCy);t=c.x;e=c.y}if(document.documentMode==8&&!mxClient.IS_EM){t+=m.dx;e+=m.dy;if(h!="fill"&&l==mxConstants.ALIGN_TOP){e-=1}}else{t*=m.scale;e*=m.scale}var x=document.documentMode==8&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");x.style.position="absolute";x.style.display="inline";x.style.left=this.format(t)+"px";x.style.top=this.format(e)+"px";x.style.zoom=m.scale;var f=this.createElement("div");f.style.position="relative";f.style.display="inline";var g=mxUtils.getAlignmentAsPoint(s,l);var v=g.x;var y=g.y;var C=this.createDiv(r,s,l,h);var E=this.createElement("div");if(p!=null){C.setAttribute("dir",p)}if(a&&i>0){if(!u){C.style.width=Math.round(i)+"px"}C.style.wordWrap=mxConstants.WORD_WRAP;C.style.whiteSpace="normal";if(C.style.wordWrap=="break-word"){var S=C;if(S.firstChild!=null&&S.firstChild.nodeName=="DIV"){S.firstChild.style.width="100%"}}}else{C.style.whiteSpace="nowrap"}var b=m.rotation+(d||0);if(this.rotateHtml&&b!=0){E.style.display="inline";E.style.zoom="1";E.appendChild(C);if(document.documentMode==8&&!mxClient.IS_EM&&this.root.nodeName!="DIV"){f.appendChild(E);x.appendChild(f)}else{x.appendChild(E)}}else if(document.documentMode==8&&!mxClient.IS_EM){f.appendChild(C);x.appendChild(f)}else{C.style.display="inline";x.appendChild(C)}if(this.root.nodeName!="DIV"){var w=this.createVmlElement("rect");w.stroked="false";w.filled="false";w.appendChild(x);this.root.appendChild(w)}else{this.root.appendChild(x)}if(u){C.style.overflow="hidden";C.style.width=Math.round(i)+"px";if(!mxClient.IS_QUIRKS){C.style.maxHeight=Math.round(n)+"px"}}else if(h=="fill"){C.style.overflow="hidden";C.style.width=Math.max(0,i)+1+"px";C.style.height=Math.max(0,n)+1+"px"}else if(h=="width"){C.style.overflow="hidden";C.style.width=Math.max(0,i)+1+"px";C.style.maxHeight=Math.max(0,n)+1+"px"}if(this.rotateHtml&&b!=0){var T=b*(Math.PI/180);var L=parseFloat(parseFloat(Math.cos(T)).toFixed(8));var A=parseFloat(parseFloat(Math.sin(-T)).toFixed(8));T%=2*Math.PI;if(T<0)T+=2*Math.PI;T%=Math.PI;if(T>Math.PI/2)T=Math.PI-T;var M=Math.cos(T);var _=Math.sin(T);if(document.documentMode==8&&!mxClient.IS_EM){C.style.display="inline-block";E.style.display="inline-block";f.style.display="inline-block"}C.style.visibility="hidden";C.style.position="absolute";document.body.appendChild(C);var O=C;if(O.firstChild!=null&&O.firstChild.nodeName=="DIV"){O=O.firstChild}var S=O.offsetWidth+3;var I=O.offsetHeight;if(u){i=Math.min(i,S);I=Math.min(I,n)}else{i=S}if(a){C.style.width=i+"px"}if(mxClient.IS_QUIRKS&&(u||h=="width")&&I>n){I=n;C.style.height=I+"px"}n=I;var P=(n-n*M+i*-_)/2-A*i*(v+.5)+L*n*(y+.5);var R=(i-i*M+n*-_)/2+L*i*(v+.5)+A*n*(y+.5);if(x.nodeName=="group"&&this.root.nodeName=="DIV"){var H=this.createElement("div");H.style.display="inline-block";H.style.position="absolute";H.style.left=this.format(t+(R-i/2)*m.scale)+"px";H.style.top=this.format(e+(P-n/2)*m.scale)+"px";x.parentNode.appendChild(H);H.appendChild(x)}else{var N=document.documentMode==8&&!mxClient.IS_EM?1:m.scale;x.style.left=this.format(t+(R-i/2)*N)+"px";x.style.top=this.format(e+(P-n/2)*N)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+L+", M12="+A+", M21="+-A+", M22="+L+", sizingMethod='auto expand')";E.style.backgroundColor=this.rotatedHtmlBackground;if(this.state.alpha<1){E.style.filter+="alpha(opacity="+this.state.alpha*100+")"}E.appendChild(C);C.style.position="";C.style.visibility=""}else if(document.documentMode!=8||mxClient.IS_EM){C.style.verticalAlign="top";if(this.state.alpha<1){x.style.filter="alpha(opacity="+this.state.alpha*100+")"}var D=C.parentNode;C.style.visibility="hidden";document.body.appendChild(C);i=C.offsetWidth;var I=C.offsetHeight;if(mxClient.IS_QUIRKS&&u&&I>n){I=n;C.style.height=I+"px"}n=I;C.style.visibility="";D.appendChild(C);x.style.left=this.format(t+i*v*this.state.scale)+"px";x.style.top=this.format(e+n*y*this.state.scale)+"px"}else{if(this.state.alpha<1){C.style.filter="alpha(opacity="+this.state.alpha*100+")"}f.style.left=v*100+"%";f.style.top=y*100+"%"}}else{this.plainText(t,e,i,n,mxUtils.htmlEntities(r,false),s,l,a,o,h,u,d,p)}}};mxVmlCanvas2D.prototype.plainText=function(t,e,i,n,r,s,l,a,o,h,u,d,p){var m=this.state;t=(t+m.dx)*m.scale;e=(e+m.dy)*m.scale;var c=this.createVmlElement("shape");c.style.width="1px";c.style.height="1px";c.stroked="false";var x=this.createVmlElement("fill");x.color=m.fontColor;x.opacity=m.alpha*100+"%";c.appendChild(x);var f=this.createVmlElement("path");f.textpathok="true";f.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0);c.appendChild(f);var g=this.createVmlElement("textpath");g.style.cssText="v-text-align:"+s;g.style.align=s;g.style.fontFamily=m.fontFamily;g.string=r;g.on="true";var v=m.fontSize*m.scale/this.vmlScale;g.style.fontSize=v+"px";if((m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){g.style.fontWeight="bold"}if((m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){g.style.fontStyle="italic"}if((m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){g.style.textDecoration="underline"}var y=r.split("\n");var C=v+(y.length-1)*v*mxConstants.LINE_HEIGHT;var E=0;var S=0;if(l==mxConstants.ALIGN_BOTTOM){S=-C/2}else if(l!=mxConstants.ALIGN_MIDDLE){S=C/2}if(d!=null){c.style.rotation=d;var b=d*(Math.PI/180);E=Math.sin(b)*S;S=Math.cos(b)*S}c.appendChild(g);c.style.left=this.format(t-E)+"px";c.style.top=this.format(e+S)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(false,true)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(true,false)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(true,true)};__mxOutput.mxVmlCanvas2D=typeof mxVmlCanvas2D!=="undefined"?mxVmlCanvas2D:undefined;function mxGuide(t,e){this.graph=t;this.setStates(e)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=true;mxGuide.prototype.vertical=true;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null;mxGuide.prototype.rounded=false;mxGuide.prototype.tolerance=2;mxGuide.prototype.setStates=function(t){this.states=t};mxGuide.prototype.isEnabledForEvent=function(t){return true};mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance};mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);e.isDashed=true;return e};mxGuide.prototype.isStateIgnored=function(t){return false};mxGuide.prototype.move=function(t,e,i,n){if(this.states!=null&&(this.horizontal||this.vertical)&&t!=null&&e!=null){var r=this.graph.getView().scale;var s=this.getGuideTolerance(i)*r;var l=t.clone();l.x+=e.x;l.y+=e.y;var a=false;var o=null;var h=null;var u=false;var d=null;var p=null;var m=s;var c=s;var x=l.x;var f=l.x+l.width;var g=l.getCenterX();var v=l.y;var y=l.y+l.height;var C=l.getCenterY();function E(i,n,r){var s=false;if(r&&Math.abs(i-g)<m){e.x=i-t.getCenterX();m=Math.abs(i-g);s=true}else if(!r){if(Math.abs(i-x)<m){e.x=i-t.x;m=Math.abs(i-x);s=true}else if(Math.abs(i-f)<m){e.x=i-t.x-t.width;m=Math.abs(i-f);s=true}}if(s){o=n;h=i;if(this.guideX==null){this.guideX=this.createGuideShape(true);this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.guideX.pointerEvents=false;this.guideX.init(this.graph.getView().getOverlayPane())}}a=a||s}function S(i,n,r){var s=false;if(r&&Math.abs(i-C)<c){e.y=i-t.getCenterY();c=Math.abs(i-C);s=true}else if(!r){if(Math.abs(i-v)<c){e.y=i-t.y;c=Math.abs(i-v);s=true}else if(Math.abs(i-y)<c){e.y=i-t.y-t.height;c=Math.abs(i-y);s=true}}if(s){d=n;p=i;if(this.guideY==null){this.guideY=this.createGuideShape(false);this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.guideY.pointerEvents=false;this.guideY.init(this.graph.getView().getOverlayPane())}}u=u||s}for(var b=0;b<this.states.length;b++){var w=this.states[b];if(w!=null&&!this.isStateIgnored(w)){if(this.horizontal){E.call(this,w.getCenterX(),w,true);E.call(this,w.x,w,false);E.call(this,w.x+w.width,w,false);if(w.cell==null){E.call(this,w.getCenterX(),w,false)}}if(this.vertical){S.call(this,w.getCenterY(),w,true);S.call(this,w.y,w,false);S.call(this,w.y+w.height,w,false);if(w.cell==null){S.call(this,w.getCenterY(),w,false)}}}}this.graph.snapDelta(e,t,!i,a,u);e=this.getDelta(t,o,e.x,d,e.y);var T=this.graph.container;if(!a&&this.guideX!=null){this.guideX.node.style.visibility="hidden"}else if(this.guideX!=null){var L=null;var A=null;if(o!=null&&t!=null){L=Math.min(t.y+e.y-this.graph.panDy,o.y);A=Math.max(t.y+t.height+e.y-this.graph.panDy,o.y+o.height)}if(L!=null&&A!=null){this.guideX.points=[new mxPoint(h,L),new mxPoint(h,A)]}else{this.guideX.points=[new mxPoint(h,-this.graph.panDy),new mxPoint(h,T.scrollHeight-3-this.graph.panDy)]}this.guideX.stroke=this.getGuideColor(o,true);this.guideX.node.style.visibility="visible";this.guideX.redraw()}if(!u&&this.guideY!=null){this.guideY.node.style.visibility="hidden"}else if(this.guideY!=null){var M=null;var _=null;if(d!=null&&t!=null){M=Math.min(t.x+e.x-this.graph.panDx,d.x);_=Math.max(t.x+t.width+e.x-this.graph.panDx,d.x+d.width)}if(M!=null&&_!=null){this.guideY.points=[new mxPoint(M,p),new mxPoint(_,p)]}else{this.guideY.points=[new mxPoint(-this.graph.panDx,p),new mxPoint(T.scrollWidth-3-this.graph.panDx,p)]}this.guideY.stroke=this.getGuideColor(d,false);this.guideY.node.style.visibility="visible";this.guideY.redraw()}}return e};mxGuide.prototype.getDelta=function(t,e,i,n,r){var s=this.graph.view.scale;if(this.rounded||e!=null&&e.cell==null){i=Math.round((t.x+i)/s)*s-t.x}if(this.rounded||n!=null&&n.cell==null){r=Math.round((t.y+r)/s)*s-t.y}return new mxPoint(i,r)};mxGuide.prototype.getGuideColor=function(t,e){return mxConstants.GUIDE_COLOR};mxGuide.prototype.hide=function(){this.setVisible(false)};mxGuide.prototype.setVisible=function(t){if(this.guideX!=null){this.guideX.node.style.visibility=t?"visible":"hidden"}if(this.guideY!=null){this.guideY.node.style.visibility=t?"visible":"hidden"}};mxGuide.prototype.destroy=function(){if(this.guideX!=null){this.guideX.destroy();this.guideX=null}if(this.guideY!=null){this.guideY.destroy();this.guideY=null}};__mxOutput.mxGuide=typeof mxGuide!=="undefined"?mxGuide:undefined;function mxShape(t){this.stencil=t;this.initStyles()}mxShape.prototype.dialect=null;mxShape.prototype.scale=1;mxShape.prototype.antiAlias=true;mxShape.prototype.minSvgStrokeWidth=1;mxShape.prototype.bounds=null;mxShape.prototype.points=null;mxShape.prototype.node=null;mxShape.prototype.state=null;mxShape.prototype.style=null;mxShape.prototype.boundingBox=null;mxShape.prototype.stencil=null;mxShape.prototype.svgStrokeTolerance=8;mxShape.prototype.pointerEvents=true;mxShape.prototype.svgPointerEvents="all";mxShape.prototype.shapePointerEvents=false;mxShape.prototype.stencilPointerEvents=false;mxShape.prototype.vmlScale=1;mxShape.prototype.outline=false;mxShape.prototype.visible=true;mxShape.prototype.useSvgBoundingBox=false;mxShape.prototype.init=function(t){if(this.node==null){this.node=this.create(t);if(t!=null){t.appendChild(this.node)}}};mxShape.prototype.initStyles=function(t){this.strokewidth=1;this.rotation=0;this.opacity=100;this.fillOpacity=100;this.strokeOpacity=100;this.flipH=false;this.flipV=false};mxShape.prototype.isParseVml=function(){return true};mxShape.prototype.isHtmlAllowed=function(){return false};mxShape.prototype.getSvgScreenOffset=function(){var t=this.stencil&&this.stencil.strokewidth!="inherit"?Number(this.stencil.strokewidth):this.strokewidth;return mxUtils.mod(Math.max(1,Math.round(t*this.scale)),2)==1?.5:0};mxShape.prototype.create=function(t){var e=null;if(t!=null&&t.ownerSVGElement!=null){e=this.createSvg(t)}else if(document.documentMode==8||!mxClient.IS_VML||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()){e=this.createHtml(t)}else{e=this.createVml(t)}return e};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createVml=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");t.style.position="absolute";return t};mxShape.prototype.createHtml=function(){var t=document.createElement("div");t.style.position="absolute";return t};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();if(this.visible&&this.checkBounds()){this.node.style.visibility="visible";this.clear();if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML)){this.redrawHtmlShape()}else{this.redrawShape()}this.updateBoundingBox()}else{this.node.style.visibility="hidden";this.boundingBox=null}};mxShape.prototype.clear=function(){if(this.node.ownerSVGElement!=null){while(this.node.lastChild!=null){this.node.removeChild(this.node.lastChild)}}else{this.node.style.cssText="position:absolute;"+(this.cursor!=null?"cursor:"+this.cursor+";":"");this.node.innerHTML=""}};mxShape.prototype.updateBoundsFromPoints=function(){var t=this.points;if(t!=null&&t.length>0&&t[0]!=null){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e<this.points.length;e++){if(t[e]!=null){this.bounds.add(new mxRectangle(Number(t[e].x),Number(t[e].y),1,1))}}}};mxShape.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var i=t;if(e!=mxConstants.DIRECTION_SOUTH&&e!=mxConstants.DIRECTION_NORTH&&this.state!=null&&this.state.text!=null&&this.state.text.isPaintBoundsInverted()){i=i.clone();var n=i.width;i.width=i.height;i.height=n}var r=this.getLabelMargins(i);if(r!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,false)=="1";var l=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,false)=="1";if(this.state!=null&&this.state.text!=null&&this.state.text.isPaintBoundsInverted()){var n=r.x;r.x=r.height;r.height=r.width;r.width=r.y;r.y=n;n=s;s=l;l=n}return mxUtils.getDirectedBounds(t,r,this.style,s,l)}return t};mxShape.prototype.getLabelMargins=function(t){return null};mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0};mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");t.style.position="absolute";t.style.width=this.node.style.width;t.style.height=this.node.style.height;return t};mxShape.prototype.redrawShape=function(){var t=this.createCanvas();if(t!=null){t.pointerEvents=this.pointerEvents;this.beforePaint(t);this.paint(t);this.afterPaint(t);if(this.node!=t.root){this.node.insertAdjacentHTML("beforeend",t.root.outerHTML)}if(this.node.nodeName=="DIV"&&document.documentMode==8){this.node.style.filter="";mxUtils.addTransparentBackgroundFilter(this.node)}this.destroyCanvas(t)}};mxShape.prototype.createCanvas=function(){var t=null;if(this.node.ownerSVGElement!=null){t=this.createSvgCanvas()}else if(mxClient.IS_VML){this.updateVmlContainer();t=this.createVmlCanvas()}if(t!=null&&this.outline){t.setStrokeWidth(this.strokewidth);t.setStrokeColor(this.stroke);if(this.isDashed!=null){t.setDashed(this.isDashed)}t.setStrokeWidth=function(){};t.setStrokeColor=function(){};t.setFillColor=function(){};t.setGradient=function(){};t.setDashed=function(){};t.text=function(){}}return t};mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,false);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0;t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();if(e!=0){this.node.setAttribute("transform","translate("+e+","+e+")")}else{this.node.removeAttribute("transform")}t.minStrokeWidth=this.minSvgStrokeWidth;if(!this.antiAlias){t.format=function(t){return Math.round(parseFloat(t))}}return t};mxShape.prototype.createVmlCanvas=function(){var t=document.documentMode==8&&this.isParseVml()?this.createVmlGroup():this.node;var e=new mxVmlCanvas2D(t,false);if(t.tagUrn!=""){var i=Math.max(1,Math.round(this.bounds.width));var n=Math.max(1,Math.round(this.bounds.height));t.coordsize=i*this.vmlScale+","+n*this.vmlScale;e.scale(this.vmlScale);e.vmlScale=this.vmlScale}var r=this.scale;e.translate(-Math.round(this.bounds.x/r),-Math.round(this.bounds.y/r));return e};mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width));var e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px";this.node.style.height=e+"px";this.node.style.overflow="visible"};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100){e+="alpha(opacity="+this.opacity+")"}if(this.isShadow){e+="progid:DXImageTransform.Microsoft.dropShadow ("+"OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', "+"OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', "+"Color='"+mxConstants.VML_SHADOWCOLOR+"')"}if(this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var i=this.fill;var n=this.gradient;var r="0";var s={east:0,south:1,west:2,north:3};var l=this.direction!=null?s[this.direction]:0;if(this.gradientDirection!=null){l=mxUtils.mod(l+s[this.gradientDirection]-1,4)}if(l==1){r="1";var a=i;i=n;n=a}else if(l==2){var a=i;i=n;n=a}else if(l==3){r="1"}e+="progid:DXImageTransform.Microsoft.gradient("+"startColorStr='"+i+"', endColorStr='"+n+"', gradientType='"+r+"')"}t.style.filter=e};mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;if(e!=null&&e!=mxConstants.NONE){t.style.borderColor=e;if(this.isDashed){t.style.borderStyle="dashed"}else if(this.strokewidth>0){t.style.borderStyle="solid"}t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"}else{t.style.borderWidth="0px"}e=this.outline?null:this.fill;if(e!=null&&e!=mxConstants.NONE){t.style.backgroundColor=e;t.style.backgroundImage="none"}else if(this.pointerEvents){t.style.backgroundColor="transparent"}else if(document.documentMode==8){mxUtils.addTransparentBackgroundFilter(t)}else{this.setTransparentBackgroundImage(t)}};mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px";t.style.overflow="hidden";t.style.left=Math.round(this.bounds.x-e/2)+"px";t.style.top=Math.round(this.bounds.y-e/2)+"px";if(document.compatMode=="CSS1Compat"){e=-e}t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px";t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"};mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var i=t.gradients[e];if(i!=null){i.mxRefCount=(i.mxRefCount||0)+1}}this.releaseSvgGradients(this.oldGradients);this.oldGradients=t.gradients}};mxShape.prototype.beforePaint=function(t){};mxShape.prototype.afterPaint=function(t){};mxShape.prototype.paint=function(t){var e=false;if(t!=null&&this.outline){var i=t.stroke;t.stroke=function(){e=true;i.apply(this,arguments)};var n=t.fillAndStroke;t.fillAndStroke=function(){e=true;n.apply(this,arguments)}}var r=this.scale;var s=this.bounds.x/r;var l=this.bounds.y/r;var a=this.bounds.width/r;var o=this.bounds.height/r;if(this.isPaintBoundsInverted()){var h=(a-o)/2;s+=h;l-=h;var u=a;a=o;o=u}this.updateTransform(t,s,l,a,o);this.configureCanvas(t,s,l,a,o);var d=null;if(this.stencil==null&&this.points==null&&this.shapePointerEvents||this.stencil!=null&&this.stencilPointerEvents){var p=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG){d=this.createTransparentSvgRectangle(p.x,p.y,p.width,p.height);this.node.appendChild(d)}else{var m=t.createRect("rect",p.x/r,p.y/r,p.width/r,p.height/r);m.appendChild(t.createTransparentFill());m.stroked="false";t.root.appendChild(m)}}if(this.stencil!=null){this.stencil.drawShape(t,this,s,l,a,o)}else{t.setStrokeWidth(this.strokewidth);if(this.points!=null){var c=[];for(var x=0;x<this.points.length;x++){if(this.points[x]!=null){c.push(new mxPoint(this.points[x].x/r,this.points[x].y/r))}}this.paintEdgeShape(t,c)}else{this.paintVertexShape(t,s,l,a,o)}}if(d!=null&&t.state!=null&&t.state.transform!=null){d.setAttribute("transform",t.state.transform)}if(t!=null&&this.outline&&!e){t.rect(s,l,a,o);t.stroke()}};mxShape.prototype.configureCanvas=function(t,e,i,n,r){var s=null;if(this.style!=null){s=this.style["dashPattern"]}t.setAlpha(this.opacity/100);t.setFillAlpha(this.fillOpacity/100);t.setStrokeAlpha(this.strokeOpacity/100);if(this.isShadow!=null){t.setShadow(this.isShadow)}if(this.isDashed!=null){t.setDashed(this.isDashed,this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,false)==1:false)}if(s!=null){t.setDashPattern(s)}if(this.fill!=null&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var l=this.getGradientBounds(t,e,i,n,r);t.setGradient(this.fill,this.gradient,l.x,l.y,l.width,l.height,this.gradientDirection)}else{t.setFillColor(this.fill)}t.setStrokeColor(this.stroke)};mxShape.prototype.getGradientBounds=function(t,e,i,n,r){return new mxRectangle(e,i,n,r)};mxShape.prototype.updateTransform=function(t,e,i,n,r){t.scale(this.scale);t.rotate(this.getShapeRotation(),this.flipH,this.flipV,e+n/2,i+r/2)};mxShape.prototype.paintVertexShape=function(t,e,i,n,r){this.paintBackground(t,e,i,n,r);if(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0){t.setShadow(false);this.paintForeground(t,e,i,n,r)}};mxShape.prototype.paintBackground=function(t,e,i,n,r){};mxShape.prototype.paintForeground=function(t,e,i,n,r){};mxShape.prototype.paintEdgeShape=function(t,e){};mxShape.prototype.getArcSize=function(t,e){var i=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1"){i=Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2))}else{var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;i=Math.min(t*n,e*n)}return i};mxShape.prototype.paintGlassEffect=function(t,e,i,n,r,s){var l=Math.ceil(this.strokewidth/2);var a=.4;t.setGradient("#ffffff","#ffffff",e,i,n,r*.6,"south",.9,.1);t.begin();s+=2*l;if(this.isRounded){t.moveTo(e-l+s,i-l);t.quadTo(e-l,i-l,e-l,i-l+s);t.lineTo(e-l,i+r*a);t.quadTo(e+n*.5,i+r*.7,e+n+l,i+r*a);t.lineTo(e+n+l,i-l+s);t.quadTo(e+n+l,i-l,e+n+l-s,i-l)}else{t.moveTo(e-l,i-l);t.lineTo(e-l,i+r*a);t.quadTo(e+n*.5,i+r*.7,e+n+l,i+r*a);t.lineTo(e+n+l,i-l)}t.close();t.fill()};mxShape.prototype.addPoints=function(t,e,i,n,r,s,l){if(e!=null&&e.length>0){l=l!=null?l:true;var a=e[e.length-1];if(r&&i){e=e.slice();var o=e[0];var h=new mxPoint(a.x+(o.x-a.x)/2,a.y+(o.y-a.y)/2);e.splice(0,0,h)}var u=e[0];var d=1;if(l){t.moveTo(u.x,u.y)}else{t.lineTo(u.x,u.y)}while(d<(r?e.length:e.length-1)){var p=e[mxUtils.mod(d,e.length)];var m=u.x-p.x;var c=u.y-p.y;if(i&&(m!=0||c!=0)&&(s==null||mxUtils.indexOf(s,d-1)<0)){var x=Math.sqrt(m*m+c*c);var f=m*Math.min(n,x/2)/x;var g=c*Math.min(n,x/2)/x;var v=p.x+f;var y=p.y+g;t.lineTo(v,y);var C=e[mxUtils.mod(d+1,e.length)];while(d<e.length-2&&Math.round(C.x-p.x)==0&&Math.round(C.y-p.y)==0){C=e[mxUtils.mod(d+2,e.length)];d++}m=C.x-p.x;c=C.y-p.y;x=Math.max(1,Math.sqrt(m*m+c*c));var E=m*Math.min(n,x/2)/x;var S=c*Math.min(n,x/2)/x;var b=p.x+E;var w=p.y+S;t.quadTo(p.x,p.y,b,w);p=new mxPoint(b,w)}else{t.lineTo(p.x,p.y)}u=p;d++}if(r){t.close()}else{t.lineTo(a.x,a.y)}}};mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};mxShape.prototype.apply=function(t){this.state=t;this.style=t.style;if(this.style!=null){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,this.fillOpacity);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0)==1;this.flipV=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0)==1;if(this.stencil!=null){this.flipH=mxUtils.getValue(this.style,"stencilFlipH",0)==1||this.flipH;this.flipV=mxUtils.getValue(this.style,"stencilFlipV",0)==1||this.flipV}if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var e=this.flipH;this.flipH=this.flipV;this.flipV=e}this.isShadow=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow)==1;this.isDashed=mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed)==1;this.isRounded=mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded)==1;this.glass=mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass)==1;if(this.fill==mxConstants.NONE){this.fill=null}if(this.gradient==mxConstants.NONE){this.gradient=null}if(this.stroke==mxConstants.NONE){this.stroke=null}}};mxShape.prototype.setCursor=function(t){if(t==null){t=""}this.cursor=t;if(this.node!=null){this.node.style.cursor=t}};mxShape.prototype.getCursor=function(){return this.cursor};mxShape.prototype.isRoundable=function(){return false};mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&this.node!=null&&this.node.ownerSVGElement!=null){try{var t=this.node.getBBox();if(t.width>0&&t.height>0){this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height);this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch(n){}}if(this.bounds!=null){var e=this.createBoundingBox();if(e!=null){this.augmentBoundingBox(e);var i=this.getShapeRotation();if(i!=0){e=mxUtils.getBoundingBox(e,i)}}this.boundingBox=e}};mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();if(this.stencil!=null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted()){t.rotate90()}return t};mxShape.prototype.augmentBoundingBox=function(t){if(this.isShadow){t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale);t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)}t.grow(this.strokewidth*this.scale/2)};mxShape.prototype.isPaintBoundsInverted=function(){return this.stencil==null&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)};mxShape.prototype.getRotation=function(){return this.rotation!=null?this.rotation:0};mxShape.prototype.getTextRotation=function(){var t=this.getRotation();if(mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)!=1){t+=mxText.prototype.verticalTextRotation}return t};mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();if(this.direction!=null){if(this.direction==mxConstants.DIRECTION_NORTH){t+=270}else if(this.direction==mxConstants.DIRECTION_WEST){t+=180}else if(this.direction==mxConstants.DIRECTION_SOUTH){t+=90}}return t};mxShape.prototype.createTransparentSvgRectangle=function(t,e,i,n){var r=document.createElementNS(mxConstants.NS_SVG,"rect");r.setAttribute("x",t);r.setAttribute("y",e);r.setAttribute("width",i);r.setAttribute("height",n);r.setAttribute("fill","none");r.setAttribute("stroke","none");r.setAttribute("pointer-events","all");return r};mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"};mxShape.prototype.releaseSvgGradients=function(t){if(t!=null){for(var e in t){var i=t[e];if(i!=null){i.mxRefCount=(i.mxRefCount||0)-1;if(i.mxRefCount==0&&i.parentNode!=null){i.parentNode.removeChild(i)}}}}};mxShape.prototype.destroy=function(){if(this.node!=null){mxEvent.release(this.node);if(this.node.parentNode!=null){this.node.parentNode.removeChild(this.node)}this.node=null}this.releaseSvgGradients(this.oldGradients);this.oldGradients=null};__mxOutput.mxShape=typeof mxShape!=="undefined"?mxShape:undefined;function mxStencil(t){this.desc=t;this.parseDescription();this.parseConstraints()}mxUtils.extend(mxStencil,mxShape);mxStencil.defaultLocalized=false;mxStencil.allowEval=false;mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.prototype.aspect=null;mxStencil.prototype.w0=null;mxStencil.prototype.h0=null;mxStencil.prototype.bgNode=null;mxStencil.prototype.fgNode=null;mxStencil.prototype.strokewidth=null;mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=t!=null?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=e!=null?e:"1"};mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(t!=null){var e=mxUtils.getChildNodes(t);if(e!=null&&e.length>0){this.constraints=[];for(var i=0;i<e.length;i++){this.constraints.push(this.parseConstraint(e[i]))}}}};mxStencil.prototype.parseConstraint=function(t){var e=Number(t.getAttribute("x"));var i=Number(t.getAttribute("y"));var n=t.getAttribute("perimeter")=="1";var r=t.getAttribute("name");return new mxConnectionConstraint(new mxPoint(e,i),n,r)};mxStencil.prototype.evaluateTextAttribute=function(t,e,i){var n=this.evaluateAttribute(t,e,i);var r=t.getAttribute("localized");if(mxStencil.defaultLocalized&&r==null||r=="1"){n=mxResources.get(n)}return n};mxStencil.prototype.evaluateAttribute=function(t,e,i){var n=t.getAttribute(e);if(n==null){var r=mxUtils.getTextContent(t);if(r!=null&&mxStencil.allowEval){var s=mxUtils.eval(r);if(typeof s=="function"){n=s(i)}}}return n};mxStencil.prototype.drawShape=function(t,e,i,n,r,s){var l=t.states.slice();var a=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,null);var o=this.computeAspect(e.style,i,n,r,s,a);var h=Math.min(o.width,o.height);var u=this.strokewidth=="inherit"?Number(mxUtils.getNumber(e.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*h;t.setStrokeWidth(u);if(e.style!=null&&mxUtils.getValue(e.style,mxConstants.STYLE_POINTER_EVENTS,"0")=="1"){t.setStrokeColor(mxConstants.NONE);t.rect(i,n,r,s);t.stroke();t.setStrokeColor(e.stroke)}this.drawChildren(t,e,i,n,r,s,this.bgNode,o,false,true);this.drawChildren(t,e,i,n,r,s,this.fgNode,o,true,!e.outline||e.style==null||mxUtils.getValue(e.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0);if(t.states.length!=l.length){t.states=l}};mxStencil.prototype.drawChildren=function(t,e,i,n,r,s,l,a,o,h){if(l!=null&&r>0&&s>0){var u=l.firstChild;while(u!=null){if(u.nodeType==mxConstants.NODETYPE_ELEMENT){this.drawNode(t,e,u,a,o,h)}u=u.nextSibling}}};mxStencil.prototype.computeAspect=function(t,e,i,n,r,s){var l=e;var a=i;var o=n/this.w0;var h=r/this.h0;var u=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(u){h=n/this.h0;o=r/this.w0;var d=(n-r)/2;l+=d;a-=d}if(this.aspect=="fixed"){h=Math.min(o,h);o=h;if(u){l+=(r-this.w0*o)/2;a+=(n-this.h0*h)/2}else{l+=(n-this.w0*o)/2;a+=(r-this.h0*h)/2}}return new mxRectangle(l,a,o,h)};mxStencil.prototype.drawNode=function(t,e,i,n,r,s){var l=i.nodeName;var a=n.x;var o=n.y;var h=n.width;var u=n.height;var d=Math.min(h,u);if(l=="save"){t.save()}else if(l=="restore"){t.restore()}else if(s){if(l=="path"){t.begin();var p=true;if(i.getAttribute("rounded")=="1"){p=false;var m=Number(i.getAttribute("arcSize"));var c=0;var x=[];var f=i.firstChild;while(f!=null){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var g=f.nodeName;if(g=="move"||g=="line"){if(g=="move"||x.length==0){x.push([])}x[x.length-1].push(new mxPoint(a+Number(f.getAttribute("x"))*h,o+Number(f.getAttribute("y"))*u));c++}else{p=true;break}}f=f.nextSibling}if(!p&&c>0){for(var v=0;v<x.length;v++){var y=false,C=x[v][0],E=x[v][x[v].length-1];if(C.x==E.x&&C.y==E.y){x[v].pop();y=true}this.addPoints(t,x[v],true,m,y)}}else{p=true}}if(p){var f=i.firstChild;while(f!=null){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){this.drawNode(t,e,f,n,r,s)}f=f.nextSibling}}}else if(l=="close"){t.close()}else if(l=="move"){t.moveTo(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u)}else if(l=="line"){t.lineTo(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u)}else if(l=="quad"){t.quadTo(a+Number(i.getAttribute("x1"))*h,o+Number(i.getAttribute("y1"))*u,a+Number(i.getAttribute("x2"))*h,o+Number(i.getAttribute("y2"))*u)}else if(l=="curve"){t.curveTo(a+Number(i.getAttribute("x1"))*h,o+Number(i.getAttribute("y1"))*u,a+Number(i.getAttribute("x2"))*h,o+Number(i.getAttribute("y2"))*u,a+Number(i.getAttribute("x3"))*h,o+Number(i.getAttribute("y3"))*u)}else if(l=="arc"){t.arcTo(Number(i.getAttribute("rx"))*h,Number(i.getAttribute("ry"))*u,Number(i.getAttribute("x-axis-rotation")),Number(i.getAttribute("large-arc-flag")),Number(i.getAttribute("sweep-flag")),a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u)}else if(l=="rect"){t.rect(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,Number(i.getAttribute("w"))*h,Number(i.getAttribute("h"))*u)}else if(l=="roundrect"){var S=Number(i.getAttribute("arcsize"));if(S==0){S=mxConstants.RECTANGLE_ROUNDING_FACTOR*100}var b=Number(i.getAttribute("w"))*h;var w=Number(i.getAttribute("h"))*u;var T=Number(S)/100;var L=Math.min(b*T,w*T);t.roundrect(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,b,w,L,L)}else if(l=="ellipse"){t.ellipse(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,Number(i.getAttribute("w"))*h,Number(i.getAttribute("h"))*u)}else if(l=="image"){if(!e.outline){var A=this.evaluateAttribute(i,"src",e);t.image(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,Number(i.getAttribute("w"))*h,Number(i.getAttribute("h"))*u,A,false,i.getAttribute("flipH")=="1",i.getAttribute("flipV")=="1")}}else if(l=="text"){if(!e.outline){var M=this.evaluateTextAttribute(i,"str",e);var _=i.getAttribute("vertical")=="1"?-90:0;if(i.getAttribute("align-shape")=="0"){var O=e.rotation;var I=mxUtils.getValue(e.style,mxConstants.STYLE_FLIPH,0)==1;var P=mxUtils.getValue(e.style,mxConstants.STYLE_FLIPV,0)==1;if(I&&P){_-=O}else if(I||P){_+=O}else{_-=O}}_-=i.getAttribute("rotation");t.text(a+Number(i.getAttribute("x"))*h,o+Number(i.getAttribute("y"))*u,0,0,M,i.getAttribute("align")||"left",i.getAttribute("valign")||"top",false,"",null,false,_)}}else if(l=="include-shape"){var R=mxStencilRegistry.getStencil(i.getAttribute("name"));if(R!=null){var H=a+Number(i.getAttribute("x"))*h;var N=o+Number(i.getAttribute("y"))*u;var b=Number(i.getAttribute("w"))*h;var w=Number(i.getAttribute("h"))*u;R.drawShape(t,e,H,N,b,w)}}else if(l=="fillstroke"){t.fillAndStroke()}else if(l=="fill"){t.fill()}else if(l=="stroke"){t.stroke()}else if(l=="strokewidth"){var D=i.getAttribute("fixed")=="1"?1:d;t.setStrokeWidth(Number(i.getAttribute("width"))*D)}else if(l=="dashed"){t.setDashed(i.getAttribute("dashed")=="1")}else if(l=="dashpattern"){var G=i.getAttribute("pattern");if(G!=null){var U=G.split(" ");var V=[];for(var v=0;v<U.length;v++){if(U[v].length>0){V.push(Number(U[v])*d)}}G=V.join(" ");t.setDashPattern(G)}}else if(l=="strokecolor"){t.setStrokeColor(i.getAttribute("color"))}else if(l=="linecap"){t.setLineCap(i.getAttribute("cap"))}else if(l=="linejoin"){t.setLineJoin(i.getAttribute("join"))}else if(l=="miterlimit"){t.setMiterLimit(Number(i.getAttribute("limit")))}else if(l=="fillcolor"){t.setFillColor(i.getAttribute("color"))}else if(l=="alpha"){t.setAlpha(i.getAttribute("alpha"))}else if(l=="fillalpha"){t.setAlpha(i.getAttribute("alpha"))}else if(l=="strokealpha"){t.setAlpha(i.getAttribute("alpha"))}else if(l=="fontcolor"){t.setFontColor(i.getAttribute("color"))}else if(l=="fontstyle"){t.setFontStyle(i.getAttribute("style"))}else if(l=="fontfamily"){t.setFontFamily(i.getAttribute("family"))}else if(l=="fontsize"){t.setFontSize(Number(i.getAttribute("size"))*d)}if(r&&(l=="fillstroke"||l=="fill"||l=="stroke")){r=false;t.setShadow(false)}}};__mxOutput.mxStencil=typeof mxStencil!=="undefined"?mxStencil:undefined;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=typeof mxStencilRegistry!=="undefined"?mxStencilRegistry:undefined;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,i,n,r,s,l,a,o,h){var u=mxMarker.markers[i];return u!=null?u(t,e,i,n,r,s,l,a,o,h):null}};(function(){function t(t){t=t!=null?t:2;return function(e,i,n,r,s,l,a,o,h,u){var d=s*h*1.118;var p=l*h*1.118;s=s*(a+h);l=l*(a+h);var m=r.clone();m.x-=d;m.y-=p;var c=n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;r.x+=-s*c-d;r.y+=-l*c-p;return function(){e.begin();e.moveTo(m.x,m.y);e.lineTo(m.x-s-l/t,m.y-l+s/t);if(n==mxConstants.ARROW_CLASSIC||n==mxConstants.ARROW_CLASSIC_THIN){e.lineTo(m.x-s*3/4,m.y-l*3/4)}e.lineTo(m.x+l/t-s,m.y-l-s/t);e.close();if(u){e.fillAndStroke()}else{e.stroke()}}}}mxMarker.addMarker("classic",t(2));mxMarker.addMarker("classicThin",t(3));mxMarker.addMarker("block",t(2));mxMarker.addMarker("blockThin",t(3));function e(t){t=t!=null?t:2;return function(e,i,n,r,s,l,a,o,h,u){var d=s*h*1.118;var p=l*h*1.118;s=s*(a+h);l=l*(a+h);var m=r.clone();m.x-=d;m.y-=p;r.x+=-d*2;r.y+=-p*2;return function(){e.begin();e.moveTo(m.x-s-l/t,m.y-l+s/t);e.lineTo(m.x,m.y);e.lineTo(m.x+l/t-s,m.y-l-s/t);e.stroke()}}}mxMarker.addMarker("open",e(2));mxMarker.addMarker("openThin",e(3));mxMarker.addMarker("oval",(function(t,e,i,n,r,s,l,a,o,h){var u=l/2;var d=n.clone();n.x-=r*u;n.y-=s*u;return function(){t.ellipse(d.x-u,d.y-u,l,l);if(h){t.fillAndStroke()}else{t.stroke()}}}));function i(t,e,i,n,r,s,l,a,o,h){var u=i==mxConstants.ARROW_DIAMOND?.7071:.9862;var d=r*o*u;var p=s*o*u;r=r*(l+o);s=s*(l+o);var m=n.clone();m.x-=d;m.y-=p;n.x+=-r-d;n.y+=-s-p;var c=i==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin();t.moveTo(m.x,m.y);t.lineTo(m.x-r/2-s/c,m.y+r/c-s/2);t.lineTo(m.x-r,m.y-s);t.lineTo(m.x-r/2+s/c,m.y-s/2-r/c);t.close();if(h){t.fillAndStroke()}else{t.stroke()}}}mxMarker.addMarker("diamond",i);mxMarker.addMarker("diamondThin",i)})();__mxOutput.mxMarker=typeof mxMarker!=="undefined"?mxMarker:undefined;function mxActor(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxActor,mxShape);mxActor.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i);t.begin();this.redrawPath(t,e,i,n,r);t.fillAndStroke()};mxActor.prototype.redrawPath=function(t,e,i,n,r){var s=n/3;t.moveTo(0,r);t.curveTo(0,3*r/5,0,2*r/5,n/2,2*r/5);t.curveTo(n/2-s,2*r/5,n/2-s,0,n/2,0);t.curveTo(n/2+s,0,n/2+s,2*r/5,n/2,2*r/5);t.curveTo(n,2*r/5,n,3*r/5,n,r);t.close()};__mxOutput.mxActor=typeof mxActor!=="undefined"?mxActor:undefined;function mxCloud(t,e,i,n){mxActor.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxCloud,mxActor);mxCloud.prototype.redrawPath=function(t,e,i,n,r){t.moveTo(.25*n,.25*r);t.curveTo(.05*n,.25*r,0,.5*r,.16*n,.55*r);t.curveTo(0,.66*r,.18*n,.9*r,.31*n,.8*r);t.curveTo(.4*n,r,.7*n,r,.8*n,.8*r);t.curveTo(n,.8*r,n,.6*r,.875*n,.5*r);t.curveTo(n,.3*r,.8*n,.1*r,.625*n,.2*r);t.curveTo(.5*n,.05*r,.3*n,.05*r,.25*n,.25*r);t.close()};__mxOutput.mxCloud=typeof mxCloud!=="undefined"?mxCloud:undefined;function mxRectangleShape(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxRectangleShape,mxShape);mxRectangleShape.prototype.isHtmlAllowed=function(){var t=true;if(this.style!=null){t=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}return!this.isRounded&&!this.glass&&this.rotation==0&&(t||this.fill!=null&&this.fill!=mxConstants.NONE)};mxRectangleShape.prototype.paintBackground=function(t,e,i,n,r){var s=true;if(this.style!=null){s=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}if(s||this.fill!=null&&this.fill!=mxConstants.NONE||this.stroke!=null&&this.stroke!=mxConstants.NONE){if(!s&&(this.fill==null||this.fill==mxConstants.NONE)){t.pointerEvents=false}if(this.isRounded){var l=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1"){l=Math.min(n/2,Math.min(r/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2))}else{var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;l=Math.min(n*a,r*a)}t.roundrect(e,i,n,r,l,l)}else{t.rect(e,i,n,r)}t.fillAndStroke()}};mxRectangleShape.prototype.isRoundable=function(t,e,i,n,r){return true};mxRectangleShape.prototype.paintForeground=function(t,e,i,n,r){if(this.glass&&!this.outline&&this.fill!=null&&this.fill!=mxConstants.NONE){this.paintGlassEffect(t,e,i,n,r,this.getArcSize(n+this.strokewidth,r+this.strokewidth))}};__mxOutput.mxRectangleShape=typeof mxRectangleShape!=="undefined"?mxRectangleShape:undefined;function mxEllipse(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxEllipse,mxShape);mxEllipse.prototype.paintVertexShape=function(t,e,i,n,r){t.ellipse(e,i,n,r);t.fillAndStroke()};__mxOutput.mxEllipse=typeof mxEllipse!=="undefined"?mxEllipse:undefined;function mxDoubleEllipse(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxDoubleEllipse,mxShape);mxDoubleEllipse.prototype.vmlScale=10;mxDoubleEllipse.prototype.paintBackground=function(t,e,i,n,r){t.ellipse(e,i,n,r);t.fillAndStroke()};mxDoubleEllipse.prototype.paintForeground=function(t,e,i,n,r){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(n/5,r/5)));e+=s;i+=s;n-=2*s;r-=2*s;if(n>0&&r>0){t.ellipse(e,i,n,r)}t.stroke()}};mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)};__mxOutput.mxDoubleEllipse=typeof mxDoubleEllipse!=="undefined"?mxDoubleEllipse:undefined;function mxRhombus(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxRhombus,mxShape);mxRhombus.prototype.isRoundable=function(){return true};mxRhombus.prototype.paintVertexShape=function(t,e,i,n,r){var s=n/2;var l=r/2;var a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin();this.addPoints(t,[new mxPoint(e+s,i),new mxPoint(e+n,i+l),new mxPoint(e+s,i+r),new mxPoint(e,i+l)],this.isRounded,a,true);t.fillAndStroke()};__mxOutput.mxRhombus=typeof mxRhombus!=="undefined"?mxRhombus:undefined;function mxPolyline(t,e,i){mxShape.call(this);this.points=t;this.stroke=e;this.strokewidth=i!=null?i:1}mxUtils.extend(mxPolyline,mxShape);mxPolyline.prototype.getRotation=function(){return 0};mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return false};mxPolyline.prototype.paintEdgeShape=function(t,e){var i=t.pointerEventsValue;t.pointerEventsValue="stroke";if(this.style==null||this.style[mxConstants.STYLE_CURVED]!=1){this.paintLine(t,e,this.isRounded)}else{this.paintCurvedLine(t,e)}t.pointerEventsValue=i};mxPolyline.prototype.paintLine=function(t,e,i){var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin();this.addPoints(t,e,i,n,false);t.stroke()};mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var i=e[0];var n=e.length;t.moveTo(i.x,i.y);for(var r=1;r<n-2;r++){var s=e[r];var l=e[r+1];var a=(s.x+l.x)/2;var o=(s.y+l.y)/2;t.quadTo(s.x,s.y,a,o)}var s=e[n-2];var l=e[n-1];t.quadTo(s.x,s.y,l.x,l.y);t.stroke()};__mxOutput.mxPolyline=typeof mxPolyline!=="undefined"?mxPolyline:undefined;function mxArrow(t,e,i,n,r,s,l){mxShape.call(this);this.points=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1;this.arrowWidth=r!=null?r:mxConstants.ARROW_WIDTH;this.spacing=s!=null?s:mxConstants.ARROW_SPACING;this.endSize=l!=null?l:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=Math.max(this.arrowWidth,this.endSize);t.grow((e/2+this.strokewidth)*this.scale)};mxArrow.prototype.paintEdgeShape=function(t,e){var i=mxConstants.ARROW_SPACING;var n=mxConstants.ARROW_WIDTH;var r=mxConstants.ARROW_SIZE;var s=e[0];var l=e[e.length-1];var a=l.x-s.x;var o=l.y-s.y;var h=Math.sqrt(a*a+o*o);var u=h-2*i-r;var d=a/h;var p=o/h;var m=u*d;var c=u*p;var x=n*p/3;var f=-n*d/3;var g=s.x-x/2+i*d;var v=s.y-f/2+i*p;var y=g+x;var C=v+f;var E=y+m;var S=C+c;var b=E+x;var w=S+f;var T=b-3*x;var L=w-3*f;t.begin();t.moveTo(g,v);t.lineTo(y,C);t.lineTo(E,S);t.lineTo(b,w);t.lineTo(l.x-i*d,l.y-i*p);t.lineTo(T,L);t.lineTo(T+x,L+f);t.close();t.fillAndStroke()};__mxOutput.mxArrow=typeof mxArrow!=="undefined"?mxArrow:undefined;function mxArrowConnector(t,e,i,n,r,s,l){mxShape.call(this);this.points=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1;this.arrowWidth=r!=null?r:mxConstants.ARROW_WIDTH;this.arrowSpacing=s!=null?s:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=true;mxArrowConnector.prototype.isRoundable=function(){return true};mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments);if(this.style!=null){this.startSize=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*3;this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*3}};mxArrowConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=this.getEdgeWidth();if(this.isMarkerStart()){e=Math.max(e,this.getStartArrowWidth())}if(this.isMarkerEnd()){e=Math.max(e,this.getEndArrowWidth())}t.grow((e/2+this.strokewidth)*this.scale)};mxArrowConnector.prototype.paintEdgeShape=function(t,e){var i=this.strokewidth;if(this.outline){i=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth))}var n=this.getStartArrowWidth()+i;var r=this.getEndArrowWidth()+i;var s=this.outline?this.getEdgeWidth()+i:this.getEdgeWidth();var l=this.isOpenEnded();var a=this.isMarkerStart();var o=this.isMarkerEnd();var h=l?0:this.arrowSpacing+i/2;var u=this.startSize+i;var d=this.endSize+i;var p=this.isArrowRounded();var m=e[e.length-1];var c=1;while(c<e.length-1&&e[c].x==e[0].x&&e[c].y==e[0].y){c++}var x=e[c].x-e[0].x;var f=e[c].y-e[0].y;var g=Math.sqrt(x*x+f*f);if(g==0){return}var v=x/g;var y,C=v;var E=f/g;var S,b=E;var w=s*E;var T=-s*v;var L=[];if(p){t.setLineJoin("round")}else if(e.length>2){t.setMiterLimit(1.42)}t.begin();var A=v;var M=E;if(a&&!l){this.paintMarker(t,e[0].x,e[0].y,v,E,u,n,s,h,true)}else{var _=e[0].x+w/2+h*v;var O=e[0].y+T/2+h*E;var I=e[0].x-w/2+h*v;var P=e[0].y-T/2+h*E;if(l){t.moveTo(_,O);L.push((function(){t.lineTo(I,P)}))}else{t.moveTo(I,P);t.lineTo(_,O)}}var R=0;var H=0;var N=0;for(var D=0;D<e.length-2;D++){var G=mxUtils.relativeCcw(e[D].x,e[D].y,e[D+1].x,e[D+1].y,e[D+2].x,e[D+2].y);R=e[D+2].x-e[D+1].x;H=e[D+2].y-e[D+1].y;N=Math.sqrt(R*R+H*H);if(N!=0){C=R/N;b=H/N;var U=v*C+E*b;var V=Math.max(Math.sqrt((U+1)/2),.04);y=v+C;S=E+b;var k=Math.sqrt(y*y+S*S);if(k!=0){y=y/k;S=S/k;var F=Math.max(V,Math.min(this.strokewidth/200+.04,.35));var B=G!=0&&p?Math.max(.1,F):Math.max(V,.06);var Y=e[D+1].x+S*s/2/B;var z=e[D+1].y-y*s/2/B;var j=e[D+1].x-S*s/2/B;var X=e[D+1].y+y*s/2/B;if(G==0||!p){t.lineTo(Y,z);(function(e,i){L.push((function(){t.lineTo(e,i)}))})(j,X)}else if(G==-1){var W=j+E*s;var K=X-v*s;var Z=j+b*s;var q=X-C*s;t.lineTo(W,K);t.quadTo(Y,z,Z,q);(function(e,i){L.push((function(){t.lineTo(e,i)}))})(j,X)}else{t.lineTo(Y,z);(function(e,i){var n=Y-E*s;var r=z+v*s;var l=Y-b*s;var a=z+C*s;L.push((function(){t.quadTo(e,i,n,r)}));L.push((function(){t.lineTo(l,a)}))})(j,X)}v=C;E=b}}}w=s*b;T=-s*C;if(o&&!l){this.paintMarker(t,m.x,m.y,-v,-E,d,r,s,h,false)}else{t.lineTo(m.x-h*C+w/2,m.y-h*b+T/2);var Q=m.x-h*C-w/2;var J=m.y-h*b-T/2;if(!l){t.lineTo(Q,J)}else{t.moveTo(Q,J);L.splice(0,0,(function(){t.moveTo(Q,J)}))}}for(var D=L.length-1;D>=0;D--){L[D]()}if(l){t.end();t.stroke()}else{t.close();t.fillAndStroke()}t.setShadow(false);t.setMiterLimit(4);if(p){t.setLineJoin("flat")}if(e.length>2){t.setMiterLimit(4);if(a&&!l){t.begin();this.paintMarker(t,e[0].x,e[0].y,A,M,u,n,s,h,true);t.stroke();t.end()}if(o&&!l){t.begin();this.paintMarker(t,m.x,m.y,-v,-E,d,r,s,h,true);t.stroke();t.end()}}};mxArrowConnector.prototype.paintMarker=function(t,e,i,n,r,s,l,a,o,h){var u=a/l;var d=a*r/2;var p=-a*n/2;var m=(o+s)*n;var c=(o+s)*r;if(h){t.moveTo(e-d+m,i-p+c)}else{t.lineTo(e-d+m,i-p+c)}t.lineTo(e-d/u+m,i-p/u+c);t.lineTo(e+o*n,i+o*r);t.lineTo(e+d/u+m,i+p/u+c);t.lineTo(e+d+m,i+p+c)};mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return false};mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE};__mxOutput.mxArrowConnector=typeof mxArrowConnector!=="undefined"?mxArrowConnector:undefined;function mxText(t,e,i,n,r,s,l,a,o,h,u,d,p,m,c,x,f,g,v,y,C){mxShape.call(this);this.value=t;this.bounds=e;this.color=r!=null?r:"black";this.align=i!=null?i:mxConstants.ALIGN_CENTER;this.valign=n!=null?n:mxConstants.ALIGN_MIDDLE;this.family=s!=null?s:mxConstants.DEFAULT_FONTFAMILY;this.size=l!=null?l:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=a!=null?a:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(o||2);this.spacingTop=this.spacing+parseInt(h||0);this.spacingRight=this.spacing+parseInt(u||0);this.spacingBottom=this.spacing+parseInt(d||0);this.spacingLeft=this.spacing+parseInt(p||0);this.horizontal=m!=null?m:true;this.background=c;this.border=x;this.wrap=f!=null?f:false;this.clipped=g!=null?g:false;this.overflow=v!=null?v:"visible";this.labelPadding=y!=null?y:0;this.textDirection=C;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0;mxText.prototype.replaceLinefeeds=true;mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=true;mxText.prototype.ignoreStringSize=false;mxText.prototype.textWidthPadding=document.documentMode==8&&!mxClient.IS_EM?4:3;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=true;mxText.prototype.isParseVml=function(){return false};mxText.prototype.isHtmlAllowed=function(){return document.documentMode!=8||mxClient.IS_EM};mxText.prototype.getSvgScreenOffset=function(){return 0};mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&this.bounds!=null&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)};mxText.prototype.paint=function(t,e){var i=this.scale;var n=this.bounds.x/i;var r=this.bounds.y/i;var s=this.bounds.width/i;var l=this.bounds.height/i;this.updateTransform(t,n,r,s,l);this.configureCanvas(t,n,r,s,l);if(e){t.updateText(n,r,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node)}else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML;var o=a||t instanceof mxVmlCanvas2D?"html":"";var h=this.value;if(!a&&o=="html"){h=mxUtils.htmlEntities(h,false)}if(o=="html"&&!mxUtils.isNode(this.value)){h=mxUtils.replaceTrailingNewlines(h,"<div><br></div>")}h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&o=="html"?h.replace(/\n/g,"<br/>"):h;var u=this.textDirection;if(u==mxConstants.TEXT_DIRECTION_AUTO&&!a){u=this.getAutoDirection()}if(u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL){u=null}t.text(n,r,s,l,h,this.align,this.valign,this.wrap,o,this.overflow,this.clipped,this.getTextRotation(),u)}};mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)){if(this.node.nodeName=="DIV"&&(this.isHtmlAllowed()||!mxClient.IS_VML)){if(mxClient.IS_SVG){this.redrawHtmlShapeWithCss3()}else{this.updateSize(this.node,this.state==null||this.state.view.textDiv==null);if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)){this.updateHtmlFilter()}else{this.updateHtmlTransform()}}this.updateBoundingBox()}else{var t=this.createCanvas();if(t!=null&&t.updateText!=null){t.pointerEvents=this.pointerEvents;this.paint(t,true);this.destroyCanvas(t);this.updateBoundingBox()}else{mxShape.prototype.redraw.apply(this,arguments)}}}else{mxShape.prototype.redraw.apply(this,arguments);if(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML){this.lastValue=this.value}else{this.lastValue=null}}};mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.color="black";this.align=mxConstants.ALIGN_CENTER;this.valign=mxConstants.ALIGN_MIDDLE;this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacing=2;this.spacingTop=2;this.spacingRight=2;this.spacingBottom=2;this.spacingLeft=2;this.horizontal=true;delete this.background;delete this.border;this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION;delete this.margin};mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments);if(this.style!=null){this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle);this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family);this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size);this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color);this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align);this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign);this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing));this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing;this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing;this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing;this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing;this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal);this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background);this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border);this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100);this.updateMargin()}this.flipV=null;this.flipH=null};mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return t!=null&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR};mxText.prototype.getContentNode=function(){var t=this.node;if(t!=null){if(t.ownerSVGElement==null){t=this.node.firstChild.firstChild}else{t=t.firstChild.firstChild.firstChild.firstChild.firstChild}}return t};mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation();var i=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null;var n=this.style!=null?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&t!=null&&this.overflow!="fill"&&(!this.clipped||!this.ignoreClippedStringSize||i!=mxConstants.ALIGN_CENTER||n!=mxConstants.ALIGN_MIDDLE)){var r=null;var s=null;if(t.ownerSVGElement!=null){if(t.firstChild!=null&&t.firstChild.firstChild!=null&&t.firstChild.firstChild.nodeName=="foreignObject"){t=t.firstChild.firstChild.firstChild.firstChild;s=t.offsetHeight*this.scale;if(this.overflow=="width"){r=this.boundingBox.width}else{r=t.offsetWidth*this.scale}}else{try{var l=t.getBBox();if(typeof this.value=="string"&&mxUtils.trim(this.value)==0){this.boundingBox=null}else if(l.width==0&&l.height==0){this.boundingBox=null}else{this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height)}return}catch(p){}}}else{var a=this.state!=null?this.state.view.textDiv:null;if(this.offsetWidth!=null&&this.offsetHeight!=null){r=this.offsetWidth*this.scale;s=this.offsetHeight*this.scale}else{if(a!=null){this.updateFont(a);this.updateSize(a,false);this.updateInnerHtml(a);t=a}var o=t;if(document.documentMode==8&&!mxClient.IS_EM){var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){t.style.wordWrap=mxConstants.WORD_WRAP;t.style.whiteSpace="normal";if(t.style.wordWrap!="break-word"){var u=o.getElementsByTagName("div");if(u.length>0){o=u[u.length-1]}r=o.offsetWidth+2;u=this.node.getElementsByTagName("div");if(this.clipped){r=Math.min(h,r)}if(u.length>1){u[u.length-2].style.width=r+"px"}}}else{t.style.whiteSpace="nowrap"}}else if(o.firstChild!=null&&o.firstChild.nodeName=="DIV"){o=o.firstChild}this.offsetWidth=o.offsetWidth+this.textWidthPadding;this.offsetHeight=o.offsetHeight;r=this.offsetWidth*this.scale;s=this.offsetHeight*this.scale}}if(r!=null&&s!=null){this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,r,s)}}if(this.boundingBox!=null){if(e!=0){var d=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox);this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width;this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height;this.boundingBox.x+=d.x;this.boundingBox.y+=d.y;this.boundingBox.width=d.width;this.boundingBox.height=d.height}else{this.boundingBox.x+=this.margin.x*this.boundingBox.width;this.boundingBox.y+=this.margin.y*this.boundingBox.height;this.unrotatedBoundingBox=null}}};mxText.prototype.getShapeRotation=function(){return 0};mxText.prototype.getTextRotation=function(){return this.state!=null&&this.state.shape!=null?this.state.shape.getTextRotation():0};mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&this.state!=null&&this.state.view.graph.model.isVertex(this.state.cell)};mxText.prototype.configureCanvas=function(t,e,i,n,r){mxShape.prototype.configureCanvas.apply(this,arguments);t.setFontColor(this.color);t.setFontBackgroundColor(this.background);t.setFontBorderColor(this.border);t.setFontFamily(this.family);t.setFontSize(this.size);t.setFontStyle(this.fontStyle)};mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width="1px";this.node.style.height="1px";this.node.style.overflow="visible"};mxText.prototype.getHtmlValue=function(){var t=this.value;if(this.dialect!=mxConstants.DIALECT_STRICTHTML){t=mxUtils.htmlEntities(t,false)}t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>");t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t;return t};mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;var e="display: inline-block; font-size: "+this.size+"px; "+"font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";if((this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){e+="font-weight: bold; "}if((this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){e+="font-style: italic; "}var i=[];if((this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){i.push("underline")}if((this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){i.push("line-through")}if(i.length>0){e+="text-decoration: "+i.join(" ")+"; "}return e};mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG){this.redrawHtmlShapeWithCss3()}else{var t=this.node.style;t.whiteSpace="normal";t.overflow="";t.width="";t.height="";this.updateValue();this.updateFont(this.node);this.updateSize(this.node,this.state==null||this.state.view.textDiv==null);this.offsetWidth=null;this.offsetHeight=null;if(mxClient.IS_IE&&(document.documentMode==null||document.documentMode<=8)){this.updateHtmlFilter()}else{this.updateHtmlTransform()}}};mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale));var e=Math.max(0,Math.round(this.bounds.height/this.scale));var i="position: absolute; left: "+Math.round(this.bounds.x)+"px; "+"top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ";var n=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.background!=null?mxUtils.htmlEntities(this.background):null,this.border!=null?mxUtils.htmlEntities(this.border):null,i,n,this.scale,mxUtils.bind(this,(function(t,e,i,n,r,s){var l=this.getTextRotation();var a=(this.scale!=1?"scale("+this.scale+") ":"")+(l!=0?"rotate("+l+"deg) ":"")+(this.margin.x!=0||this.margin.y!=0?"translate("+this.margin.x*100+"%,"+this.margin.y*100+"%)":"");if(a!=""){a="transform-origin: 0 0; transform: "+a+"; "}if(s==""){i+=n;n="display:inline-block; min-width: 100%; "+a}else{n+=a;if(mxClient.IS_SF){n+="-webkit-clip-path: content-box;"}}if(this.opacity<100){r+="opacity: "+this.opacity/100+"; "}this.node.setAttribute("style",i);var o=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();if(this.node.firstChild==null){this.node.innerHTML="<div><div>"+o+"</div></div>"}this.node.firstChild.firstChild.setAttribute("style",r);this.node.firstChild.setAttribute("style",n)})))};mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation();var e=this.node.style;var i=this.margin.x;var n=this.margin.y;if(t!=0){mxUtils.setPrefixedStyle(e,"transformOrigin",-i*100+"%"+" "+-n*100+"%");mxUtils.setPrefixedStyle(e,"transform","translate("+i*100+"%"+","+n*100+"%) "+"scale("+this.scale+") rotate("+t+"deg)")}else{mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%");mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") "+"translate("+i*100+"%"+","+n*100+"%)")}e.left=Math.round(this.bounds.x-Math.ceil(i*(this.overflow!="fill"&&this.overflow!="width"?3:1)))+"px";e.top=Math.round(this.bounds.y-n*(this.overflow!="fill"?3:1))+"px";if(this.opacity<100){e.opacity=this.opacity/100}else{e.opacity=""}};mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value)){t.innerHTML=this.value.outerHTML}else{var e=this.value;if(this.dialect!=mxConstants.DIALECT_STRICTHTML){e=mxUtils.htmlEntities(e,false)}e=mxUtils.replaceTrailingNewlines(e,"<div>&nbsp;</div>");e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;e='<div style="display:inline-block;_display:inline;">'+e+"</div>";t.innerHTML=e}};mxText.prototype.updateHtmlFilter=function(){var t=this.node.style;var e=this.margin.x;var i=this.margin.y;var n=this.scale;mxUtils.setOpacity(this.node,this.opacity);var r=0;var s=0;var l=this.state!=null?this.state.view.textDiv:null;var a=this.node;if(l!=null){l.style.overflow="";l.style.height="";l.style.width="";this.updateFont(l);this.updateSize(l,false);this.updateInnerHtml(l);var o=Math.round(this.bounds.width/this.scale);if(this.wrap&&o>0){l.style.whiteSpace="normal";l.style.wordWrap=mxConstants.WORD_WRAP;r=o;if(this.clipped){r=Math.min(r,this.bounds.width)}l.style.width=r+"px"}else{l.style.whiteSpace="nowrap"}a=l;if(a.firstChild!=null&&a.firstChild.nodeName=="DIV"){a=a.firstChild;if(this.wrap&&l.style.wordWrap=="break-word"){a.style.width="100%"}}if(!this.clipped&&this.wrap&&o>0){r=a.offsetWidth+this.textWidthPadding;l.style.width=r+"px"}s=a.offsetHeight+2;if(mxClient.IS_QUIRKS&&this.border!=null&&this.border!=mxConstants.NONE){s+=3}}else if(a.firstChild!=null&&a.firstChild.nodeName=="DIV"){a=a.firstChild;s=a.offsetHeight}r=a.offsetWidth+this.textWidthPadding;if(this.clipped){s=Math.min(s,this.bounds.height)}var o=this.bounds.width/n;var h=this.bounds.height/n;if(this.overflow=="fill"){s=h;r=o}else if(this.overflow=="width"){s=a.scrollHeight;r=o}this.offsetWidth=r;this.offsetHeight=s;if(mxClient.IS_QUIRKS&&(this.clipped||this.overflow=="width"&&h>0)){h=Math.min(h,s);t.height=Math.round(h)+"px"}else{h=s}if(this.overflow!="fill"&&this.overflow!="width"){if(this.clipped){r=Math.min(o,r)}o=r;if(mxClient.IS_QUIRKS&&this.clipped||this.wrap){t.width=Math.round(o)+"px"}}h*=n;o*=n;var u=this.getTextRotation()*(Math.PI/180);var d=parseFloat(parseFloat(Math.cos(u)).toFixed(8));var p=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));u%=2*Math.PI;if(u<0){u+=2*Math.PI}u%=Math.PI;if(u>Math.PI/2){u=Math.PI-u}var m=Math.cos(u);var c=Math.sin(-u);var x=o*-(e+.5);var f=h*-(i+.5);var g=(h-h*m+o*c)/2+p*x-d*f;var v=(o-o*m+h*c)/2-d*x-p*f;if(u!=0){var y="progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12="+p+", M21="+-p+", M22="+d+", sizingMethod='auto expand')";if(t.filter!=null&&t.filter.length>0){t.filter+=" "+y}else{t.filter=y}}var i=0;if(this.overflow!="fill"&&mxClient.IS_QUIRKS){if(this.valign==mxConstants.ALIGN_TOP){i-=1}else if(this.valign==mxConstants.ALIGN_BOTTOM){i+=2}else{i+=1}}t.zoom=n;t.left=Math.round(this.bounds.x+v-o/2)+"px";t.top=Math.round(this.bounds.y+g-h/2+i)+"px"};mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value)){this.node.innerHTML="";this.node.appendChild(this.value)}else{var t=this.value;if(this.dialect!=mxConstants.DIALECT_STRICTHTML){t=mxUtils.htmlEntities(t,false)}t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>");t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t;var e=this.background!=null&&this.background!=mxConstants.NONE?this.background:null;var i=this.border!=null&&this.border!=mxConstants.NONE?this.border:null;if(this.overflow=="fill"||this.overflow=="width"){if(e!=null){this.node.style.backgroundColor=e}if(i!=null){this.node.style.border="1px solid "+i}}else{var n="";if(e!=null){n+="background-color:"+mxUtils.htmlEntities(e)+";"}if(i!=null){n+="border:1px solid "+mxUtils.htmlEntities(i)+";"}var r=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t='<div style="zoom:1;'+n+"display:inline-block;_display:inline;text-decoration:inherit;"+"padding-bottom:1px;padding-right:1px;line-height:"+r+'">'+t+"</div>"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var l=this.textDirection;if(l==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML){l=this.getAutoDirection()}if(l==mxConstants.TEXT_DIRECTION_LTR||l==mxConstants.TEXT_DIRECTION_RTL){s[s.length-1].setAttribute("dir",l)}else{s[s.length-1].removeAttribute("dir")}}}};mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;e.fontSize=this.size+"px";e.fontFamily=this.family;e.verticalAlign="top";e.color=this.color;if((this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD){e.fontWeight="bold"}else{e.fontWeight=""}if((this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC){e.fontStyle="italic"}else{e.fontStyle=""}var i=[];if((this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){i.push("underline")}if((this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){i.push("line-through")}e.textDecoration=i.join(" ");if(this.align==mxConstants.ALIGN_CENTER){e.textAlign="center"}else if(this.align==mxConstants.ALIGN_RIGHT){e.textAlign="right"}else{e.textAlign="left"}};mxText.prototype.updateSize=function(t,e){var i=Math.max(0,Math.round(this.bounds.width/this.scale));var n=Math.max(0,Math.round(this.bounds.height/this.scale));var r=t.style;if(this.clipped){r.overflow="hidden";if(!mxClient.IS_QUIRKS){r.maxHeight=n+"px";r.maxWidth=i+"px"}else{r.width=i+"px"}}else if(this.overflow=="fill"){r.width=i+1+"px";r.height=n+1+"px";r.overflow="hidden"}else if(this.overflow=="width"){r.width=i+1+"px";r.maxHeight=n+1+"px";r.overflow="hidden"}if(this.wrap&&i>0){r.wordWrap=mxConstants.WORD_WRAP;r.whiteSpace="normal";r.width=i+"px";if(e&&this.overflow!="fill"&&this.overflow!="width"){var s=t;if(s.firstChild!=null&&s.firstChild.nodeName=="DIV"){s=s.firstChild;if(t.style.wordWrap=="break-word"){s.style.width="100%"}}var l=s.offsetWidth;if(l==0){var a=t.parentNode;t.style.visibility="hidden";document.body.appendChild(t);l=s.offsetWidth;t.style.visibility="";a.appendChild(t)}l+=3;if(this.clipped){l=Math.min(l,i)}r.width=l+"px"}}else{r.whiteSpace="nowrap"}};mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)};mxText.prototype.getSpacing=function(){var t=0;var e=0;if(this.align==mxConstants.ALIGN_CENTER){t=(this.spacingLeft-this.spacingRight)/2}else if(this.align==mxConstants.ALIGN_RIGHT){t=-this.spacingRight-this.baseSpacingRight}else{t=this.spacingLeft+this.baseSpacingLeft}if(this.valign==mxConstants.ALIGN_MIDDLE){e=(this.spacingTop-this.spacingBottom)/2}else if(this.valign==mxConstants.ALIGN_BOTTOM){e=-this.spacingBottom-this.baseSpacingBottom}else{e=this.spacingTop+this.baseSpacingTop}return new mxPoint(t,e)};__mxOutput.mxText=typeof mxText!=="undefined"?mxText:undefined;function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor);mxTriangle.prototype.isRoundable=function(){return true};mxTriangle.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(n,.5*r),new mxPoint(0,r)],this.isRounded,s,true)};__mxOutput.mxTriangle=typeof mxTriangle!=="undefined"?mxTriangle:undefined;function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor);mxHexagon.prototype.redrawPath=function(t,e,i,n,r){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*n,0),new mxPoint(.75*n,0),new mxPoint(n,.5*r),new mxPoint(.75*n,r),new mxPoint(.25*n,r),new mxPoint(0,.5*r)],this.isRounded,s,true)};__mxOutput.mxHexagon=typeof mxHexagon!=="undefined"?mxHexagon:undefined;function mxLine(t,e,i,n){mxShape.call(this);this.bounds=t;this.stroke=e;this.strokewidth=i!=null?i:1;this.vertical=n!=null?n:this.vertical}mxUtils.extend(mxLine,mxShape);mxLine.prototype.vertical=false;mxLine.prototype.paintVertexShape=function(t,e,i,n,r){t.begin();if(this.vertical){var s=e+n/2;t.moveTo(s,i);t.lineTo(s,i+r)}else{var s=i+r/2;t.moveTo(e,s);t.lineTo(e+n,s)}t.stroke()};__mxOutput.mxLine=typeof mxLine!=="undefined"?mxLine:undefined;function mxImageShape(t,e,i,n,r){mxShape.call(this);this.bounds=t;this.image=e;this.fill=i;this.stroke=n;this.strokewidth=r!=null?r:1;this.shadow=false}mxUtils.extend(mxImageShape,mxRectangleShape);mxImageShape.prototype.preserveImageAspect=true;mxImageShape.prototype.getSvgScreenOffset=function(){return 0};mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments);this.fill=null;this.stroke=null;this.gradient=null;if(this.style!=null){this.preserveImageAspect=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1)==1;this.flipH=this.flipH||mxUtils.getValue(this.style,"imageFlipH",0)==1;this.flipV=this.flipV||mxUtils.getValue(this.style,"imageFlipV",0)==1}};mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect};mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");t.style.position="absolute";return t};mxImageShape.prototype.isRoundable=function(t,e,i,n,r){return false};mxImageShape.prototype.paintVertexShape=function(t,e,i,n,r){if(this.image!=null){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);if(s!=null){t.setFillColor(s);t.setStrokeColor(l);t.rect(e,i,n,r);t.fillAndStroke()}t.image(e,i,n,r,this.image,this.preserveImageAspect,false,false);var l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);if(l!=null){t.setShadow(false);t.setStrokeColor(l);t.rect(e,i,n,r);t.stroke()}}else{mxRectangleShape.prototype.paintBackground.apply(this,arguments)}};mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerHTML="";if(this.image!=null){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,"");var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t;this.node.style.borderColor=e;var i=mxClient.IS_IE6||(document.documentMode==null||document.documentMode<=8)&&this.rotation!=0;var n=document.createElement(i?mxClient.VML_PREFIX+":image":"img");n.setAttribute("border","0");n.style.position="absolute";n.src=this.image;var r=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=r;if(this.flipH&&this.flipV){r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"}else if(this.flipH){r+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)"}else if(this.flipV){r+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}if(n.style.filter!=r){n.style.filter=r}if(n.nodeName=="image"){n.style.rotation=this.rotation}else if(this.rotation!=0){mxUtils.setPrefixedStyle(n.style,"transform","rotate("+this.rotation+"deg)")}else{mxUtils.setPrefixedStyle(n.style,"transform","")}n.style.width=this.node.style.width;n.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(n)}else{this.setTransparentBackgroundImage(this.node)}};__mxOutput.mxImageShape=typeof mxImageShape!=="undefined"?mxImageShape:undefined;function mxLabel(t,e,i,n){mxRectangleShape.call(this,t,e,i,n)}mxUtils.extend(mxLabel,mxRectangleShape);mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments);if(this.indicatorShape!=null){this.indicator=new this.indicatorShape;this.indicator.dialect=this.dialect;this.indicator.init(this.node)}};mxLabel.prototype.redraw=function(){if(this.indicator!=null){this.indicator.fill=this.indicatorColor;this.indicator.stroke=this.indicatorStrokeColor;this.indicator.gradient=this.indicatorGradientColor;this.indicator.direction=this.indicatorDirection;this.indicator.redraw()}mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&this.indicatorColor==null&&this.indicatorShape==null};mxLabel.prototype.paintForeground=function(t,e,i,n,r){this.paintImage(t,e,i,n,r);this.paintIndicator(t,e,i,n,r);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(t,e,i,n,r){if(this.image!=null){var s=this.getImageBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.image,false,false,false)}};mxLabel.prototype.getImageBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT);var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);var l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE);var a=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE);var o=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;if(r==mxConstants.ALIGN_CENTER){t+=(i-l)/2}else if(r==mxConstants.ALIGN_RIGHT){t+=i-l-o}else{t+=o}if(s==mxConstants.ALIGN_TOP){e+=o}else if(s==mxConstants.ALIGN_BOTTOM){e+=n-a-o}else{e+=(n-a)/2}return new mxRectangle(t,e,l,a)};mxLabel.prototype.paintIndicator=function(t,e,i,n,r){if(this.indicator!=null){this.indicator.bounds=this.getIndicatorBounds(e,i,n,r);this.indicator.paint(t)}else if(this.indicatorImage!=null){var s=this.getIndicatorBounds(e,i,n,r);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,false,false,false)}};mxLabel.prototype.getIndicatorBounds=function(t,e,i,n){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT);var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);var l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize);var a=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize);var o=this.spacing+5;if(r==mxConstants.ALIGN_RIGHT){t+=i-l-o}else if(r==mxConstants.ALIGN_CENTER){t+=(i-l)/2}else{t+=o}if(s==mxConstants.ALIGN_BOTTOM){e+=n-a-o}else if(s==mxConstants.ALIGN_TOP){e+=o}else{e+=(n-a)/2}return new mxRectangle(t,e,l,a)};mxLabel.prototype.redrawHtmlShape=function(){mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);while(this.node.hasChildNodes()){this.node.removeChild(this.node.lastChild)}if(this.image!=null){var t=document.createElement("img");t.style.position="relative";t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x;e.y-=this.bounds.y;t.style.left=Math.round(e.x)+"px";t.style.top=Math.round(e.y)+"px";t.style.width=Math.round(e.width)+"px";t.style.height=Math.round(e.height)+"px";t.src=this.image;this.node.appendChild(t)}};__mxOutput.mxLabel=typeof mxLabel!=="undefined"?mxLabel:undefined;function mxCylinder(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxCylinder,mxShape);mxCylinder.prototype.maxHeight=40;mxCylinder.prototype.svgStrokeTolerance=0;mxCylinder.prototype.paintVertexShape=function(t,e,i,n,r){t.translate(e,i);t.begin();this.redrawPath(t,e,i,n,r,false);t.fillAndStroke();if(!this.outline||this.style==null||mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)==0){t.setShadow(false);t.begin();this.redrawPath(t,e,i,n,r,true);t.stroke()}};mxCylinder.prototype.getCylinderSize=function(t,e,i,n){return Math.min(this.maxHeight,Math.round(n/5))};mxCylinder.prototype.redrawPath=function(t,e,i,n,r,s){var l=this.getCylinderSize(e,i,n,r);if(s&&this.fill!=null||!s&&this.fill==null){t.moveTo(0,l);t.curveTo(0,2*l,n,2*l,n,l);if(!s){t.stroke();t.begin()}}if(!s){t.moveTo(0,l);t.curveTo(0,-l/3,n,-l/3,n,l);t.lineTo(n,r-l);t.curveTo(n,r+l/3,0,r+l/3,0,r-l);t.close()}};__mxOutput.mxCylinder=typeof mxCylinder!=="undefined"?mxCylinder:undefined;function mxConnector(t,e,i){mxPolyline.call(this,t,e,i)}mxUtils.extend(mxConnector,mxPolyline);mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=this.style!=null&&this.style[mxConstants.STYLE_CURVED]==1;mxShape.prototype.updateBoundingBox.apply(this,arguments)};mxConnector.prototype.paintEdgeShape=function(t,e){var i=this.createMarker(t,e,true);var n=this.createMarker(t,e,false);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);t.setFillColor(this.stroke);t.setShadow(false);t.setDashed(false);if(i!=null){i()}if(n!=null){n()}};mxConnector.prototype.createMarker=function(t,e,i){var n=null;var r=e.length;var s=mxUtils.getValue(this.style,i?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW);var l=i?e[1]:e[r-2];var a=i?e[0]:e[r-1];if(s!=null&&l!=null&&a!=null){var o=1;while(o<r-1&&Math.round(l.x-a.x)==0&&Math.round(l.y-a.y)==0){l=i?e[1+o]:e[r-2-o];o++}var h=a.x-l.x;var u=a.y-l.y;var d=Math.max(1,Math.sqrt(h*h+u*u));var p=h/d;var m=u/d;var c=mxUtils.getNumber(this.style,i?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);var x=this.style[i?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL]!=0;n=mxMarker.createMarker(t,this,s,a,p,m,c,i,this.strokewidth,x)}return n};mxConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=0;if(mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE){e=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1}if(mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE){e=Math.max(e,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1}t.grow(e*this.scale)};__mxOutput.mxConnector=typeof mxConnector!=="undefined"?mxConnector:undefined;function mxSwimlane(t,e,i,n){mxShape.call(this);this.bounds=t;this.fill=e;this.stroke=i;this.strokewidth=n!=null?n:1}mxUtils.extend(mxSwimlane,mxShape);mxSwimlane.prototype.imageSize=16;mxSwimlane.prototype.isRoundable=function(t,e,i,n,r){return true};mxSwimlane.prototype.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))};mxSwimlane.prototype.getLabelBounds=function(t){var e=this.getTitleSize();var i=new mxRectangle(t.x,t.y,t.width,t.height);var n=this.isHorizontal();var r=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0)==1;var s=mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0)==1;var l=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH;var a=n==!l;var o=!a&&r!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);var h=a&&s!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(!l){var u=Math.min(i.height,e*this.scale);if(o||h){i.y+=i.height-u}i.height=u}else{var u=Math.min(i.width,e*this.scale);if(o||h){i.x+=i.width-u}i.width=u}return i};mxSwimlane.prototype.getGradientBounds=function(t,e,i,n,r){var s=this.getTitleSize();if(this.isHorizontal()){s=Math.min(s,r);return new mxRectangle(e,i,n,s)}else{s=Math.min(s,n);return new mxRectangle(e,i,s,r)}};mxSwimlane.prototype.getSwimlaneArcSize=function(t,e,i){if(mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)=="1"){return Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2))}else{var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.RECTANGLE_ROUNDING_FACTOR*100)/100;return i*n*3}};mxSwimlane.prototype.isHorizontal=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)==1};mxSwimlane.prototype.paintVertexShape=function(t,e,i,n,r){var s=this.getTitleSize();var l=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);var a=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1)==1;var o=0;if(this.isHorizontal()){s=Math.min(s,r)}else{s=Math.min(s,n)}t.translate(e,i);if(!this.isRounded){this.paintSwimlane(t,e,i,n,r,s,l,a)}else{o=this.getSwimlaneArcSize(n,r,s);o=Math.min((this.isHorizontal()?r:n)-s,Math.min(s,o));this.paintRoundedSwimlane(t,e,i,n,r,s,o,l,a)}var h=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(t,e,i,n,r,s,h);if(this.image!=null){var u=this.getImageBounds(e,i,n,r);t.image(u.x-e,u.y-i,u.width,u.height,this.image,false,false,false)}if(this.glass){t.setShadow(false);this.paintGlassEffect(t,0,0,n,s,o)}};mxSwimlane.prototype.paintSwimlane=function(t,e,i,n,r,s,l,a){t.begin();var o=true;if(this.style!=null){o=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}if(!o&&(this.fill==null||this.fill==mxConstants.NONE)){t.pointerEvents=false}if(this.isHorizontal()){t.moveTo(0,s);t.lineTo(0,0);t.lineTo(n,0);t.lineTo(n,s);t.fillAndStroke();if(s<r){if(l==mxConstants.NONE||!o){t.pointerEvents=false}if(l!=mxConstants.NONE){t.setFillColor(l)}t.begin();t.moveTo(0,s);t.lineTo(0,r);t.lineTo(n,r);t.lineTo(n,s);if(l==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}else{t.moveTo(s,0);t.lineTo(0,0);t.lineTo(0,r);t.lineTo(s,r);t.fillAndStroke();if(s<n){if(l==mxConstants.NONE||!o){t.pointerEvents=false}if(l!=mxConstants.NONE){t.setFillColor(l)}t.begin();t.moveTo(s,0);t.lineTo(n,0);t.lineTo(n,r);t.lineTo(s,r);if(l==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}if(a){this.paintDivider(t,e,i,n,r,s,l==mxConstants.NONE)}};mxSwimlane.prototype.paintRoundedSwimlane=function(t,e,i,n,r,s,l,a,o){t.begin();var h=true;if(this.style!=null){h=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"}if(!h&&(this.fill==null||this.fill==mxConstants.NONE)){t.pointerEvents=false}if(this.isHorizontal()){t.moveTo(n,s);t.lineTo(n,l);t.quadTo(n,0,n-Math.min(n/2,l),0);t.lineTo(Math.min(n/2,l),0);t.quadTo(0,0,0,l);t.lineTo(0,s);t.fillAndStroke();if(s<r){if(a==mxConstants.NONE||!h){t.pointerEvents=false}if(a!=mxConstants.NONE){t.setFillColor(a)}t.begin();t.moveTo(0,s);t.lineTo(0,r-l);t.quadTo(0,r,Math.min(n/2,l),r);t.lineTo(n-Math.min(n/2,l),r);t.quadTo(n,r,n,r-l);t.lineTo(n,s);if(a==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}else{t.moveTo(s,0);t.lineTo(l,0);t.quadTo(0,0,0,Math.min(r/2,l));t.lineTo(0,r-Math.min(r/2,l));t.quadTo(0,r,l,r);t.lineTo(s,r);t.fillAndStroke();if(s<n){if(a==mxConstants.NONE||!h){t.pointerEvents=false}if(a!=mxConstants.NONE){t.setFillColor(a)}t.begin();t.moveTo(s,r);t.lineTo(n-l,r);t.quadTo(n,r,n,r-Math.min(r/2,l));t.lineTo(n,Math.min(r/2,l));t.quadTo(n,0,n-l,0);t.lineTo(s,0);if(a==mxConstants.NONE){t.stroke()}else{t.fillAndStroke()}}}if(o){this.paintDivider(t,e,i,n,r,s,a==mxConstants.NONE)}};mxSwimlane.prototype.paintDivider=function(t,e,i,n,r,s,l){if(!l){t.setShadow(false)}t.begin();if(this.isHorizontal()){t.moveTo(0,s);t.lineTo(n,s)}else{t.moveTo(s,0);t.lineTo(s,r)}t.stroke()};mxSwimlane.prototype.paintSeparator=function(t,e,i,n,r,s,l){if(l!=mxConstants.NONE){t.setStrokeColor(l);t.setDashed(true);t.begin();if(this.isHorizontal()){t.moveTo(n,s);t.lineTo(n,r)}else{t.moveTo(s,0);t.lineTo(n,0)}t.stroke();t.setDashed(false)}};mxSwimlane.prototype.getImageBounds=function(t,e,i,n){if(this.isHorizontal()){return new mxRectangle(t+i-this.imageSize,e,this.imageSize,this.imageSize)}else{return new mxRectangle(t,e,this.imageSize,this.imageSize)}};__mxOutput.mxSwimlane=typeof mxSwimlane!=="undefined"?mxSwimlane:undefined;function mxGraphLayout(t){this.graph=t}mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=true;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(t,e,i){};mxGraphLayout.prototype.resizeCell=function(t,e){};mxGraphLayout.prototype.execute=function(t){};mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(t,e,i,n){return this.graph.getCurrentCellStyle(e)[t]};mxGraphLayout.traverse=function(t,e,i,n,r){if(i!=null&&t!=null){e=e!=null?e:true;r=r||new mxDictionary;if(!r.get(t)){r.put(t,true);var s=i(t,n);if(s==null||s){var l=this.graph.model.getEdgeCount(t);if(l>0){for(var a=0;a<l;a++){var o=this.graph.model.getEdgeAt(t,a);var h=this.graph.model.getTerminal(o,true)==t;if(!e||h){var u=this.graph.view.getVisibleTerminal(o,!h);this.traverse(u,e,i,o,r)}}}}}}};mxGraphLayout.prototype.isAncestor=function(t,e,i){if(!i){return this.graph.model.getParent(e)==t}if(e==t){return false}while(e!=null&&e!=t){e=this.graph.model.getParent(e)}return e==t};mxGraphLayout.prototype.isVertexMovable=function(t){return this.graph.isCellMovable(t)};mxGraphLayout.prototype.isVertexIgnored=function(t){return!this.graph.getModel().isVertex(t)||!this.graph.isCellVisible(t)};mxGraphLayout.prototype.isEdgeIgnored=function(t){var e=this.graph.getModel();return!e.isEdge(t)||!this.graph.isCellVisible(t)||e.getTerminal(t,true)==null||e.getTerminal(t,false)==null};mxGraphLayout.prototype.setEdgeStyleEnabled=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,e?"0":"1",[t])};mxGraphLayout.prototype.setOrthogonalEdge=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,e?"1":"0",[t])};mxGraphLayout.prototype.getParentOffset=function(t){var e=new mxPoint;if(t!=null&&t!=this.parent){var i=this.graph.getModel();if(i.isAncestor(this.parent,t)){var n=i.getGeometry(t);while(t!=this.parent){e.x=e.x+n.x;e.y=e.y+n.y;t=i.getParent(t);n=i.getGeometry(t)}}}return e};mxGraphLayout.prototype.setEdgePoints=function(t,e){if(t!=null){var i=this.graph.model;var n=i.getGeometry(t);if(n==null){n=new mxGeometry;n.setRelative(true)}else{n=n.clone()}if(this.parent!=null&&e!=null){var r=i.getParent(t);var s=this.getParentOffset(r);for(var l=0;l<e.length;l++){e[l].x=e[l].x-s.x;e[l].y=e[l].y-s.y}}n.points=e;i.setGeometry(t,n)}};mxGraphLayout.prototype.setVertexLocation=function(t,e,i){var n=this.graph.getModel();var r=n.getGeometry(t);var s=null;if(r!=null){s=new mxRectangle(e,i,r.width,r.height);if(this.useBoundingBox){var l=this.graph.getView().getState(t);if(l!=null&&l.text!=null&&l.text.boundingBox!=null){var a=this.graph.getView().scale;var o=l.text.boundingBox;if(l.text.boundingBox.x<l.x){e+=(l.x-o.x)/a;s.width=o.width}if(l.text.boundingBox.y<l.y){i+=(l.y-o.y)/a;s.height=o.height}}}if(this.parent!=null){var h=n.getParent(t);if(h!=null&&h!=this.parent){var u=this.getParentOffset(h);e=e-u.x;i=i-u.y}}if(r.x!=e||r.y!=i){r=r.clone();r.x=e;r.y=i;n.setGeometry(t,r)}}return s};mxGraphLayout.prototype.getVertexBounds=function(t){var e=this.graph.getModel().getGeometry(t);if(this.useBoundingBox){var i=this.graph.getView().getState(t);if(i!=null&&i.text!=null&&i.text.boundingBox!=null){var n=this.graph.getView().scale;var r=i.text.boundingBox;var s=Math.max(i.x-r.x,0)/n;var l=Math.max(i.y-r.y,0)/n;var a=Math.max(r.x+r.width-(i.x+i.width),0)/n;var o=Math.max(r.y+r.height-(i.y+i.height),0)/n;e=new mxRectangle(e.x-s,e.y-l,e.width+s+a,e.height+l+o)}}if(this.parent!=null){var h=this.graph.getModel().getParent(t);e=e.clone();if(h!=null&&h!=this.parent){var u=this.getParentOffset(h);e.x=e.x+u.x;e.y=e.y+u.y}}return new mxRectangle(e.x,e.y,e.width,e.height)};mxGraphLayout.prototype.arrangeGroups=function(t,e,i,n,r,s){return this.graph.updateGroupBounds(t,e,true,i,n,r,s)};function WeightedCellSorter(t,e){this.cell=t;this.weightedValue=e}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=false;WeightedCellSorter.prototype.visited=false;WeightedCellSorter.prototype.rankIndex=null;WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(t,e){if(t!=null&&e!=null){if(e.weightedValue>t.weightedValue){return-1}else if(e.weightedValue<t.weightedValue){return 1}else{if(e.nudge){return-1}else{return 1}}}else{return 0}};__mxOutput.mxGraphLayout=typeof mxGraphLayout!=="undefined"?mxGraphLayout:undefined;function mxStackLayout(t,e,i,n,r,s){mxGraphLayout.call(this,t);this.horizontal=e!=null?e:true;this.spacing=i!=null?i:0;this.x0=n!=null?n:0;this.y0=r!=null?r:0;this.border=s!=null?s:0}mxStackLayout.prototype=new mxGraphLayout;mxStackLayout.prototype.constructor=mxStackLayout;mxStackLayout.prototype.horizontal=null;mxStackLayout.prototype.spacing=null;mxStackLayout.prototype.x0=null;mxStackLayout.prototype.y0=null;mxStackLayout.prototype.border=0;mxStackLayout.prototype.marginTop=0;mxStackLayout.prototype.marginLeft=0;mxStackLayout.prototype.marginRight=0;mxStackLayout.prototype.marginBottom=0;mxStackLayout.prototype.keepFirstLocation=false;mxStackLayout.prototype.fill=false;mxStackLayout.prototype.resizeParent=false;mxStackLayout.prototype.resizeParentMax=false;mxStackLayout.prototype.resizeLast=false;mxStackLayout.prototype.wrap=null;mxStackLayout.prototype.borderCollapse=true;mxStackLayout.prototype.allowGaps=false;mxStackLayout.prototype.gridSize=0;mxStackLayout.prototype.isHorizontal=function(){return this.horizontal};mxStackLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel();var r=n.getParent(t);var s=this.isHorizontal();if(t!=null&&r!=null){var l=0;var a=0;var o=n.getChildCount(r);var h=s?e:i;var u=this.graph.getView().getState(r);if(u!=null){h-=s?u.x:u.y}h/=this.graph.view.scale;for(l=0;l<o;l++){var d=n.getChildAt(r,l);if(d!=t){var p=n.getGeometry(d);if(p!=null){var m=s?p.x+p.width/2:p.y+p.height/2;if(a<=h&&m>h){break}a=m}}}var c=r.getIndex(t);c=Math.max(0,l-(l>c?1:0));n.add(r,t,c)}};mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel();var i=e.getGeometry(t);if(this.graph.container!=null&&(i==null&&e.isLayer(t)||t==this.graph.getView().currentRoot)){var n=this.graph.container.offsetWidth-1;var r=this.graph.container.offsetHeight-1;i=new mxRectangle(0,0,n,r)}return i};mxStackLayout.prototype.getLayoutCells=function(t){var e=this.graph.getModel();var i=e.getChildCount(t);var n=[];for(var r=0;r<i;r++){var s=e.getChildAt(t,r);if(!this.isVertexIgnored(s)&&this.isVertexMovable(s)){n.push(s)}}if(this.allowGaps){n.sort(mxUtils.bind(this,(function(t,e){var i=this.graph.getCellGeometry(t);var n=this.graph.getCellGeometry(e);return this.horizontal?i.x==n.x?0:i.x>n.x>0?1:-1:i.y==n.y?0:i.y>n.y>0?1:-1})))}return n};mxStackLayout.prototype.snap=function(t){if(this.gridSize!=null&&this.gridSize>0){t=Math.max(t,this.gridSize);if(t/this.gridSize>1){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}}return t};mxStackLayout.prototype.execute=function(t){if(t!=null){var e=this.getParentSize(t);var i=this.isHorizontal();var n=this.graph.getModel();var r=null;if(e!=null){r=i?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight}r-=2*this.border;var s=this.x0+this.border+this.marginLeft;var l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var a=this.graph.getCellStyle(t);var o=mxUtils.getNumber(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);var h=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,true)==1;if(e!=null){if(h){o=Math.min(o,e.height)}else{o=Math.min(o,e.width)}}if(i==h){r-=o}if(h){l+=o}else{s+=o}}n.beginUpdate();try{var u=0;var d=null;var p=0;var m=null;var c=this.getLayoutCells(t);for(var x=0;x<c.length;x++){var f=c[x];var g=n.getGeometry(f);if(g!=null){g=g.clone();if(this.wrap!=null&&d!=null){if(i&&d.x+d.width+g.width+2*this.spacing>this.wrap||!i&&d.y+d.height+g.height+2*this.spacing>this.wrap){d=null;if(i){l+=u+this.spacing}else{s+=u+this.spacing}u=0}}u=Math.max(u,i?g.height:g.width);var v=0;if(!this.borderCollapse){var y=this.graph.getCellStyle(f);v=mxUtils.getNumber(y,mxConstants.STYLE_STROKEWIDTH,1)}if(d!=null){var C=p+this.spacing+Math.floor(v/2);if(i){g.x=this.snap((this.allowGaps?Math.max(C,g.x):C)-this.marginLeft)+this.marginLeft}else{g.y=this.snap((this.allowGaps?Math.max(C,g.y):C)-this.marginTop)+this.marginTop}}else if(!this.keepFirstLocation){if(i){g.x=this.allowGaps&&g.x>s?Math.max(this.snap(g.x-this.marginLeft)+this.marginLeft,s):s}else{g.y=this.allowGaps&&g.y>l?Math.max(this.snap(g.y-this.marginTop)+this.marginTop,l):l}}if(i){g.y=l}else{g.x=s}if(this.fill&&r!=null){if(i){g.height=r}else{g.width=r}}if(i){g.width=this.snap(g.width)}else{g.height=this.snap(g.height)}this.setChildGeometry(f,g);m=f;d=g;if(i){p=d.x+d.width+Math.floor(v/2)}else{p=d.y+d.height+Math.floor(v/2)}}}if(this.resizeParent&&e!=null&&d!=null&&!this.graph.isCellCollapsed(t)){this.updateParentGeometry(t,e,d)}else if(this.resizeLast&&e!=null&&d!=null&&m!=null){if(i){d.width=e.width-d.x-this.spacing-this.marginRight-this.marginLeft}else{d.height=e.height-d.y-this.spacing-this.marginBottom}this.setChildGeometry(m,d)}}finally{n.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(t,e){var i=this.graph.getCellGeometry(t);if(i==null||e.x!=i.x||e.y!=i.y||e.width!=i.width||e.height!=i.height){this.graph.getModel().setGeometry(t,e)}};mxStackLayout.prototype.updateParentGeometry=function(t,e,i){var n=this.isHorizontal();var r=this.graph.getModel();var s=e.clone();if(n){var l=i.x+i.width+this.marginRight+this.border;if(this.resizeParentMax){s.width=Math.max(s.width,l)}else{s.width=l}}else{var l=i.y+i.height+this.marginBottom+this.border;if(this.resizeParentMax){s.height=Math.max(s.height,l)}else{s.height=l}}if(e.x!=s.x||e.y!=s.y||e.width!=s.width||e.height!=s.height){r.setGeometry(t,s)}};__mxOutput.mxStackLayout=typeof mxStackLayout!=="undefined"?mxStackLayout:undefined;function mxPartitionLayout(t,e,i,n){mxGraphLayout.call(this,t);this.horizontal=e!=null?e:true;this.spacing=i||0;this.border=n||0}mxPartitionLayout.prototype=new mxGraphLayout;mxPartitionLayout.prototype.constructor=mxPartitionLayout;mxPartitionLayout.prototype.horizontal=null;mxPartitionLayout.prototype.spacing=null;mxPartitionLayout.prototype.border=null;mxPartitionLayout.prototype.resizeVertices=true;mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal};mxPartitionLayout.prototype.moveCell=function(t,e,i){var n=this.graph.getModel();var r=n.getParent(t);if(t!=null&&r!=null){var s=0;var l=0;var a=n.getChildCount(r);for(s=0;s<a;s++){var o=n.getChildAt(r,s);var h=this.getVertexBounds(o);if(h!=null){var u=h.x+h.width/2;if(l<e&&u>e){break}l=u}}var d=r.getIndex(t);d=Math.max(0,s-(s>d?1:0));n.add(r,t,d)}};mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal();var i=this.graph.getModel();var n=i.getGeometry(t);if(this.graph.container!=null&&(n==null&&i.isLayer(t)||t==this.graph.getView().currentRoot)){var r=this.graph.container.offsetWidth-1;var s=this.graph.container.offsetHeight-1;n=new mxRectangle(0,0,r,s)}if(n!=null){var l=[];var a=i.getChildCount(t);for(var o=0;o<a;o++){var h=i.getChildAt(t,o);if(!this.isVertexIgnored(h)&&this.isVertexMovable(h)){l.push(h)}}var u=l.length;if(u>0){var d=this.border;var p=this.border;var m=e?n.height:n.width;m-=2*this.border;var c=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;m-=e?c.height:c.width;d=d+c.width;p=p+c.height;var x=this.border+(u-1)*this.spacing;var f=e?(n.width-d-x)/u:(n.height-p-x)/u;if(f>0){i.beginUpdate();try{for(var o=0;o<u;o++){var h=l[o];var g=i.getGeometry(h);if(g!=null){g=g.clone();g.x=d;g.y=p;if(e){if(this.resizeVertices){g.width=f;g.height=m}d+=f+this.spacing}else{if(this.resizeVertices){g.height=f;g.width=m}p+=f+this.spacing}i.setGeometry(h,g)}}}finally{i.endUpdate()}}}}};__mxOutput.mxPartitionLayout=typeof mxPartitionLayout!=="undefined"?mxPartitionLayout:undefined;function mxCompactTreeLayout(t,e,i){mxGraphLayout.call(this,t);this.horizontal=e!=null?e:true;this.invert=i!=null?i:false}mxCompactTreeLayout.prototype=new mxGraphLayout;mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout;mxCompactTreeLayout.prototype.horizontal=null;mxCompactTreeLayout.prototype.invert=null;mxCompactTreeLayout.prototype.resizeParent=true;mxCompactTreeLayout.prototype.maintainParentLocation=false;mxCompactTreeLayout.prototype.groupPadding=10;mxCompactTreeLayout.prototype.groupPaddingTop=0;mxCompactTreeLayout.prototype.groupPaddingRight=0;mxCompactTreeLayout.prototype.groupPaddingBottom=0;mxCompactTreeLayout.prototype.groupPaddingLeft=0;mxCompactTreeLayout.prototype.parentsChanged=null;mxCompactTreeLayout.prototype.moveTree=false;mxCompactTreeLayout.prototype.visited=null;mxCompactTreeLayout.prototype.levelDistance=10;mxCompactTreeLayout.prototype.nodeDistance=20;mxCompactTreeLayout.prototype.resetEdges=true;mxCompactTreeLayout.prototype.prefHozEdgeSep=5;mxCompactTreeLayout.prototype.prefVertEdgeOff=4;mxCompactTreeLayout.prototype.minEdgeJetty=8;mxCompactTreeLayout.prototype.channelBuffer=4;mxCompactTreeLayout.prototype.edgeRouting=true;mxCompactTreeLayout.prototype.sortEdges=false;mxCompactTreeLayout.prototype.alignRanks=false;mxCompactTreeLayout.prototype.maxRankHeight=null;mxCompactTreeLayout.prototype.root=null;mxCompactTreeLayout.prototype.node=null;mxCompactTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0};mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal};mxCompactTreeLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.getModel();if(e==null){if(this.graph.getEdges(t,i.getParent(t),this.invert,!this.invert,false).length>0){this.root=t}else{var n=this.graph.findTreeRoots(t,true,this.invert);if(n.length>0){for(var r=0;r<n.length;r++){if(!this.isVertexIgnored(n[r])&&this.graph.getEdges(n[r],null,this.invert,!this.invert,false).length>0){this.root=n[r];break}}}}}else{this.root=e}if(this.root!=null){if(this.resizeParent){this.parentsChanged=new Object}else{this.parentsChanged=null}this.parentX=null;this.parentY=null;if(t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var s=this.graph.getCellGeometry(t);if(s!=null){this.parentX=s.x;this.parentY=s.y}}i.beginUpdate();try{this.visited=new Object;this.node=this.dfs(this.root,t);if(this.alignRanks){this.maxRankHeight=[];this.findRankHeights(this.node,0);this.setCellHeights(this.node,0)}if(this.node!=null){this.layout(this.node);var l=this.graph.gridSize;var a=l;if(!this.moveTree){var o=this.getVertexBounds(this.root);if(o!=null){l=o.x;a=o.y}}var h=null;if(this.isHorizontal()){h=this.horizontalLayout(this.node,l,a)}else{h=this.verticalLayout(this.node,null,l,a)}if(h!=null){var u=0;var d=0;if(h.x<0){u=Math.abs(l-h.x)}if(h.y<0){d=Math.abs(a-h.y)}if(u!=0||d!=0){this.moveNode(this.node,u,d)}if(this.resizeParent){this.adjustParents()}if(this.edgeRouting){this.localEdgeProcessing(this.node)}}if(this.parentX!=null&&this.parentY!=null){var s=this.graph.getCellGeometry(t);if(s!=null){s=s.clone();s.x=this.parentX;s.y=this.parentY;i.setGeometry(t,s)}}}}finally{i.endUpdate()}}};mxCompactTreeLayout.prototype.moveNode=function(t,e,i){t.x+=e;t.y+=i;this.apply(t);var n=t.child;while(n!=null){this.moveNode(n,e,i);n=n.next}};mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var i=new mxDictionary;e.sort((function(e,n){var r=e.getTerminal(e.getTerminal(false)==t);var s=i.get(r);if(s==null){s=mxCellPath.create(r).split(mxCellPath.PATH_SEPARATOR);i.put(r,s)}var l=n.getTerminal(n.getTerminal(false)==t);var a=i.get(l);if(a==null){a=mxCellPath.create(l).split(mxCellPath.PATH_SEPARATOR);i.put(l,a)}return mxCellPath.compare(s,a)}))};mxCompactTreeLayout.prototype.findRankHeights=function(t,e){if(this.maxRankHeight[e]==null||this.maxRankHeight[e]<t.height){this.maxRankHeight[e]=t.height}var i=t.child;while(i!=null){this.findRankHeights(i,e+1);i=i.next}};mxCompactTreeLayout.prototype.setCellHeights=function(t,e){if(this.maxRankHeight[e]!=null&&this.maxRankHeight[e]>t.height){t.height=this.maxRankHeight[e]}var i=t.child;while(i!=null){this.setCellHeights(i,e+1);i=i.next}};mxCompactTreeLayout.prototype.dfs=function(t,e){var i=mxCellPath.create(t);var n=null;if(t!=null&&this.visited[i]==null&&!this.isVertexIgnored(t)){this.visited[i]=t;n=this.createNode(t);var r=this.graph.getModel();var s=null;var l=this.graph.getEdges(t,e,this.invert,!this.invert,false,true);var a=this.graph.getView();if(this.sortEdges){this.sortOutgoingEdges(t,l)}for(var o=0;o<l.length;o++){var h=l[o];if(!this.isEdgeIgnored(h)){if(this.resetEdges){this.setEdgePoints(h,null)}if(this.edgeRouting){this.setEdgeStyleEnabled(h,false);this.setEdgePoints(h,null)}var u=a.getState(h);var d=u!=null?u.getVisibleTerminal(this.invert):a.getVisibleTerminal(h,this.invert);var p=this.dfs(d,e);if(p!=null&&r.getGeometry(d)!=null){if(s==null){n.child=p}else{s.next=p}s=p}}}}return n};mxCompactTreeLayout.prototype.layout=function(t){if(t!=null){var e=t.child;while(e!=null){this.layout(e);e=e.next}if(t.child!=null){this.attachParent(t,this.join(t))}else{this.layoutLeaf(t)}}};mxCompactTreeLayout.prototype.horizontalLayout=function(t,e,i,n){t.x+=e+t.offsetX;t.y+=i+t.offsetY;n=this.apply(t,n);var r=t.child;if(r!=null){n=this.horizontalLayout(r,t.x,t.y,n);var s=t.y+r.offsetY;var l=r.next;while(l!=null){n=this.horizontalLayout(l,t.x+r.offsetX,s,n);s+=l.offsetY;l=l.next}}return n};mxCompactTreeLayout.prototype.verticalLayout=function(t,e,i,n,r){t.x+=i+t.offsetY;t.y+=n+t.offsetX;r=this.apply(t,r);var s=t.child;if(s!=null){r=this.verticalLayout(s,t,t.x,t.y,r);var l=t.x+s.offsetY;var a=s.next;while(a!=null){r=this.verticalLayout(a,t,l,t.y+s.offsetX,r);l+=a.offsetY;a=a.next}}return r};mxCompactTreeLayout.prototype.attachParent=function(t,e){var i=this.nodeDistance+this.levelDistance;var n=(e-t.width)/2-this.nodeDistance;var r=n+t.width+2*this.nodeDistance-e;t.child.offsetX=i+t.height;t.child.offsetY=r;t.contour.upperHead=this.createLine(t.height,0,this.createLine(i,r,t.contour.upperHead));t.contour.lowerHead=this.createLine(t.height,0,this.createLine(i,n,t.contour.lowerHead))};mxCompactTreeLayout.prototype.layoutLeaf=function(t){var e=2*this.nodeDistance;t.contour.upperTail=this.createLine(t.height+e,0);t.contour.upperHead=t.contour.upperTail;t.contour.lowerTail=this.createLine(0,-t.width-e);t.contour.lowerHead=this.createLine(t.height+e,0,t.contour.lowerTail)};mxCompactTreeLayout.prototype.join=function(t){var e=2*this.nodeDistance;var i=t.child;t.contour=i.contour;var n=i.width+e;var r=n;i=i.next;while(i!=null){var s=this.merge(t.contour,i.contour);i.offsetY=s+n;i.offsetX=0;n=i.width+e;r+=s+n;i=i.next}return r};mxCompactTreeLayout.prototype.merge=function(t,e){var i=0;var n=0;var r=0;var s=t.lowerHead;var l=e.upperHead;while(l!=null&&s!=null){var a=this.offset(i,n,l.dx,l.dy,s.dx,s.dy);n+=a;r+=a;if(i+l.dx<=s.dx){i+=l.dx;n+=l.dy;l=l.next}else{i-=s.dx;n-=s.dy;s=s.next}}if(l!=null){var o=this.bridge(t.upperTail,0,0,l,i,n);t.upperTail=o.next!=null?e.upperTail:o;t.lowerTail=e.lowerTail}else{var o=this.bridge(e.lowerTail,i,n,s,0,0);if(o.next==null){t.lowerTail=o}}t.lowerHead=e.lowerHead;return r};mxCompactTreeLayout.prototype.offset=function(t,e,i,n,r,s){var l=0;if(r<=t||t+i<=0){return 0}var a=r*n-i*s;if(a>0){if(t<0){var o=t*n;l=o/i-e}else if(t>0){var o=t*s;l=o/r-e}else{l=-e}}else if(r<t+i){var o=(r-t)*n;l=s-(e+o/i)}else if(r>t+i){var o=(i+t)*s;l=o/r-(e+n)}else{l=s-(e+n)}if(l>0){return l}else{return 0}};mxCompactTreeLayout.prototype.bridge=function(t,e,i,n,r,s){var l=r+n.dx-e;var a=0;var o=0;if(n.dx==0){a=n.dy}else{o=l*n.dy;a=o/n.dx}var h=this.createLine(l,a,n.next);t.next=this.createLine(0,s+n.dy-a-i,h);return h};mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t;e.x=0;e.y=0;e.width=0;e.height=0;var i=this.getVertexBounds(t);if(i!=null){if(this.isHorizontal()){e.width=i.height;e.height=i.width}else{e.width=i.width;e.height=i.height}}e.offsetX=0;e.offsetY=0;e.contour=new Object;return e};mxCompactTreeLayout.prototype.apply=function(t,e){var i=this.graph.getModel();var n=t.cell;var r=i.getGeometry(n);if(n!=null&&r!=null){if(this.isVertexMovable(n)){r=this.setVertexLocation(n,t.x,t.y);if(this.resizeParent){var s=i.getParent(n);var l=mxCellPath.create(s);if(this.parentsChanged[l]==null){this.parentsChanged[l]=s}}}if(e==null){e=new mxRectangle(r.x,r.y,r.width,r.height)}else{e=new mxRectangle(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x+e.width,r.x+r.width),Math.max(e.y+e.height,r.y+r.height))}}return e};mxCompactTreeLayout.prototype.createLine=function(t,e,i){var n=new Object;n.dx=t;n.dy=e;n.next=i;return n};mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged){t.push(this.parentsChanged[e])}this.arrangeGroups(mxUtils.sortCells(t,true),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)};mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);var e=t.child;while(e!=null){this.localEdgeProcessing(e);e=e.next}};mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){var e=t.child;var i=t.cell;var n=0;var r=[];while(e!=null){n++;var s=e.x;if(this.horizontal){s=e.y}r.push(new WeightedCellSorter(e,s));e=e.next}r.sort(WeightedCellSorter.prototype.compare);var l=t.width;var a=(n+1)*this.prefHozEdgeSep;if(l>a+2*this.prefHozEdgeSep){l-=2*this.prefHozEdgeSep}var o=l/n;var h=o/2;if(l>a+2*this.prefHozEdgeSep){h+=this.prefHozEdgeSep}var u=this.minEdgeJetty-this.prefVertEdgeOff;var d=this.getVertexBounds(i);e=t.child;for(var p=0;p<r.length;p++){var m=r[p].cell.cell;var c=this.getVertexBounds(m);var x=this.graph.getEdgesBetween(i,m,false);var f=[];var g=0;var v=0;for(var y=0;y<x.length;y++){if(this.horizontal){g=d.x+d.width;v=d.y+h;f.push(new mxPoint(g,v));g=d.x+d.width+u;f.push(new mxPoint(g,v));v=c.y+c.height/2;f.push(new mxPoint(g,v));this.setEdgePoints(x[y],f)}else{g=d.x+h;v=d.y+d.height;f.push(new mxPoint(g,v));v=d.y+d.height+u;f.push(new mxPoint(g,v));g=c.x+c.width/2;f.push(new mxPoint(g,v));this.setEdgePoints(x[y],f)}}if(p<n/2){u+=this.prefVertEdgeOff}else if(p>n/2){u-=this.prefVertEdgeOff}h+=o}};__mxOutput.mxCompactTreeLayout=typeof mxCompactTreeLayout!=="undefined"?mxCompactTreeLayout:undefined;function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,false)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout);mxRadialTreeLayout.prototype.angleOffset=.5;mxRadialTreeLayout.prototype.rootx=0;mxRadialTreeLayout.prototype.rooty=0;mxRadialTreeLayout.prototype.levelDistance=120;mxRadialTreeLayout.prototype.nodeDistance=10;mxRadialTreeLayout.prototype.autoRadius=false;mxRadialTreeLayout.prototype.sortEdges=false;mxRadialTreeLayout.prototype.rowMinX=[];mxRadialTreeLayout.prototype.rowMaxX=[];mxRadialTreeLayout.prototype.rowMinCenX=[];mxRadialTreeLayout.prototype.rowMaxCenX=[];mxRadialTreeLayout.prototype.rowRadi=[];mxRadialTreeLayout.prototype.row=[];mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0};mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t;this.useBoundingBox=false;this.edgeRouting=false;mxCompactTreeLayout.prototype.execute.apply(this,arguments);var i=null;var n=this.getVertexBounds(this.root);this.centerX=n.x+n.width/2;this.centerY=n.y+n.height/2;for(var r in this.visited){var s=this.getVertexBounds(this.visited[r]);i=i!=null?i:s.clone();i.add(s)}this.calcRowDims([this.node],0);var l=0;var a=0;for(var o=0;o<this.row.length;o++){var h=(this.centerX-this.rowMinX[o]-this.nodeDistance)/this.rowRadi[o];var u=(this.rowMaxX[o]-this.centerX-this.nodeDistance)/this.rowRadi[o];l=Math.max(l,h);a=Math.max(a,u)}for(var o=0;o<this.row.length;o++){var d=this.centerX-this.nodeDistance-l*this.rowRadi[o];var p=this.centerX+this.nodeDistance+a*this.rowRadi[o];var m=p-d;for(var c=0;c<this.row[o].length;c++){var x=this.row[o];var f=x[c];var s=this.getVertexBounds(f.cell);var g=(s.x+s.width/2-d)/m;var v=2*Math.PI*g;f.theta=v}}for(var o=this.row.length-2;o>=0;o--){var x=this.row[o];for(var c=0;c<x.length;c++){var f=x[c];var y=f.child;var C=0;var E=0;while(y!=null){E+=y.theta;C++;y=y.next}if(C>0){var S=E/C;if(S>f.theta&&c<x.length-1){var b=x[c+1].theta;f.theta=Math.min(S,b-Math.PI/10)}else if(S<f.theta&&c>0){var w=x[c-1].theta;f.theta=Math.max(S,w+Math.PI/10)}}}}for(var o=0;o<this.row.length;o++){for(var c=0;c<this.row[o].length;c++){var x=this.row[o];var f=x[c];var s=this.getVertexBounds(f.cell);this.setVertexLocation(f.cell,this.centerX-s.width/2+this.rowRadi[o]*Math.cos(f.theta),this.centerY-s.height/2+this.rowRadi[o]*Math.sin(f.theta))}}};mxRadialTreeLayout.prototype.calcRowDims=function(t,e){if(t==null||t.length==0){return}this.rowMinX[e]=this.centerX;this.rowMaxX[e]=this.centerX;this.rowMinCenX[e]=this.centerX;this.rowMaxCenX[e]=this.centerX;this.row[e]=[];var i=false;for(var n=0;n<t.length;n++){var r=t[n]!=null?t[n].child:null;while(r!=null){var s=r.cell;var l=this.getVertexBounds(s);this.rowMinX[e]=Math.min(l.x,this.rowMinX[e]);this.rowMaxX[e]=Math.max(l.x+l.width,this.rowMaxX[e]);this.rowMinCenX[e]=Math.min(l.x+l.width/2,this.rowMinCenX[e]);this.rowMaxCenX[e]=Math.max(l.x+l.width/2,this.rowMaxCenX[e]);this.rowRadi[e]=l.y-this.getVertexBounds(this.root).y;if(r.child!=null){i=true}this.row[e].push(r);r=r.next}}if(i){this.calcRowDims(this.row[e],e+1)}};__mxOutput.mxRadialTreeLayout=typeof mxRadialTreeLayout!=="undefined"?mxRadialTreeLayout:undefined;function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}mxFastOrganicLayout.prototype=new mxGraphLayout;mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout;mxFastOrganicLayout.prototype.useInputOrigin=true;mxFastOrganicLayout.prototype.resetEdges=true;mxFastOrganicLayout.prototype.disableEdgeStyle=true;mxFastOrganicLayout.prototype.forceConstant=50;mxFastOrganicLayout.prototype.forceConstantSquared=0;mxFastOrganicLayout.prototype.minDistanceLimit=2;mxFastOrganicLayout.prototype.maxDistanceLimit=500;mxFastOrganicLayout.prototype.minDistanceLimitSquared=4;mxFastOrganicLayout.prototype.initialTemp=200;mxFastOrganicLayout.prototype.temperature=0;mxFastOrganicLayout.prototype.maxIterations=0;mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedToRun=true;mxFastOrganicLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||this.graph.getConnections(t).length==0};mxFastOrganicLayout.prototype.execute=function(t){var e=this.graph.getModel();this.vertexArray=[];var i=this.graph.getChildVertices(t);for(var n=0;n<i.length;n++){if(!this.isVertexIgnored(i[n])){this.vertexArray.push(i[n])}}var r=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null;var s=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];if(this.forceConstant<.001){this.forceConstant=.001}this.forceConstantSquared=this.forceConstant*this.forceConstant;for(var n=0;n<this.vertexArray.length;n++){var l=this.vertexArray[n];this.cellLocation[n]=[];var a=mxObjectIdentity.get(l);this.indices[a]=n;var o=this.getVertexBounds(l);var h=o.width;var u=o.height;var d=o.x;var p=o.y;this.cellLocation[n][0]=d+h/2;this.cellLocation[n][1]=p+u/2;this.radius[n]=Math.min(h,u);this.radiusSquared[n]=this.radius[n]*this.radius[n]}e.beginUpdate();try{for(var n=0;n<s;n++){this.dispX[n]=0;this.dispY[n]=0;this.isMoveable[n]=this.isVertexMovable(this.vertexArray[n]);var m=this.graph.getConnections(this.vertexArray[n],t);var i=this.graph.getOpposites(m,this.vertexArray[n]);this.neighbours[n]=[];for(var c=0;c<i.length;c++){if(this.resetEdges){this.graph.resetEdge(m[c])}if(this.disableEdgeStyle){this.setEdgeStyleEnabled(m[c],false)}var a=mxObjectIdentity.get(i[c]);var x=this.indices[a];if(x!=null){this.neighbours[n][c]=x}else{this.neighbours[n][c]=n}}}this.temperature=this.initialTemp;if(this.maxIterations==0){this.maxIterations=20*Math.sqrt(s)}for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun){return}this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}var f=null;var g=null;for(var n=0;n<this.vertexArray.length;n++){var l=this.vertexArray[n];if(this.isVertexMovable(l)){var o=this.getVertexBounds(l);if(o!=null){this.cellLocation[n][0]-=o.width/2;this.cellLocation[n][1]-=o.height/2;var d=this.graph.snap(Math.round(this.cellLocation[n][0]));var p=this.graph.snap(Math.round(this.cellLocation[n][1]));this.setVertexLocation(l,d,p);if(f==null){f=d}else{f=Math.min(f,d)}if(g==null){g=p}else{g=Math.min(g,p)}}}}var v=-(f||0)+1;var y=-(g||0)+1;if(r!=null){v+=r.x;y+=r.y}this.graph.moveCells(this.vertexArray,v,y)}finally{e.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var t=0;t<this.vertexArray.length;t++){if(this.isMoveable[t]){var e=Math.sqrt(this.dispX[t]*this.dispX[t]+this.dispY[t]*this.dispY[t]);if(e<.001){e=.001}var i=this.dispX[t]/e*Math.min(e,this.temperature);var n=this.dispY[t]/e*Math.min(e,this.temperature);this.dispX[t]=0;this.dispY[t]=0;this.cellLocation[t][0]+=i;this.cellLocation[t][1]+=n}}};mxFastOrganicLayout.prototype.calcAttraction=function(){for(var t=0;t<this.vertexArray.length;t++){for(var e=0;e<this.neighbours[t].length;e++){var i=this.neighbours[t][e];if(t!=i&&this.isMoveable[t]&&this.isMoveable[i]){var n=this.cellLocation[t][0]-this.cellLocation[i][0];var r=this.cellLocation[t][1]-this.cellLocation[i][1];var s=n*n+r*r-this.radiusSquared[t]-this.radiusSquared[i];if(s<this.minDistanceLimitSquared){s=this.minDistanceLimitSquared}var l=Math.sqrt(s);var a=s/this.forceConstant;var o=n/l*a;var h=r/l*a;this.dispX[t]-=o;this.dispY[t]-=h;this.dispX[i]+=o;this.dispY[i]+=h}}}};mxFastOrganicLayout.prototype.calcRepulsion=function(){var t=this.vertexArray.length;for(var e=0;e<t;e++){for(var i=e;i<t;i++){if(!this.allowedToRun){return}if(i!=e&&this.isMoveable[e]&&this.isMoveable[i]){var n=this.cellLocation[e][0]-this.cellLocation[i][0];var r=this.cellLocation[e][1]-this.cellLocation[i][1];if(n==0){n=.01+Math.random()}if(r==0){r=.01+Math.random()}var s=Math.sqrt(n*n+r*r);var l=s-this.radius[e]-this.radius[i];if(l>this.maxDistanceLimit){continue}if(l<this.minDistanceLimit){l=this.minDistanceLimit}var a=this.forceConstantSquared/l;var o=n/s*a;var h=r/s*a;this.dispX[e]+=o;this.dispY[e]+=h;this.dispX[i]-=o;this.dispY[i]-=h}}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};__mxOutput.mxFastOrganicLayout=typeof mxFastOrganicLayout!=="undefined"?mxFastOrganicLayout:undefined;function mxCircleLayout(t,e){mxGraphLayout.call(this,t);this.radius=e!=null?e:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=false;mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=true;mxCircleLayout.prototype.disableEdgeStyle=true;mxCircleLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{var i=0;var n=null;var r=null;var s=[];var l=e.getChildCount(t);for(var a=0;a<l;a++){var o=e.getChildAt(t,a);if(!this.isVertexIgnored(o)){s.push(o);var h=this.getVertexBounds(o);if(n==null){n=h.y}else{n=Math.min(n,h.y)}if(r==null){r=h.x}else{r=Math.min(r,h.x)}i=Math.max(i,Math.max(h.width,h.height))}else if(!this.isEdgeIgnored(o)){if(this.resetEdges){this.graph.resetEdge(o)}if(this.disableEdgeStyle){this.setEdgeStyleEnabled(o,false)}}}var u=this.getRadius(s.length,i);if(this.moveCircle){r=this.x0;n=this.y0}this.circle(s,u,r,n)}finally{e.endUpdate()}};mxCircleLayout.prototype.getRadius=function(t,e){return Math.max(t*e/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(t,e,i,n){var r=t.length;var s=2*Math.PI/r;for(var l=0;l<r;l++){if(this.isVertexMovable(t[l])){this.setVertexLocation(t[l],Math.round(i+e+e*Math.sin(l*s)),Math.round(n+e+e*Math.cos(l*s)))}}};__mxOutput.mxCircleLayout=typeof mxCircleLayout!=="undefined"?mxCircleLayout:undefined;function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}mxParallelEdgeLayout.prototype=new mxGraphLayout;mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.checkOverlap=false;mxParallelEdgeLayout.prototype.execute=function(t,e){var i=this.findParallels(t,e);this.graph.model.beginUpdate();try{for(var n in i){var r=i[n];if(r.length>1){this.layout(r)}}}finally{this.graph.model.endUpdate()}};mxParallelEdgeLayout.prototype.findParallels=function(t,e){var i=[];var n=mxUtils.bind(this,(function(t){if(!this.isEdgeIgnored(t)){var e=this.getEdgeId(t);if(e!=null){if(i[e]==null){i[e]=[]}i[e].push(t)}}}));if(e!=null){for(var r=0;r<e.length;r++){n(e[r])}}else{var s=this.graph.getModel();var l=s.getChildCount(t);for(var r=0;r<l;r++){n(s.getChildAt(t,r))}}return i};mxParallelEdgeLayout.prototype.getEdgeId=function(t){var e=this.graph.getView();var i=e.getVisibleTerminal(t,true);var n=e.getVisibleTerminal(t,false);var r="";if(i!=null&&n!=null){i=mxObjectIdentity.get(i);n=mxObjectIdentity.get(n);if(this.checkOverlap){var s=this.graph.view.getState(t);if(s!=null&&s.absolutePoints!=null){var l=[];for(var a=0;a<s.absolutePoints.length;a++){var o=s.absolutePoints[a];if(o!=null){l.push(o.x,o.y)}}r=l.join(",")}}return(i>n?n+"-"+i:i+"-"+n)+r}return null};mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0];var i=this.graph.getView();var n=this.graph.getModel();var r=n.getGeometry(i.getVisibleTerminal(e,true));var s=n.getGeometry(i.getVisibleTerminal(e,false));if(r==s){var l=r.x+r.width+this.spacing;var a=r.y+r.height/2;for(var o=0;o<t.length;o++){this.route(t[o],l,a);l+=this.spacing}}else if(r!=null&&s!=null){var h=r.x+r.width/2;var u=r.y+r.height/2;var d=s.x+s.width/2;var p=s.y+s.height/2;var m=d-h;var c=p-u;var x=Math.sqrt(m*m+c*c);if(x>0){var l=h+m/2;var a=u+c/2;var f=c*this.spacing/x;var g=m*this.spacing/x;l+=f*(t.length-1)/2;a-=g*(t.length-1)/2;for(var o=0;o<t.length;o++){this.route(t[o],l,a);l-=f;a+=g}}}};mxParallelEdgeLayout.prototype.route=function(t,e,i){if(this.graph.isCellMovable(t)){this.setEdgePoints(t,[new mxPoint(e,i)])}};__mxOutput.mxParallelEdgeLayout=typeof mxParallelEdgeLayout!=="undefined"?mxParallelEdgeLayout:undefined;function mxCompositeLayout(t,e,i){mxGraphLayout.call(this,t);this.layouts=e;this.master=i}mxCompositeLayout.prototype=new mxGraphLayout;mxCompositeLayout.prototype.constructor=mxCompositeLayout;mxCompositeLayout.prototype.layouts=null;mxCompositeLayout.prototype.master=null;mxCompositeLayout.prototype.moveCell=function(t,e,i){if(this.master!=null){this.master.moveCell.apply(this.master,arguments)}else{this.layouts[0].moveCell.apply(this.layouts[0],arguments)}};mxCompositeLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var i=0;i<this.layouts.length;i++){this.layouts[i].execute.apply(this.layouts[i],arguments)}}finally{e.endUpdate()}};__mxOutput.mxCompositeLayout=typeof mxCompositeLayout!=="undefined"?mxCompositeLayout:undefined;function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}mxEdgeLabelLayout.prototype=new mxGraphLayout;mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout;mxEdgeLabelLayout.prototype.execute=function(t){var e=this.graph.view;var i=this.graph.getModel();var n=[];var r=[];var s=i.getChildCount(t);for(var l=0;l<s;l++){var a=i.getChildAt(t,l);var o=e.getState(a);if(o!=null){if(!this.isVertexIgnored(a)){r.push(o)}else if(!this.isEdgeIgnored(a)){n.push(o)}}}this.placeLabels(r,n)};mxEdgeLabelLayout.prototype.placeLabels=function(t,e){var i=this.graph.getModel();i.beginUpdate();try{for(var n=0;n<e.length;n++){var r=e[n];if(r!=null&&r.text!=null&&r.text.boundingBox!=null){for(var s=0;s<t.length;s++){var l=t[s];if(l!=null){this.avoid(r,l)}}}}}finally{i.endUpdate()}};mxEdgeLabelLayout.prototype.avoid=function(t,e){var i=this.graph.getModel();var n=t.text.boundingBox;if(mxUtils.intersects(n,e)){var r=-n.y-n.height+e.y;var s=-n.y+e.y+e.height;var l=Math.abs(r)<Math.abs(s)?r:s;var a=-n.x-n.width+e.x;var o=-n.x+e.x+e.width;var h=Math.abs(a)<Math.abs(o)?a:o;if(Math.abs(h)<Math.abs(l)){l=0}else{h=0}var u=i.getGeometry(t.cell);if(u!=null){u=u.clone();if(u.offset!=null){u.offset.x+=h;u.offset.y+=l}else{u.offset=new mxPoint(h,l)}i.setGeometry(t.cell,u)}}};__mxOutput.mxEdgeLabelLayout=typeof mxEdgeLabelLayout!=="undefined"?mxEdgeLabelLayout:undefined;function mxGraphAbstractHierarchyCell(){this.x=[];this.y=[];this.temp=[]}mxGraphAbstractHierarchyCell.prototype.maxRank=-1;mxGraphAbstractHierarchyCell.prototype.minRank=-1;mxGraphAbstractHierarchyCell.prototype.x=null;mxGraphAbstractHierarchyCell.prototype.y=null;mxGraphAbstractHierarchyCell.prototype.width=0;mxGraphAbstractHierarchyCell.prototype.height=0;mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.temp=null;mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(t){return null};mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(t){return null};mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return false};mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return false};mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(t){return null};mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(t,e){return null};mxGraphAbstractHierarchyCell.prototype.setX=function(t,e){if(this.isVertex()){this.x[0]=e}else if(this.isEdge()){this.x[t-this.minRank-1]=e}};mxGraphAbstractHierarchyCell.prototype.getX=function(t){if(this.isVertex()){return this.x[0]}else if(this.isEdge()){return this.x[t-this.minRank-1]}return 0};mxGraphAbstractHierarchyCell.prototype.setY=function(t,e){if(this.isVertex()){this.y[0]=e}else if(this.isEdge()){this.y[t-this.minRank-1]=e}};__mxOutput.mxGraphAbstractHierarchyCell=typeof mxGraphAbstractHierarchyCell!=="undefined"?mxGraphAbstractHierarchyCell:undefined;function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments);this.cell=t;this.id=mxObjectIdentity.get(t);this.connectsAsTarget=[];this.connectsAsSource=[]}mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode;mxGraphHierarchyNode.prototype.cell=null;mxGraphHierarchyNode.prototype.id=null;mxGraphHierarchyNode.prototype.connectsAsTarget=null;mxGraphHierarchyNode.prototype.connectsAsSource=null;mxGraphHierarchyNode.prototype.hashCode=false;mxGraphHierarchyNode.prototype.getRankValue=function(t){return this.maxRank};mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(t){if(this.nextLayerConnectedCells==null){this.nextLayerConnectedCells=[];this.nextLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsTarget.length;e++){var i=this.connectsAsTarget[e];if(i.maxRank==-1||i.maxRank==t+1){this.nextLayerConnectedCells[0].push(i.source)}else{this.nextLayerConnectedCells[0].push(i)}}}return this.nextLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(t){if(this.previousLayerConnectedCells==null){this.previousLayerConnectedCells=[];this.previousLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsSource.length;e++){var i=this.connectsAsSource[e];if(i.minRank==-1||i.minRank==t-1){this.previousLayerConnectedCells[0].push(i.target)}else{this.previousLayerConnectedCells[0].push(i)}}}return this.previousLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.isVertex=function(){return true};mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(t){return this.temp[0]};mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(t,e){this.temp[0]=e};mxGraphHierarchyNode.prototype.isAncestor=function(t){if(t!=null&&this.hashCode!=null&&t.hashCode!=null&&this.hashCode.length<t.hashCode.length){if(this.hashCode==t.hashCode){return true}if(this.hashCode==null||this.hashCode==null){return false}for(var e=0;e<this.hashCode.length;e++){if(this.hashCode[e]!=t.hashCode[e]){return false}}return true}return false};mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell};__mxOutput.mxGraphHierarchyNode=typeof mxGraphHierarchyNode!=="undefined"?mxGraphHierarchyNode:undefined;function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments);this.edges=t;this.ids=[];for(var e=0;e<t.length;e++){this.ids.push(mxObjectIdentity.get(t[e]))}}mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge;mxGraphHierarchyEdge.prototype.edges=null;mxGraphHierarchyEdge.prototype.ids=null;mxGraphHierarchyEdge.prototype.source=null;mxGraphHierarchyEdge.prototype.target=null;mxGraphHierarchyEdge.prototype.isReversed=false;mxGraphHierarchyEdge.prototype.invert=function(t){var e=this.source;this.source=this.target;this.target=e;this.isReversed=!this.isReversed};mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(t){if(this.nextLayerConnectedCells==null){this.nextLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++){this.nextLayerConnectedCells[e]=[];if(e==this.temp.length-1){this.nextLayerConnectedCells[e].push(this.source)}else{this.nextLayerConnectedCells[e].push(this)}}}return this.nextLayerConnectedCells[t-this.minRank-1]};mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(t){if(this.previousLayerConnectedCells==null){this.previousLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++){this.previousLayerConnectedCells[e]=[];if(e==0){this.previousLayerConnectedCells[e].push(this.target)}else{this.previousLayerConnectedCells[e].push(this)}}}return this.previousLayerConnectedCells[t-this.minRank-1]};mxGraphHierarchyEdge.prototype.isEdge=function(){return true};mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(t){return this.temp[t-this.minRank-1]};mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(t,e){this.temp[t-this.minRank-1]=e};mxGraphHierarchyEdge.prototype.getCoreCell=function(){if(this.edges!=null&&this.edges.length>0){return this.edges[0]}return null};__mxOutput.mxGraphHierarchyEdge=typeof mxGraphHierarchyEdge!=="undefined"?mxGraphHierarchyEdge:undefined;function mxGraphHierarchyModel(t,e,i,n,r){var s=t.getGraph();this.tightenToSource=r;this.roots=i;this.parent=n;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;var l=[];if(e==null){e=this.graph.getChildVertices(n)}this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(t,e,l);for(var a=0;a<e.length;a++){var o=l[a].connectsAsSource;for(var h=0;h<o.length;h++){var u=o[h];var d=u.edges;if(d!=null&&d.length>0){var p=d[0];var m=t.getVisibleTerminal(p,false);var c=this.vertexMapper.get(m);if(l[a]==c){m=t.getVisibleTerminal(p,true);c=this.vertexMapper.get(m)}if(c!=null&&l[a]!=c){u.target=c;if(c.connectsAsTarget.length==0){c.connectsAsTarget=[]}if(mxUtils.indexOf(c.connectsAsTarget,u)<0){c.connectsAsTarget.push(u)}}}}l[a].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null;mxGraphHierarchyModel.prototype.vertexMapper=null;mxGraphHierarchyModel.prototype.edgeMapper=null;mxGraphHierarchyModel.prototype.ranks=null;mxGraphHierarchyModel.prototype.roots=null;mxGraphHierarchyModel.prototype.parent=null;mxGraphHierarchyModel.prototype.dfsCount=0;mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8;mxGraphHierarchyModel.prototype.tightenToSource=false;mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,i){var n=t.getGraph();for(var r=0;r<e.length;r++){i[r]=new mxGraphHierarchyNode(e[r]);this.vertexMapper.put(e[r],i[r]);var s=t.getEdges(e[r]);i[r].connectsAsSource=[];for(var l=0;l<s.length;l++){var a=t.getVisibleTerminal(s[l],false);if(a!=e[r]&&t.graph.model.isVertex(a)&&!t.isVertexIgnored(a)){var o=t.getEdgesBetween(e[r],a,false);var h=t.getEdgesBetween(e[r],a,true);if(o!=null&&o.length>0&&this.edgeMapper.get(o[0])==null&&h.length*2>=o.length){var u=new mxGraphHierarchyEdge(o);for(var d=0;d<o.length;d++){var p=o[d];this.edgeMapper.put(p,u);n.resetEdge(p);if(t.disableEdgeStyle){t.setEdgeStyleEnabled(p,false);t.setOrthogonalEdge(p,true)}}u.source=i[r];if(mxUtils.indexOf(i[r].connectsAsSource,u)<0){i[r].connectsAsSource.push(u)}}}}i[r].temp[0]=0}};mxGraphHierarchyModel.prototype.initialRank=function(){var t=[];if(this.roots!=null){for(var e=0;e<this.roots.length;e++){var i=this.vertexMapper.get(this.roots[e]);if(i!=null){t.push(i)}}}var n=this.vertexMapper.getValues();for(var e=0;e<n.length;e++){n[e].temp[0]=-1}var r=t.slice();while(t.length>0){var i=t[0];var s;var l;s=i.connectsAsTarget;l=i.connectsAsSource;var a=true;var o=this.SOURCESCANSTARTRANK;for(var e=0;e<s.length;e++){var h=s[e];if(h.temp[0]==5270620){var u=h.source;o=Math.min(o,u.temp[0]-1)}else{a=false;break}}if(a){i.temp[0]=o;this.maxRank=Math.min(this.maxRank,o);if(l!=null){for(var e=0;e<l.length;e++){var h=l[e];h.temp[0]=5270620;var u=h.target;if(u.temp[0]==-1){t.push(u);u.temp[0]=-2}}}t.shift()}else{var d=t.shift();t.push(i);if(d==i&&t.length==1){break}}}for(var e=0;e<n.length;e++){n[e].temp[0]-=this.maxRank}for(var e=0;e<r.length;e++){var i=r[e];var p=0;var s=i.connectsAsSource;for(var m=0;m<s.length;m++){var h=s[m];var u=h.target;i.temp[0]=Math.max(p,u.temp[0]+1);p=i.temp[0]}}this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank};mxGraphHierarchyModel.prototype.fixRanks=function(){var t=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++){t[e]=[];this.ranks[e]=t[e]}var i=null;if(this.roots!=null){var n=this.roots;i=[];for(var e=0;e<n.length;e++){var r=n[e];var s=this.vertexMapper.get(r);i[e]=s}}this.visit((function(e,i,n,r,s){if(s==0&&i.maxRank<0&&i.minRank<0){t[i.temp[0]].push(i);i.maxRank=i.temp[0];i.minRank=i.temp[0];i.temp[0]=t[i.maxRank].length-1}if(e!=null&&n!=null){var l=e.maxRank-i.maxRank;if(l>1){n.maxRank=e.maxRank;n.minRank=i.maxRank;n.temp=[];n.x=[];n.y=[];for(var a=n.minRank+1;a<n.maxRank;a++){t[a].push(n);n.setGeneralPurposeVariable(a,t[a].length-1)}}}}),i,false,null)};mxGraphHierarchyModel.prototype.visit=function(t,e,i,n){if(e!=null){for(var r=0;r<e.length;r++){var s=e[r];if(s!=null){if(n==null){n=new Object}if(i){s.hashCode=[];s.hashCode[0]=this.dfsCount;s.hashCode[1]=r;this.extendedDfs(null,s,null,t,n,s.hashCode,r,0)}else{this.dfs(null,s,null,t,n,0)}}}this.dfsCount++}};mxGraphHierarchyModel.prototype.dfs=function(t,e,i,n,r,s){if(e!=null){var l=e.id;if(r[l]==null){r[l]=e;n(t,e,i,s,0);var a=e.connectsAsSource.slice();for(var o=0;o<a.length;o++){var h=a[o];var u=h.target;this.dfs(e,u,h,n,r,s+1)}}else{n(t,e,i,s,1)}}};mxGraphHierarchyModel.prototype.extendedDfs=function(t,e,i,n,r,s,l,a){if(e!=null){if(t!=null){if(e.hashCode==null||e.hashCode[0]!=t.hashCode[0]){var o=t.hashCode.length+1;e.hashCode=t.hashCode.slice();e.hashCode[o-1]=l}}var h=e.id;if(r[h]==null){r[h]=e;n(t,e,i,a,0);var u=e.connectsAsSource.slice();for(var d=0;d<u.length;d++){var p=u[d];var m=p.target;this.extendedDfs(e,m,p,n,r,e.hashCode,d,a+1)}}else{n(t,e,i,a,1)}}};__mxOutput.mxGraphHierarchyModel=typeof mxGraphHierarchyModel!=="undefined"?mxGraphHierarchyModel:undefined;function mxSwimlaneModel(t,e,i,n,r){var s=t.getGraph();this.tightenToSource=r;this.roots=i;this.parent=n;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;var l=[];if(e==null){e=this.graph.getChildVertices(n)}this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(t,e,l);for(var a=0;a<e.length;a++){var o=l[a].connectsAsSource;for(var h=0;h<o.length;h++){var u=o[h];var d=u.edges;if(d!=null&&d.length>0){var p=d[0];var m=t.getVisibleTerminal(p,false);var c=this.vertexMapper.get(m);if(l[a]==c){m=t.getVisibleTerminal(p,true);c=this.vertexMapper.get(m)}if(c!=null&&l[a]!=c){u.target=c;if(c.connectsAsTarget.length==0){c.connectsAsTarget=[]}if(mxUtils.indexOf(c.connectsAsTarget,u)<0){c.connectsAsTarget.push(u)}}}}l[a].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null;mxSwimlaneModel.prototype.vertexMapper=null;mxSwimlaneModel.prototype.edgeMapper=null;mxSwimlaneModel.prototype.ranks=null;mxSwimlaneModel.prototype.roots=null;mxSwimlaneModel.prototype.parent=null;mxSwimlaneModel.prototype.dfsCount=0;mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8;mxSwimlaneModel.prototype.tightenToSource=false;mxSwimlaneModel.prototype.ranksPerGroup=null;mxSwimlaneModel.prototype.createInternalCells=function(t,e,i){var n=t.getGraph();var r=t.swimlanes;for(var s=0;s<e.length;s++){i[s]=new mxGraphHierarchyNode(e[s]);this.vertexMapper.put(e[s],i[s]);i[s].swimlaneIndex=-1;for(var l=0;l<r.length;l++){if(n.model.getParent(e[s])==r[l]){i[s].swimlaneIndex=l;break}}var a=t.getEdges(e[s]);i[s].connectsAsSource=[];for(var o=0;o<a.length;o++){var h=t.getVisibleTerminal(a[o],false);if(h!=e[s]&&t.graph.model.isVertex(h)&&!t.isVertexIgnored(h)){var u=t.getEdgesBetween(e[s],h,false);var d=t.getEdgesBetween(e[s],h,true);if(u!=null&&u.length>0&&this.edgeMapper.get(u[0])==null&&d.length*2>=u.length){var p=new mxGraphHierarchyEdge(u);for(var m=0;m<u.length;m++){var c=u[m];this.edgeMapper.put(c,p);n.resetEdge(c);if(t.disableEdgeStyle){t.setEdgeStyleEnabled(c,false);t.setOrthogonalEdge(c,true)}}p.source=i[s];if(mxUtils.indexOf(i[s].connectsAsSource,p)<0){i[s].connectsAsSource.push(p)}}}}i[s].temp[0]=0}};mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var t=[];var e=new Object;if(this.roots!=null){for(var i=0;i<this.roots.length;i++){var n=this.vertexMapper.get(this.roots[i]);this.maxChainDfs(null,n,null,e,0);if(n!=null){t.push(n)}}}var r=[];var s=[];for(var i=this.ranksPerGroup.length-1;i>=0;i--){if(i==this.ranksPerGroup.length-1){r[i]=0}else{r[i]=s[i+1]+1}s[i]=r[i]+this.ranksPerGroup[i]}this.maxRank=s[0];var l=this.vertexMapper.getValues();for(var i=0;i<l.length;i++){l[i].temp[0]=-1}while(t.length>0){var n=t[0];var a;var o;a=n.connectsAsTarget;o=n.connectsAsSource;var h=true;var u=s[0];for(var i=0;i<a.length;i++){var d=a[i];if(d.temp[0]==5270620){var p=d.source;u=Math.min(u,p.temp[0]-1)}else{h=false;break}}if(h){if(u>s[n.swimlaneIndex]){u=s[n.swimlaneIndex]}n.temp[0]=u;if(o!=null){for(var i=0;i<o.length;i++){var d=o[i];d.temp[0]=5270620;var p=d.target;if(p.temp[0]==-1){t.push(p);p.temp[0]=-2}}}t.shift()}else{var m=t.shift();t.push(n);if(m==n&&t.length==1){break}}}};mxSwimlaneModel.prototype.maxChainDfs=function(t,e,i,n,r){if(e!=null){var s=mxCellPath.create(e.cell);if(n[s]==null){n[s]=e;var l=e.swimlaneIndex;if(this.ranksPerGroup[l]==null||this.ranksPerGroup[l]<r){this.ranksPerGroup[l]=r}var a=e.connectsAsSource.slice();for(var o=0;o<a.length;o++){var h=a[o];var u=h.target;if(e.swimlaneIndex<u.swimlaneIndex){this.maxChainDfs(e,u,h,mxUtils.clone(n,null,true),0)}else if(e.swimlaneIndex==u.swimlaneIndex){this.maxChainDfs(e,u,h,mxUtils.clone(n,null,true),r+1)}}}}};mxSwimlaneModel.prototype.fixRanks=function(){var t=[];this.ranks=[];for(var e=0;e<this.maxRank+1;e++){t[e]=[];this.ranks[e]=t[e]}var i=null;if(this.roots!=null){var n=this.roots;i=[];for(var e=0;e<n.length;e++){var r=n[e];var s=this.vertexMapper.get(r);i[e]=s}}this.visit((function(e,i,n,r,s){if(s==0&&i.maxRank<0&&i.minRank<0){t[i.temp[0]].push(i);i.maxRank=i.temp[0];i.minRank=i.temp[0];i.temp[0]=t[i.maxRank].length-1}if(e!=null&&n!=null){var l=e.maxRank-i.maxRank;if(l>1){n.maxRank=e.maxRank;n.minRank=i.maxRank;n.temp=[];n.x=[];n.y=[];for(var a=n.minRank+1;a<n.maxRank;a++){t[a].push(n);n.setGeneralPurposeVariable(a,t[a].length-1)}}}}),i,false,null)};mxSwimlaneModel.prototype.visit=function(t,e,i,n){if(e!=null){for(var r=0;r<e.length;r++){var s=e[r];if(s!=null){if(n==null){n=new Object}if(i){s.hashCode=[];s.hashCode[0]=this.dfsCount;s.hashCode[1]=r;this.extendedDfs(null,s,null,t,n,s.hashCode,r,0)}else{this.dfs(null,s,null,t,n,0)}}}this.dfsCount++}};mxSwimlaneModel.prototype.dfs=function(t,e,i,n,r,s){if(e!=null){var l=e.id;if(r[l]==null){r[l]=e;n(t,e,i,s,0);var a=e.connectsAsSource.slice();for(var o=0;o<a.length;o++){var h=a[o];var u=h.target;this.dfs(e,u,h,n,r,s+1)}}else{n(t,e,i,s,1)}}};mxSwimlaneModel.prototype.extendedDfs=function(t,e,i,n,r,s,l,a){if(e!=null){if(t!=null){if(e.hashCode==null||e.hashCode[0]!=t.hashCode[0]){var o=t.hashCode.length+1;e.hashCode=t.hashCode.slice();e.hashCode[o-1]=l}}var h=e.id;if(r[h]==null){r[h]=e;n(t,e,i,a,0);var u=e.connectsAsSource.slice();var d=e.connectsAsTarget.slice();for(var p=0;p<u.length;p++){var m=u[p];var c=m.target;if(e.swimlaneIndex<=c.swimlaneIndex){this.extendedDfs(e,c,m,n,r,e.hashCode,p,a+1)}}for(var p=0;p<d.length;p++){var m=d[p];var c=m.source;if(e.swimlaneIndex<c.swimlaneIndex){this.extendedDfs(e,c,m,n,r,e.hashCode,p,a+1)}}}else{n(t,e,i,a,1)}}};__mxOutput.mxSwimlaneModel=typeof mxSwimlaneModel!=="undefined"?mxSwimlaneModel:undefined;function mxHierarchicalLayoutStage(){}mxHierarchicalLayoutStage.prototype.execute=function(t){};__mxOutput.mxHierarchicalLayoutStage=typeof mxHierarchicalLayoutStage!=="undefined"?mxHierarchicalLayoutStage:undefined;function mxMedianHybridCrossingReduction(t){this.layout=t}mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage;mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction;mxMedianHybridCrossingReduction.prototype.layout=null;mxMedianHybridCrossingReduction.prototype.maxIterations=24;mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null;mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0;mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0;mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2;mxMedianHybridCrossingReduction.prototype.execute=function(t){var e=this.layout.getModel();this.nestedBestRanks=[];for(var i=0;i<e.ranks.length;i++){this.nestedBestRanks[i]=e.ranks[i].slice()}var n=0;var r=this.calculateCrossings(e);for(var i=0;i<this.maxIterations&&n<this.maxNoImprovementIterations;i++){this.weightedMedian(i,e);this.transpose(i,e);var s=this.calculateCrossings(e);if(s<r){r=s;n=0;for(var l=0;l<this.nestedBestRanks.length;l++){var a=e.ranks[l];for(var o=0;o<a.length;o++){var h=a[o];this.nestedBestRanks[l][h.getGeneralPurposeVariable(l)]=h}}}else{n++;for(var l=0;l<this.nestedBestRanks.length;l++){var a=e.ranks[l];for(var o=0;o<a.length;o++){var h=a[o];h.setGeneralPurposeVariable(l,o)}}}if(r==0){break}}var u=[];var d=[];for(var i=0;i<e.maxRank+1;i++){d[i]=[];u[i]=d[i]}for(var i=0;i<this.nestedBestRanks.length;i++){for(var l=0;l<this.nestedBestRanks[i].length;l++){d[i].push(this.nestedBestRanks[i][l])}}e.ranks=u};mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(t){var e=t.ranks.length;var i=0;for(var n=1;n<e;n++){i+=this.calculateRankCrossing(n,t)}return i};mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(t,e){var i=0;var n=e.ranks[t];var r=e.ranks[t-1];var s=[];for(var l=0;l<n.length;l++){var a=n[l];var o=a.getGeneralPurposeVariable(t);var h=a.getPreviousLayerConnectedCells(t);var u=[];for(var d=0;d<h.length;d++){var p=h[d];var m=p.getGeneralPurposeVariable(t-1);u.push(m)}u.sort((function(t,e){return t-e}));s[o]=u}var c=[];for(var l=0;l<s.length;l++){c=c.concat(s[l])}var x=1;while(x<r.length){x<<=1}var f=2*x-1;x-=1;var g=[];for(var l=0;l<f;++l){g[l]=0}for(var l=0;l<c.length;l++){var v=c[l];var y=v+x;++g[y];while(y>0){if(y%2){i+=g[y+1]}y=y-1>>1;++g[y]}}return i};mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){var i=true;var n=0;var r=10;while(i&&n++<r){var s=t%2==1&&n%2==1;i=false;for(var l=0;l<e.ranks.length;l++){var a=e.ranks[l];var o=[];for(var h=0;h<a.length;h++){var u=a[h];var d=u.getGeneralPurposeVariable(l);if(d<0){d=h}o[d]=u}var p=null;var m=null;var c=null;var x=null;var f=null;var g=null;var v=null;var y=null;var C=null;var E=null;for(var h=0;h<a.length-1;h++){if(h==0){C=o[h];p=C.getNextLayerConnectedCells(l);m=C.getPreviousLayerConnectedCells(l);f=[];g=[];for(var S=0;S<p.length;S++){f[S]=p[S].getGeneralPurposeVariable(l+1)}for(var S=0;S<m.length;S++){g[S]=m[S].getGeneralPurposeVariable(l-1)}}else{p=c;m=x;f=v;g=y;C=E}E=o[h+1];c=E.getNextLayerConnectedCells(l);x=E.getPreviousLayerConnectedCells(l);v=[];y=[];for(var S=0;S<c.length;S++){v[S]=c[S].getGeneralPurposeVariable(l+1)}for(var S=0;S<x.length;S++){y[S]=x[S].getGeneralPurposeVariable(l-1)}var b=0;var w=0;for(var S=0;S<f.length;S++){for(var T=0;T<v.length;T++){if(f[S]>v[T]){b++}if(f[S]<v[T]){w++}}}for(var S=0;S<g.length;S++){for(var T=0;T<y.length;T++){if(g[S]>y[T]){b++}if(g[S]<y[T]){w++}}}if(w<b||w==b&&s){var L=C.getGeneralPurposeVariable(l);C.setGeneralPurposeVariable(l,E.getGeneralPurposeVariable(l));E.setGeneralPurposeVariable(l,L);c=p;x=m;v=f;y=g;E=C;if(!s){i=true}}}}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(t,e){var i=t%2==0;if(i){for(var n=e.maxRank-1;n>=0;n--){this.medianRank(n,i)}}else{for(var n=1;n<e.maxRank;n++){this.medianRank(n,i)}}};mxMedianHybridCrossingReduction.prototype.medianRank=function(t,e){var i=this.nestedBestRanks[t].length;var n=[];var r=[];for(var s=0;s<i;s++){var l=this.nestedBestRanks[t][s];var a=new MedianCellSorter;a.cell=l;var o;if(e){o=l.getNextLayerConnectedCells(t)}else{o=l.getPreviousLayerConnectedCells(t)}var h;if(e){h=t+1}else{h=t-1}if(o!=null&&o.length!=0){a.medianValue=this.medianValue(o,h);n.push(a)}else{r[l.getGeneralPurposeVariable(t)]=true}}n.sort(MedianCellSorter.prototype.compare);for(var s=0;s<i;s++){if(r[s]==null){var l=n.shift().cell;l.setGeneralPurposeVariable(t,s)}}};mxMedianHybridCrossingReduction.prototype.medianValue=function(t,e){var i=[];var n=0;for(var r=0;r<t.length;r++){var s=t[r];i[n++]=s.getGeneralPurposeVariable(e)}i.sort((function(t,e){return t-e}));if(n%2==1){return i[Math.floor(n/2)]}else if(n==2){return(i[0]+i[1])/2}else{var l=n/2;var a=i[l-1]-i[0];var o=i[n-1]-i[l];return(i[l-1]*o+i[l]*a)/(a+o)}};function MedianCellSorter(){}MedianCellSorter.prototype.medianValue=0;MedianCellSorter.prototype.cell=false;MedianCellSorter.prototype.compare=function(t,e){if(t!=null&&e!=null){if(e.medianValue>t.medianValue){return-1}else if(e.medianValue<t.medianValue){return 1}else{return 0}}else{return 0}};__mxOutput.mxMedianHybridCrossingReduction=typeof mxMedianHybridCrossingReduction!=="undefined"?mxMedianHybridCrossingReduction:undefined;function mxMinimumCycleRemover(t){this.layout=t}mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage;mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover;mxMinimumCycleRemover.prototype.layout=null;mxMinimumCycleRemover.prototype.execute=function(t){var e=this.layout.getModel();var i=new Object;var n=e.vertexMapper.getValues();var r=new Object;for(var s=0;s<n.length;s++){r[n[s].id]=n[s]}var l=null;if(e.roots!=null){var a=e.roots;l=[];for(var s=0;s<a.length;s++){l[s]=e.vertexMapper.get(a[s])}}e.visit((function(t,e,n,s,l){if(e.isAncestor(t)){n.invert();mxUtils.remove(n,t.connectsAsSource);t.connectsAsTarget.push(n);mxUtils.remove(n,e.connectsAsTarget);e.connectsAsSource.push(n)}i[e.id]=e;delete r[e.id]}),l,true,null);var o=mxUtils.clone(i,null,true);e.visit((function(t,e,n,s,l){if(e.isAncestor(t)){n.invert();mxUtils.remove(n,t.connectsAsSource);e.connectsAsSource.push(n);t.connectsAsTarget.push(n);mxUtils.remove(n,e.connectsAsTarget)}i[e.id]=e;delete r[e.id]}),r,true,o)};__mxOutput.mxMinimumCycleRemover=typeof mxMinimumCycleRemover!=="undefined"?mxMinimumCycleRemover:undefined;function mxCoordinateAssignment(t,e,i,n,r,s){this.layout=t;this.intraCellSpacing=e;this.interRankCellSpacing=i;this.orientation=n;this.initialX=r;this.parallelEdgeSpacing=s}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage;mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment;mxCoordinateAssignment.prototype.layout=null;mxCoordinateAssignment.prototype.intraCellSpacing=30;mxCoordinateAssignment.prototype.interRankCellSpacing=100;mxCoordinateAssignment.prototype.parallelEdgeSpacing=10;mxCoordinateAssignment.prototype.maxIterations=8;mxCoordinateAssignment.prototype.prefHozEdgeSep=5;mxCoordinateAssignment.prototype.prefVertEdgeOff=2;mxCoordinateAssignment.prototype.minEdgeJetty=12;mxCoordinateAssignment.prototype.channelBuffer=4;mxCoordinateAssignment.prototype.jettyPositions=null;mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH;mxCoordinateAssignment.prototype.initialX=null;mxCoordinateAssignment.prototype.limitX=null;mxCoordinateAssignment.prototype.currentXDelta=null;mxCoordinateAssignment.prototype.widestRank=null;mxCoordinateAssignment.prototype.rankTopY=null;mxCoordinateAssignment.prototype.rankBottomY=null;mxCoordinateAssignment.prototype.widestRankValue=null;mxCoordinateAssignment.prototype.rankWidths=null;mxCoordinateAssignment.prototype.rankY=null;mxCoordinateAssignment.prototype.fineTuning=true;mxCoordinateAssignment.prototype.nextLayerConnectedCache=null;mxCoordinateAssignment.prototype.previousLayerConnectedCache=null;mxCoordinateAssignment.prototype.groupPadding=10;mxCoordinateAssignment.prototype.printStatus=function(){var t=this.layout.getModel();mxLog.show();mxLog.writeln("======Coord assignment debug=======");for(var e=0;e<t.ranks.length;e++){mxLog.write("Rank ",e," : ");var i=t.ranks[e];for(var n=0;n<i.length;n++){var r=i[n];mxLog.write(r.getGeneralPurposeVariable(e)," ")}mxLog.writeln()}mxLog.writeln("====================================")};mxCoordinateAssignment.prototype.execute=function(t){this.jettyPositions=Object();var e=this.layout.getModel();this.currentXDelta=0;this.initialCoords(this.layout.getGraph(),e);if(this.fineTuning){this.minNode(e)}var i=1e8;if(this.fineTuning){for(var n=0;n<this.maxIterations;n++){if(n!=0){this.medianPos(n,e);this.minNode(e)}if(this.currentXDelta<i){for(var r=0;r<e.ranks.length;r++){var s=e.ranks[r];for(var l=0;l<s.length;l++){var a=s[l];a.setX(r,a.getGeneralPurposeVariable(r))}}i=this.currentXDelta}else{for(var r=0;r<e.ranks.length;r++){var s=e.ranks[r];for(var l=0;l<s.length;l++){var a=s[l];a.setGeneralPurposeVariable(r,a.getX(r))}}}this.minPath(this.layout.getGraph(),e);this.currentXDelta=0}}this.setCellLocations(this.layout.getGraph(),e)};mxCoordinateAssignment.prototype.minNode=function(t){var e=[];var i=new mxDictionary;var n=[];for(var r=0;r<=t.maxRank;r++){n[r]=t.ranks[r];for(var s=0;s<n[r].length;s++){var l=n[r][s];var a=new WeightedCellSorter(l,r);a.rankIndex=s;a.visited=true;e.push(a);i.put(l,a)}}var o=e.length*10;var h=0;var u=1;while(e.length>0&&h<=o){var d=e.shift();var p=d.cell;var m=d.weightedValue;var c=parseInt(d.rankIndex);var x=p.getNextLayerConnectedCells(m);var f=p.getPreviousLayerConnectedCells(m);var g=x.length;var v=f.length;var y=this.medianXValue(x,m+1);var C=this.medianXValue(f,m-1);var E=g+v;var S=p.getGeneralPurposeVariable(m);var b=S;if(E>0){b=(y*g+C*v)/E}var w=false;if(b<S-u){if(c==0){p.setGeneralPurposeVariable(m,b);w=true}else{var T=n[m][c-1];var L=T.getGeneralPurposeVariable(m);L=L+T.width/2+this.intraCellSpacing+p.width/2;if(L<b){p.setGeneralPurposeVariable(m,b);w=true}else if(L<p.getGeneralPurposeVariable(m)-u){p.setGeneralPurposeVariable(m,L);w=true}}}else if(b>S+u){var A=n[m].length;if(c==A-1){p.setGeneralPurposeVariable(m,b);w=true}else{var M=n[m][c+1];var _=M.getGeneralPurposeVariable(m);_=_-M.width/2-this.intraCellSpacing-p.width/2;if(_>b){p.setGeneralPurposeVariable(m,b);w=true}else if(_>p.getGeneralPurposeVariable(m)+u){p.setGeneralPurposeVariable(m,_);w=true}}}if(w){for(var r=0;r<x.length;r++){var O=x[r];var I=i.get(O);if(I!=null){if(I.visited==false){I.visited=true;e.push(I)}}}for(var r=0;r<f.length;r++){var O=f[r];var I=i.get(O);if(I!=null){if(I.visited==false){I.visited=true;e.push(I)}}}}d.visited=false;h++}};mxCoordinateAssignment.prototype.medianPos=function(t,e){var i=t%2==0;if(i){for(var n=e.maxRank;n>0;n--){this.rankMedianPosition(n-1,e,n)}}else{for(var n=0;n<e.maxRank-1;n++){this.rankMedianPosition(n+1,e,n)}}};mxCoordinateAssignment.prototype.rankMedianPosition=function(t,e,i){var n=e.ranks[t];var r=[];var s=new Object;for(var l=0;l<n.length;l++){var a=n[l];r[l]=new WeightedCellSorter;r[l].cell=a;r[l].rankIndex=l;s[a.id]=r[l];var o=null;if(i<t){o=a.getPreviousLayerConnectedCells(t)}else{o=a.getNextLayerConnectedCells(t)}r[l].weightedValue=this.calculatedWeightedValue(a,o)}r.sort(WeightedCellSorter.prototype.compare);for(var l=0;l<r.length;l++){var h=0;var u=r[l].cell;var o=null;var d=0;if(i<t){o=u.getPreviousLayerConnectedCells(t).slice()}else{o=u.getNextLayerConnectedCells(t).slice()}if(o!=null){h=o.length;if(h>0){d=this.medianXValue(o,i)}else{d=u.getGeneralPurposeVariable(t)}}var p=0;var m=-1e8;for(var c=r[l].rankIndex-1;c>=0;){var x=s[n[c].id];if(x!=null){var f=x.cell;if(x.visited){m=f.getGeneralPurposeVariable(t)+f.width/2+this.intraCellSpacing+p+u.width/2;c=-1}else{p+=f.width+this.intraCellSpacing;c--}}}var g=0;var v=1e8;for(var c=r[l].rankIndex+1;c<r.length;){var x=s[n[c].id];if(x!=null){var y=x.cell;if(x.visited){v=y.getGeneralPurposeVariable(t)-y.width/2-this.intraCellSpacing-g-u.width/2;c=r.length}else{g+=y.width+this.intraCellSpacing;c++}}}if(d>=m&&d<=v){u.setGeneralPurposeVariable(t,d)}else if(d<m){u.setGeneralPurposeVariable(t,m);this.currentXDelta+=m-d}else if(d>v){u.setGeneralPurposeVariable(t,v);this.currentXDelta+=d-v}r[l].visited=true}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){var i=0;for(var n=0;n<e.length;n++){var r=e[n];if(t.isVertex()&&r.isVertex()){i++}else if(t.isEdge()&&r.isEdge()){i+=8}else{i+=2}}return i};mxCoordinateAssignment.prototype.medianXValue=function(t,e){if(t.length==0){return 0}var i=[];for(var n=0;n<t.length;n++){i[n]=t[n].getGeneralPurposeVariable(e)}i.sort((function(t,e){return t-e}));if(t.length%2==1){return i[Math.floor(t.length/2)]}else{var r=t.length/2;var s=i[r-1];var l=i[r];return(s+l)/2}};mxCoordinateAssignment.prototype.initialCoords=function(t,e){this.calculateWidestRank(t,e);for(var i=this.widestRank;i>=0;i--){if(i<e.maxRank){this.rankCoordinates(i,t,e)}}for(var i=this.widestRank+1;i<=e.maxRank;i++){if(i>0){this.rankCoordinates(i,t,e)}}};mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,i){var n=i.ranks[t];var r=this.initialX+(this.widestRankValue-this.rankWidths[t])/2;var s=false;for(var l=0;l<n.length;l++){var a=n[l];if(a.isVertex()){var o=this.layout.getVertexBounds(a.cell);if(o!=null){if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){a.width=o.width;a.height=o.height}else{a.width=o.height;a.height=o.width}}else{s=true}}else if(a.isEdge()){var h=1;if(a.edges!=null){h=a.edges.length}else{mxLog.warn("edge.edges is null")}a.width=(h-1)*this.parallelEdgeSpacing}r+=a.width/2;a.setX(t,r);a.setGeneralPurposeVariable(t,r);r+=a.width/2;r+=this.intraCellSpacing}if(s==true){mxLog.warn("At least one cell has no bounds")}};mxCoordinateAssignment.prototype.calculateWidestRank=function(t,e){var i=-this.interRankCellSpacing;var n=0;this.rankWidths=[];this.rankY=[];for(var r=e.maxRank;r>=0;r--){var s=0;var l=e.ranks[r];var a=this.initialX;var o=false;for(var h=0;h<l.length;h++){var u=l[h];if(u.isVertex()){var d=this.layout.getVertexBounds(u.cell);if(d!=null){if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){u.width=d.width;u.height=d.height}else{u.width=d.height;u.height=d.width}}else{o=true}s=Math.max(s,u.height)}else if(u.isEdge()){var p=1;if(u.edges!=null){p=u.edges.length}else{mxLog.warn("edge.edges is null")}u.width=(p-1)*this.parallelEdgeSpacing}a+=u.width/2;u.setX(r,a);u.setGeneralPurposeVariable(r,a);a+=u.width/2;a+=this.intraCellSpacing;if(a>this.widestRankValue){this.widestRankValue=a;this.widestRank=r}this.rankWidths[r]=a}if(o==true){mxLog.warn("At least one cell has no bounds")}this.rankY[r]=i;var m=s/2+n/2+this.interRankCellSpacing;n=s;if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST){i+=m}else{i-=m}for(var h=0;h<l.length;h++){var c=l[h];c.setY(r,i)}}};mxCoordinateAssignment.prototype.minPath=function(t,e){var i=e.edgeMapper.getValues();for(var n=0;n<i.length;n++){var r=i[n];if(r.maxRank-r.minRank-1<1){continue}var s=r.getGeneralPurposeVariable(r.minRank+1);var l=true;var a=0;for(var o=r.minRank+2;o<r.maxRank;o++){var h=r.getGeneralPurposeVariable(o);if(s!=h){l=false;s=h}else{a++}}if(!l){var u=0;var d=0;var p=[];var m=[];var c=r.getGeneralPurposeVariable(r.minRank+1);for(var o=r.minRank+1;o<r.maxRank-1;o++){var x=r.getX(o+1);if(c==x){p[o-r.minRank-1]=c;u++}else if(this.repositionValid(e,r,o+1,c)){p[o-r.minRank-1]=c;u++}else{p[o-r.minRank-1]=x;c=x}}c=r.getX(o);for(var o=r.maxRank-1;o>r.minRank+1;o--){var x=r.getX(o-1);if(c==x){m[o-r.minRank-2]=c;d++}else if(this.repositionValid(e,r,o-1,c)){m[o-r.minRank-2]=c;d++}else{m[o-r.minRank-2]=r.getX(o-1);c=x}}if(d>a||u>a){if(d>=u){for(var o=r.maxRank-2;o>r.minRank;o--){r.setX(o,m[o-r.minRank-1])}}else if(u>d){for(var o=r.minRank+2;o<r.maxRank;o++){r.setX(o,p[o-r.minRank-2])}}}}}};mxCoordinateAssignment.prototype.repositionValid=function(t,e,i,n){var r=t.ranks[i];var s=-1;for(var l=0;l<r.length;l++){if(e==r[l]){s=l;break}}if(s<0){return false}var a=e.getGeneralPurposeVariable(i);if(n<a){if(s==0){return true}var o=r[s-1];var h=o.getGeneralPurposeVariable(i);h=h+o.width/2+this.intraCellSpacing+e.width/2;if(h<=n){return true}else{return false}}else if(n>a){if(s==r.length-1){return true}var u=r[s+1];var d=u.getGeneralPurposeVariable(i);d=d-u.width/2-this.intraCellSpacing-e.width/2;if(d>=n){return true}else{return false}}return true};mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[];this.rankBottomY=[];for(var i=0;i<e.ranks.length;i++){this.rankTopY[i]=Number.MAX_VALUE;this.rankBottomY[i]=-Number.MAX_VALUE}var n=e.vertexMapper.getValues();for(var i=0;i<n.length;i++){this.setVertexLocation(n[i])}if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.layout.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){this.localEdgeProcessing(e)}var r=e.edgeMapper.getValues();for(var i=0;i<r.length;i++){this.setEdgePosition(r[i])}};mxCoordinateAssignment.prototype.localEdgeProcessing=function(t){for(var e=0;e<t.ranks.length;e++){var i=t.ranks[e];for(var n=0;n<i.length;n++){var r=i[n];if(r.isVertex()){var s=r.getPreviousLayerConnectedCells(e);var l=e-1;for(var a=0;a<2;a++){if(l>-1&&l<t.ranks.length&&s!=null&&s.length>0){var o=[];for(var h=0;h<s.length;h++){var u=new WeightedCellSorter(s[h],s[h].getX(l));o.push(u)}o.sort(WeightedCellSorter.prototype.compare);var d=r.x[0]-r.width/2;var p=d+r.width;var m=0;var c=[];for(var h=0;h<o.length;h++){var x=o[h].cell;var f;if(x.isVertex()){if(a==0){f=r.connectsAsSource}else{f=r.connectsAsTarget}for(var g=0;g<f.length;g++){if(f[g].source==x||f[g].target==x){m+=f[g].edges.length;c.push(f[g])}}}else{m+=x.edges.length;c.push(x)}}var v=(m+1)*this.prefHozEdgeSep;if(r.width>v+2*this.prefHozEdgeSep){d+=this.prefHozEdgeSep;p-=this.prefHozEdgeSep}var y=p-d;var C=y/m;var E=d+C/2;var S=this.minEdgeJetty-this.prefVertEdgeOff;for(var h=0;h<c.length;h++){var b=c[h].edges.length;var w=this.jettyPositions[c[h].ids[0]];if(w==null){w=[];this.jettyPositions[c[h].ids[0]]=w}if(h<m/2){S+=this.prefVertEdgeOff}else if(h>m/2){S-=this.prefVertEdgeOff}for(var T=0;T<b;T++){w[T*4+a*2]=E;E+=C;w[T*4+a*2+1]=S}}}s=r.getNextLayerConnectedCells(e);l=e+1}}}}};mxCoordinateAssignment.prototype.setEdgePosition=function(t){var e=0;if(t.temp[0]!=101207){var i=t.maxRank;var n=t.minRank;if(i==n){i=t.source.maxRank;n=t.target.minRank}var r=0;var s=this.jettyPositions[t.ids[0]];var l=t.isReversed?t.target.cell:t.source.cell;var a=this.layout.graph;var o=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH;for(var h=0;h<t.edges.length;h++){var u=t.edges[h];var d=this.layout.getVisibleTerminal(u,true);var p=[];var m=t.isReversed;if(d!=l){m=!m}if(s!=null){var c=m?2:0;var x=m?o?this.rankBottomY[n]:this.rankTopY[n]:o?this.rankTopY[i]:this.rankBottomY[i];var f=s[r*4+1+c];if(m!=o){f=-f}x+=f;var g=s[r*4+c];var v=a.model.getTerminal(u,true);if(this.layout.isPort(v)&&a.model.getParent(v)==d){var y=a.view.getState(v);if(y!=null){g=y.x}else{g=d.geometry.x+t.source.width*v.geometry.x}}if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){p.push(new mxPoint(g,x));if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(g,x+f))}}else{p.push(new mxPoint(x,g));if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(x+f,g))}}}var C=t.x.length-1;var E=-1;var S=-1;var b=t.maxRank-1;if(m){C=0;E=t.x.length;S=1;b=t.minRank+1}for(var w=C;t.maxRank!=t.minRank&&w!=E;w+=S){var T=t.x[w]+e;var L=(this.rankTopY[b]+this.rankBottomY[b+1])/2;var A=(this.rankTopY[b-1]+this.rankBottomY[b])/2;if(m){var M=L;L=A;A=M}if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){p.push(new mxPoint(T,L));p.push(new mxPoint(T,A))}else{p.push(new mxPoint(L,T));p.push(new mxPoint(A,T))}this.limitX=Math.max(this.limitX,T);b+=S}if(s!=null){var c=m?2:0;var _=m?o?this.rankTopY[i]:this.rankBottomY[i]:o?this.rankBottomY[n]:this.rankTopY[n];var f=s[r*4+3-c];if(m!=o){f=-f}var x=_-f;var g=s[r*4+2-c];var O=a.model.getTerminal(u,false);var I=this.layout.getVisibleTerminal(u,false);if(this.layout.isPort(O)&&a.model.getParent(O)==I){var y=a.view.getState(O);if(y!=null){g=y.x}else{g=I.geometry.x+t.target.width*O.geometry.x}}if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(g,x-f))}p.push(new mxPoint(g,x))}else{if(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE){p.push(new mxPoint(x-f,g))}p.push(new mxPoint(x,g))}}if(t.isReversed){this.processReversedEdge(t,u)}this.layout.setEdgePoints(u,p);if(e==0){e=this.parallelEdgeSpacing}else if(e>0){e=-e}else{e=-e+this.parallelEdgeSpacing}r++}t.temp[0]=101207}};mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell;var i=t.x[0]-t.width/2;var n=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],n);this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],n+t.height);if(this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH){this.layout.setVertexLocation(e,i,n)}else{this.layout.setVertexLocation(e,n,i)}this.limitX=Math.max(this.limitX,i+t.width)};mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){};__mxOutput.mxCoordinateAssignment=typeof mxCoordinateAssignment!=="undefined"?mxCoordinateAssignment:undefined;function mxSwimlaneOrdering(t){this.layout=t}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage;mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering;mxSwimlaneOrdering.prototype.layout=null;mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel();var i=new Object;var n=mxUtils.clone(e.vertexMapper,null,true);var r=null;if(e.roots!=null){var s=e.roots;r=[];for(var l=0;l<s.length;l++){r[l]=e.vertexMapper.get(s[l])}}e.visit((function(t,e,r,s,l){var a=t!=null&&t.swimlaneIndex==e.swimlaneIndex&&e.isAncestor(t);var o=t!=null&&r!=null&&t.swimlaneIndex<e.swimlaneIndex&&r.source==e;if(a){r.invert();mxUtils.remove(r,t.connectsAsSource);e.connectsAsSource.push(r);t.connectsAsTarget.push(r);mxUtils.remove(r,e.connectsAsTarget)}else if(o){r.invert();mxUtils.remove(r,t.connectsAsTarget);e.connectsAsTarget.push(r);t.connectsAsSource.push(r);mxUtils.remove(r,e.connectsAsSource)}var h=mxCellPath.create(e.cell);i[h]=e;delete n[h]}),r,true,null)};__mxOutput.mxSwimlaneOrdering=typeof mxSwimlaneOrdering!=="undefined"?mxSwimlaneOrdering:undefined;function mxHierarchicalLayout(t,e,i){mxGraphLayout.call(this,t);this.orientation=e!=null?e:mxConstants.DIRECTION_NORTH;this.deterministic=i!=null?i:true}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout;mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout;mxHierarchicalLayout.prototype.roots=null;mxHierarchicalLayout.prototype.resizeParent=false;mxHierarchicalLayout.prototype.maintainParentLocation=false;mxHierarchicalLayout.prototype.moveParent=false;mxHierarchicalLayout.prototype.parentBorder=0;mxHierarchicalLayout.prototype.intraCellSpacing=30;mxHierarchicalLayout.prototype.interRankCellSpacing=100;mxHierarchicalLayout.prototype.interHierarchySpacing=60;mxHierarchicalLayout.prototype.parallelEdgeSpacing=10;mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxHierarchicalLayout.prototype.fineTuning=true;mxHierarchicalLayout.prototype.tightenToSource=true;mxHierarchicalLayout.prototype.disableEdgeStyle=true;mxHierarchicalLayout.prototype.traverseAncestors=true;mxHierarchicalLayout.prototype.model=null;mxHierarchicalLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxHierarchicalLayout.prototype.getModel=function(){return this.model};mxHierarchicalLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(e!=null&&!(e instanceof Array)){e=[e]}if(e==null&&t==null){return}this.parentX=null;this.parentY=null;if(t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var n=this.graph.getCellGeometry(t);if(n!=null){this.parentX=n.x;this.parentY=n.y}}if(e!=null){var r=[];for(var s=0;s<e.length;s++){var l=t!=null?i.isAncestor(t,e[s]):true;if(l&&i.isVertex(e[s])){r.push(e[s])}}this.roots=r}i.beginUpdate();try{this.run(t);if(this.resizeParent&&!this.graph.isCellCollapsed(t)){this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent)}if(this.parentX!=null&&this.parentY!=null){var n=this.graph.getCellGeometry(t);if(n!=null){n=n.clone();n.x=this.parentX;n.y=this.parentY;i.setGeometry(t,n)}}}finally{i.endUpdate()}};mxHierarchicalLayout.prototype.findRoots=function(t,e){var i=[];if(t!=null&&e!=null){var n=this.graph.model;var r=null;var s=-1e5;for(var l in e){var a=e[l];if(n.isVertex(a)&&this.graph.isCellVisible(a)){var o=this.getEdges(a);var h=0;var u=0;for(var d=0;d<o.length;d++){var p=this.getVisibleTerminal(o[d],true);if(p==a){h++}else{u++}}if(u==0&&h>0){i.push(a)}var m=h-u;if(m>s){s=m;r=a}}}if(i.length==0&&r!=null){i.push(r)}}return i};mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null){return e}var i=this.graph.model;var n=[];var r=this.graph.isCellCollapsed(t);var s=i.getChildCount(t);for(var l=0;l<s;l++){var a=i.getChildAt(t,l);if(this.isPort(a)){n=n.concat(i.getEdges(a,true,true))}else if(r||!this.graph.isCellVisible(a)){n=n.concat(i.getEdges(a,true,true))}}n=n.concat(i.getEdges(t,true,true));var o=[];for(var l=0;l<n.length;l++){var h=this.getVisibleTerminal(n[l],true);var u=this.getVisibleTerminal(n[l],false);if(h==u||h!=u&&(u==t&&(this.parent==null||this.isAncestor(this.parent,h,this.traverseAncestors))||h==t&&(this.parent==null||this.isAncestor(this.parent,u,this.traverseAncestors)))){o.push(n[l])}}this.edgesCache.put(t,o);return o};mxHierarchicalLayout.prototype.getVisibleTerminal=function(t,e){var i=this.edgesTargetTermCache;if(e){i=this.edgeSourceTermCache}var n=i.get(t);if(n!=null){return n}var r=this.graph.view.getState(t);var s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);if(s==null){s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)}if(s!=null){if(this.isPort(s)){s=this.graph.model.getParent(s)}i.put(t,s)}return s};mxHierarchicalLayout.prototype.run=function(t){var e=[];var i=[];if(this.roots==null&&t!=null){var n=Object();this.filterDescendants(t,n);this.roots=[];var r=true;for(var s in n){if(n[s]!=null){r=false;break}}while(!r){var l=this.findRoots(t,n);for(var a=0;a<l.length;a++){var o=Object();e.push(o);this.traverse(l[a],true,null,i,o,e,n)}for(var a=0;a<l.length;a++){this.roots.push(l[a])}r=true;for(var s in n){if(n[s]!=null){r=false;break}}}}else{for(var a=0;a<this.roots.length;a++){var o=Object();e.push(o);this.traverse(this.roots[a],true,null,i,o,e,null)}}var h=0;for(var a=0;a<e.length;a++){var o=e[a];var u=[];for(var s in o){u.push(o[s])}this.model=new mxGraphHierarchyModel(this,u,this.roots,t,this.tightenToSource);this.cycleStage(t);this.layeringStage();this.crossingStage(t);h=this.placementStage(h,t)}};mxHierarchicalLayout.prototype.filterDescendants=function(t,e){var i=this.graph.model;if(i.isVertex(t)&&t!=this.parent&&this.graph.isCellVisible(t)){e[mxObjectIdentity.get(t)]=t}if(this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t)){var n=i.getChildCount(t);for(var r=0;r<n;r++){var s=i.getChildAt(t,r);if(!this.isPort(s)){this.filterDescendants(s,e)}}}};mxHierarchicalLayout.prototype.isPort=function(t){if(t!=null&&t.geometry!=null){return t.geometry.relative}else{return false}};mxHierarchicalLayout.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdges(t);var r=[];for(var s=0;s<n.length;s++){var l=this.getVisibleTerminal(n[s],true);var a=this.getVisibleTerminal(n[s],false);if(l==t&&a==e||!i&&l==e&&a==t){r.push(n[s])}}return r};mxHierarchicalLayout.prototype.traverse=function(t,e,i,n,r,s,l){if(t!=null&&n!=null){var a=mxObjectIdentity.get(t);if(n[a]==null&&(l==null?true:l[a]!=null)){if(r[a]==null){r[a]=t}if(n[a]==null){n[a]=t}if(l!==null){delete l[a]}var o=this.getEdges(t);var h=[];for(var u=0;u<o.length;u++){h[u]=this.getVisibleTerminal(o[u],true)==t}for(var u=0;u<o.length;u++){if(!e||h[u]){var d=this.getVisibleTerminal(o[u],!h[u]);var p=1;for(var m=0;m<o.length;m++){if(m==u){continue}else{var c=h[m];var x=this.getVisibleTerminal(o[m],!c);if(x==d){if(c){p++}else{p--}}}}if(p>=0){r=this.traverse(d,e,o[u],n,r,s,l)}}}}else{if(r[a]==null){for(var u=0;u<s.length;u++){var f=s[u];if(f[a]!=null){for(var g in f){r[g]=f[g]}s.splice(u,1);return r}}}}}return r};mxHierarchicalLayout.prototype.cycleStage=function(t){var e=new mxMinimumCycleRemover(this);e.execute(t)};mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxHierarchicalLayout.prototype.crossingStage=function(t){var e=new mxMedianHybridCrossingReduction(this);e.execute(t)};mxHierarchicalLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);i.fineTuning=this.fineTuning;i.execute(e);return i.limitX+this.interHierarchySpacing};__mxOutput.mxHierarchicalLayout=typeof mxHierarchicalLayout!=="undefined"?mxHierarchicalLayout:undefined;function mxSwimlaneLayout(t,e,i){mxGraphLayout.call(this,t);this.orientation=e!=null?e:mxConstants.DIRECTION_NORTH;this.deterministic=i!=null?i:true}mxSwimlaneLayout.prototype=new mxGraphLayout;mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout;mxSwimlaneLayout.prototype.roots=null;mxSwimlaneLayout.prototype.swimlanes=null;mxSwimlaneLayout.prototype.dummyVertexWidth=50;mxSwimlaneLayout.prototype.resizeParent=false;mxSwimlaneLayout.prototype.maintainParentLocation=false;mxSwimlaneLayout.prototype.moveParent=false;mxSwimlaneLayout.prototype.parentBorder=30;mxSwimlaneLayout.prototype.intraCellSpacing=30;mxSwimlaneLayout.prototype.interRankCellSpacing=100;mxSwimlaneLayout.prototype.interHierarchySpacing=60;mxSwimlaneLayout.prototype.parallelEdgeSpacing=10;mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxSwimlaneLayout.prototype.fineTuning=true;mxSwimlaneLayout.prototype.tightenToSource=true;mxSwimlaneLayout.prototype.disableEdgeStyle=true;mxSwimlaneLayout.prototype.traverseAncestors=true;mxSwimlaneLayout.prototype.model=null;mxSwimlaneLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxSwimlaneLayout.prototype.getModel=function(){return this.model};mxSwimlaneLayout.prototype.execute=function(t,e){this.parent=t;var i=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(e==null||e.length<1){return}if(t==null){t=i.getParent(e[0])}this.parentX=null;this.parentY=null;if(t!=this.root&&i.isVertex(t)!=null&&this.maintainParentLocation){var n=this.graph.getCellGeometry(t);if(n!=null){this.parentX=n.x;this.parentY=n.y}}this.swimlanes=e;var r=[];for(var s=0;s<e.length;s++){var l=this.graph.getChildCells(e[s]);if(l==null||l.length==0){var a=this.graph.insertVertex(e[s],null,null,0,0,this.dummyVertexWidth,0);r.push(a)}}i.beginUpdate();try{this.run(t);if(this.resizeParent&&!this.graph.isCellCollapsed(t)){this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent)}if(this.parentX!=null&&this.parentY!=null){var n=this.graph.getCellGeometry(t);if(n!=null){n=n.clone();n.x=this.parentX;n.y=this.parentY;i.setGeometry(t,n)}}this.graph.removeCells(r)}finally{i.endUpdate()}};mxSwimlaneLayout.prototype.updateGroupBounds=function(){var t=[];var e=this.model;for(var i in e.edgeMapper){var n=e.edgeMapper[i];for(var r=0;r<n.edges.length;r++){t.push(n.edges[r])}}var s=this.graph.getBoundingBoxFromGeometry(t,true);var l=[];for(var r=0;r<this.swimlanes.length;r++){var a=this.swimlanes[r];var o=this.graph.getCellGeometry(a);if(o!=null){var h=this.graph.getChildCells(a);var u=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;var d=this.graph.getBoundingBoxFromGeometry(h);l[r]=d;var p=d.y+o.y-u.height-this.parentBorder;var m=d.y+o.y+d.height;if(s==null){s=new mxRectangle(0,p,0,m-p)}else{s.y=Math.min(s.y,p);var c=Math.max(s.y+s.height,m);s.height=c-s.y}}}for(var r=0;r<this.swimlanes.length;r++){var a=this.swimlanes[r];var o=this.graph.getCellGeometry(a);if(o!=null){var h=this.graph.getChildCells(a);var u=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;var x=o.clone();var f=r==0?this.parentBorder:this.interRankCellSpacing/2;var g=u.width+f;var v=l[r].x-g;var y=s.y-this.parentBorder;x.x+=v;x.y=y;x.width=l[r].width+g+this.interRankCellSpacing/2;x.height=s.height+u.height+2*this.parentBorder;this.graph.model.setGeometry(a,x);this.graph.moveCells(h,-v,o.y-y)}}};mxSwimlaneLayout.prototype.findRoots=function(t,e){var i=[];if(t!=null&&e!=null){var n=this.graph.model;var r=null;var s=-1e5;for(var l in e){var a=e[l];if(a!=null&&n.isVertex(a)&&this.graph.isCellVisible(a)&&n.isAncestor(t,a)){var o=this.getEdges(a);var h=0;var u=0;for(var d=0;d<o.length;d++){var p=this.getVisibleTerminal(o[d],true);if(p==a){var m=this.getVisibleTerminal(o[d],false);if(n.isAncestor(t,m)){h++}}else if(n.isAncestor(t,p)){u++}}if(u==0&&h>0){i.push(a)}var c=h-u;if(c>s){s=c;r=a}}}if(i.length==0&&r!=null){i.push(r)}}return i};mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(e!=null){return e}var i=this.graph.model;var n=[];var r=this.graph.isCellCollapsed(t);var s=i.getChildCount(t);for(var l=0;l<s;l++){var a=i.getChildAt(t,l);if(this.isPort(a)){n=n.concat(i.getEdges(a,true,true))}else if(r||!this.graph.isCellVisible(a)){n=n.concat(i.getEdges(a,true,true))}}n=n.concat(i.getEdges(t,true,true));var o=[];for(var l=0;l<n.length;l++){var h=this.getVisibleTerminal(n[l],true);var u=this.getVisibleTerminal(n[l],false);if(h==u||h!=u&&(u==t&&(this.parent==null||this.graph.isValidAncestor(h,this.parent,this.traverseAncestors))||h==t&&(this.parent==null||this.graph.isValidAncestor(u,this.parent,this.traverseAncestors)))){o.push(n[l])}}this.edgesCache.put(t,o);return o};mxSwimlaneLayout.prototype.getVisibleTerminal=function(t,e){var i=this.edgesTargetTermCache;if(e){i=this.edgeSourceTermCache}var n=i.get(t);if(n!=null){return n}var r=this.graph.view.getState(t);var s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);if(s==null){s=r!=null?r.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)}if(s!=null){if(this.isPort(s)){s=this.graph.model.getParent(s)}i.put(t,s)}return s};mxSwimlaneLayout.prototype.run=function(t){var e=[];var i=Object();if(this.swimlanes!=null&&this.swimlanes.length>0&&t!=null){var n=Object();for(var r=0;r<this.swimlanes.length;r++){this.filterDescendants(this.swimlanes[r],n)}this.roots=[];var s=true;for(var l in n){if(n[l]!=null){s=false;break}}var a=0;while(!s&&a<this.swimlanes.length){var o=this.findRoots(this.swimlanes[a],n);if(o.length==0){a++;continue}for(var r=0;r<o.length;r++){var h=Object();e.push(h);this.traverse(o[r],true,null,i,h,e,n,a)}for(var r=0;r<o.length;r++){this.roots.push(o[r])}s=true;for(var l in n){if(n[l]!=null){s=false;break}}}}else{for(var r=0;r<this.roots.length;r++){var h=Object();e.push(h);this.traverse(this.roots[r],true,null,i,h,e,null)}}var u=[];for(var l in i){u.push(i[l])}this.model=new mxSwimlaneModel(this,u,this.roots,t,this.tightenToSource);this.cycleStage(t);this.layeringStage();this.crossingStage(t);this.placementStage(0,t)};mxSwimlaneLayout.prototype.filterDescendants=function(t,e){var i=this.graph.model;if(i.isVertex(t)&&t!=this.parent&&i.getParent(t)!=this.parent&&this.graph.isCellVisible(t)){e[mxObjectIdentity.get(t)]=t}if(this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t)){var n=i.getChildCount(t);for(var r=0;r<n;r++){var s=i.getChildAt(t,r);if(!this.isPort(s)){this.filterDescendants(s,e)}}}};mxSwimlaneLayout.prototype.isPort=function(t){if(t.geometry.relative){return true}return false};mxSwimlaneLayout.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdges(t);var r=[];for(var s=0;s<n.length;s++){var l=this.getVisibleTerminal(n[s],true);var a=this.getVisibleTerminal(n[s],false);if(l==t&&a==e||!i&&l==e&&a==t){r.push(n[s])}}return r};mxSwimlaneLayout.prototype.traverse=function(t,e,i,n,r,s,l,a){if(t!=null&&n!=null){var o=mxObjectIdentity.get(t);if(n[o]==null&&(l==null?true:l[o]!=null)){if(r[o]==null){r[o]=t}if(n[o]==null){n[o]=t}if(l!==null){delete l[o]}var h=this.getEdges(t);var u=this.graph.model;for(var d=0;d<h.length;d++){var p=this.getVisibleTerminal(h[d],true);var m=p==t;if(m){p=this.getVisibleTerminal(h[d],false)}var c=0;for(c=0;c<this.swimlanes.length;c++){if(u.isAncestor(this.swimlanes[c],p)){break}}if(c>=this.swimlanes.length){continue}if(c>a||(!e||m)&&c==a){r=this.traverse(p,e,h[d],n,r,s,l,c)}}}else{if(r[o]==null){for(var d=0;d<s.length;d++){var x=s[d];if(x[o]!=null){for(var f in x){r[f]=x[f]}s.splice(d,1);return r}}}}}return r};mxSwimlaneLayout.prototype.cycleStage=function(t){var e=new mxSwimlaneOrdering(this);e.execute(t)};mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxSwimlaneLayout.prototype.crossingStage=function(t){var e=new mxMedianHybridCrossingReduction(this);e.execute(t)};mxSwimlaneLayout.prototype.placementStage=function(t,e){var i=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);i.fineTuning=this.fineTuning;i.execute(e);return i.limitX+this.interHierarchySpacing};__mxOutput.mxSwimlaneLayout=typeof mxSwimlaneLayout!=="undefined"?mxSwimlaneLayout:undefined;function mxGraphModel(t){this.currentEdit=this.createUndoableEdit();if(t!=null){this.setRoot(t)}else{this.clear()}}mxGraphModel.prototype=new mxEventSource;mxGraphModel.prototype.constructor=mxGraphModel;mxGraphModel.prototype.root=null;mxGraphModel.prototype.cells=null;mxGraphModel.prototype.maintainEdgeParent=true;mxGraphModel.prototype.ignoreRelativeEdgeParent=true;mxGraphModel.prototype.createIds=true;mxGraphModel.prototype.prefix="";mxGraphModel.prototype.postfix="";mxGraphModel.prototype.nextId=0;mxGraphModel.prototype.currentEdit=null;mxGraphModel.prototype.updateLevel=0;mxGraphModel.prototype.endingUpdate=false;mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())};mxGraphModel.prototype.isCreateIds=function(){return this.createIds};mxGraphModel.prototype.setCreateIds=function(t){this.createIds=t};mxGraphModel.prototype.createRoot=function(){var t=new mxCell;t.insert(new mxCell);return t};mxGraphModel.prototype.getCell=function(t){return this.cells!=null?this.cells[t]:null};mxGraphModel.prototype.filterCells=function(t,e){var i=null;if(t!=null){i=[];for(var n=0;n<t.length;n++){if(e(t[n])){i.push(t[n])}}}return i};mxGraphModel.prototype.getDescendants=function(t){return this.filterDescendants(null,t)};mxGraphModel.prototype.filterDescendants=function(t,e){var i=[];e=e||this.getRoot();if(t==null||t(e)){i.push(e)}var n=this.getChildCount(e);for(var r=0;r<n;r++){var s=this.getChildAt(e,r);i=i.concat(this.filterDescendants(t,s))}return i};mxGraphModel.prototype.getRoot=function(t){var e=t||this.root;if(t!=null){while(t!=null){e=t;t=this.getParent(t)}}return e};mxGraphModel.prototype.setRoot=function(t){this.execute(new mxRootChange(this,t));return t};mxGraphModel.prototype.rootChanged=function(t){var e=this.root;this.root=t;this.nextId=0;this.cells=null;this.cellAdded(t);return e};mxGraphModel.prototype.isRoot=function(t){return t!=null&&this.root==t};mxGraphModel.prototype.isLayer=function(t){return this.isRoot(this.getParent(t))};mxGraphModel.prototype.isAncestor=function(t,e){while(e!=null&&e!=t){e=this.getParent(e)}return e==t};mxGraphModel.prototype.contains=function(t){return this.isAncestor(this.root,t)};mxGraphModel.prototype.getParent=function(t){return t!=null?t.getParent():null};mxGraphModel.prototype.add=function(t,e,i){if(e!=t&&t!=null&&e!=null){if(i==null){i=this.getChildCount(t)}var n=t!=this.getParent(e);this.execute(new mxChildChange(this,t,e,i));if(this.maintainEdgeParent&&n){this.updateEdgeParents(e)}}return e};mxGraphModel.prototype.cellAdded=function(t){if(t!=null){if(t.getId()==null&&this.createIds){t.setId(this.createId(t))}if(t.getId()!=null){var e=this.getCell(t.getId());if(e!=t){while(e!=null){t.setId(this.createId(t));e=this.getCell(t.getId())}if(this.cells==null){this.cells=new Object}this.cells[t.getId()]=t}}if(mxUtils.isNumeric(t.getId())){this.nextId=Math.max(this.nextId,t.getId())}var i=this.getChildCount(t);for(var n=0;n<i;n++){this.cellAdded(this.getChildAt(t,n))}}};mxGraphModel.prototype.createId=function(t){var e=this.nextId;this.nextId++;return this.prefix+e+this.postfix};mxGraphModel.prototype.updateEdgeParents=function(t,e){e=e||this.getRoot(t);var i=this.getChildCount(t);for(var n=0;n<i;n++){var r=this.getChildAt(t,n);this.updateEdgeParents(r,e)}var s=this.getEdgeCount(t);var l=[];for(var n=0;n<s;n++){l.push(this.getEdgeAt(t,n))}for(var n=0;n<l.length;n++){var a=l[n];if(this.isAncestor(e,a)){this.updateEdgeParent(a,e)}}};mxGraphModel.prototype.updateEdgeParent=function(t,e){var i=this.getTerminal(t,true);var n=this.getTerminal(t,false);var r=null;while(i!=null&&!this.isEdge(i)&&i.geometry!=null&&i.geometry.relative){i=this.getParent(i)}while(n!=null&&this.ignoreRelativeEdgeParent&&!this.isEdge(n)&&n.geometry!=null&&n.geometry.relative){n=this.getParent(n)}if(this.isAncestor(e,i)&&this.isAncestor(e,n)){if(i==n){r=this.getParent(i)}else{r=this.getNearestCommonAncestor(i,n)}if(r!=null&&(this.getParent(r)!=this.root||this.isAncestor(r,t))&&this.getParent(t)!=r){var s=this.getGeometry(t);if(s!=null){var l=this.getOrigin(this.getParent(t));var a=this.getOrigin(r);var o=a.x-l.x;var h=a.y-l.y;s=s.clone();s.translate(-o,-h);this.setGeometry(t,s)}this.add(r,t,this.getChildCount(r))}}};mxGraphModel.prototype.getOrigin=function(t){var e=null;if(t!=null){e=this.getOrigin(this.getParent(t));if(!this.isEdge(t)){var i=this.getGeometry(t);if(i!=null){e.x+=i.x;e.y+=i.y}}}else{e=new mxPoint}return e};mxGraphModel.prototype.getNearestCommonAncestor=function(t,e){if(t!=null&&e!=null){var i=mxCellPath.create(e);if(i!=null&&i.length>0){var n=t;var r=mxCellPath.create(n);if(i.length<r.length){n=e;var s=r;r=i;i=s}while(n!=null){var l=this.getParent(n);if(i.indexOf(r+mxCellPath.PATH_SEPARATOR)==0&&l!=null){return n}r=mxCellPath.getParentPath(r);n=l}}}return null};mxGraphModel.prototype.remove=function(t){if(t==this.root){this.setRoot(null)}else if(this.getParent(t)!=null){this.execute(new mxChildChange(this,null,t))}return t};mxGraphModel.prototype.cellRemoved=function(t){if(t!=null&&this.cells!=null){var e=this.getChildCount(t);for(var i=e-1;i>=0;i--){this.cellRemoved(this.getChildAt(t,i))}if(this.cells!=null&&t.getId()!=null){delete this.cells[t.getId()]}}};mxGraphModel.prototype.parentForCellChanged=function(t,e,i){var n=this.getParent(t);if(e!=null){if(e!=n||n.getIndex(t)!=i){e.insert(t,i)}}else if(n!=null){var r=n.getIndex(t);n.remove(r)}var s=this.contains(e);var l=this.contains(n);if(s&&!l){this.cellAdded(t)}else if(l&&!s){this.cellRemoved(t)}return n};mxGraphModel.prototype.getChildCount=function(t){return t!=null?t.getChildCount():0};mxGraphModel.prototype.getChildAt=function(t,e){return t!=null?t.getChildAt(e):null};mxGraphModel.prototype.getChildren=function(t){return t!=null?t.children:null};mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,true,false)};mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,false,true)};mxGraphModel.prototype.getChildCells=function(t,e,i){e=e!=null?e:false;i=i!=null?i:false;var n=this.getChildCount(t);var r=[];for(var s=0;s<n;s++){var l=this.getChildAt(t,s);if(!i&&!e||i&&this.isEdge(l)||e&&this.isVertex(l)){r.push(l)}}return r};mxGraphModel.prototype.getTerminal=function(t,e){return t!=null?t.getTerminal(e):null};mxGraphModel.prototype.setTerminal=function(t,e,i){var n=e!=this.getTerminal(t,i);this.execute(new mxTerminalChange(this,t,e,i));if(this.maintainEdgeParent&&n){this.updateEdgeParent(t,this.getRoot())}return e};mxGraphModel.prototype.setTerminals=function(t,e,i){this.beginUpdate();try{this.setTerminal(t,e,true);this.setTerminal(t,i,false)}finally{this.endUpdate()}};mxGraphModel.prototype.terminalForCellChanged=function(t,e,i){var n=this.getTerminal(t,i);if(e!=null){e.insertEdge(t,i)}else if(n!=null){n.removeEdge(t,i)}return n};mxGraphModel.prototype.getEdgeCount=function(t){return t!=null?t.getEdgeCount():0};mxGraphModel.prototype.getEdgeAt=function(t,e){return t!=null?t.getEdgeAt(e):null};mxGraphModel.prototype.getDirectedEdgeCount=function(t,e,i){var n=0;var r=this.getEdgeCount(t);for(var s=0;s<r;s++){var l=this.getEdgeAt(t,s);if(l!=i&&this.getTerminal(l,e)==t){n++}}return n};mxGraphModel.prototype.getConnections=function(t){return this.getEdges(t,true,true,false)};mxGraphModel.prototype.getIncomingEdges=function(t){return this.getEdges(t,true,false,false)};mxGraphModel.prototype.getOutgoingEdges=function(t){return this.getEdges(t,false,true,false)};mxGraphModel.prototype.getEdges=function(t,e,i,n){e=e!=null?e:true;i=i!=null?i:true;n=n!=null?n:true;var r=this.getEdgeCount(t);var s=[];for(var l=0;l<r;l++){var a=this.getEdgeAt(t,l);var o=this.getTerminal(a,true);var h=this.getTerminal(a,false);if(n&&o==h||o!=h&&(e&&h==t||i&&o==t)){s.push(a)}}return s};mxGraphModel.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdgeCount(t);var r=this.getEdgeCount(e);var s=t;var l=n;if(r<n){l=r;s=e}var a=[];for(var o=0;o<l;o++){var h=this.getEdgeAt(s,o);var u=this.getTerminal(h,true);var d=this.getTerminal(h,false);var p=u==t&&d==e;var m=d==t&&u==e;if(p||!i&&m){a.push(h)}}return a};mxGraphModel.prototype.getOpposites=function(t,e,i,n){i=i!=null?i:true;n=n!=null?n:true;var r=[];if(t!=null){for(var s=0;s<t.length;s++){var l=this.getTerminal(t[s],true);var a=this.getTerminal(t[s],false);if(l==e&&a!=null&&a!=e&&n){r.push(a)}else if(a==e&&l!=null&&l!=e&&i){r.push(l)}}}return r};mxGraphModel.prototype.getTopmostCells=function(t){var e=new mxDictionary;var i=[];for(var n=0;n<t.length;n++){e.put(t[n],true)}for(var n=0;n<t.length;n++){var r=t[n];var s=true;var l=this.getParent(r);while(l!=null){if(e.get(l)){s=false;break}l=this.getParent(l)}if(s){i.push(r)}}return i};mxGraphModel.prototype.isVertex=function(t){return t!=null?t.isVertex():false};mxGraphModel.prototype.isEdge=function(t){return t!=null?t.isEdge():false};mxGraphModel.prototype.isConnectable=function(t){return t!=null?t.isConnectable():false};mxGraphModel.prototype.getValue=function(t){return t!=null?t.getValue():null};mxGraphModel.prototype.setValue=function(t,e){this.execute(new mxValueChange(this,t,e));return e};mxGraphModel.prototype.valueForCellChanged=function(t,e){return t.valueChanged(e)};mxGraphModel.prototype.getGeometry=function(t){return t!=null?t.getGeometry():null};mxGraphModel.prototype.setGeometry=function(t,e){if(e!=this.getGeometry(t)){this.execute(new mxGeometryChange(this,t,e))}return e};mxGraphModel.prototype.geometryForCellChanged=function(t,e){var i=this.getGeometry(t);t.setGeometry(e);return i};mxGraphModel.prototype.getStyle=function(t){return t!=null?t.getStyle():null};mxGraphModel.prototype.setStyle=function(t,e){if(e!=this.getStyle(t)){this.execute(new mxStyleChange(this,t,e))}return e};mxGraphModel.prototype.styleForCellChanged=function(t,e){var i=this.getStyle(t);t.setStyle(e);return i};mxGraphModel.prototype.isCollapsed=function(t){return t!=null?t.isCollapsed():false};mxGraphModel.prototype.setCollapsed=function(t,e){if(e!=this.isCollapsed(t)){this.execute(new mxCollapseChange(this,t,e))}return e};mxGraphModel.prototype.collapsedStateForCellChanged=function(t,e){var i=this.isCollapsed(t);t.setCollapsed(e);return i};mxGraphModel.prototype.isVisible=function(t){return t!=null?t.isVisible():false};mxGraphModel.prototype.setVisible=function(t,e){if(e!=this.isVisible(t)){this.execute(new mxVisibleChange(this,t,e))}return e};mxGraphModel.prototype.visibleStateForCellChanged=function(t,e){var i=this.isVisible(t);t.setVisible(e);return i};mxGraphModel.prototype.execute=function(t){t.execute();this.beginUpdate();this.currentEdit.add(t);this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",t));this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t));this.endUpdate()};mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++;this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE));if(this.updateLevel==1){this.fireEvent(new mxEventObject(mxEvent.START_EDIT))}};mxGraphModel.prototype.endUpdate=function(){this.updateLevel--;if(this.updateLevel==0){this.fireEvent(new mxEventObject(mxEvent.END_EDIT))}if(!this.endingUpdate){this.endingUpdate=this.updateLevel==0;this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var t=this.currentEdit;this.currentEdit=this.createUndoableEdit();t.notify();this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t))}}finally{this.endingUpdate=false}}};mxGraphModel.prototype.createUndoableEdit=function(t){var e=new mxUndoableEdit(this,t!=null?t:true);e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes));e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))};return e};mxGraphModel.prototype.mergeChildren=function(t,e,i){i=i!=null?i:true;this.beginUpdate();try{var n=new Object;this.mergeChildrenImpl(t,e,i,n);for(var r in n){var s=n[r];var l=this.getTerminal(s,true);if(l!=null){l=n[mxCellPath.create(l)];this.setTerminal(s,l,true)}l=this.getTerminal(s,false);if(l!=null){l=n[mxCellPath.create(l)];this.setTerminal(s,l,false)}}}finally{this.endUpdate()}};mxGraphModel.prototype.mergeChildrenImpl=function(t,e,i,n){this.beginUpdate();try{var r=t.getChildCount();for(var s=0;s<r;s++){var l=t.getChildAt(s);if(typeof l.getId=="function"){var a=l.getId();var o=a!=null&&(!this.isEdge(l)||!i)?this.getCell(a):null;if(o==null){var h=l.clone();h.setId(a);h.setTerminal(l.getTerminal(true),true);h.setTerminal(l.getTerminal(false),false);o=e.insert(h);this.cellAdded(o)}n[mxCellPath.create(l)]=o;this.mergeChildrenImpl(l,o,i,n)}}}finally{this.endUpdate()}};mxGraphModel.prototype.getParents=function(t){var e=[];if(t!=null){var i=new mxDictionary;for(var n=0;n<t.length;n++){var r=this.getParent(t[n]);if(r!=null&&!i.get(r)){i.put(r,true);e.push(r)}}}return e};mxGraphModel.prototype.cloneCell=function(t,e){if(t!=null){return this.cloneCells([t],e)[0]}return null};mxGraphModel.prototype.cloneCells=function(t,e,i){e=e!=null?e:true;i=i!=null?i:new Object;var n=[];for(var r=0;r<t.length;r++){if(t[r]!=null){n.push(this.cloneCellImpl(t[r],i,e))}else{n.push(null)}}for(var r=0;r<n.length;r++){if(n[r]!=null){this.restoreClone(n[r],t[r],i)}}return n};mxGraphModel.prototype.cloneCellImpl=function(t,e,i){var n=mxObjectIdentity.get(t);var r=e[n];if(r==null){r=this.cellCloned(t);e[n]=r;if(i){var s=this.getChildCount(t);for(var l=0;l<s;l++){var a=this.cloneCellImpl(this.getChildAt(t,l),e,true);r.insert(a)}}}return r};mxGraphModel.prototype.cellCloned=function(t){return t.clone()};mxGraphModel.prototype.restoreClone=function(t,e,i){var n=this.getTerminal(e,true);if(n!=null){var r=i[mxObjectIdentity.get(n)];if(r!=null){r.insertEdge(t,true)}}var s=this.getTerminal(e,false);if(s!=null){var r=i[mxObjectIdentity.get(s)];if(r!=null){r.insertEdge(t,false)}}var l=this.getChildCount(t);for(var a=0;a<l;a++){this.restoreClone(this.getChildAt(t,a),this.getChildAt(e,a),i)}};function mxRootChange(t,e){this.model=t;this.root=e;this.previous=e}mxRootChange.prototype.execute=function(){this.root=this.previous;this.previous=this.model.rootChanged(this.previous)};function mxChildChange(t,e,i,n){this.model=t;this.parent=e;this.previous=e;this.child=i;this.index=n;this.previousIndex=n}mxChildChange.prototype.execute=function(){if(this.child!=null){var t=this.model.getParent(this.child);var e=t!=null?t.getIndex(this.child):0;if(this.previous==null){this.connect(this.child,false)}t=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex);if(this.previous!=null){this.connect(this.child,true)}this.parent=this.previous;this.previous=t;this.index=this.previousIndex;this.previousIndex=e}};mxChildChange.prototype.connect=function(t,e){e=e!=null?e:true;var i=t.getTerminal(true);var n=t.getTerminal(false);if(i!=null){if(e){this.model.terminalForCellChanged(t,i,true)}else{this.model.terminalForCellChanged(t,null,true)}}if(n!=null){if(e){this.model.terminalForCellChanged(t,n,false)}else{this.model.terminalForCellChanged(t,null,false)}}t.setTerminal(i,true);t.setTerminal(n,false);var r=this.model.getChildCount(t);for(var s=0;s<r;s++){this.connect(this.model.getChildAt(t,s),e)}};function mxTerminalChange(t,e,i,n){this.model=t;this.cell=e;this.terminal=i;this.previous=i;this.source=n}mxTerminalChange.prototype.execute=function(){if(this.cell!=null){this.terminal=this.previous;this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)}};function mxValueChange(t,e,i){this.model=t;this.cell=e;this.value=i;this.previous=i}mxValueChange.prototype.execute=function(){if(this.cell!=null){this.value=this.previous;this.previous=this.model.valueForCellChanged(this.cell,this.previous)}};function mxStyleChange(t,e,i){this.model=t;this.cell=e;this.style=i;this.previous=i}mxStyleChange.prototype.execute=function(){if(this.cell!=null){this.style=this.previous;this.previous=this.model.styleForCellChanged(this.cell,this.previous)}};function mxGeometryChange(t,e,i){this.model=t;this.cell=e;this.geometry=i;this.previous=i}mxGeometryChange.prototype.execute=function(){if(this.cell!=null){this.geometry=this.previous;this.previous=this.model.geometryForCellChanged(this.cell,this.previous)}};function mxCollapseChange(t,e,i){this.model=t;this.cell=e;this.collapsed=i;this.previous=i}mxCollapseChange.prototype.execute=function(){if(this.cell!=null){this.collapsed=this.previous;this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)}};function mxVisibleChange(t,e,i){this.model=t;this.cell=e;this.visible=i;this.previous=i}mxVisibleChange.prototype.execute=function(){if(this.cell!=null){this.visible=this.previous;this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)}};function mxCellAttributeChange(t,e,i){this.cell=t;this.attribute=e;this.value=i;this.previous=i}mxCellAttributeChange.prototype.execute=function(){if(this.cell!=null){var t=this.cell.getAttribute(this.attribute);if(this.previous==null){this.cell.value.removeAttribute(this.attribute)}else{this.cell.setAttribute(this.attribute,this.previous)}this.previous=t}};__mxOutput.mxGraphModel=typeof mxGraphModel!=="undefined"?mxGraphModel:undefined;function mxCell(t,e,i){this.value=t;this.setGeometry(e);this.setStyle(i);if(this.onInit!=null){this.onInit()}}mxCell.prototype.id=null;mxCell.prototype.value=null;mxCell.prototype.geometry=null;mxCell.prototype.style=null;mxCell.prototype.vertex=false;mxCell.prototype.edge=false;mxCell.prototype.connectable=true;mxCell.prototype.visible=true;mxCell.prototype.collapsed=false;mxCell.prototype.parent=null;mxCell.prototype.source=null;mxCell.prototype.target=null;mxCell.prototype.children=null;mxCell.prototype.edges=null;mxCell.prototype.mxTransient=["id","value","parent","source","target","children","edges"];mxCell.prototype.getId=function(){return this.id};mxCell.prototype.setId=function(t){this.id=t};mxCell.prototype.getValue=function(){return this.value};mxCell.prototype.setValue=function(t){this.value=t};mxCell.prototype.valueChanged=function(t){var e=this.getValue();this.setValue(t);return e};mxCell.prototype.getGeometry=function(){return this.geometry};mxCell.prototype.setGeometry=function(t){this.geometry=t};mxCell.prototype.getStyle=function(){return this.style};mxCell.prototype.setStyle=function(t){this.style=t};mxCell.prototype.isVertex=function(){return this.vertex!=0};mxCell.prototype.setVertex=function(t){this.vertex=t};mxCell.prototype.isEdge=function(){return this.edge!=0};mxCell.prototype.setEdge=function(t){this.edge=t};mxCell.prototype.isConnectable=function(){return this.connectable!=0};mxCell.prototype.setConnectable=function(t){this.connectable=t};mxCell.prototype.isVisible=function(){return this.visible!=0};mxCell.prototype.setVisible=function(t){this.visible=t};mxCell.prototype.isCollapsed=function(){return this.collapsed!=0};mxCell.prototype.setCollapsed=function(t){this.collapsed=t};mxCell.prototype.getParent=function(){return this.parent};mxCell.prototype.setParent=function(t){this.parent=t};mxCell.prototype.getTerminal=function(t){return t?this.source:this.target};mxCell.prototype.setTerminal=function(t,e){if(e){this.source=t}else{this.target=t}return t};mxCell.prototype.getChildCount=function(){return this.children==null?0:this.children.length};mxCell.prototype.getIndex=function(t){return mxUtils.indexOf(this.children,t)};mxCell.prototype.getChildAt=function(t){return this.children==null?null:this.children[t]};mxCell.prototype.insert=function(t,e){if(t!=null){if(e==null){e=this.getChildCount();if(t.getParent()==this){e--}}t.removeFromParent();t.setParent(this);if(this.children==null){this.children=[];this.children.push(t)}else{this.children.splice(e,0,t)}}return t};mxCell.prototype.remove=function(t){var e=null;if(this.children!=null&&t>=0){e=this.getChildAt(t);if(e!=null){this.children.splice(t,1);e.setParent(null)}}return e};mxCell.prototype.removeFromParent=function(){if(this.parent!=null){var t=this.parent.getIndex(this);this.parent.remove(t)}};mxCell.prototype.getEdgeCount=function(){return this.edges==null?0:this.edges.length};mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)};mxCell.prototype.getEdgeAt=function(t){return this.edges==null?null:this.edges[t]};mxCell.prototype.insertEdge=function(t,e){if(t!=null){t.removeFromTerminal(e);t.setTerminal(this,e);if(this.edges==null||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0){if(this.edges==null){this.edges=[]}this.edges.push(t)}}return t};mxCell.prototype.removeEdge=function(t,e){if(t!=null){if(t.getTerminal(!e)!=this&&this.edges!=null){var i=this.getEdgeIndex(t);if(i>=0){this.edges.splice(i,1)}}t.setTerminal(null,e)}return t};mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);if(e!=null){e.removeEdge(this,t)}};mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return e!=null&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):e.getAttribute(t)!=null};mxCell.prototype.getAttribute=function(t,e){var i=this.getValue();var n=i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT?i.getAttribute(t):null;return n!=null?n:e};mxCell.prototype.setAttribute=function(t,e){var i=this.getValue();if(i!=null&&i.nodeType==mxConstants.NODETYPE_ELEMENT){i.setAttribute(t,e)}};mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);t.setValue(this.cloneValue());return t};mxCell.prototype.cloneValue=function(){var t=this.getValue();if(t!=null){if(typeof t.clone=="function"){t=t.clone()}else if(!isNaN(t.nodeType)){t=t.cloneNode(true)}}return t};__mxOutput.mxCell=typeof mxCell!=="undefined"?mxCell:undefined;function mxGeometry(t,e,i,n){mxRectangle.call(this,t,e,i,n)}mxGeometry.prototype=new mxRectangle;mxGeometry.prototype.constructor=mxGeometry;mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=true;mxGeometry.prototype.alternateBounds=null;mxGeometry.prototype.sourcePoint=null;mxGeometry.prototype.targetPoint=null;mxGeometry.prototype.points=null;mxGeometry.prototype.offset=null;mxGeometry.prototype.relative=false;mxGeometry.prototype.swap=function(){if(this.alternateBounds!=null){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x;this.y=this.alternateBounds.y;this.width=this.alternateBounds.width;this.height=this.alternateBounds.height;this.alternateBounds=t}};mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint};mxGeometry.prototype.setTerminalPoint=function(t,e){if(e){this.sourcePoint=t}else{this.targetPoint=t}return t};mxGeometry.prototype.rotate=function(t,e){var i=mxUtils.toRadians(t);var n=Math.cos(i);var r=Math.sin(i);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY());var l=mxUtils.getRotatedPoint(s,n,r,e);this.x=Math.round(l.x-this.width/2);this.y=Math.round(l.y-this.height/2)}if(this.sourcePoint!=null){var l=mxUtils.getRotatedPoint(this.sourcePoint,n,r,e);this.sourcePoint.x=Math.round(l.x);this.sourcePoint.y=Math.round(l.y)}if(this.targetPoint!=null){var l=mxUtils.getRotatedPoint(this.targetPoint,n,r,e);this.targetPoint.x=Math.round(l.x);this.targetPoint.y=Math.round(l.y)}if(this.points!=null){for(var a=0;a<this.points.length;a++){if(this.points[a]!=null){var l=mxUtils.getRotatedPoint(this.points[a],n,r,e);this.points[a].x=Math.round(l.x);this.points[a].y=Math.round(l.y)}}}};mxGeometry.prototype.translate=function(t,e){t=parseFloat(t);e=parseFloat(e);if(!this.relative){this.x=parseFloat(this.x)+t;this.y=parseFloat(this.y)+e}if(this.sourcePoint!=null){this.sourcePoint.x=parseFloat(this.sourcePoint.x)+t;this.sourcePoint.y=parseFloat(this.sourcePoint.y)+e}if(this.targetPoint!=null){this.targetPoint.x=parseFloat(this.targetPoint.x)+t;this.targetPoint.y=parseFloat(this.targetPoint.y)+e}if(this.TRANSLATE_CONTROL_POINTS&&this.points!=null){for(var i=0;i<this.points.length;i++){if(this.points[i]!=null){this.points[i].x=parseFloat(this.points[i].x)+t;this.points[i].y=parseFloat(this.points[i].y)+e}}}};mxGeometry.prototype.scale=function(t,e,i){t=parseFloat(t);e=parseFloat(e);if(this.sourcePoint!=null){this.sourcePoint.x=parseFloat(this.sourcePoint.x)*t;this.sourcePoint.y=parseFloat(this.sourcePoint.y)*e}if(this.targetPoint!=null){this.targetPoint.x=parseFloat(this.targetPoint.x)*t;this.targetPoint.y=parseFloat(this.targetPoint.y)*e}if(this.points!=null){for(var n=0;n<this.points.length;n++){if(this.points[n]!=null){this.points[n].x=parseFloat(this.points[n].x)*t;this.points[n].y=parseFloat(this.points[n].y)*e}}}if(!this.relative){this.x=parseFloat(this.x)*t;this.y=parseFloat(this.y)*e;if(i){e=t=Math.min(t,e)}this.width=parseFloat(this.width)*t;this.height=parseFloat(this.height)*e}};mxGeometry.prototype.equals=function(t){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==t.relative&&(this.sourcePoint==null&&t.sourcePoint==null||this.sourcePoint!=null&&this.sourcePoint.equals(t.sourcePoint))&&(this.targetPoint==null&&t.targetPoint==null||this.targetPoint!=null&&this.targetPoint.equals(t.targetPoint))&&(this.points==null&&t.points==null||this.points!=null&&mxUtils.equalPoints(this.points,t.points))&&(this.alternateBounds==null&&t.alternateBounds==null||this.alternateBounds!=null&&this.alternateBounds.equals(t.alternateBounds))&&(this.offset==null&&t.offset==null||this.offset!=null&&this.offset.equals(t.offset))};__mxOutput.mxGeometry=typeof mxGeometry!=="undefined"?mxGeometry:undefined;var mxCellPath={PATH_SEPARATOR:".",create:function(t){var e="";if(t!=null){var i=t.getParent();while(i!=null){var n=i.getIndex(t);e=n+mxCellPath.PATH_SEPARATOR+e;t=i;i=t.getParent()}}var r=e.length;if(r>1){e=e.substring(0,r-1)}return e},getParentPath:function(t){if(t!=null){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0){return t.substring(0,e)}else if(t.length>0){return""}}return null},resolve:function(t,e){var i=t;if(e!=null){var n=e.split(mxCellPath.PATH_SEPARATOR);for(var r=0;r<n.length;r++){i=i.getChildAt(parseInt(n[r]))}}return i},compare:function(t,e){var i=Math.min(t.length,e.length);var n=0;for(var r=0;r<i;r++){if(t[r]!=e[r]){if(t[r].length==0||e[r].length==0){n=t[r]==e[r]?0:t[r]>e[r]?1:-1}else{var s=parseInt(t[r]);var l=parseInt(e[r]);n=s==l?0:s>l?1:-1}break}}if(n==0){var s=t.length;var l=e.length;if(s!=l){n=s>l?1:-1}}return n}};__mxOutput.mxCellPath=typeof mxCellPath!=="undefined"?mxCellPath:undefined;var mxPerimeter={RectanglePerimeter:function(t,e,i,n){var r=t.getCenterX();var s=t.getCenterY();var l=i.x-r;var a=i.y-s;var o=Math.atan2(a,l);var h=new mxPoint(0,0);var u=Math.PI;var d=Math.PI/2;var p=d-o;var m=Math.atan2(t.height,t.width);if(o<-u+m||o>u-m){h.x=t.x;h.y=s-t.width*Math.tan(o)/2}else if(o<-m){h.y=t.y;h.x=r-t.height*Math.tan(p)/2}else if(o<m){h.x=t.x+t.width;h.y=s+t.width*Math.tan(o)/2}else{h.y=t.y+t.height;h.x=r+t.height*Math.tan(p)/2}if(n){if(i.x>=t.x&&i.x<=t.x+t.width){h.x=i.x}else if(i.y>=t.y&&i.y<=t.y+t.height){h.y=i.y}if(i.x<t.x){h.x=t.x}else if(i.x>t.x+t.width){h.x=t.x+t.width}if(i.y<t.y){h.y=t.y}else if(i.y>t.y+t.height){h.y=t.y+t.height}}return h},EllipsePerimeter:function(t,e,i,n){var r=t.x;var s=t.y;var l=t.width/2;var a=t.height/2;var o=r+l;var h=s+a;var u=i.x;var d=i.y;var p=parseInt(u-o);var m=parseInt(d-h);if(p==0&&m!=0){return new mxPoint(o,h+a*m/Math.abs(m))}else if(p==0&&m==0){return new mxPoint(u,d)}if(n){if(d>=s&&d<=s+t.height){var c=d-h;var x=Math.sqrt(l*l*(1-c*c/(a*a)))||0;if(u<=r){x=-x}return new mxPoint(o+x,d)}if(u>=r&&u<=r+t.width){var x=u-o;var c=Math.sqrt(a*a*(1-x*x/(l*l)))||0;if(d<=s){c=-c}return new mxPoint(u,h+c)}}var f=m/p;var g=h-f*o;var v=l*l*f*f+a*a;var y=-2*o*v;var C=l*l*f*f*o*o+a*a*o*o-l*l*a*a;var E=Math.sqrt(y*y-4*v*C);var S=(-y+E)/(2*v);var b=(-y-E)/(2*v);var w=f*S+g;var T=f*b+g;var L=Math.sqrt(Math.pow(S-u,2)+Math.pow(w-d,2));var A=Math.sqrt(Math.pow(b-u,2)+Math.pow(T-d,2));var M=0;var _=0;if(L<A){M=S;_=w}else{M=b;_=T}return new mxPoint(M,_)},RhombusPerimeter:function(t,e,i,n){var r=t.x;var s=t.y;var l=t.width;var a=t.height;var o=r+l/2;var h=s+a/2;var u=i.x;var d=i.y;if(o==u){if(h>d){return new mxPoint(o,s)}else{return new mxPoint(o,s+a)}}else if(h==d){if(o>u){return new mxPoint(r,h)}else{return new mxPoint(r+l,h)}}var p=o;var m=h;if(n){if(u>=r&&u<=r+l){p=u}else if(d>=s&&d<=s+a){m=d}}if(u<o){if(d<h){return mxUtils.intersection(u,d,p,m,o,s,r,h)}else{return mxUtils.intersection(u,d,p,m,o,s+a,r,h)}}else if(d<h){return mxUtils.intersection(u,d,p,m,o,s,r+l,h)}else{return mxUtils.intersection(u,d,p,m,o,s+a,r+l,h)}},TrianglePerimeter:function(t,e,i,n){var r=e!=null?e.style[mxConstants.STYLE_DIRECTION]:null;var s=r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH;var l=t.x;var a=t.y;var o=t.width;var h=t.height;var u=l+o/2;var d=a+h/2;var p=new mxPoint(l,a);var m=new mxPoint(l+o,d);var c=new mxPoint(l,a+h);if(r==mxConstants.DIRECTION_NORTH){p=c;m=new mxPoint(u,a);c=new mxPoint(l+o,a+h)}else if(r==mxConstants.DIRECTION_SOUTH){m=new mxPoint(u,a+h);c=new mxPoint(l+o,a)}else if(r==mxConstants.DIRECTION_WEST){p=new mxPoint(l+o,a);m=new mxPoint(l,d);c=new mxPoint(l+o,a+h)}var x=i.x-u;var f=i.y-d;var g=s?Math.atan2(x,f):Math.atan2(f,x);var v=s?Math.atan2(o,h):Math.atan2(h,o);var y=false;if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_WEST){y=g>-v&&g<v}else{y=g<-Math.PI+v||g>Math.PI-v}var C=null;if(y){if(n&&(s&&i.x>=p.x&&i.x<=c.x||!s&&i.y>=p.y&&i.y<=c.y)){if(s){C=new mxPoint(i.x,p.y)}else{C=new mxPoint(p.x,i.y)}}else{if(r==mxConstants.DIRECTION_NORTH){C=new mxPoint(l+o/2+h*Math.tan(g)/2,a+h)}else if(r==mxConstants.DIRECTION_SOUTH){C=new mxPoint(l+o/2-h*Math.tan(g)/2,a)}else if(r==mxConstants.DIRECTION_WEST){C=new mxPoint(l+o,a+h/2+o*Math.tan(g)/2)}else{C=new mxPoint(l,a+h/2-o*Math.tan(g)/2)}}}else{if(n){var E=new mxPoint(u,d);if(i.y>=a&&i.y<=a+h){E.x=s?u:r==mxConstants.DIRECTION_WEST?l+o:l;E.y=i.y}else if(i.x>=l&&i.x<=l+o){E.x=i.x;E.y=!s?d:r==mxConstants.DIRECTION_NORTH?a+h:a}x=i.x-E.x;f=i.y-E.y;u=E.x;d=E.y}if(s&&i.x<=l+o/2||!s&&i.y<=a+h/2){C=mxUtils.intersection(i.x,i.y,u,d,p.x,p.y,m.x,m.y)}else{C=mxUtils.intersection(i.x,i.y,u,d,m.x,m.y,c.x,c.y)}}if(C==null){C=new mxPoint(u,d)}return C},HexagonPerimeter:function(t,e,i,n){var r=t.x;var s=t.y;var l=t.width;var a=t.height;var o=t.getCenterX();var h=t.getCenterY();var u=i.x;var d=i.y;var p=u-o;var m=d-h;var c=-Math.atan2(m,p);var x=Math.PI;var f=Math.PI/2;var g=new mxPoint(o,h);var v=e!=null?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var y=v==mxConstants.DIRECTION_NORTH||v==mxConstants.DIRECTION_SOUTH;var C=new mxPoint;var E=new mxPoint;if(u<r&&d<s||u<r&&d>s+a||u>r+l&&d<s||u>r+l&&d>s+a){n=false}if(n){if(y){if(u==o){if(d<=s){return new mxPoint(o,s)}else if(d>=s+a){return new mxPoint(o,s+a)}}else if(u<r){if(d==s+a/4){return new mxPoint(r,s+a/4)}else if(d==s+3*a/4){return new mxPoint(r,s+3*a/4)}}else if(u>r+l){if(d==s+a/4){return new mxPoint(r+l,s+a/4)}else if(d==s+3*a/4){return new mxPoint(r+l,s+3*a/4)}}else if(u==r){if(d<h){return new mxPoint(r,s+a/4)}else if(d>h){return new mxPoint(r,s+3*a/4)}}else if(u==r+l){if(d<h){return new mxPoint(r+l,s+a/4)}else if(d>h){return new mxPoint(r+l,s+3*a/4)}}if(d==s){return new mxPoint(o,s)}else if(d==s+a){return new mxPoint(o,s+a)}if(u<o){if(d>s+a/4&&d<s+3*a/4){C=new mxPoint(r,s);E=new mxPoint(r,s+a)}else if(d<s+a/4){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s-Math.floor(.25*a))}else if(d>s+3*a/4){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s+Math.floor(1.25*a))}}else if(u>o){if(d>s+a/4&&d<s+3*a/4){C=new mxPoint(r+l,s);E=new mxPoint(r+l,s+a)}else if(d<s+a/4){C=new mxPoint(r,s-Math.floor(.25*a));E=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a))}else if(d>s+3*a/4){C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a));E=new mxPoint(r,s+Math.floor(1.25*a))}}}else{if(d==h){if(u<=r){return new mxPoint(r,s+a/2)}else if(u>=r+l){return new mxPoint(r+l,s+a/2)}}else if(d<s){if(u==r+l/4){return new mxPoint(r+l/4,s)}else if(u==r+3*l/4){return new mxPoint(r+3*l/4,s)}}else if(d>s+a){if(u==r+l/4){return new mxPoint(r+l/4,s+a)}else if(u==r+3*l/4){return new mxPoint(r+3*l/4,s+a)}}else if(d==s){if(u<o){return new mxPoint(r+l/4,s)}else if(u>o){return new mxPoint(r+3*l/4,s)}}else if(d==s+a){if(u<o){return new mxPoint(r+l/4,s+a)}else if(d>h){return new mxPoint(r+3*l/4,s+a)}}if(u==r){return new mxPoint(r,h)}else if(u==r+l){return new mxPoint(r+l,h)}if(d<h){if(u>r+l/4&&u<r+3*l/4){C=new mxPoint(r,s);E=new mxPoint(r+l,s)}else if(u<r+l/4){C=new mxPoint(r-Math.floor(.25*l),s+a);E=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a))}else if(u>r+3*l/4){C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a));E=new mxPoint(r+Math.floor(1.25*l),s+a)}}else if(d>h){if(u>r+l/4&&u<r+3*l/4){C=new mxPoint(r,s+a);E=new mxPoint(r+l,s+a)}else if(u<r+l/4){C=new mxPoint(r-Math.floor(.25*l),s);E=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a))}else if(u>r+3*l/4){C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a));E=new mxPoint(r+Math.floor(1.25*l),s)}}}var S=o;var b=h;if(u>=r&&u<=r+l){S=u;if(d<h){b=s+a}else{b=s}}else if(d>=s&&d<=s+a){b=d;if(u<o){S=r+l}else{S=r}}g=mxUtils.intersection(S,b,i.x,i.y,C.x,C.y,E.x,E.y)}else{if(y){var w=Math.atan2(a/4,l/2);if(c==w){return new mxPoint(r+l,s+Math.floor(.25*a))}else if(c==f){return new mxPoint(r+Math.floor(.5*l),s)}else if(c==x-w){return new mxPoint(r,s+Math.floor(.25*a))}else if(c==-w){return new mxPoint(r+l,s+Math.floor(.75*a))}else if(c==-f){return new mxPoint(r+Math.floor(.5*l),s+a)}else if(c==-x+w){return new mxPoint(r,s+Math.floor(.75*a))}if(c<w&&c>-w){C=new mxPoint(r+l,s);E=new mxPoint(r+l,s+a)}else if(c>w&&c<f){C=new mxPoint(r,s-Math.floor(.25*a));E=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a))}else if(c>f&&c<x-w){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s-Math.floor(.25*a))}else if(c>x-w&&c<=x||c<-x+w&&c>=-x){C=new mxPoint(r,s);E=new mxPoint(r,s+a)}else if(c<-w&&c>-f){C=new mxPoint(r+Math.floor(1.5*l),s+Math.floor(.5*a));E=new mxPoint(r,s+Math.floor(1.25*a))}else if(c<-f&&c>-x+w){C=new mxPoint(r-Math.floor(.5*l),s+Math.floor(.5*a));E=new mxPoint(r+l,s+Math.floor(1.25*a))}}else{var w=Math.atan2(a/2,l/4);if(c==w){return new mxPoint(r+Math.floor(.75*l),s)}else if(c==x-w){return new mxPoint(r+Math.floor(.25*l),s)}else if(c==x||c==-x){return new mxPoint(r,s+Math.floor(.5*a))}else if(c==0){return new mxPoint(r+l,s+Math.floor(.5*a))}else if(c==-w){return new mxPoint(r+Math.floor(.75*l),s+a)}else if(c==-x+w){return new mxPoint(r+Math.floor(.25*l),s+a)}if(c>0&&c<w){C=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a));E=new mxPoint(r+Math.floor(1.25*l),s+a)}else if(c>w&&c<x-w){C=new mxPoint(r,s);E=new mxPoint(r+l,s)}else if(c>x-w&&c<x){C=new mxPoint(r-Math.floor(.25*l),s+a);E=new mxPoint(r+Math.floor(.5*l),s-Math.floor(.5*a))}else if(c<0&&c>-w){C=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a));E=new mxPoint(r+Math.floor(1.25*l),s)}else if(c<-w&&c>-x+w){C=new mxPoint(r,s+a);E=new mxPoint(r+l,s+a)}else if(c<-x+w&&c>-x){C=new mxPoint(r-Math.floor(.25*l),s);E=new mxPoint(r+Math.floor(.5*l),s+Math.floor(1.5*a))}}g=mxUtils.intersection(o,h,i.x,i.y,C.x,C.y,E.x,E.y)}if(g==null){return new mxPoint(o,h)}return g}};__mxOutput.mxPerimeter=typeof mxPerimeter!=="undefined"?mxPerimeter:undefined;function mxPrintPreview(t,e,i,n,r,s,l,a,o){this.graph=t;this.scale=e!=null?e:1/t.pageScale;this.border=n!=null?n:0;this.pageFormat=mxRectangle.fromRectangle(i!=null?i:t.pageFormat);this.title=a!=null?a:"Printer-friendly version";this.x0=r!=null?r:0;this.y0=s!=null?s:0;this.borderColor=l;this.pageSelector=o!=null?o:true}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=true;mxPrintPreview.prototype.printOverlays=false;mxPrintPreview.prototype.printControls=false;mxPrintPreview.prototype.printBackgroundImage=false;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null;mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=true;mxPrintPreview.prototype.getWindow=function(){return this.wnd};mxPrintPreview.prototype.getDoctype=function(){var t="";if(document.documentMode==5){t='<meta http-equiv="X-UA-Compatible" content="IE=5">'}else if(document.documentMode==8){t='<meta http-equiv="X-UA-Compatible" content="IE=8">'}else if(document.documentMode>8){t='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e'}return t};mxPrintPreview.prototype.appendGraph=function(t,e,i,n,r,s){this.graph=t;this.scale=e!=null?e:1/t.pageScale;this.x0=i;this.y0=n;this.open(null,null,r,s)};mxPrintPreview.prototype.open=function(t,e,i,n){var r=this.graph.cellRenderer.initializeOverlay;var s=null;try{if(this.printOverlays){this.graph.cellRenderer.initializeOverlay=function(t,e){e.init(t.view.getDrawPane())}}if(this.printControls){this.graph.cellRenderer.initControl=function(t,e,i,n){e.dialect=t.view.graph.dialect;e.init(t.view.getDrawPane())}}this.wnd=e!=null?e:this.wnd;var l=false;if(this.wnd==null){l=true;this.wnd=window.open()}var a=this.wnd.document;if(l){var o=this.getDoctype();if(o!=null&&o.length>0){a.writeln(o)}if(mxClient.IS_VML){a.writeln('<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">')}else{if(document.compatMode==="CSS1Compat"){a.writeln("<!DOCTYPE html>")}a.writeln("<html>")}a.writeln("<head>");this.writeHead(a,t);a.writeln("</head>");a.writeln('<body class="mxPage">')}var h=this.graph.getGraphBounds().clone();var u=this.graph.getView().getScale();var d=u/this.scale;var p=this.graph.getView().getTranslate();if(!this.autoOrigin){this.x0-=p.x*this.scale;this.y0-=p.y*this.scale;h.width+=h.x;h.height+=h.y;h.x=0;h.y=0;this.border=0}var m=this.pageFormat.width-this.border*2;var c=this.pageFormat.height-this.border*2;this.pageFormat.height+=this.marginTop+this.marginBottom;h.width/=d;h.height/=d;var x=Math.max(1,Math.ceil((h.width+this.x0)/m));var f=Math.max(1,Math.ceil((h.height+this.y0)/c));this.pageCount=x*f;var g=mxUtils.bind(this,(function(){if(this.pageSelector&&(f>1||x>1)){var t=this.createPageSelector(f,x);a.body.appendChild(t);if(mxClient.IS_IE&&a.documentMode==null||a.documentMode==5||a.documentMode==8||a.documentMode==7){t.style.position="absolute";var e=function(){t.style.top=(a.body.scrollTop||a.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()}));mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}}));var v=mxUtils.bind(this,(function(t,e){if(this.borderColor!=null){t.style.borderColor=this.borderColor;t.style.borderStyle="solid";t.style.borderWidth="1px"}t.style.background=this.backgroundColor;if(i||e){t.style.pageBreakAfter="always"}if(l&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE)){a.writeln(t.outerHTML);t.parentNode.removeChild(t)}else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var n=a.createElement("div");n.innerHTML=t.outerHTML;n=n.getElementsByTagName("div")[0];a.body.appendChild(n);t.parentNode.removeChild(t)}else{t.parentNode.removeChild(t);a.body.appendChild(t)}if(i||e){this.addPageBreak(a)}}));var y=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(y!=null){for(var C=0;C<y.length;C++){v(y[C],true)}}var E=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(var C=0;C<f;C++){var S=C*c/this.scale-this.y0/this.scale+(h.y-p.y*u)/u;for(var b=0;b<x;b++){if(this.wnd==null){return null}var w=b*m/this.scale-this.x0/this.scale+(h.x-p.x*u)/u;var T=C*x+b+1;var L=new mxRectangle(w,S,m,c);s=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,(function(t){this.addGraphFragment(-w,-S,this.scale,T,t,L);if(this.printBackgroundImage){this.insertBackgroundImage(t,-w,-S)}})),T);s.setAttribute("id","mxPage-"+T);v(s,E!=null||C<f-1||b<x-1)}}if(E!=null){for(var C=0;C<E.length;C++){v(E[C],C<E.length-1)}}if(l&&!n){this.closeDocument();g()}this.wnd.focus()}catch(A){if(s!=null&&s.parentNode!=null){s.parentNode.removeChild(s)}}finally{this.graph.cellRenderer.initializeOverlay=r}return this.wnd};mxPrintPreview.prototype.addPageBreak=function(t){var e=t.createElement("hr");e.className="mxPageBreak";t.body.appendChild(e)};mxPrintPreview.prototype.closeDocument=function(){try{if(this.wnd!=null&&this.wnd.document!=null){var t=this.wnd.document;this.writePostfix(t);t.writeln("</body>");t.writeln("</html>");t.close();mxEvent.release(t.body)}}catch(e){}};mxPrintPreview.prototype.writeHead=function(t,e){if(this.title!=null){t.writeln("<title>"+this.title+"</title>")}if(mxClient.IS_VML){t.writeln('<style type="text/css">v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}</style>')}mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t);t.writeln('<style type="text/css">');t.writeln("@media print {");t.writeln(" * { -webkit-print-color-adjust: exact; }");t.writeln(" table.mxPageSelector { display: none; }");t.writeln(" hr.mxPageBreak { display: none; }");t.writeln("}");t.writeln("@media screen {");t.writeln(" table.mxPageSelector { position: fixed; right: 10px; top: 10px;"+"font-family: Arial; font-size:10pt; border: solid 1px darkgray;"+"background: white; border-collapse:collapse; }");t.writeln(" table.mxPageSelector td { border: solid 1px gray; padding:4px; }");t.writeln(" body.mxPage { background: gray; }");t.writeln("}");if(e!=null){t.writeln(e)}t.writeln("</style>")};mxPrintPreview.prototype.writePostfix=function(t){};mxPrintPreview.prototype.createPageSelector=function(t,e){var i=this.wnd.document;var n=i.createElement("table");n.className="mxPageSelector";n.setAttribute("border","0");var r=i.createElement("tbody");for(var s=0;s<t;s++){var l=i.createElement("tr");for(var a=0;a<e;a++){var o=s*e+a+1;var h=i.createElement("td");var u=i.createElement("a");u.setAttribute("href","#mxPage-"+o);if(mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var d="var page = document.getElementById('mxPage-"+o+"');page.scrollIntoView(true);event.preventDefault();";u.setAttribute("onclick",d)}mxUtils.write(u,o,i);h.appendChild(u);l.appendChild(h)}r.appendChild(l)}n.appendChild(r);return n};mxPrintPreview.prototype.renderPage=function(t,e,i,n,r,s){var l=this.wnd.document;var a=document.createElement("div");var o=null;try{if(i!=0||n!=0){a.style.position="relative";a.style.width=t+"px";a.style.height=e+"px";a.style.pageBreakInside="avoid";var h=document.createElement("div");h.style.position="relative";h.style.top=this.border+"px";h.style.left=this.border+"px";h.style.width=t-2*this.border+"px";h.style.height=e-2*this.border+"px";h.style.overflow="hidden";var u=document.createElement("div");u.style.position="relative";u.style.marginLeft=i+"px";u.style.marginTop=n+"px";if(l.documentMode==8){h.style.position="absolute";u.style.position="absolute"}if(l.documentMode==10){u.style.width="100%";u.style.height="100%"}h.appendChild(u);a.appendChild(h);document.body.appendChild(a);o=u}else{a.style.width=t+"px";a.style.height=e+"px";a.style.overflow="hidden";a.style.pageBreakInside="avoid";if(l.documentMode==8){a.style.position="relative"}var h=document.createElement("div");h.style.width=t-2*this.border+"px";h.style.height=e-2*this.border+"px";h.style.overflow="hidden";if(mxClient.IS_IE&&(l.documentMode==null||l.documentMode==5||l.documentMode==8||l.documentMode==7)){h.style.marginTop=this.border+"px";h.style.marginLeft=this.border+"px"}else{h.style.top=this.border+"px";h.style.left=this.border+"px"}if(this.graph.dialect==mxConstants.DIALECT_VML){h.style.position="absolute"}a.appendChild(h);document.body.appendChild(a);o=h}}catch(d){a.parentNode.removeChild(a);a=null;throw d}r(o);return a};mxPrintPreview.prototype.getRoot=function(){var t=this.graph.view.currentRoot;if(t==null){t=this.graph.getModel().getRoot()}return t};mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF};mxPrintPreview.prototype.addGraphFragment=function(t,e,i,n,r,s){var l=this.graph.getView();var a=this.graph.container;this.graph.container=r;var o=l.getCanvas();var h=l.getBackgroundPane();var u=l.getDrawPane();var d=l.getOverlayPane();var p=i;if(this.graph.dialect==mxConstants.DIALECT_SVG){l.createSvg();if(this.useCssTransforms()){var m=l.getDrawPane().parentNode;var c=m.getAttribute("transform");m.setAttribute("transformOrigin","0 0");m.setAttribute("transform","scale("+i+","+i+")"+"translate("+t+","+e+")");i=1;t=0;e=0}}else if(this.graph.dialect==mxConstants.DIALECT_VML){l.createVml()}else{l.createHtml()}var x=l.isEventsEnabled();l.setEventsEnabled(false);var f=this.graph.isEnabled();this.graph.setEnabled(false);var g=l.getTranslate();l.translate=new mxPoint(t,e);var v=this.graph.cellRenderer.redraw;var y=l.states;var C=l.scale;if(this.clipping){var E=new mxRectangle((s.x+g.x)*C,(s.y+g.y)*C,s.width*C/p,s.height*C/p);this.graph.cellRenderer.redraw=function(t,e,i){if(t!=null){var n=y.get(t.cell);if(n!=null){var r=l.getBoundingBox(n,false);if(r!=null&&r.width>0&&r.height>0&&!mxUtils.intersects(E,r)){return}}}v.apply(this,arguments)}}var S=null;try{var b=[this.getRoot()];S=new mxTemporaryCellStates(l,i,b,null,mxUtils.bind(this,(function(t){return this.getLinkForCellState(t)})))}finally{if(mxClient.IS_IE){l.overlayPane.innerHTML="";l.canvas.style.overflow="hidden";l.canvas.style.position="relative";l.canvas.style.top=this.marginTop+"px";l.canvas.style.width=s.width+"px";l.canvas.style.height=s.height+"px"}else{var w=r.firstChild;while(w!=null){var T=w.nextSibling;var L=w.nodeName.toLowerCase();if(L=="svg"){w.style.overflow="hidden";w.style.position="relative";w.style.top=this.marginTop+"px";w.setAttribute("width",s.width);w.setAttribute("height",s.height);w.style.width="";w.style.height=""}else if(w.style.cursor!="default"&&L!="div"){w.parentNode.removeChild(w)}w=T}}if(this.printBackgroundImage){var A=r.getElementsByTagName("svg");if(A.length>0){A[0].style.position="absolute"}}l.overlayPane.parentNode.removeChild(l.overlayPane);this.graph.setEnabled(f);this.graph.container=a;this.graph.cellRenderer.redraw=v;l.canvas=o;l.backgroundPane=h;l.drawPane=u;l.overlayPane=d;l.translate=g;S.destroy();l.setEventsEnabled(x)}};mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)};mxPrintPreview.prototype.insertBackgroundImage=function(t,e,i){var n=this.graph.backgroundImage;if(n!=null){var r=document.createElement("img");r.style.position="absolute";r.style.marginLeft=Math.round(e*this.scale)+"px";r.style.marginTop=Math.round(i*this.scale)+"px";r.setAttribute("width",Math.round(this.scale*n.width));r.setAttribute("height",Math.round(this.scale*n.height));r.src=n.src;t.insertBefore(r,t.firstChild)}};mxPrintPreview.prototype.getCoverPages=function(){return null};mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(t){var e=this.open(t);if(e!=null){e.print()}};mxPrintPreview.prototype.close=function(){if(this.wnd!=null){this.wnd.close();this.wnd=null}};__mxOutput.mxPrintPreview=typeof mxPrintPreview!=="undefined"?mxPrintPreview:undefined;function mxStylesheet(){this.styles=new Object;this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";t[mxConstants.STYLE_STROKECOLOR]="#6482B9";t[mxConstants.STYLE_FONTCOLOR]="#774400";return t};mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR;t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC;t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;t[mxConstants.STYLE_STROKECOLOR]="#6482B9";t[mxConstants.STYLE_FONTCOLOR]="#446299";return t};mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)};mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)};mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles["defaultVertex"]};mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles["defaultEdge"]};mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e};mxStylesheet.prototype.getCellStyle=function(t,e){var i=e;if(t!=null&&t.length>0){var n=t.split(";");if(i!=null&&t.charAt(0)!=";"){i=mxUtils.clone(i)}else{i=new Object}for(var r=0;r<n.length;r++){var s=n[r];var l=s.indexOf("=");if(l>=0){var a=s.substring(0,l);var o=s.substring(l+1);if(o==mxConstants.NONE){delete i[a]}else if(mxUtils.isNumeric(o)){i[a]=parseFloat(o)}else{i[a]=o}}else{var h=this.styles[s];if(h!=null){for(var a in h){i[a]=h[a]}}}}}return i};__mxOutput.mxStylesheet=typeof mxStylesheet!=="undefined"?mxStylesheet:undefined;function mxCellState(t,e,i){this.view=t;this.cell=e;this.style=i!=null?i:{};this.origin=new mxPoint;this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle;mxCellState.prototype.constructor=mxCellState;mxCellState.prototype.view=null;mxCellState.prototype.cell=null;mxCellState.prototype.style=null;mxCellState.prototype.invalidStyle=false;mxCellState.prototype.invalid=true;mxCellState.prototype.origin=null;mxCellState.prototype.absolutePoints=null;mxCellState.prototype.absoluteOffset=null;mxCellState.prototype.visibleSourceState=null;mxCellState.prototype.visibleTargetState=null;mxCellState.prototype.terminalDistance=0;mxCellState.prototype.length=0;mxCellState.prototype.segments=null;mxCellState.prototype.shape=null;mxCellState.prototype.text=null;mxCellState.prototype.unscaledWidth=null;mxCellState.prototype.unscaledHeight=null;mxCellState.prototype.getPerimeterBounds=function(t,e){t=t||0;e=e!=null?e:new mxRectangle(this.x,this.y,this.width,this.height);if(this.shape!=null&&this.shape.stencil!=null&&this.shape.stencil.aspect=="fixed"){var i=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=i.x;e.y=i.y;e.width=this.shape.stencil.w0*i.width;e.height=this.shape.stencil.h0*i.height}if(t!=0){e.grow(t)}return e};mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){if(e){if(this.absolutePoints==null){this.absolutePoints=[]}if(this.absolutePoints.length==0){this.absolutePoints.push(t)}else{this.absolutePoints[0]=t}}else{if(this.absolutePoints==null){this.absolutePoints=[];this.absolutePoints.push(null);this.absolutePoints.push(t)}else if(this.absolutePoints.length==1){this.absolutePoints.push(t)}else{this.absolutePoints[this.absolutePoints.length-1]=t}}};mxCellState.prototype.setCursor=function(t){if(this.shape!=null){this.shape.setCursor(t)}if(this.text!=null){this.text.setCursor(t)}};mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return e!=null?e.cell:null};mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState};mxCellState.prototype.setVisibleTerminalState=function(t,e){if(e){this.visibleSourceState=t}else{this.visibleTargetState=t}};mxCellState.prototype.getCellBounds=function(){return this.cellBounds};mxCellState.prototype.getPaintBounds=function(){return this.paintBounds};mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate;var e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e);this.paintBounds=mxRectangle.fromRectangle(this.cellBounds);if(this.shape!=null&&this.shape.isPaintBoundsInverted()){this.paintBounds.rotate90()}};mxCellState.prototype.setState=function(t){this.view=t.view;this.cell=t.cell;this.style=t.style;this.absolutePoints=t.absolutePoints;this.origin=t.origin;this.absoluteOffset=t.absoluteOffset;this.boundingBox=t.boundingBox;this.terminalDistance=t.terminalDistance;this.segments=t.segments;this.length=t.length;this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height;this.unscaledWidth=t.unscaledWidth;this.unscaledHeight=t.unscaledHeight};mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(this.absolutePoints!=null){t.absolutePoints=[];for(var e=0;e<this.absolutePoints.length;e++){t.absolutePoints[e]=this.absolutePoints[e].clone()}}if(this.origin!=null){t.origin=this.origin.clone()}if(this.absoluteOffset!=null){t.absoluteOffset=this.absoluteOffset.clone()}if(this.boundingBox!=null){t.boundingBox=this.boundingBox.clone()}t.terminalDistance=this.terminalDistance;t.segments=this.segments;t.length=this.length;t.x=this.x;t.y=this.y;t.width=this.width;t.height=this.height;t.unscaledWidth=this.unscaledWidth;t.unscaledHeight=this.unscaledHeight;return t};mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)};__mxOutput.mxCellState=typeof mxCellState!=="undefined"?mxCellState:undefined;function mxGraphSelectionModel(t){this.graph=t;this.cells=[]}mxGraphSelectionModel.prototype=new mxEventSource;mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel;mxGraphSelectionModel.prototype.doneResource=mxClient.language!="none"?"done":"";mxGraphSelectionModel.prototype.updatingSelectionResource=mxClient.language!="none"?"updatingSelection":"";mxGraphSelectionModel.prototype.graph=null;mxGraphSelectionModel.prototype.singleSelection=false;mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection};mxGraphSelectionModel.prototype.setSingleSelection=function(t){this.singleSelection=t};mxGraphSelectionModel.prototype.isSelected=function(t){if(t!=null){return mxUtils.indexOf(this.cells,t)>=0}return false};mxGraphSelectionModel.prototype.isEmpty=function(){return this.cells.length==0};mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)};mxGraphSelectionModel.prototype.setCell=function(t){if(t!=null){this.setCells([t])}};mxGraphSelectionModel.prototype.setCells=function(t){if(t!=null){if(this.singleSelection){t=[this.getFirstSelectableCell(t)]}var e=[];for(var i=0;i<t.length;i++){if(this.graph.isCellSelectable(t[i])){e.push(t[i])}}this.changeSelection(e,this.cells)}};mxGraphSelectionModel.prototype.getFirstSelectableCell=function(t){if(t!=null){for(var e=0;e<t.length;e++){if(this.graph.isCellSelectable(t[e])){return t[e]}}}return null};mxGraphSelectionModel.prototype.addCell=function(t){if(t!=null){this.addCells([t])}};mxGraphSelectionModel.prototype.addCells=function(t){if(t!=null){var e=null;if(this.singleSelection){e=this.cells;t=[this.getFirstSelectableCell(t)]}var i=[];for(var n=0;n<t.length;n++){if(!this.isSelected(t[n])&&this.graph.isCellSelectable(t[n])){i.push(t[n])}}this.changeSelection(i,e)}};mxGraphSelectionModel.prototype.removeCell=function(t){if(t!=null){this.removeCells([t])}};mxGraphSelectionModel.prototype.removeCells=function(t){if(t!=null){var e=[];for(var i=0;i<t.length;i++){if(this.isSelected(t[i])){e.push(t[i])}}this.changeSelection(null,e)}};mxGraphSelectionModel.prototype.changeSelection=function(t,e){if(t!=null&&t.length>0&&t[0]!=null||e!=null&&e.length>0&&e[0]!=null){var i=new mxSelectionChange(this,t,e);i.execute();var n=new mxUndoableEdit(this,false);n.add(i);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n))}};mxGraphSelectionModel.prototype.cellAdded=function(t){if(t!=null&&!this.isSelected(t)){this.cells.push(t)}};mxGraphSelectionModel.prototype.cellRemoved=function(t){if(t!=null){var e=mxUtils.indexOf(this.cells,t);if(e>=0){this.cells.splice(e,1)}}};function mxSelectionChange(t,e,i){this.selectionModel=t;this.added=e!=null?e.slice():null;this.removed=i!=null?i.slice():null}mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource;if(this.removed!=null){for(var e=0;e<this.removed.length;e++){this.selectionModel.cellRemoved(this.removed[e])}}if(this.added!=null){for(var e=0;e<this.added.length;e++){this.selectionModel.cellAdded(this.added[e])}}var i=this.added;this.added=this.removed;this.removed=i;window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource;mxLog.leave("mxSelectionChange.execute",t);this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))};__mxOutput.mxGraphSelectionModel=typeof mxGraphSelectionModel!=="undefined"?mxGraphSelectionModel:undefined;function mxCellEditor(t){this.graph=t;this.zoomHandler=mxUtils.bind(this,(function(){if(this.graph.isEditing()){this.resize()}}));this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler);this.changeHandler=mxUtils.bind(this,(function(t){if(this.editingCell!=null&&this.graph.getView().getState(this.editingCell)==null){this.stopEditing(true)}}));this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}mxCellEditor.prototype.graph=null;mxCellEditor.prototype.textarea=null;mxCellEditor.prototype.editingCell=null;mxCellEditor.prototype.trigger=null;mxCellEditor.prototype.modified=false;mxCellEditor.prototype.autoSize=true;mxCellEditor.prototype.selectText=true;mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"";mxCellEditor.prototype.escapeCancelsEditing=true;mxCellEditor.prototype.textNode="";mxCellEditor.prototype.zIndex=5;mxCellEditor.prototype.minResize=new mxRectangle(0,20);mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:!mxClient.IS_IE11?1:0;mxCellEditor.prototype.blurEnabled=false;mxCellEditor.prototype.initialValue=null;mxCellEditor.prototype.align=null;mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div");this.textarea.className="mxCellEditor mxPlainTextEditor";this.textarea.contentEditable=true;if(mxClient.IS_GC){this.textarea.style.minHeight="1em"}this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative";this.installListeners(this.textarea)};mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)};mxCellEditor.prototype.setAlign=function(t){if(this.textarea!=null){this.textarea.style.textAlign=t}this.align=t;this.resize()};mxCellEditor.prototype.getInitialValue=function(t,e){var i=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),false);if(!mxClient.IS_QUIRKS&&document.documentMode!=8&&document.documentMode!=9&&document.documentMode!=10){i=mxUtils.replaceTrailingNewlines(i,"<div><br></div>")}return i.replace(/\n/g,"<br>")};mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)};mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)};mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,(function(t){this.graph.stopEditing(false);mxEvent.consume(t)})));mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){if(this.blurEnabled){this.focusLost(t)}})));mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){if(!mxEvent.isConsumed(t)){if(this.isStopEditingEvent(t)){this.graph.stopEditing(false);mxEvent.consume(t)}else if(t.keyCode==27){this.graph.stopEditing(this.isCancelEditingKeyEvent(t));mxEvent.consume(t)}}})));var e=mxUtils.bind(this,(function(e){if(this.editingCell!=null){if(this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||e.keyCode!=8&&e.keyCode!=46)){this.clearOnChange=false;t.innerHTML=""}}}));mxEvent.addListener(t,"keypress",e);mxEvent.addListener(t,"paste",e);var i=mxUtils.bind(this,(function(t){if(this.editingCell!=null){if(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="<br>"){this.textarea.innerHTML=this.getEmptyLabelText();this.clearOnChange=this.textarea.innerHTML.length>0}else{this.clearOnChange=false}}}));mxEvent.addListener(t,!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keyup",i);mxEvent.addListener(t,"cut",i);mxEvent.addListener(t,"paste",i);var n=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown";var r=mxUtils.bind(this,(function(t){if(this.editingCell!=null&&this.autoSize&&!mxEvent.isConsumed(t)){if(this.resizeThread!=null){window.clearTimeout(this.resizeThread)}this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null;this.resize()})),0)}}));mxEvent.addListener(t,n,r);mxEvent.addListener(window,"resize",r);if(document.documentMode>=9){mxEvent.addListener(t,"DOMNodeRemoved",r);mxEvent.addListener(t,"DOMNodeInserted",r)}else{mxEvent.addListener(t,"cut",r);mxEvent.addListener(t,"paste",r)}};mxCellEditor.prototype.isStopEditingEvent=function(t){return t.keyCode==113||this.graph.isEnterStopsCellEditing()&&t.keyCode==13&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)};mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea};mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(t==null){this.stopEditing(true)}else if(this.textarea!=null){var e=this.graph.getModel().isEdge(t.cell);var i=this.graph.getView().scale;var n=null;if(!this.autoSize||t.style[mxConstants.STYLE_OVERFLOW]=="fill"){this.bounds=this.getEditorBounds(t);this.textarea.style.width=Math.round(this.bounds.width/i)+"px";this.textarea.style.height=Math.round(this.bounds.height/i)+"px";if(document.documentMode==8||mxClient.IS_QUIRKS){this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px"}else{this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px";this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP;this.textarea.style.whiteSpace="normal";if(t.style[mxConstants.STYLE_OVERFLOW]!="fill"){this.textarea.style.width=Math.round(this.bounds.width/i)+this.wordWrapPadding+"px"}}else{this.textarea.style.whiteSpace="nowrap";if(t.style[mxConstants.STYLE_OVERFLOW]!="fill"){this.textarea.style.width=""}}}else{var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);n=t.text!=null&&this.align==null?t.text.margin:null;if(n==null){n=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))}if(e){this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0);if(r!=null){var s=(parseFloat(r)+2)*i;this.bounds.width=s;this.bounds.x+=n.x*s}}else{var l=mxRectangle.fromRectangle(t);var a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=t.shape!=null&&a==mxConstants.ALIGN_CENTER&&o==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l;if(r!=null){l.width=parseFloat(r)*i}if(!t.view.graph.cellRenderer.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="width"){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*i;var u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+h;var d=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+h;var p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+h;var m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+h;var a=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var o=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+m,l.y+u,l.width-(a==mxConstants.ALIGN_CENTER&&r==null?m+d:0),l.height-(o==mxConstants.ALIGN_MIDDLE?u+p:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP;this.textarea.style.whiteSpace="normal";var s=Math.round(this.bounds.width/(document.documentMode==8?i:i))+this.wordWrapPadding;if(this.textarea.style.position!="relative"){this.textarea.style.width=s+"px";if(this.textarea.scrollWidth>s){this.textarea.style.width=this.textarea.scrollWidth+"px"}}else{this.textarea.style.maxWidth=s+"px"}}else{this.textarea.style.whiteSpace="nowrap";this.textarea.style.width=""}if(document.documentMode==8){this.textarea.style.zoom="1";this.textarea.style.height="auto"}var c=this.textarea.scrollWidth;var x=this.textarea.scrollHeight;if(document.documentMode==8){this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-n.x*(this.bounds.width-(c+1)*i)+c*(i-1)*0+(n.x+.5)*2)/i))+"px";this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-n.y*(this.bounds.height-(x+.5)*i)+x*(i-1)*0+Math.abs(n.y+.5)*1)/i))+"px";this.textarea.style.width=Math.round(c*i)+"px";this.textarea.style.height=Math.round(x*i)+"px"}else if(mxClient.IS_QUIRKS){this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-n.x*(this.bounds.width-(c+1)*i)+c*(i-1)*0+(n.x+.5)*2))+"px";this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-n.y*(this.bounds.height-(x+.5)*i)+x*(i-1)*0+Math.abs(n.y+.5)*1))+"px"}else{this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-n.x*(this.bounds.width-2))+1)+"px";this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-n.y*(this.bounds.height-4)+(n.y==-1?3:0))+1)+"px"}}if(mxClient.IS_VML){this.textarea.style.zoom=i}else{mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+i+","+i+")"+(n==null?"":" translate("+n.x*100+"%,"+n.y*100+"%)"))}}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};mxCellEditor.prototype.getBackgroundColor=function(t){return null};mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML){return true}else{var t=false;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(e!=null){var i=mxUtils.getCurrentStyle(e);if(i!=null){t=i.position=="absolute"}}}return!t}};mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(true);this.align=null;if(this.textarea==null){this.init()}if(this.graph.tooltipHandler!=null){this.graph.tooltipHandler.hideTooltip()}var i=this.graph.getView().getState(t);if(i!=null){var n=this.graph.getView().scale;var r=mxUtils.getValue(i.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);var s=mxUtils.getValue(i.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var l=mxUtils.getValue(i.style,mxConstants.STYLE_FONTCOLOR,"black");var a=mxUtils.getValue(i.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT);var o=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD;var h=(mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC;var u=[];if((mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE){u.push("underline")}if((mxUtils.getValue(i.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH){u.push("line-through")}this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(r*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.backgroundColor=this.getBackgroundColor(i);this.textarea.style.textDecoration=u.join(" ");this.textarea.style.fontWeight=o?"bold":"normal";this.textarea.style.fontStyle=h?"italic":"";this.textarea.style.fontSize=Math.round(r)+"px";this.textarea.style.zIndex=this.zIndex;this.textarea.style.fontFamily=s;this.textarea.style.textAlign=a;this.textarea.style.outline="none";this.textarea.style.color=l;var d=this.textDirection=mxUtils.getValue(i.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);if(d==mxConstants.TEXT_DIRECTION_AUTO){if(i!=null&&i.text!=null&&i.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(i.text.value)){d=i.text.getAutoDirection()}}if(d==mxConstants.TEXT_DIRECTION_LTR||d==mxConstants.TEXT_DIRECTION_RTL){this.textarea.setAttribute("dir",d)}else{this.textarea.removeAttribute("dir")}this.textarea.innerHTML=this.getInitialValue(i,e)||"";this.initialValue=this.textarea.innerHTML;if(this.textarea.innerHTML.length==0||this.textarea.innerHTML=="<br>"){this.textarea.innerHTML=this.getEmptyLabelText();this.clearOnChange=true}else{this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText()}this.graph.container.appendChild(this.textarea);this.editingCell=t;this.trigger=e;this.textNode=null;if(i.text!=null&&this.isHideLabel(i)){this.textNode=i.text.node;this.textNode.style.visibility="hidden"}if(this.autoSize&&(this.graph.model.isEdge(i.cell)||i.style[mxConstants.STYLE_OVERFLOW]!="fill")){window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0)}this.resize();try{this.textarea.focus();if(this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)){document.execCommand("selectAll",false,null)}}catch(p){}}};mxCellEditor.prototype.isSelectText=function(){return this.selectText};mxCellEditor.prototype.clearSelection=function(){var t=null;if(window.getSelection){t=window.getSelection()}else if(document.selection){t=document.selection}if(t!=null){if(t.empty){t.empty()}else if(t.removeAllRanges){t.removeAllRanges()}}};mxCellEditor.prototype.stopEditing=function(t){t=t||false;if(this.editingCell!=null){if(this.textNode!=null){this.textNode.style.visibility="visible";this.textNode=null}var e=!t?this.graph.view.getState(this.editingCell):null;var i=this.initialValue;this.initialValue=null;this.editingCell=null;this.trigger=null;this.bounds=null;this.textarea.blur();this.clearSelection();if(this.textarea.parentNode!=null){this.textarea.parentNode.removeChild(this.textarea)}if(this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()){this.textarea.innerHTML="";this.clearOnChange=false}if(e!=null&&(this.textarea.innerHTML!=i||this.align!=null)){this.prepareTextarea();var n=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{if(n!=null){this.applyValue(e,n)}if(this.align!=null){this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea);this.textarea=null;this.align=null}};mxCellEditor.prototype.prepareTextarea=function(){if(this.textarea.lastChild!=null&&this.textarea.lastChild.nodeName=="BR"){this.textarea.removeChild(this.textarea.lastChild)}};mxCellEditor.prototype.isHideLabel=function(t){return true};mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,t.text==null?30:t.text.size*e+20,this.textarea.style.textAlign=="left"?120:40)};mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell);var i=this.graph.getView().scale;var n=this.getMinimumSize(t);var r=n.width;var s=n.height;var l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&t.style[mxConstants.STYLE_OVERFLOW]=="fill"){l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t))}else{var a=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*i;var o=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*i+a;var h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*i+a;var u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*i+a;var d=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*i+a;l=new mxRectangle(t.x,t.y,Math.max(r,t.width-d-h),Math.max(s,t.height-o-u));var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var m=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=t.shape!=null&&p==mxConstants.ALIGN_CENTER&&m==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l;if(e){l.x=t.absoluteOffset.x;l.y=t.absoluteOffset.y;if(t.text!=null&&t.text.boundingBox!=null){if(t.text.boundingBox.x>0){l.x=t.text.boundingBox.x}if(t.text.boundingBox.y>0){l.y=t.text.boundingBox.y}}}else if(t.text!=null&&t.text.boundingBox!=null){l.x=Math.min(l.x,t.text.boundingBox.x);l.y=Math.min(l.y,t.text.boundingBox.y)}l.x+=d;l.y+=o;if(t.text!=null&&t.text.boundingBox!=null){if(!e){l.width=Math.max(l.width,t.text.boundingBox.width);l.height=Math.max(l.height,t.text.boundingBox.height)}else{l.width=Math.max(r,t.text.boundingBox.width);l.height=Math.max(s,t.text.boundingBox.height)}}if(this.graph.getModel().isVertex(t.cell)){var c=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(c==mxConstants.ALIGN_LEFT){l.x-=t.width}else if(c==mxConstants.ALIGN_RIGHT){l.x+=t.width}var x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(x==mxConstants.ALIGN_TOP){l.y-=t.height}else if(x==mxConstants.ALIGN_BOTTOM){l.y+=t.height}}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))};mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText};mxCellEditor.prototype.getEditingCell=function(){return this.editingCell};mxCellEditor.prototype.destroy=function(){if(this.textarea!=null){mxEvent.release(this.textarea);if(this.textarea.parentNode!=null){this.textarea.parentNode.removeChild(this.textarea)}this.textarea=null}if(this.changeHandler!=null){this.graph.getModel().removeListener(this.changeHandler);this.changeHandler=null}if(this.zoomHandler){this.graph.view.removeListener(this.zoomHandler);this.zoomHandler=null}};__mxOutput.mxCellEditor=typeof mxCellEditor!=="undefined"?mxCellEditor:undefined;function mxCellRenderer(){}mxCellRenderer.defaultShapes=new Object;mxCellRenderer.prototype.defaultEdgeShape=mxConnector;mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape;mxCellRenderer.prototype.defaultTextShape=mxText;mxCellRenderer.prototype.legacyControlPosition=true;mxCellRenderer.prototype.legacySpacing=true;mxCellRenderer.prototype.antiAlias=true;mxCellRenderer.prototype.minSvgStrokeWidth=1;mxCellRenderer.prototype.forceControlClickHandler=false;mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e};mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape);mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus);mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder);mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor);mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle);mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon);mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud);mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane);mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape);mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel);mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect;this.configureShape(t);t.shape.init(t.view.getDrawPane())};mxCellRenderer.prototype.createShape=function(t){var e=null;if(t.style!=null){var i=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(i!=null){e=new mxShape(i)}else{var n=this.getShapeConstructor(t);e=new n}}return e};mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))};mxCellRenderer.prototype.getShape=function(t){return t!=null?mxCellRenderer.defaultShapes[t]:null};mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);if(e==null){e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape}return e};mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t);t.shape.image=t.view.graph.getImage(t);t.shape.indicatorColor=t.view.graph.getIndicatorColor(t);t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR];t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t);t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION];t.shape.indicatorImage=t.view.graph.getIndicatorImage(t);this.postConfigureShape(t)};mxCellRenderer.prototype.postConfigureShape=function(t){if(t.shape!=null){this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR);this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR);this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR);this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR);this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR)}};mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(t.style!=null){var e=["inherit","swimlane","indicated"];var i=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR];for(var n=0;n<i.length;n++){if(mxUtils.indexOf(e,t.style[i[n]])>=0){return true}}}return false};mxCellRenderer.prototype.resolveColor=function(t,e,i){var n=i==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(n!=null){var r=t.view.graph;var s=n[e];var l=null;if(s=="inherit"){l=r.model.getParent(t.cell)}else if(s=="swimlane"){n[e]=i==mxConstants.STYLE_STROKECOLOR||i==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff";if(r.model.getTerminal(t.cell,false)!=null){l=r.model.getTerminal(t.cell,false)}else{l=t.cell}l=r.getSwimlane(l);i=r.swimlaneIndicatorColorAttribute}else if(s=="indicated"&&t.shape!=null){n[e]=t.shape.indicatorColor}else if(i!=mxConstants.STYLE_FILLCOLOR&&s==mxConstants.STYLE_FILLCOLOR&&t.shape!=null){n[e]=t.style[mxConstants.STYLE_FILLCOLOR]}else if(i!=mxConstants.STYLE_STROKECOLOR&&s==mxConstants.STYLE_STROKECOLOR&&t.shape!=null){n[e]=t.style[mxConstants.STYLE_STROKECOLOR]}if(l!=null){var a=r.getView().getState(l);n[e]=null;if(a!=null){var o=i==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;if(o!=null&&e!="indicatorColor"){n[e]=o[e]}else{n[e]=a.style[i]}}}}};mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)};mxCellRenderer.prototype.createLabel=function(t,e){var i=t.view.graph;var n=i.getModel().isEdge(t.cell);if(t.style[mxConstants.STYLE_FONTSIZE]>0||t.style[mxConstants.STYLE_FONTSIZE]==null){var r=i.isHtmlLabel(t.cell)||e!=null&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,i.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],i.isWrapping(t.cell)&&i.isHtmlLabel(t.cell),i.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION));t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100);t.text.dialect=r?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect;t.text.style=t.style;t.text.state=t;this.initializeLabel(t,t.text);var s=false;var l=function(e){var n=t;if(mxClient.IS_TOUCH||s){var r=mxEvent.getClientX(e);var l=mxEvent.getClientY(e);var a=mxUtils.convertPoint(i.container,r,l);n=i.view.getState(i.getCellAt(a.x,a.y))}return n};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t));s=i.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(e).nodeName=="IMG"}})),mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,l(e)))}})),mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,l(e)));s=false}})));if(i.nativeDblClickEnabled){mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){if(this.isLabelEvent(t,e)){i.dblClick(e,t.cell);mxEvent.consume(e)}})))}}};mxCellRenderer.prototype.initializeLabel=function(t,e){if(mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG){e.init(t.view.graph.container)}else{e.init(t.view.getDrawPane())}};mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph;var i=e.getCellOverlays(t.cell);var n=null;if(i!=null){n=new mxDictionary;for(var r=0;r<i.length;r++){var s=t.overlays!=null?t.overlays.remove(i[r]):null;if(s==null){var l=new mxImageShape(new mxRectangle,i[r].image.src);l.dialect=t.view.graph.dialect;l.preserveImageAspect=false;l.overlay=i[r];this.initializeOverlay(t,l);this.installCellOverlayListeners(t,i[r],l);if(i[r].cursor!=null){l.node.style.cursor=i[r].cursor}n.put(i[r],l)}else{n.put(i[r],s)}}}if(t.overlays!=null){t.overlays.visit((function(t,e){e.destroy()}))}t.overlays=n};mxCellRenderer.prototype.initializeOverlay=function(t,e){e.init(t.view.getOverlayPane())};mxCellRenderer.prototype.installCellOverlayListeners=function(t,e,i){var n=t.view.graph;mxEvent.addListener(i.node,"click",(function(i){if(n.isEditing()){n.stopEditing(!n.isInvokesStopCellEditing())}e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",i,"cell",t.cell))}));mxEvent.addGestureListeners(i.node,(function(t){mxEvent.consume(t)}),(function(e){n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}));if(mxClient.IS_TOUCH){mxEvent.addListener(i.node,"touchend",(function(i){e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",i,"cell",t.cell))}))}};mxCellRenderer.prototype.createControl=function(t){var e=t.view.graph;var i=e.getFoldingImage(t);if(e.foldingEnabled&&i!=null){if(t.control==null){var n=new mxRectangle(0,0,i.width,i.height);t.control=new mxImageShape(n,i.src);t.control.preserveImageAspect=false;t.control.dialect=e.dialect;this.initControl(t,t.control,true,this.createControlClickHandler(t))}}else if(t.control!=null){t.control.destroy();t.control=null}};mxCellRenderer.prototype.createControlClickHandler=function(t){var e=t.view.graph;return mxUtils.bind(this,(function(i){if(this.forceControlClickHandler||e.isEnabled()){var n=!e.isCellCollapsed(t.cell);e.foldCells(n,false,[t.cell],null,i);mxEvent.consume(i)}}))};mxCellRenderer.prototype.initControl=function(t,e,i,n){var r=t.view.graph;var s=r.isHtmlLabel(t.cell)&&mxClient.NO_FO&&r.dialect==mxConstants.DIALECT_SVG;if(s){e.dialect=mxConstants.DIALECT_PREFERHTML;e.init(r.container);e.node.style.zIndex=1}else{e.init(t.view.getOverlayPane())}var l=e.innerNode||e.node;if(n!=null&&!mxClient.IS_IOS){if(r.isEnabled()){l.style.cursor="pointer"}mxEvent.addListener(l,"click",n)}if(i){var a=null;mxEvent.addGestureListeners(l,(function(e){a=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e));r.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t));mxEvent.consume(e)}),(function(e){r.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),(function(e){r.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,t));mxEvent.consume(e)}));if(n!=null&&mxClient.IS_IOS){l.addEventListener("touchend",(function(t){if(a!=null){var e=r.tolerance;if(Math.abs(a.x-mxEvent.getClientX(t))<e&&Math.abs(a.y-mxEvent.getClientY(t))<e){n.call(n,t);mxEvent.consume(t)}}}),true)}}return l};mxCellRenderer.prototype.isShapeEvent=function(t,e){return true};mxCellRenderer.prototype.isLabelEvent=function(t,e){return true};mxCellRenderer.prototype.installListeners=function(t){var e=t.view.graph;var i=function(i){var n=t;if(e.dialect!=mxConstants.DIALECT_SVG&&mxEvent.getSource(i).nodeName=="IMG"||mxClient.IS_TOUCH){var r=mxEvent.getClientX(i);var s=mxEvent.getClientY(i);var l=mxUtils.convertPoint(e.container,r,s);n=e.view.getState(e.getCellAt(l.x,l.y))}return n};mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,(function(i){if(this.isShapeEvent(t,i)){e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(i,t))}})),mxUtils.bind(this,(function(n){if(this.isShapeEvent(t,n)){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(n,i(n)))}})),mxUtils.bind(this,(function(n){if(this.isShapeEvent(t,n)){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(n,i(n)))}})));if(e.nativeDblClickEnabled){mxEvent.addListener(t.shape.node,"dblclick",mxUtils.bind(this,(function(i){if(this.isShapeEvent(t,i)){e.dblClick(i,t.cell);mxEvent.consume(i)}})))}};mxCellRenderer.prototype.redrawLabel=function(t,e){var i=t.view.graph;var n=this.getLabelValue(t);var r=i.isWrapping(t.cell);var s=i.isLabelClipped(t.cell);var l=t.view.graph.isHtmlLabel(t.cell)||n!=null&&mxUtils.isNode(n);var a=l?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect;var o=t.style[mxConstants.STYLE_OVERFLOW]||"visible";if(t.text!=null&&(t.text.wrap!=r||t.text.clipped!=s||t.text.overflow!=o||t.text.dialect!=a)){t.text.destroy();t.text=null}if(t.text==null&&n!=null&&(mxUtils.isNode(n)||n.length>0)){this.createLabel(t,n)}else if(t.text!=null&&(n==null||n.length==0)){t.text.destroy();t.text=null}if(t.text!=null){if(e){if(t.text.lastValue!=null&&this.isTextShapeInvalid(t,t.text)){t.text.lastValue=null}t.text.resetStyles();t.text.apply(t);t.text.valign=i.getVerticalAlign(t)}var h=this.getLabelBounds(t);var u=this.getTextScale(t);this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR);if(e||t.text.value!=n||t.text.isWrapping!=r||t.text.overflow!=o||t.text.isClipping!=s||t.text.scale!=u||t.text.dialect!=a||t.text.bounds==null||!t.text.bounds.equals(h)){t.text.dialect=a;t.text.value=n;t.text.bounds=h;t.text.scale=u;t.text.wrap=r;t.text.clipped=s;t.text.overflow=o;var d=t.text.node.style.visibility;this.redrawLabelShape(t.text);t.text.node.style.visibility=d}}};mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function i(i,n,r){var s=false;if(n=="spacingTop"||n=="spacingRight"||n=="spacingBottom"||n=="spacingLeft"){s=parseFloat(e[i])-parseFloat(e.spacing)!=(t.style[n]||r)}else{s=e[i]!=(t.style[n]||r)}return s}return i("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||i("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||i("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||i("color",mxConstants.STYLE_FONTCOLOR,"black")||i("align",mxConstants.STYLE_ALIGN,"")||i("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||i("spacing",mxConstants.STYLE_SPACING,2)||i("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||i("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||i("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||i("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||i("horizontal",mxConstants.STYLE_HORIZONTAL,true)||i("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||i("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||i("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||i("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)};mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()};mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale};mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph;var i=t.view.scale;var n=e.getModel().isEdge(t.cell);var r=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(n){var s=t.text.getSpacing();r.x+=s.x*i;r.y+=s.y*i;var l=e.getCellGeometry(t.cell);if(l!=null){r.width=Math.max(0,l.width*i);r.height=Math.max(0,l.height*i)}}else{if(t.text.isPaintBoundsInverted()){var a=r.x;r.x=r.y;r.y=a}r.x+=t.x;r.y+=t.y;r.width=Math.max(1,t.width);r.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var o=(t.width-t.height)/2;r.x+=o;r.y-=o;var a=r.width;r.width=r.height;r.height=a}if(t.shape!=null){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE){r=t.shape.getLabelBounds(r)}}var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(d!=null){r.width=parseFloat(d)*i}if(!n){this.rotateLabelBounds(t,r)}return r};mxCellRenderer.prototype.rotateLabelBounds=function(t,e){e.y-=t.text.margin.y*e.height;e.x-=t.text.margin.x*e.width;if(!this.legacySpacing||t.style[mxConstants.STYLE_OVERFLOW]!="fill"&&t.style[mxConstants.STYLE_OVERFLOW]!="width"){var i=t.view.scale;var n=t.text.getSpacing();e.x+=n.x*i;e.y+=n.y*i;var r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);var l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(r==mxConstants.ALIGN_CENTER&&l==null?t.text.spacingLeft*i+t.text.spacingRight*i:0));e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*i+t.text.spacingBottom*i:0))}var a=t.text.getTextRotation();if(a!=0&&t!=null&&t.view.graph.model.isVertex(t.cell)){var o=t.getCenterX();var h=t.getCenterY();if(e.x!=o||e.y!=h){var u=a*(Math.PI/180);var d=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(o,h));e.x=d.x;e.y=d.y}}};mxCellRenderer.prototype.redrawCellOverlays=function(t,e){this.createCellOverlays(t);if(t.overlays!=null){var i=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90);var n=mxUtils.toRadians(i);var r=Math.cos(n);var s=Math.sin(n);t.overlays.visit((function(n,l){var a=l.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)){if(t.shape!=null&&i!=0){var o=a.getCenterX();var h=a.getCenterY();var u=mxUtils.getRotatedPoint(new mxPoint(o,h),r,s,new mxPoint(t.getCenterX(),t.getCenterY()));o=u.x;h=u.y;a.x=Math.round(o-a.width/2);a.y=Math.round(h-a.height/2)}}if(e||l.bounds==null||l.scale!=t.view.scale||!l.bounds.equals(a)){l.bounds=a;l.scale=t.view.scale;l.redraw()}}))}};mxCellRenderer.prototype.redrawControl=function(t,e){var i=t.view.graph.getFoldingImage(t);if(t.control!=null&&i!=null){var n=this.getControlBounds(t,i.width,i.height);var r=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation();var s=t.view.scale;if(e||t.control.scale!=s||!t.control.bounds.equals(n)||t.control.rotation!=r){t.control.rotation=r;t.control.bounds=n;t.control.scale=s;t.control.redraw()}}};mxCellRenderer.prototype.getControlBounds=function(t,e,i){if(t.control!=null){var n=t.view.scale;var r=t.getCenterX();var s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)){r=t.x+e*n;s=t.y+i*n;if(t.shape!=null){var l=t.shape.getShapeRotation();if(this.legacyControlPosition){l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0)}else{if(t.shape.isPaintBoundsInverted()){var a=(t.width-t.height)/2;r+=a;s-=a}}if(l!=0){var o=mxUtils.toRadians(l);var h=Math.cos(o);var u=Math.sin(o);var d=mxUtils.getRotatedPoint(new mxPoint(r,s),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));r=d.x;s=d.y}}}return t.view.graph.getModel().isEdge(t.cell)?new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n)):new mxRectangle(Math.round(r-e/2*n),Math.round(s-i/2*n),Math.round(e*n),Math.round(i*n))}return null};mxCellRenderer.prototype.insertStateAfter=function(t,e,i){var n=this.getShapesForState(t);for(var r=0;r<n.length;r++){if(n[r]!=null&&n[r].node!=null){var s=n[r].node.parentNode!=t.view.getDrawPane()&&n[r].node.parentNode!=t.view.getOverlayPane();var l=s?i:e;if(l!=null&&l.nextSibling!=n[r].node){if(l.nextSibling==null){l.parentNode.appendChild(n[r].node)}else{l.parentNode.insertBefore(n[r].node,l.nextSibling)}}else if(l==null){if(n[r].node.parentNode==t.view.graph.container){var a=t.view.canvas;while(a!=null&&a.parentNode!=t.view.graph.container){a=a.parentNode}if(a!=null&&a.nextSibling!=null){if(a.nextSibling!=n[r].node){n[r].node.parentNode.insertBefore(n[r].node,a.nextSibling)}}else{n[r].node.parentNode.appendChild(n[r].node)}}else if(n[r].node.parentNode!=null&&n[r].node.parentNode.firstChild!=null&&n[r].node.parentNode.firstChild!=n[r].node){n[r].node.parentNode.insertBefore(n[r].node,n[r].node.parentNode.firstChild)}}if(s){i=n[r].node}else{e=n[r].node}}}return[e,i]};mxCellRenderer.prototype.getShapesForState=function(t){return[t.shape,t.text,t.control]};mxCellRenderer.prototype.redraw=function(t,e,i){var n=this.redrawShape(t,e,i);if(t.shape!=null&&(i==null||i)){this.redrawLabel(t,n);this.redrawCellOverlays(t,n);this.redrawControl(t,n)}};mxCellRenderer.prototype.redrawShape=function(t,e,i){var n=t.view.graph.model;var r=false;if(t.shape!=null&&t.shape.style!=null&&t.style!=null&&t.shape.style[mxConstants.STYLE_SHAPE]!=t.style[mxConstants.STYLE_SHAPE]){t.shape.destroy();t.shape=null}if(t.shape==null&&t.view.graph.container!=null&&t.cell!=t.view.currentRoot&&(n.isVertex(t.cell)||n.isEdge(t.cell))){t.shape=this.createShape(t);if(t.shape!=null){t.shape.minSvgStrokeWidth=this.minSvgStrokeWidth;t.shape.antiAlias=this.antiAlias;this.createIndicatorShape(t);this.initializeShape(t);this.createCellOverlays(t);this.installListeners(t);t.view.graph.selectionCellsHandler.updateHandler(t)}}else if(!e&&t.shape!=null&&(!mxUtils.equalEntries(t.shape.style,t.style)||this.checkPlaceholderStyles(t))){t.shape.resetStyles();this.configureShape(t);t.view.graph.selectionCellsHandler.updateHandler(t);e=true}if(t.shape!=null&&t.shape.indicatorShape!=this.getShape(t.view.graph.getIndicatorShape(t))){if(t.shape.indicator!=null){t.shape.indicator.destroy();t.shape.indicator=null}this.createIndicatorShape(t);if(t.shape.indicatorShape!=null){t.shape.indicator=new t.shape.indicatorShape;t.shape.indicator.dialect=t.shape.dialect;t.shape.indicator.init(t.node);e=true}}if(t.shape!=null){this.createControl(t);if(e||this.isShapeInvalid(t,t.shape)){if(t.absolutePoints!=null){t.shape.points=t.absolutePoints.slice();t.shape.bounds=null}else{t.shape.points=null;t.shape.bounds=new mxRectangle(t.x,t.y,t.width,t.height)}t.shape.scale=t.view.scale;if(i==null||i){this.doRedrawShape(t)}else{t.shape.updateBoundingBox()}r=true}}return r};mxCellRenderer.prototype.doRedrawShape=function(t){t.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(t,e){return e.bounds==null||e.scale!=t.view.scale||t.absolutePoints==null&&!e.bounds.equals(t)||t.absolutePoints!=null&&!mxUtils.equalPoints(e.points,t.absolutePoints)};mxCellRenderer.prototype.destroy=function(t){if(t.shape!=null){if(t.text!=null){t.text.destroy();t.text=null}if(t.overlays!=null){t.overlays.visit((function(t,e){e.destroy()}));t.overlays=null}if(t.control!=null){t.control.destroy();t.control=null}t.shape.destroy();t.shape=null}};__mxOutput.mxCellRenderer=typeof mxCellRenderer!=="undefined"?mxCellRenderer:undefined;var mxEdgeStyle={EntityRelation:function(t,e,i,n,r){var s=t.view;var l=s.graph;var a=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale;var o=t.absolutePoints;var h=o[0];var u=o[o.length-1];var d=false;if(e!=null){var p=l.getCellGeometry(e.cell);if(p.relative){d=p.x<=.5}else if(i!=null){d=(u!=null?u.x:i.x+i.width)<(h!=null?h.x:e.x)}}if(h!=null){e=new mxCellState;e.x=h.x;e.y=h.y}else if(e!=null){var m=mxUtils.getPortConstraints(e,t,true,mxConstants.DIRECTION_MASK_NONE);if(m!=mxConstants.DIRECTION_MASK_NONE&&m!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST){d=m==mxConstants.DIRECTION_MASK_WEST}}else{return}var c=true;if(i!=null){var x=l.getCellGeometry(i.cell);if(x.relative){c=x.x<=.5}else if(e!=null){c=(h!=null?h.x:e.x+e.width)<(u!=null?u.x:i.x)}}if(u!=null){i=new mxCellState;i.x=u.x;i.y=u.y}else if(i!=null){var m=mxUtils.getPortConstraints(i,t,false,mxConstants.DIRECTION_MASK_NONE);if(m!=mxConstants.DIRECTION_MASK_NONE&&m!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST){c=m==mxConstants.DIRECTION_MASK_WEST}}if(e!=null&&i!=null){var f=d?e.x:e.x+e.width;var g=s.getRoutingCenterY(e);var v=c?i.x:i.x+i.width;var y=s.getRoutingCenterY(i);var C=a;var E=d?-C:C;var S=new mxPoint(f+E,g);E=c?-C:C;var b=new mxPoint(v+E,y);if(d==c){var w=d?Math.min(f,v)-a:Math.max(f,v)+a;r.push(new mxPoint(w,g));r.push(new mxPoint(w,y))}else if(S.x<b.x==d){var T=g+(y-g)/2;r.push(S);r.push(new mxPoint(S.x,T));r.push(new mxPoint(b.x,T));r.push(b)}else{r.push(S);r.push(b)}}},Loop:function(t,e,i,n,r){var s=t.absolutePoints;var l=s[0];var a=s[s.length-1];if(l!=null&&a!=null){if(n!=null&&n.length>0){for(var o=0;o<n.length;o++){var h=n[o];h=t.view.transformControlPoint(t,h);r.push(new mxPoint(h.x,h.y))}}return}if(e!=null){var u=t.view;var d=u.graph;var h=n!=null&&n.length>0?n[0]:null;if(h!=null){h=u.transformControlPoint(t,h);if(mxUtils.contains(e,h.x,h.y)){h=null}}var p=0;var m=0;var c=0;var x=0;var f=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,d.gridSize)*u.scale;var g=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);if(g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH){p=u.getRoutingCenterX(e);m=f}else{c=u.getRoutingCenterY(e);x=f}if(h==null||h.x<e.x||h.x>e.x+e.width){if(h!=null){p=h.x;x=Math.max(Math.abs(c-h.y),x)}else{if(g==mxConstants.DIRECTION_NORTH){c=e.y-2*m}else if(g==mxConstants.DIRECTION_SOUTH){c=e.y+e.height+2*m}else if(g==mxConstants.DIRECTION_EAST){p=e.x-2*x}else{p=e.x+e.width+2*x}}}else if(h!=null){p=u.getRoutingCenterX(e);m=Math.max(Math.abs(p-h.x),x);c=h.y;x=0}r.push(new mxPoint(p-m,c-x));r.push(new mxPoint(p+m,c+x))}},ElbowConnector:function(t,e,i,n,r){var s=n!=null&&n.length>0?n[0]:null;var l=false;var a=false;if(e!=null&&i!=null){if(s!=null){var o=Math.min(e.x,i.x);var h=Math.max(e.x+e.width,i.x+i.width);var u=Math.min(e.y,i.y);var d=Math.max(e.y+e.height,i.y+i.height);s=t.view.transformControlPoint(t,s);l=s.y<u||s.y>d;a=s.x<o||s.x>h}else{var o=Math.max(e.x,i.x);var h=Math.min(e.x+e.width,i.x+i.width);l=o==h;if(!l){var u=Math.max(e.y,i.y);var d=Math.min(e.y+e.height,i.y+i.height);a=u==d}}}if(!a&&(l||t.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)){mxEdgeStyle.TopToBottom(t,e,i,n,r)}else{mxEdgeStyle.SideToSide(t,e,i,n,r)}},SideToSide:function(t,e,i,n,r){var s=t.view;var l=n!=null&&n.length>0?n[0]:null;var a=t.absolutePoints;var o=a[0];var h=a[a.length-1];if(l!=null){l=s.transformControlPoint(t,l)}if(o!=null){e=new mxCellState;e.x=o.x;e.y=o.y}if(h!=null){i=new mxCellState;i.x=h.x;i.y=h.y}if(e!=null&&i!=null){var u=Math.max(e.x,i.x);var d=Math.min(e.x+e.width,i.x+i.width);var p=l!=null?l.x:Math.round(d+(u-d)/2);var m=s.getRoutingCenterY(e);var c=s.getRoutingCenterY(i);if(l!=null){if(l.y>=e.y&&l.y<=e.y+e.height){m=l.y}if(l.y>=i.y&&l.y<=i.y+i.height){c=l.y}}if(!mxUtils.contains(i,p,m)&&!mxUtils.contains(e,p,m)){r.push(new mxPoint(p,m))}if(!mxUtils.contains(i,p,c)&&!mxUtils.contains(e,p,c)){r.push(new mxPoint(p,c))}if(r.length==1){if(l!=null){if(!mxUtils.contains(i,p,l.y)&&!mxUtils.contains(e,p,l.y)){r.push(new mxPoint(p,l.y))}}else{var x=Math.max(e.y,i.y);var f=Math.min(e.y+e.height,i.y+i.height);r.push(new mxPoint(p,x+(f-x)/2))}}}},TopToBottom:function(t,e,i,n,r){var s=t.view;var l=n!=null&&n.length>0?n[0]:null;var a=t.absolutePoints;var o=a[0];var h=a[a.length-1];if(l!=null){l=s.transformControlPoint(t,l)}if(o!=null){e=new mxCellState;e.x=o.x;e.y=o.y}if(h!=null){i=new mxCellState;i.x=h.x;i.y=h.y}if(e!=null&&i!=null){var u=Math.max(e.y,i.y);var d=Math.min(e.y+e.height,i.y+i.height);var p=s.getRoutingCenterX(e);if(l!=null&&l.x>=e.x&&l.x<=e.x+e.width){p=l.x}var m=l!=null?l.y:Math.round(d+(u-d)/2);if(!mxUtils.contains(i,p,m)&&!mxUtils.contains(e,p,m)){r.push(new mxPoint(p,m))}if(l!=null&&l.x>=i.x&&l.x<=i.x+i.width){p=l.x}else{p=s.getRoutingCenterX(i)}if(!mxUtils.contains(i,p,m)&&!mxUtils.contains(e,p,m)){r.push(new mxPoint(p,m))}if(r.length==1){if(l!=null&&r.length==1){if(!mxUtils.contains(i,l.x,m)&&!mxUtils.contains(e,l.x,m)){r.push(new mxPoint(l.x,m))}}else{var c=Math.max(e.x,i.x);var x=Math.min(e.x+e.width,i.x+i.width);r.push(new mxPoint(c+(x-c)/2,m))}}}},SegmentConnector:function(t,e,i,n,r){var s=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale);var l=mxEdgeStyle.scaleCellState(e,t.view.scale);var a=mxEdgeStyle.scaleCellState(i,t.view.scale);var o=1;var h=r.length>0?r[0]:null;var u=true;var d=null;function p(e){e.x=Math.round(e.x*t.view.scale*10)/10;e.y=Math.round(e.y*t.view.scale*10)/10;if(h==null||Math.abs(h.x-e.x)>=o||Math.abs(h.y-e.y)>=Math.max(1,t.view.scale)){r.push(e);h=e}return h}var m=s[0];if(m==null&&l!=null){m=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l))}else if(m!=null){m=m.clone()}var c=s.length-1;if(n!=null&&n.length>0){var x=[];for(var f=0;f<n.length;f++){var g=t.view.transformControlPoint(t,n[f],true);if(g!=null){x.push(g)}}if(x.length==0){return}if(m!=null&&x[0]!=null){if(Math.abs(x[0].x-m.x)<o){x[0].x=m.x}if(Math.abs(x[0].y-m.y)<o){x[0].y=m.y}}var v=s[c];if(v!=null&&x[x.length-1]!=null){if(Math.abs(x[x.length-1].x-v.x)<o){x[x.length-1].x=v.x}if(Math.abs(x[x.length-1].y-v.y)<o){x[x.length-1].y=v.y}}d=x[0];var y=l;var C=s[0];var E=false;var S=false;var b=d;if(C!=null){y=null}for(var f=0;f<2;f++){var w=C!=null&&C.x==b.x;var T=C!=null&&C.y==b.y;var L=y!=null&&(b.y>=y.y&&b.y<=y.y+y.height);var A=y!=null&&(b.x>=y.x&&b.x<=y.x+y.width);E=T||C==null&&L;S=w||C==null&&A;if(f==0&&(E&&S||w&&T));else{if(C!=null&&(!T&&!w)&&(L||A)){u=L?false:true;break}if(S||E){u=E;if(f==1){u=x.length%2==0?E:S}break}}y=a;C=s[c];if(C!=null){y=null}b=x[x.length-1];if(w&&T){x=x.slice(1)}}if(u&&(s[0]!=null&&s[0].y!=d.y||s[0]==null&&l!=null&&(d.y<l.y||d.y>l.y+l.height))){p(new mxPoint(m.x,d.y))}else if(!u&&(s[0]!=null&&s[0].x!=d.x||s[0]==null&&l!=null&&(d.x<l.x||d.x>l.x+l.width))){p(new mxPoint(d.x,m.y))}if(u){m.y=d.y}else{m.x=d.x}for(var f=0;f<x.length;f++){u=!u;d=x[f];if(u){m.y=d.y}else{m.x=d.x}p(m.clone())}}else{d=m;u=true}m=s[c];if(m==null&&a!=null){m=new mxPoint(t.view.getRoutingCenterX(a),t.view.getRoutingCenterY(a))}if(m!=null){if(d!=null){if(u&&(s[c]!=null&&s[c].y!=d.y||s[c]==null&&a!=null&&(d.y<a.y||d.y>a.y+a.height))){p(new mxPoint(m.x,d.y))}else if(!u&&(s[c]!=null&&s[c].x!=d.x||s[c]==null&&a!=null&&(d.x<a.x||d.x>a.x+a.width))){p(new mxPoint(d.x,m.y))}}}if(s[0]==null&&l!=null){while(r.length>1&&r[1]!=null&&mxUtils.contains(l,r[1].x,r[1].y)){r.splice(1,1)}}if(s[c]==null&&a!=null){while(r.length>1&&r[r.length-1]!=null&&mxUtils.contains(a,r[r.length-1].x,r[r.length-1].y)){r.splice(r.length-1,1)}}if(v!=null&&r[r.length-1]!=null&&Math.abs(v.x-r[r.length-1].x)<=o&&Math.abs(v.y-r[r.length-1].y)<=o){r.splice(r.length-1,1);if(r[r.length-1]!=null){if(Math.abs(r[r.length-1].x-v.x)<o){r[r.length-1].x=v.x}if(Math.abs(r[r.length-1].y-v.y)<o){r[r.length-1].y=v.y}}}},orthBuffer:10,orthPointsFallback:true,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(t,e){var i=mxUtils.getValue(t.style,e?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(t.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));if(i=="auto"){var n=mxUtils.getValue(t.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE);if(n!=mxConstants.NONE){var r=mxUtils.getNumber(t.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);i=Math.max(2,Math.ceil((r+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer}else{i=2*mxEdgeStyle.orthBuffer}}return i},scalePointArray:function(t,e){var i=[];if(t!=null){for(var n=0;n<t.length;n++){if(t[n]!=null){var r=new mxPoint(Math.round(t[n].x/e*10)/10,Math.round(t[n].y/e*10)/10);i[n]=r}else{i[n]=null}}}else{i=null}return i},scaleCellState:function(t,e){var i=null;if(t!=null){i=t.clone();i.setRect(Math.round(t.x/e*10)/10,Math.round(t.y/e*10)/10,Math.round(t.width/e*10)/10,Math.round(t.height/e*10)/10)}else{i=null}return i},OrthConnector:function(t,e,i,n,r){var s=t.view.graph;var l=h==null?false:s.getModel().isEdge(h.cell);var a=u==null?false:s.getModel().isEdge(u.cell);var o=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale);var h=mxEdgeStyle.scaleCellState(e,t.view.scale);var u=mxEdgeStyle.scaleCellState(i,t.view.scale);var d=o[0];var p=o[o.length-1];var m=h!=null?h.x:d.x;var c=h!=null?h.y:d.y;var x=h!=null?h.width:0;var f=h!=null?h.height:0;var g=u!=null?u.x:p.x;var v=u!=null?u.y:p.y;var y=u!=null?u.width:0;var C=u!=null?u.height:0;var E=mxEdgeStyle.getJettySize(t,true);var S=mxEdgeStyle.getJettySize(t,false);if(h!=null&&u==h){S=Math.max(E,S);E=S}var b=S+E;var w=false;if(d!=null&&p!=null){var T=p.x-d.x;var L=p.y-d.y;w=T*T+L*L<b*b}if(w||mxEdgeStyle.orthPointsFallback&&(n!=null&&n.length>0)||l||a){mxEdgeStyle.SegmentConnector(t,e,i,n,r);return}var A=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL];var M=0;if(h!=null){A[0]=mxUtils.getPortConstraints(h,t,true,mxConstants.DIRECTION_MASK_ALL);M=mxUtils.getValue(h.style,mxConstants.STYLE_ROTATION,0);if(M!=0){var _=mxUtils.getBoundingBox(new mxRectangle(m,c,x,f),M);m=_.x;c=_.y;x=_.width;f=_.height}}if(u!=null){A[1]=mxUtils.getPortConstraints(u,t,false,mxConstants.DIRECTION_MASK_ALL);M=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0);if(M!=0){var _=mxUtils.getBoundingBox(new mxRectangle(g,v,y,C),M);g=_.x;v=_.y;y=_.width;C=_.height}}var O=[0,0];var I=[[m,c,x,f],[g,v,y,C]];var P=[E,S];for(var R=0;R<2;R++){mxEdgeStyle.limits[R][1]=I[R][0]-P[R];mxEdgeStyle.limits[R][2]=I[R][1]-P[R];mxEdgeStyle.limits[R][4]=I[R][0]+I[R][2]+P[R];mxEdgeStyle.limits[R][8]=I[R][1]+I[R][3]+P[R]}var H=I[0][0]+I[0][2]/2;var N=I[0][1]+I[0][3]/2;var D=I[1][0]+I[1][2]/2;var G=I[1][1]+I[1][3]/2;var T=H-D;var L=N-G;var U=0;if(T<0){if(L<0){U=2}else{U=1}}else{if(L<=0){U=3;if(T==0){U=2}}}var V=null;if(h!=null){V=d}var k=[[.5,.5],[.5,.5]];for(var R=0;R<2;R++){if(V!=null){k[R][0]=(V.x-I[R][0])/I[R][2];if(Math.abs(V.x-I[R][0])<=1){O[R]=mxConstants.DIRECTION_MASK_WEST}else if(Math.abs(V.x-I[R][0]-I[R][2])<=1){O[R]=mxConstants.DIRECTION_MASK_EAST}k[R][1]=(V.y-I[R][1])/I[R][3];if(Math.abs(V.y-I[R][1])<=1){O[R]=mxConstants.DIRECTION_MASK_NORTH}else if(Math.abs(V.y-I[R][1]-I[R][3])<=1){O[R]=mxConstants.DIRECTION_MASK_SOUTH}}V=null;if(u!=null){V=p}}var F=I[0][1]-(I[1][1]+I[1][3]);var B=I[0][0]-(I[1][0]+I[1][2]);var Y=I[1][1]-(I[0][1]+I[0][3]);var z=I[1][0]-(I[0][0]+I[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(B-b,0);mxEdgeStyle.vertexSeperations[2]=Math.max(F-b,0);mxEdgeStyle.vertexSeperations[4]=Math.max(Y-b,0);mxEdgeStyle.vertexSeperations[3]=Math.max(z-b,0);var j=[];var X=[];var W=[];X[0]=B>=z?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;W[0]=F>=Y?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;X[1]=mxUtils.reversePortConstraints(X[0]);W[1]=mxUtils.reversePortConstraints(W[0]);var K=B>=z?B:z;var Z=F>=Y?F:Y;var q=[[0,0],[0,0]];var Q=false;for(var R=0;R<2;R++){if(O[R]!=0){continue}if((X[R]&A[R])==0){X[R]=mxUtils.reversePortConstraints(X[R])}if((W[R]&A[R])==0){W[R]=mxUtils.reversePortConstraints(W[R])}q[R][0]=W[R];q[R][1]=X[R]}if(Z>0&&K>0){if((X[0]&A[0])>0&&(W[1]&A[1])>0){q[0][0]=X[0];q[0][1]=W[0];q[1][0]=W[1];q[1][1]=X[1];Q=true}else if((W[0]&A[0])>0&&(X[1]&A[1])>0){q[0][0]=W[0];q[0][1]=X[0];q[1][0]=X[1];q[1][1]=W[1];Q=true}}if(Z>0&&!Q){q[0][0]=W[0];q[0][1]=X[0];q[1][0]=W[1];q[1][1]=X[1];Q=true}if(K>0&&!Q){q[0][0]=X[0];q[0][1]=W[0];q[1][0]=X[1];q[1][1]=W[1];Q=true}for(var R=0;R<2;R++){if(O[R]!=0){continue}if((q[R][0]&A[R])==0){q[R][0]=q[R][1]}j[R]=q[R][0]&A[R];j[R]|=(q[R][1]&A[R])<<8;j[R]|=(q[1-R][R]&A[R])<<16;j[R]|=(q[1-R][1-R]&A[R])<<24;if((j[R]&15)==0){j[R]=j[R]<<8}if((j[R]&3840)==0){j[R]=j[R]&15|j[R]>>8}if((j[R]&983040)==0){j[R]=j[R]&65535|(j[R]&251658240)>>8}O[R]=j[R]&15;if(A[R]==mxConstants.DIRECTION_MASK_WEST||A[R]==mxConstants.DIRECTION_MASK_NORTH||A[R]==mxConstants.DIRECTION_MASK_EAST||A[R]==mxConstants.DIRECTION_MASK_SOUTH){O[R]=A[R]}}var J=O[0]==mxConstants.DIRECTION_MASK_EAST?3:O[0];var $=O[1]==mxConstants.DIRECTION_MASK_EAST?3:O[1];J-=U;$-=U;if(J<1){J+=4}if($<1){$+=4}var tt=mxEdgeStyle.routePatterns[J-1][$-1];mxEdgeStyle.wayPoints1[0][0]=I[0][0];mxEdgeStyle.wayPoints1[0][1]=I[0][1];switch(O[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=E;mxEdgeStyle.wayPoints1[0][1]+=k[0][1]*I[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=k[0][0]*I[0][2];mxEdgeStyle.wayPoints1[0][1]+=I[0][3]+E;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=I[0][2]+E;mxEdgeStyle.wayPoints1[0][1]+=k[0][1]*I[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=k[0][0]*I[0][2];mxEdgeStyle.wayPoints1[0][1]-=E;break}var et=0;var it=(O[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1;var nt=it;var rt=0;for(var R=0;R<tt.length;R++){var st=tt[R]&15;var lt=st==mxConstants.DIRECTION_MASK_EAST?3:st;lt+=U;if(lt>4){lt-=4}var at=mxEdgeStyle.dirVectors[lt-1];rt=lt%2>0?0:1;if(rt!=it){et++;mxEdgeStyle.wayPoints1[et][0]=mxEdgeStyle.wayPoints1[et-1][0];mxEdgeStyle.wayPoints1[et][1]=mxEdgeStyle.wayPoints1[et-1][1]}var ot=(tt[R]&mxEdgeStyle.TARGET_MASK)>0;var ht=(tt[R]&mxEdgeStyle.SOURCE_MASK)>0;var ut=(tt[R]&mxEdgeStyle.SIDE_MASK)>>5;ut=ut<<U;if(ut>15){ut=ut>>4}var dt=(tt[R]&mxEdgeStyle.CENTER_MASK)>0;if((ht||ot)&&ut<9){var pt=0;var mt=ht?0:1;if(dt&&rt==0){pt=I[mt][0]+k[mt][0]*I[mt][2]}else if(dt){pt=I[mt][1]+k[mt][1]*I[mt][3]}else{pt=mxEdgeStyle.limits[mt][ut]}if(rt==0){var ct=mxEdgeStyle.wayPoints1[et][0];var xt=(pt-ct)*at[0];if(xt>0){mxEdgeStyle.wayPoints1[et][0]+=at[0]*xt}}else{var ft=mxEdgeStyle.wayPoints1[et][1];var gt=(pt-ft)*at[1];if(gt>0){mxEdgeStyle.wayPoints1[et][1]+=at[1]*gt}}}else if(dt){mxEdgeStyle.wayPoints1[et][0]+=at[0]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2);mxEdgeStyle.wayPoints1[et][1]+=at[1]*Math.abs(mxEdgeStyle.vertexSeperations[lt]/2)}if(et>0&&mxEdgeStyle.wayPoints1[et][rt]==mxEdgeStyle.wayPoints1[et-1][rt]){et--}else{it=rt}}for(var R=0;R<=et;R++){if(R==et){var vt=(O[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1;var yt=vt==nt?0:1;if(yt!=(et+1)%2){break}}r.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[R][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[R][1]*t.view.scale*10)/10))}var Ct=1;while(Ct<r.length){if(r[Ct-1]==null||r[Ct]==null||r[Ct-1].x!=r[Ct].x||r[Ct-1].y!=r[Ct].y){Ct++}else{r.splice(Ct,1)}}},getRoutePattern:function(t,e,i,n){var r=t[0]==mxConstants.DIRECTION_MASK_EAST?3:t[0];var s=t[1]==mxConstants.DIRECTION_MASK_EAST?3:t[1];r-=e;s-=e;if(r<1){r+=4}if(s<1){s+=4}var l=routePatterns[r-1][s-1];if(i==0||n==0){if(inlineRoutePatterns[r-1][s-1]!=null){l=inlineRoutePatterns[r-1][s-1]}}return l}};__mxOutput.mxEdgeStyle=typeof mxEdgeStyle!=="undefined"?mxEdgeStyle:undefined;var mxStyleRegistry={values:[],putValue:function(t,e){mxStyleRegistry.values[t]=e},getValue:function(t){return mxStyleRegistry.values[t]},getName:function(t){for(var e in mxStyleRegistry.values){if(mxStyleRegistry.values[e]==t){return e}}return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter);__mxOutput.mxStyleRegistry=typeof mxStyleRegistry!=="undefined"?mxStyleRegistry:undefined;function mxGraphView(t){this.graph=t;this.translate=new mxPoint;this.graphBounds=new mxRectangle;this.states=new mxDictionary}mxGraphView.prototype=new mxEventSource;mxGraphView.prototype.constructor=mxGraphView;mxGraphView.prototype.EMPTY_POINT=new mxPoint;mxGraphView.prototype.doneResource=mxClient.language!="none"?"done":"";mxGraphView.prototype.updatingDocumentResource=mxClient.language!="none"?"updatingDocument":"";mxGraphView.prototype.allowEval=false;mxGraphView.prototype.captureDocumentGesture=true;mxGraphView.prototype.optimizeVmlReflows=true;mxGraphView.prototype.rendering=true;mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null;mxGraphView.prototype.graphBounds=null;mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=false;mxGraphView.prototype.lastNode=null;mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.setGraphBounds=function(t){this.graphBounds=t};mxGraphView.prototype.getBounds=function(t){var e=null;if(t!=null&&t.length>0){var i=this.graph.getModel();for(var n=0;n<t.length;n++){if(i.isVertex(t[n])||i.isEdge(t[n])){var r=this.getState(t[n]);if(r!=null){if(e==null){e=mxRectangle.fromRectangle(r)}else{e.add(r)}}}}}return e};mxGraphView.prototype.setCurrentRoot=function(t){if(this.currentRoot!=t){var e=new mxCurrentRootChange(this,t);e.execute();var i=new mxUndoableEdit(this,true);i.add(e);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",i));this.graph.sizeDidChange()}return t};mxGraphView.prototype.scaleAndTranslate=function(t,e,i){var n=this.scale;var r=new mxPoint(this.translate.x,this.translate.y);if(this.scale!=t||this.translate.x!=e||this.translate.y!=i){this.scale=t;this.translate.x=e;this.translate.y=i;if(this.isEventsEnabled()){this.viewStateChanged()}}this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",t,"previousScale",n,"translate",this.translate,"previousTranslate",r))};mxGraphView.prototype.getScale=function(){return this.scale};mxGraphView.prototype.setScale=function(t){var e=this.scale;if(this.scale!=t){this.scale=t;if(this.isEventsEnabled()){this.viewStateChanged()}}this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",t,"previousScale",e))};mxGraphView.prototype.getTranslate=function(){return this.translate};mxGraphView.prototype.setTranslate=function(t,e){var i=new mxPoint(this.translate.x,this.translate.y);if(this.translate.x!=t||this.translate.y!=e){this.translate.x=t;this.translate.y=e;if(this.isEventsEnabled()){this.viewStateChanged()}}this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",i))};mxGraphView.prototype.viewStateChanged=function(){this.revalidate();this.graph.sizeDidChange()};mxGraphView.prototype.refresh=function(){if(this.currentRoot!=null){this.clear()}this.revalidate()};mxGraphView.prototype.revalidate=function(){this.invalidate();this.validate()};mxGraphView.prototype.clear=function(t,e,i){var n=this.graph.getModel();t=t||n.getRoot();e=e!=null?e:false;i=i!=null?i:true;this.removeState(t);if(i&&(e||t!=this.currentRoot)){var r=n.getChildCount(t);for(var s=0;s<r;s++){this.clear(n.getChildAt(t,s),e)}}else{this.invalidate(t)}};mxGraphView.prototype.invalidate=function(t,e,i){var n=this.graph.getModel();t=t||n.getRoot();e=e!=null?e:true;i=i!=null?i:true;var r=this.getState(t);if(r!=null){r.invalid=true}if(!t.invalidating){t.invalidating=true;if(e){var s=n.getChildCount(t);for(var l=0;l<s;l++){var a=n.getChildAt(t,l);this.invalidate(a,e,i)}}if(i){var o=n.getEdgeCount(t);for(var l=0;l<o;l++){this.invalidate(n.getEdgeAt(t,l),e,i)}}delete t.invalidating}};mxGraphView.prototype.validate=function(t){var e=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;this.resetValidationState();var i=null;if(this.optimizeVmlReflows&&this.canvas!=null&&this.textDiv==null&&(document.documentMode==8&&!mxClient.IS_EM||mxClient.IS_QUIRKS)){this.placeholder=document.createElement("div");this.placeholder.style.position="absolute";this.placeholder.style.width=this.canvas.clientWidth+"px";this.placeholder.style.height=this.canvas.clientHeight+"px";this.canvas.parentNode.appendChild(this.placeholder);i=this.drawPane.style.display;this.canvas.style.display="none";this.textDiv=document.createElement("div");this.textDiv.style.position="absolute";this.textDiv.style.whiteSpace="nowrap";this.textDiv.style.visibility="hidden";this.textDiv.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";this.textDiv.style.zoom="1";document.body.appendChild(this.textDiv)}var n=this.getBoundingBox(this.validateCellState(this.validateCell(t||(this.currentRoot!=null?this.currentRoot:this.graph.getModel().getRoot()))));this.setGraphBounds(n!=null?n:this.getEmptyBounds());this.validateBackground();if(i!=null){this.canvas.style.display=i;this.textDiv.parentNode.removeChild(this.textDiv);if(this.placeholder!=null){this.placeholder.parentNode.removeChild(this.placeholder)}this.textDiv=null}this.resetValidationState();window.status=mxResources.get(this.doneResource)||this.doneResource;mxLog.leave("mxGraphView.validate",e)};mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)};mxGraphView.prototype.getBoundingBox=function(t,e){e=e!=null?e:true;var i=null;if(t!=null){if(t.shape!=null&&t.shape.boundingBox!=null){i=t.shape.boundingBox.clone()}if(t.text!=null&&t.text.boundingBox!=null){if(i!=null){i.add(t.text.boundingBox)}else{i=t.text.boundingBox.clone()}}if(e){var n=this.graph.getModel();var r=n.getChildCount(t.cell);for(var s=0;s<r;s++){var l=this.getBoundingBox(this.getState(n.getChildAt(t.cell,s)));if(l!=null){if(i==null){i=l}else{i.add(l)}}}}}return i};mxGraphView.prototype.createBackgroundPageShape=function(t){return new mxRectangleShape(t,"white","black")};mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage();this.validateBackgroundPage()};mxGraphView.prototype.validateBackgroundImage=function(){var t=this.graph.getBackgroundImage();if(t!=null){if(this.backgroundImage==null||this.backgroundImage.image!=t.src){if(this.backgroundImage!=null){this.backgroundImage.destroy()}var e=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(e,t.src);this.backgroundImage.dialect=this.graph.dialect;this.backgroundImage.init(this.backgroundPane);this.backgroundImage.redraw();if(document.documentMode==8&&!mxClient.IS_EM){mxEvent.addGestureListeners(this.backgroundImage.node,mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))})),mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))})),mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))})))}}this.redrawBackgroundImage(this.backgroundImage,t)}else if(this.backgroundImage!=null){this.backgroundImage.destroy();this.backgroundImage=null}};mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var t=this.getBackgroundPageBounds();if(this.backgroundPageShape==null){this.backgroundPageShape=this.createBackgroundPageShape(t);this.backgroundPageShape.scale=this.scale;this.backgroundPageShape.isShadow=true;this.backgroundPageShape.dialect=this.graph.dialect;this.backgroundPageShape.init(this.backgroundPane);this.backgroundPageShape.redraw();if(this.graph.nativeDblClickEnabled){mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,(function(t){this.graph.dblClick(t)})))}mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))})),mxUtils.bind(this,(function(t){if(this.graph.tooltipHandler!=null&&this.graph.tooltipHandler.isHideOnHover()){this.graph.tooltipHandler.hide()}if(this.graph.isMouseDown&&!mxEvent.isConsumed(t)){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}})),mxUtils.bind(this,(function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))})))}else{this.backgroundPageShape.scale=this.scale;this.backgroundPageShape.bounds=t;this.backgroundPageShape.redraw()}}else if(this.backgroundPageShape!=null){this.backgroundPageShape.destroy();this.backgroundPageShape=null}};mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.graph.pageFormat;var e=this.scale*this.graph.pageScale;var i=new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,t.width*e,t.height*e);return i};mxGraphView.prototype.redrawBackgroundImage=function(t,e){t.scale=this.scale;t.bounds.x=this.scale*this.translate.x;t.bounds.y=this.scale*this.translate.y;t.bounds.width=this.scale*e.width;t.bounds.height=this.scale*e.height;t.redraw()};mxGraphView.prototype.validateCell=function(t,e){e=e!=null?e:true;if(t!=null){e=e&&this.graph.isCellVisible(t);var i=this.getState(t,e);if(i!=null&&!e){this.removeState(t)}else{var n=this.graph.getModel();var r=n.getChildCount(t);for(var s=0;s<r;s++){this.validateCell(n.getChildAt(t,s),e&&(!this.isCellCollapsed(t)||t==this.currentRoot))}}}return t};mxGraphView.prototype.validateCellState=function(t,e){e=e!=null?e:true;var i=null;if(t!=null){i=this.getState(t);if(i!=null){var n=this.graph.getModel();if(i.invalid){i.invalid=false;if(i.style==null||i.invalidStyle){i.style=this.graph.getCellStyle(i.cell);i.invalidStyle=false}if(t!=this.currentRoot){this.validateCellState(n.getParent(t),false)}i.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,true),false),true);i.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,false),false),false);this.updateCellState(i);if(t!=this.currentRoot&&!i.invalid){this.graph.cellRenderer.redraw(i,false,this.isRendering());i.updateCachedBounds()}}if(e&&!i.invalid){if(i.shape!=null){this.stateValidated(i)}var r=n.getChildCount(t);for(var s=0;s<r;s++){this.validateCellState(n.getChildAt(t,s))}}}}return i};mxGraphView.prototype.updateCellState=function(t){t.absoluteOffset.x=0;t.absoluteOffset.y=0;t.origin.x=0;t.origin.y=0;t.length=0;if(t.cell!=this.currentRoot){var e=this.graph.getModel();var i=this.getState(e.getParent(t.cell));if(i!=null&&i.cell!=this.currentRoot){t.origin.x+=i.origin.x;t.origin.y+=i.origin.y}var n=this.graph.getChildOffsetForCell(t.cell);if(n!=null){t.origin.x+=n.x;t.origin.y+=n.y}var r=this.graph.getCellGeometry(t.cell);if(r!=null){if(!e.isEdge(t.cell)){n=r.offset!=null?r.offset:this.EMPTY_POINT;if(r.relative&&i!=null){if(e.isEdge(i.cell)){var s=this.getPoint(i,r);if(s!=null){t.origin.x+=s.x/this.scale-i.origin.x-this.translate.x;t.origin.y+=s.y/this.scale-i.origin.y-this.translate.y}}else{t.origin.x+=r.x*i.unscaledWidth+n.x;t.origin.y+=r.y*i.unscaledHeight+n.y}}else{t.absoluteOffset.x=this.scale*n.x;t.absoluteOffset.y=this.scale*n.y;t.origin.x+=r.x;t.origin.y+=r.y}}t.x=this.scale*(this.translate.x+t.origin.x);t.y=this.scale*(this.translate.y+t.origin.y);t.width=this.scale*r.width;t.unscaledWidth=r.width;t.height=this.scale*r.height;t.unscaledHeight=r.height;if(e.isVertex(t.cell)){this.updateVertexState(t,r)}if(e.isEdge(t.cell)){this.updateEdgeState(t,r)}}}t.updateCachedBounds()};mxGraphView.prototype.isCellCollapsed=function(t){return this.graph.isCellCollapsed(t)};mxGraphView.prototype.updateVertexState=function(t,e){var i=this.graph.getModel();var n=this.getState(i.getParent(t.cell));if(e.relative&&n!=null&&!i.isEdge(n.cell)){var r=mxUtils.toRadians(n.style[mxConstants.STYLE_ROTATION]||"0");if(r!=0){var s=Math.cos(r);var l=Math.sin(r);var a=new mxPoint(t.getCenterX(),t.getCenterY());var o=new mxPoint(n.getCenterX(),n.getCenterY());var h=mxUtils.getRotatedPoint(a,s,l,o);t.x=h.x-t.width/2;t.y=h.y-t.height/2}}this.updateVertexLabelOffset(t)};mxGraphView.prototype.updateEdgeState=function(t,e){var i=t.getVisibleTerminalState(true);var n=t.getVisibleTerminalState(false);if(this.graph.model.getTerminal(t.cell,true)!=null&&i==null||i==null&&e.getTerminalPoint(true)==null||this.graph.model.getTerminal(t.cell,false)!=null&&n==null||n==null&&e.getTerminalPoint(false)==null){this.clear(t.cell,true)}else{this.updateFixedTerminalPoints(t,i,n);this.updatePoints(t,e.points,i,n);this.updateFloatingTerminalPoints(t,i,n);var r=t.absolutePoints;if(t.cell!=this.currentRoot&&(r==null||r.length<2||r[0]==null||r[r.length-1]==null)){this.clear(t.cell,true)}else{this.updateEdgeBounds(t);this.updateEdgeLabelOffset(t)}}};mxGraphView.prototype.updateVertexLabelOffset=function(t){var e=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(e==mxConstants.ALIGN_LEFT){var i=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(i!=null){i*=this.scale}else{i=t.width}t.absoluteOffset.x-=i}else if(e==mxConstants.ALIGN_RIGHT){t.absoluteOffset.x+=t.width}else if(e==mxConstants.ALIGN_CENTER){var i=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(i!=null){var n=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);var r=0;if(n==mxConstants.ALIGN_CENTER){r=.5}else if(n==mxConstants.ALIGN_RIGHT){r=1}if(r!=0){t.absoluteOffset.x-=(i*this.scale-t.width)*r}}}var s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(s==mxConstants.ALIGN_TOP){t.absoluteOffset.y-=t.height}else if(s==mxConstants.ALIGN_BOTTOM){t.absoluteOffset.y+=t.height}};mxGraphView.prototype.resetValidationState=function(){this.lastNode=null;this.lastHtmlNode=null;this.lastForegroundNode=null;this.lastForegroundHtmlNode=null};mxGraphView.prototype.stateValidated=function(t){var e=this.graph.getModel().isEdge(t.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(t.cell)&&this.graph.keepEdgesInBackground;var i=e?this.lastForegroundHtmlNode||this.lastHtmlNode:this.lastHtmlNode;var n=e?this.lastForegroundNode||this.lastNode:this.lastNode;var r=this.graph.cellRenderer.insertStateAfter(t,n,i);if(e){this.lastForegroundHtmlNode=r[1];this.lastForegroundNode=r[0]}else{this.lastHtmlNode=r[1];this.lastNode=r[0]}};mxGraphView.prototype.updateFixedTerminalPoints=function(t,e,i){this.updateFixedTerminalPoint(t,e,true,this.graph.getConnectionConstraint(t,e,true));this.updateFixedTerminalPoint(t,i,false,this.graph.getConnectionConstraint(t,i,false))};mxGraphView.prototype.updateFixedTerminalPoint=function(t,e,i,n){t.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(t,e,i,n),i)};mxGraphView.prototype.getFixedTerminalPoint=function(t,e,i,n){var r=null;if(n!=null){r=this.graph.getConnectionPoint(e,n,false)}if(r==null&&e==null){var s=this.scale;var l=this.translate;var a=t.origin;var o=this.graph.getCellGeometry(t.cell);r=o.getTerminalPoint(i);if(r!=null){r=new mxPoint(s*(l.x+r.x+a.x),s*(l.y+r.y+a.y))}}return r};mxGraphView.prototype.updateBoundsFromStencil=function(t){var e=null;if(t!=null&&t.shape!=null&&t.shape.stencil!=null&&t.shape.stencil.aspect=="fixed"){e=mxRectangle.fromRectangle(t);var i=t.shape.stencil.computeAspect(t.style,t.x,t.y,t.width,t.height);t.setRect(i.x,i.y,t.shape.stencil.w0*i.width,t.shape.stencil.h0*i.height)}return e};mxGraphView.prototype.updatePoints=function(t,e,i,n){if(t!=null){var r=[];r.push(t.absolutePoints[0]);var s=this.getEdgeStyle(t,e,i,n);if(s!=null){var l=this.getTerminalPort(t,i,true);var a=this.getTerminalPort(t,n,false);var o=this.updateBoundsFromStencil(l);var h=this.updateBoundsFromStencil(a);s(t,l,a,e,r);if(o!=null){l.setRect(o.x,o.y,o.width,o.height)}if(h!=null){a.setRect(h.x,h.y,h.width,h.height)}}else if(e!=null){for(var u=0;u<e.length;u++){if(e[u]!=null){var d=mxUtils.clone(e[u]);r.push(this.transformControlPoint(t,d))}}}var p=t.absolutePoints;r.push(p[p.length-1]);t.absolutePoints=r}};mxGraphView.prototype.transformControlPoint=function(t,e,i){if(t!=null&&e!=null){var n=t.origin;var r=i?1:this.scale;return new mxPoint(r*(e.x+this.translate.x+n.x),r*(e.y+this.translate.y+n.y))}return null};mxGraphView.prototype.isLoopStyleEnabled=function(t,e,i,n){var r=this.graph.getConnectionConstraint(t,i,true);var s=this.graph.getConnectionConstraint(t,n,false);if((e==null||e.length<2)&&(!mxUtils.getValue(t.style,mxConstants.STYLE_ORTHOGONAL_LOOP,false)||(r==null||r.point==null)&&(s==null||s.point==null))){return i!=null&&i==n}return false};mxGraphView.prototype.getEdgeStyle=function(t,e,i,n){var r=this.isLoopStyleEnabled(t,e,i,n)?mxUtils.getValue(t.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):!mxUtils.getValue(t.style,mxConstants.STYLE_NOEDGESTYLE,false)?t.style[mxConstants.STYLE_EDGE]:null;if(typeof r=="string"){var s=mxStyleRegistry.getValue(r);if(s==null&&this.isAllowEval()){s=mxUtils.eval(r)}r=s}if(typeof r=="function"){return r}return null};mxGraphView.prototype.updateFloatingTerminalPoints=function(t,e,i){var n=t.absolutePoints;var r=n[0];var s=n[n.length-1];if(s==null&&i!=null){this.updateFloatingTerminalPoint(t,i,e,false)}if(r==null&&e!=null){this.updateFloatingTerminalPoint(t,e,i,true)}};mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,i,n){t.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(t,e,i,n),n)};mxGraphView.prototype.getFloatingTerminalPoint=function(t,e,i,n){e=this.getTerminalPort(t,e,n);var r=this.getNextPoint(t,i,n);var s=this.graph.isOrthogonal(t);var l=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0"));var a=new mxPoint(e.getCenterX(),e.getCenterY());if(l!=0){var o=Math.cos(-l);var h=Math.sin(-l);r=mxUtils.getRotatedPoint(r,o,h,a)}var u=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(t.style[n?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);var d=this.getPerimeterPoint(e,r,l==0&&s,u);if(l!=0){var o=Math.cos(l);var h=Math.sin(l);d=mxUtils.getRotatedPoint(d,o,h,a)}return d};mxGraphView.prototype.getTerminalPort=function(t,e,i){var n=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;var r=mxUtils.getValue(t.style,n);if(r!=null){var s=this.getState(this.graph.getModel().getCell(r));if(s!=null){e=s}}return e};mxGraphView.prototype.getPerimeterPoint=function(t,e,i,n){var r=null;if(t!=null){var s=this.getPerimeterFunction(t);if(s!=null&&e!=null){var l=this.getPerimeterBounds(t,n);if(l.width>0||l.height>0){r=new mxPoint(e.x,e.y);var a=false;var o=false;if(this.graph.model.isVertex(t.cell)){a=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0)==1;o=mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0)==1;if(t.shape!=null&&t.shape.stencil!=null){a=mxUtils.getValue(t.style,"stencilFlipH",0)==1||a;o=mxUtils.getValue(t.style,"stencilFlipV",0)==1||o}if(a){r.x=2*l.getCenterX()-r.x}if(o){r.y=2*l.getCenterY()-r.y}}r=s(l,t,r,i);if(r!=null){if(a){r.x=2*l.getCenterX()-r.x}if(o){r.y=2*l.getCenterY()-r.y}}}}if(r==null){r=this.getPoint(t)}}return r};mxGraphView.prototype.getRoutingCenterX=function(t){var e=t.style!=null?parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0:0;return t.getCenterX()+e*t.width};mxGraphView.prototype.getRoutingCenterY=function(t){var e=t.style!=null?parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return t.getCenterY()+e*t.height};mxGraphView.prototype.getPerimeterBounds=function(t,e){e=e!=null?e:0;if(t!=null){e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)}return t.getPerimeterBounds(e*this.scale)};mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if(typeof e=="string"){var i=mxStyleRegistry.getValue(e);if(i==null&&this.isAllowEval()){i=mxUtils.eval(e)}e=i}if(typeof e=="function"){return e}return null};mxGraphView.prototype.getNextPoint=function(t,e,i){var n=t.absolutePoints;var r=null;if(n!=null&&n.length>=2){var s=n.length;r=n[i?Math.min(1,s-1):Math.max(0,s-2)]}if(r==null&&e!=null){r=new mxPoint(e.getCenterX(),e.getCenterY())}return r};mxGraphView.prototype.getVisibleTerminal=function(t,e){var i=this.graph.getModel();var n=i.getTerminal(t,e);var r=n;while(n!=null&&n!=this.currentRoot){if(!this.graph.isCellVisible(r)||this.isCellCollapsed(n)){r=n}n=i.getParent(n)}if(r!=null&&(!i.contains(r)||i.getParent(r)==i.getRoot()||r==this.currentRoot)){r=null}return r};mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints;var i=e[0];var n=e[e.length-1];if(i.x!=n.x||i.y!=n.y){var r=n.x-i.x;var s=n.y-i.y;t.terminalDistance=Math.sqrt(r*r+s*s)}else{t.terminalDistance=0}var l=0;var a=[];var o=i;if(o!=null){var h=o.x;var u=o.y;var d=h;var p=u;for(var m=1;m<e.length;m++){var c=e[m];if(c!=null){var r=o.x-c.x;var s=o.y-c.y;var x=Math.sqrt(r*r+s*s);a.push(x);l+=x;o=c;h=Math.min(o.x,h);u=Math.min(o.y,u);d=Math.max(o.x,d);p=Math.max(o.y,p)}}t.length=l;t.segments=a;var f=1;t.x=h;t.y=u;t.width=Math.max(f,d-h);t.height=Math.max(f,p-u)}};mxGraphView.prototype.getPoint=function(t,e){var i=t.getCenterX();var n=t.getCenterY();if(t.segments!=null&&(e==null||e.relative)){var r=e!=null?e.x/2:0;var s=t.absolutePoints.length;var l=Math.round((r+.5)*t.length);var a=t.segments[0];var o=0;var h=1;while(l>=Math.round(o+a)&&h<s-1){o+=a;a=t.segments[h++]}var u=a==0?0:(l-o)/a;var d=t.absolutePoints[h-1];var p=t.absolutePoints[h];if(d!=null&&p!=null){var m=0;var c=0;var x=0;if(e!=null){m=e.y;var f=e.offset;if(f!=null){c=f.x;x=f.y}}var g=p.x-d.x;var v=p.y-d.y;var y=a==0?0:v/a;var C=a==0?0:g/a;i=d.x+g*u+(y*m+c)*this.scale;n=d.y+v*u-(C*m-x)*this.scale}}else if(e!=null){var f=e.offset;if(f!=null){i+=f.x;n+=f.y}}return new mxPoint(i,n)};mxGraphView.prototype.getRelativePoint=function(t,e,i){var n=this.graph.getModel();var r=n.getGeometry(t.cell);if(r!=null){var s=t.absolutePoints.length;if(r.relative&&s>1){var l=t.length;var a=t.segments;var o=t.absolutePoints[0];var h=t.absolutePoints[1];var u=mxUtils.ptSegDistSq(o.x,o.y,h.x,h.y,e,i);var d=0;var p=0;var m=0;for(var c=2;c<s;c++){p+=a[c-2];h=t.absolutePoints[c];var x=mxUtils.ptSegDistSq(o.x,o.y,h.x,h.y,e,i);if(x<=u){u=x;d=c-1;m=p}o=h}var f=a[d];o=t.absolutePoints[d];h=t.absolutePoints[d+1];var g=o.x;var v=o.y;var y=h.x;var C=h.y;var E=e;var S=i;var b=g-y;var w=v-C;E-=y;S-=C;var T=0;E=b-E;S=w-S;var L=E*b+S*w;if(L<=0){T=0}else{T=L*L/(b*b+w*w)}var A=Math.sqrt(T);if(A>f){A=f}var M=Math.sqrt(mxUtils.ptSegDistSq(o.x,o.y,h.x,h.y,e,i));var _=mxUtils.relativeCcw(o.x,o.y,h.x,h.y,e,i);if(_==-1){M=-M}return new mxPoint((l/2-m-A)/l*-2,M/this.scale)}}return new mxPoint};mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;t.absoluteOffset.x=t.getCenterX();t.absoluteOffset.y=t.getCenterY();if(e!=null&&e.length>0&&t.segments!=null){var i=this.graph.getCellGeometry(t.cell);if(i.relative){var n=this.getPoint(t,i);if(n!=null){t.absoluteOffset=n}}else{var r=e[0];var s=e[e.length-1];if(r!=null&&s!=null){var l=s.x-r.x;var a=s.y-r.y;var o=0;var h=0;var u=i.offset;if(u!=null){o=u.x;h=u.y}var d=r.x+l/2+o*this.scale;var p=r.y+a/2+h*this.scale;t.absoluteOffset.x=d;t.absoluteOffset.y=p}}}};mxGraphView.prototype.getState=function(t,e){e=e||false;var i=null;if(t!=null){i=this.states.get(t);if(e&&(i==null||this.updateStyle)&&this.graph.isCellVisible(t)){if(i==null){i=this.createState(t);this.states.put(t,i)}else{i.style=this.graph.getCellStyle(t)}}}return i};mxGraphView.prototype.isRendering=function(){return this.rendering};mxGraphView.prototype.setRendering=function(t){this.rendering=t};mxGraphView.prototype.isAllowEval=function(){return this.allowEval};mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t};mxGraphView.prototype.getStates=function(){return this.states};mxGraphView.prototype.setStates=function(t){this.states=t};mxGraphView.prototype.getCellStates=function(t){if(t==null){return this.states}else{var e=[];for(var i=0;i<t.length;i++){var n=this.getState(t[i]);if(n!=null){e.push(n)}}return e}};mxGraphView.prototype.removeState=function(t){var e=null;if(t!=null){e=this.states.remove(t);if(e!=null){this.graph.cellRenderer.destroy(e);e.invalid=true;e.destroy()}}return e};mxGraphView.prototype.createState=function(t){return new mxCellState(this,t,this.graph.getCellStyle(t))};mxGraphView.prototype.getCanvas=function(){return this.canvas};mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane};mxGraphView.prototype.getDrawPane=function(){return this.drawPane};mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane};mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane};mxGraphView.prototype.isContainerEvent=function(t){var e=mxEvent.getSource(t);return e==this.graph.container||e.parentNode==this.backgroundPane||e.parentNode!=null&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane||e==this.decoratorPane};mxGraphView.prototype.isScrollEvent=function(t){var e=mxUtils.getOffset(this.graph.container);var i=new mxPoint(t.clientX-e.x,t.clientY-e.y);var n=this.graph.container.offsetWidth;var r=this.graph.container.clientWidth;if(n>r&&i.x>r+2&&i.x<=n){return true}var s=this.graph.container.offsetHeight;var l=this.graph.container.clientHeight;if(s>l&&i.y>l+2&&i.y<=s){return true}return false};mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;if(t.dialect==mxConstants.DIALECT_SVG){this.createSvg()}else if(t.dialect==mxConstants.DIALECT_VML){this.createVml()}else{this.createHtml()}};mxGraphView.prototype.installListeners=function(){var t=this.graph;var e=t.container;if(e!=null){if(mxClient.IS_TOUCH){mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,(function(e){t.fireGestureEvent(e);mxEvent.consume(e)})));mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,(function(e){t.fireGestureEvent(e);mxEvent.consume(e)})));mxEvent.addListener(e,"gestureend",mxUtils.bind(this,(function(e){t.fireGestureEvent(e);mxEvent.consume(e)})))}var i=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)&&(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(e))){t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e));i=e.pointerId}})),mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)&&(i==null||e.pointerId==i)){t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))}})),mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)){t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}i=null})));mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){if(this.isContainerEvent(e)){t.dblClick(e)}})));var n=function(i){var n=null;if(mxClient.IS_TOUCH){var r=mxEvent.getClientX(i);var s=mxEvent.getClientY(i);var l=mxUtils.convertPoint(e,r,s);n=t.view.getState(t.getCellAt(l.x,l.y))}return n};t.addMouseListener({mouseDown:function(e,i){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}});this.moveHandler=mxUtils.bind(this,(function(e){if(t.tooltipHandler!=null&&t.tooltipHandler.isHideOnHover()){t.tooltipHandler.hide()}if(this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(e)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"&&!mxEvent.isConsumed(e)){t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,n(e)))}}));this.endHandler=mxUtils.bind(this,(function(e){if(this.captureDocumentGesture&&t.isMouseDown&&t.container!=null&&!this.isContainerEvent(e)&&t.container.style.display!="none"&&t.container.style.visibility!="hidden"){t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}}));mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}};mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(t!=null){this.canvas=this.createHtmlPane("100%","100%");this.canvas.style.overflow="hidden";this.backgroundPane=this.createHtmlPane("1px","1px");this.drawPane=this.createHtmlPane("1px","1px");this.overlayPane=this.createHtmlPane("1px","1px");this.decoratorPane=this.createHtmlPane("1px","1px");this.canvas.appendChild(this.backgroundPane);this.canvas.appendChild(this.drawPane);this.canvas.appendChild(this.overlayPane);this.canvas.appendChild(this.decoratorPane);t.appendChild(this.canvas);this.updateContainerStyle(t);if(mxClient.IS_QUIRKS){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds();var i=e.x+e.width+this.graph.border;var n=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(i,n)}));mxEvent.addListener(window,"resize",e)}}};mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(this.graph.container!=null){var i=this.graph.container.offsetWidth;var n=this.graph.container.offsetHeight;if(i<t){this.canvas.style.width=t+"px"}else{this.canvas.style.width="100%"}if(n<e){this.canvas.style.height=e+"px"}else{this.canvas.style.height="100%"}}};mxGraphView.prototype.createHtmlPane=function(t,e){var i=document.createElement("DIV");if(t!=null&&e!=null){i.style.position="absolute";i.style.left="0px";i.style.top="0px";i.style.width=t;i.style.height=e}else{i.style.position="relative"}return i};mxGraphView.prototype.createVml=function(){var t=this.graph.container;if(t!=null){var e=t.offsetWidth;var i=t.offsetHeight;this.canvas=this.createVmlPane(e,i);this.canvas.style.overflow="hidden";this.backgroundPane=this.createVmlPane(e,i);this.drawPane=this.createVmlPane(e,i);this.overlayPane=this.createVmlPane(e,i);this.decoratorPane=this.createVmlPane(e,i);this.canvas.appendChild(this.backgroundPane);this.canvas.appendChild(this.drawPane);this.canvas.appendChild(this.overlayPane);this.canvas.appendChild(this.decoratorPane);t.appendChild(this.canvas)}};mxGraphView.prototype.createVmlPane=function(t,e){var i=document.createElement(mxClient.VML_PREFIX+":group");i.style.position="absolute";i.style.left="0px";i.style.top="0px";i.style.width=t+"px";i.style.height=e+"px";i.setAttribute("coordsize",t+","+e);i.setAttribute("coordorigin","0,0");return i};mxGraphView.prototype.createSvg=function(){var t=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g");this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.backgroundPane);this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.drawPane);this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.overlayPane);this.decoratorPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.decoratorPane);var e=document.createElementNS(mxConstants.NS_SVG,"svg");e.style.left="0px";e.style.top="0px";e.style.width="100%";e.style.height="100%";e.style.display="block";e.appendChild(this.canvas);if(mxClient.IS_IE||mxClient.IS_IE11){e.style.overflow="hidden"}if(t!=null){t.appendChild(e);this.updateContainerStyle(t)}};mxGraphView.prototype.updateContainerStyle=function(t){var e=mxUtils.getCurrentStyle(t);if(e!=null&&e.position=="static"){t.style.position="relative"}if(mxClient.IS_POINTER){t.style.touchAction="none"}};mxGraphView.prototype.destroy=function(){var t=this.canvas!=null?this.canvas.ownerSVGElement:null;if(t==null){t=this.canvas}if(t!=null&&t.parentNode!=null){this.clear(this.currentRoot,true);mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler);mxEvent.release(this.graph.container);t.parentNode.removeChild(t);this.moveHandler=null;this.endHandler=null;this.canvas=null;this.backgroundPane=null;this.drawPane=null;this.overlayPane=null;this.decoratorPane=null}};function mxCurrentRootChange(t,e){this.view=t;this.root=e;this.previous=e;this.isUp=e==null;if(!this.isUp){var i=this.view.currentRoot;var n=this.view.graph.getModel();while(i!=null){if(i==e){this.isUp=true;break}i=n.getParent(i)}}}mxCurrentRootChange.prototype.execute=function(){var t=this.view.currentRoot;this.view.currentRoot=this.previous;this.previous=t;var e=this.view.graph.getTranslateForRoot(this.view.currentRoot);if(e!=null){this.view.translate=new mxPoint(-e.x,-e.y)}if(this.isUp){this.view.clear(this.view.currentRoot,true);this.view.validate()}else{this.view.refresh()}var i=this.isUp?mxEvent.UP:mxEvent.DOWN;this.view.fireEvent(new mxEventObject(i,"root",this.view.currentRoot,"previous",this.previous));this.isUp=!this.isUp};__mxOutput.mxGraphView=typeof mxGraphView!=="undefined"?mxGraphView:undefined;function mxGraph(t,e,i,n){this.mouseListeners=null;this.renderHint=i;if(mxClient.IS_SVG){this.dialect=mxConstants.DIALECT_SVG}else if(i==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML){this.dialect=mxConstants.DIALECT_VML}else if(i==mxConstants.RENDERING_HINT_FASTEST){this.dialect=mxConstants.DIALECT_STRICTHTML}else if(i==mxConstants.RENDERING_HINT_FASTER){this.dialect=mxConstants.DIALECT_PREFERHTML}else{this.dialect=mxConstants.DIALECT_MIXEDHTML}this.model=e!=null?e:new mxGraphModel;this.multiplicities=[];this.imageBundles=[];this.cellRenderer=this.createCellRenderer();this.setSelectionModel(this.createSelectionModel());this.setStylesheet(n!=null?n:this.createStylesheet());this.view=this.createGraphView();this.graphModelChangeListener=mxUtils.bind(this,(function(t,e){this.graphModelChanged(e.getProperty("edit").changes)}));this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener);this.createHandlers();if(t!=null){this.init(t)}this.view.revalidate()}if(mxLoadResources){mxResources.add(mxClient.basePath+"/resources/graph")}else{mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph")}mxGraph.prototype=new mxEventSource;mxGraph.prototype.constructor=mxGraph;mxGraph.prototype.mouseListeners=null;mxGraph.prototype.isMouseDown=false;mxGraph.prototype.model=null;mxGraph.prototype.view=null;mxGraph.prototype.stylesheet=null;mxGraph.prototype.selectionModel=null;mxGraph.prototype.cellEditor=null;mxGraph.prototype.cellRenderer=null;mxGraph.prototype.multiplicities=null;mxGraph.prototype.renderHint=null;mxGraph.prototype.dialect=null;mxGraph.prototype.gridSize=10;mxGraph.prototype.gridEnabled=true;mxGraph.prototype.portsEnabled=true;mxGraph.prototype.nativeDblClickEnabled=true;mxGraph.prototype.doubleTapEnabled=true;mxGraph.prototype.doubleTapTimeout=500;mxGraph.prototype.doubleTapTolerance=25;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchTime=0;mxGraph.prototype.tapAndHoldEnabled=true;mxGraph.prototype.tapAndHoldDelay=500;mxGraph.prototype.tapAndHoldInProgress=false;mxGraph.prototype.tapAndHoldValid=false;mxGraph.prototype.initialTouchX=0;mxGraph.prototype.initialTouchY=0;mxGraph.prototype.tolerance=4;mxGraph.prototype.defaultOverlap=.5;mxGraph.prototype.defaultParent=null;mxGraph.prototype.alternateEdgeStyle=null;mxGraph.prototype.backgroundImage=null;mxGraph.prototype.pageVisible=false;mxGraph.prototype.pageBreaksVisible=false;mxGraph.prototype.pageBreakColor="gray";mxGraph.prototype.pageBreakDashed=true;mxGraph.prototype.minPageBreakDist=20;mxGraph.prototype.preferPageSize=false;mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT;mxGraph.prototype.pageScale=1.5;mxGraph.prototype.enabled=true;mxGraph.prototype.escapeEnabled=true;mxGraph.prototype.invokesStopCellEditing=true;mxGraph.prototype.enterStopsCellEditing=false;mxGraph.prototype.useScrollbarsForPanning=true;mxGraph.prototype.exportEnabled=true;mxGraph.prototype.importEnabled=true;mxGraph.prototype.cellsLocked=false;mxGraph.prototype.cellsCloneable=true;mxGraph.prototype.foldingEnabled=true;mxGraph.prototype.cellsEditable=true;mxGraph.prototype.cellsDeletable=true;mxGraph.prototype.cellsMovable=true;mxGraph.prototype.edgeLabelsMovable=true;mxGraph.prototype.vertexLabelsMovable=false;mxGraph.prototype.dropEnabled=false;mxGraph.prototype.splitEnabled=true;mxGraph.prototype.cellsResizable=true;mxGraph.prototype.cellsBendable=true;mxGraph.prototype.cellsSelectable=true;mxGraph.prototype.cellsDisconnectable=true;mxGraph.prototype.autoSizeCells=false;mxGraph.prototype.autoSizeCellsOnAdd=false;mxGraph.prototype.autoScroll=true;mxGraph.prototype.ignoreScrollbars=false;mxGraph.prototype.translateToScrollPosition=false;mxGraph.prototype.timerAutoScroll=false;mxGraph.prototype.allowAutoPanning=false;mxGraph.prototype.autoExtend=true;mxGraph.prototype.maximumGraphBounds=null;mxGraph.prototype.minimumGraphSize=null;mxGraph.prototype.minimumContainerSize=null;mxGraph.prototype.maximumContainerSize=null;mxGraph.prototype.resizeContainer=false;mxGraph.prototype.border=0;mxGraph.prototype.keepEdgesInForeground=false;mxGraph.prototype.keepEdgesInBackground=false;mxGraph.prototype.allowNegativeCoordinates=true;mxGraph.prototype.constrainChildren=true;mxGraph.prototype.constrainRelativeChildren=false;mxGraph.prototype.extendParents=true;mxGraph.prototype.extendParentsOnAdd=true;mxGraph.prototype.extendParentsOnMove=false;mxGraph.prototype.recursiveResize=false;mxGraph.prototype.collapseToPreferredSize=true;mxGraph.prototype.zoomFactor=1.2;mxGraph.prototype.keepSelectionVisibleOnZoom=false;mxGraph.prototype.centerZoom=true;mxGraph.prototype.resetViewOnRootChange=true;mxGraph.prototype.resetEdgesOnResize=false;mxGraph.prototype.resetEdgesOnMove=false;mxGraph.prototype.resetEdgesOnConnect=true;mxGraph.prototype.allowLoops=false;mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop;mxGraph.prototype.multigraph=true;mxGraph.prototype.connectableEdges=false;mxGraph.prototype.allowDanglingEdges=true;mxGraph.prototype.cloneInvalidEdges=false;mxGraph.prototype.disconnectOnMove=true;mxGraph.prototype.labelsVisible=true;mxGraph.prototype.htmlLabels=false;mxGraph.prototype.swimlaneSelectionEnabled=true;mxGraph.prototype.swimlaneNesting=true;mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR;mxGraph.prototype.imageBundles=null;mxGraph.prototype.minFitScale=.1;mxGraph.prototype.maxFitScale=8;mxGraph.prototype.panDx=0;mxGraph.prototype.panDy=0;mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9);mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9);mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16);mxGraph.prototype.alreadyConnectedResource=mxClient.language!="none"?"alreadyConnected":"";mxGraph.prototype.containsValidationErrorsResource=mxClient.language!="none"?"containsValidationErrors":"";mxGraph.prototype.collapseExpandResource=mxClient.language!="none"?"collapse-expand":"";mxGraph.prototype.init=function(t){this.container=t;this.cellEditor=this.createCellEditor();this.view.init();this.sizeDidChange();mxEvent.addListener(t,"mouseleave",mxUtils.bind(this,(function(t){if(this.tooltipHandler!=null&&this.tooltipHandler.div!=null&&this.tooltipHandler.div!=t.relatedTarget){this.tooltipHandler.hide()}})));if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})));mxEvent.addListener(t,"selectstart",mxUtils.bind(this,(function(t){return this.isEditing()||!this.isMouseDown&&!mxEvent.isShiftDown(t)})))}if(document.documentMode==8){t.insertAdjacentHTML("beforeend","<"+mxClient.VML_PREFIX+":group"+' style="DISPLAY: none;"></'+mxClient.VML_PREFIX+":group>")}};mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler();this.tooltipHandler.setEnabled(false);this.selectionCellsHandler=this.createSelectionCellsHandler();this.connectionHandler=this.createConnectionHandler();this.connectionHandler.setEnabled(false);this.graphHandler=this.createGraphHandler();this.panningHandler=this.createPanningHandler();this.panningHandler.panningEnabled=false;this.popupMenuHandler=this.createPopupMenuHandler()};mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)};mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)};mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)};mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)};mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)};mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)};mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t};mxGraph.prototype.getSelectionCellsForChanges=function(t,e){var i=new mxDictionary;var n=[];var r=mxUtils.bind(this,(function(t){if(!i.get(t)&&this.model.contains(t)){if(this.model.isEdge(t)||this.model.isVertex(t)){i.put(t,true);n.push(t)}else{var e=this.model.getChildCount(t);for(var s=0;s<e;s++){r(this.model.getChildAt(t,s))}}}}));for(var s=0;s<t.length;s++){var l=t[s];if(l.constructor!=mxRootChange&&(e==null||!e(l))){var a=null;if(l instanceof mxChildChange){a=l.child}else if(l.cell!=null&&l.cell instanceof mxCell){a=l.cell}if(a!=null){r(a)}}}return n};mxGraph.prototype.graphModelChanged=function(t){for(var e=0;e<t.length;e++){this.processChange(t[e])}this.updateSelection();this.view.validate();this.sizeDidChange()};mxGraph.prototype.updateSelection=function(){var t=this.getSelectionCells();var e=[];for(var i=0;i<t.length;i++){if(!this.model.contains(t[i])||!this.isCellVisible(t[i])){e.push(t[i])}else{var n=this.model.getParent(t[i]);while(n!=null&&n!=this.view.currentRoot){if(this.isCellCollapsed(n)||!this.isCellVisible(n)){e.push(t[i]);break}n=this.model.getParent(n)}}}this.removeSelectionCells(e)};mxGraph.prototype.processChange=function(t){if(t instanceof mxRootChange){this.clearSelection();this.setDefaultParent(null);this.removeStateForCell(t.previous);if(this.resetViewOnRootChange){this.view.scale=1;this.view.translate.x=0;this.view.translate.y=0}this.fireEvent(new mxEventObject(mxEvent.ROOT))}else if(t instanceof mxChildChange){var e=this.model.getParent(t.child);this.view.invalidate(t.child,true,true);if(!this.model.contains(e)||this.isCellCollapsed(e)){this.view.invalidate(t.child,true,true);this.removeStateForCell(t.child);if(this.view.currentRoot==t.child){this.home()}}if(e!=t.previous){if(e!=null){this.view.invalidate(e,false,false)}if(t.previous!=null){this.view.invalidate(t.previous,false,false)}}}else if(t instanceof mxTerminalChange||t instanceof mxGeometryChange){if(t instanceof mxTerminalChange||(t.previous==null&&t.geometry!=null||t.previous!=null&&!t.previous.equals(t.geometry))){this.view.invalidate(t.cell)}}else if(t instanceof mxValueChange){this.view.invalidate(t.cell,false,false)}else if(t instanceof mxStyleChange){this.view.invalidate(t.cell,true,true);var i=this.view.getState(t.cell);if(i!=null){i.invalidStyle=true}}else if(t.cell!=null&&t.cell instanceof mxCell){this.removeStateForCell(t.cell)}};mxGraph.prototype.removeStateForCell=function(t){var e=this.model.getChildCount(t);for(var i=0;i<e;i++){this.removeStateForCell(this.model.getChildAt(t,i))}this.view.invalidate(t,false,true);this.view.removeState(t)};mxGraph.prototype.addCellOverlay=function(t,e){if(t.overlays==null){t.overlays=[]}t.overlays.push(e);var i=this.view.getState(t);if(i!=null){this.cellRenderer.redraw(i)}this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",t,"overlay",e));return e};mxGraph.prototype.getCellOverlays=function(t){return t.overlays};mxGraph.prototype.removeCellOverlay=function(t,e){if(e==null){this.removeCellOverlays(t)}else{var i=mxUtils.indexOf(t.overlays,e);if(i>=0){t.overlays.splice(i,1);if(t.overlays.length==0){t.overlays=null}var n=this.view.getState(t);if(n!=null){this.cellRenderer.redraw(n)}this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else{e=null}}return e};mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(e!=null){t.overlays=null;var i=this.view.getState(t);if(i!=null){this.cellRenderer.redraw(i)}for(var n=0;n<e.length;n++){this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e[n]))}}return e};mxGraph.prototype.clearCellOverlays=function(t){t=t!=null?t:this.model.getRoot();this.removeCellOverlays(t);var e=this.model.getChildCount(t);for(var i=0;i<e;i++){var n=this.model.getChildAt(t,i);this.clearCellOverlays(n)}};mxGraph.prototype.setCellWarning=function(t,e,i,n){if(e!=null&&e.length>0){i=i!=null?i:this.warningImage;var r=new mxCellOverlay(i,"<font color=red>"+e+"</font>");if(n){r.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,i){if(this.isEnabled()){this.setSelectionCell(t)}})))}return this.addCellOverlay(t,r)}else{this.removeCellOverlays(t)}return null};mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)};mxGraph.prototype.startEditingAtCell=function(t,e){if(e==null||!mxEvent.isMultiTouchEvent(e)){if(t==null){t=this.getSelectionCell();if(t!=null&&!this.isCellEditable(t)){t=null}}if(t!=null){this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e));this.cellEditor.startEditing(t,e);this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))}}};mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)};mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t);this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))};mxGraph.prototype.labelChanged=function(t,e,i){this.model.beginUpdate();try{var n=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t));this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",n,"event",i))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellLabelChanged=function(t,e,i){this.model.beginUpdate();try{this.model.setValue(t,e);if(i){this.cellSizeUpdated(t,false)}}finally{this.model.endUpdate()}};mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))};mxGraph.prototype.click=function(t){var e=t.getEvent();var i=t.getCell();var n=new mxEventObject(mxEvent.CLICK,"event",e,"cell",i);if(t.isConsumed()){n.consume()}this.fireEvent(n);if(this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()){if(i!=null){if(this.isTransparentClickEvent(e)){var r=false;var s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);r=r||e;return!r||e||t.cell!=i&&this.model.isAncestor(t.cell,i)})));if(s!=null){i=s}}}else if(this.isSwimlaneSelectionEnabled()){i=this.getSwimlaneAt(t.getGraphX(),t.getGraphY());if(i!=null&&(!this.isToggleEvent(e)||!mxEvent.isAltDown(e))){var l=i;var a=[];while(l!=null){l=this.model.getParent(l);var o=this.view.getState(l);if(this.isSwimlane(l)&&o!=null){a.push(l)}}if(a.length>0){a=a.reverse();a.splice(0,0,i);a.push(i);for(var h=0;h<a.length-1;h++){if(this.isCellSelected(a[h])){i=a[this.isToggleEvent(e)?h:h+1]}}}}}if(i!=null){this.selectCellForEvent(i,e)}else if(!this.isToggleEvent(e)){this.clearSelection()}}};mxGraph.prototype.isSiblingSelected=function(t){var e=this.model;var i=e.getParent(t);var n=e.getChildCount(i);for(var r=0;r<n;r++){var s=e.getChildAt(i,r);if(t!=s&&this.isCellSelected(s)){return true}}return false};mxGraph.prototype.dblClick=function(t,e){var i=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(i);if(this.isEnabled()&&!mxEvent.isConsumed(t)&&!i.isConsumed()&&e!=null&&this.isCellEditable(e)&&!this.isEditing(e)){this.startEditingAtCell(e,t);mxEvent.consume(t)}};mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent();var i=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());this.fireEvent(i);if(i.isConsumed()){this.panningHandler.panningTrigger=false}if(this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed()&&this.connectionHandler.isEnabled()){var n=this.view.getState(this.connectionHandler.marker.getCell(t));if(n!=null){this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor;this.connectionHandler.marker.markedState=n;this.connectionHandler.marker.mark();this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY());this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t);this.connectionHandler.previous=n;this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))}}};mxGraph.prototype.scrollPointToVisible=function(t,e,i,n){if(!this.timerAutoScroll&&(this.ignoreScrollbars||mxUtils.hasScrollbars(this.container))){var r=this.container;n=n!=null?n:20;if(t>=r.scrollLeft&&e>=r.scrollTop&&t<=r.scrollLeft+r.clientWidth&&e<=r.scrollTop+r.clientHeight){var s=r.scrollLeft+r.clientWidth-t;if(s<n){var l=r.scrollLeft;r.scrollLeft+=n-s;if(i&&l==r.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){var a=this.view.getDrawPane().ownerSVGElement;var o=this.container.scrollWidth+n-s;a.style.width=o+"px"}else{var o=Math.max(r.clientWidth,r.scrollWidth)+n-s;var h=this.view.getCanvas();h.style.width=o+"px"}r.scrollLeft+=n-s}}else{s=t-r.scrollLeft;if(s<n){r.scrollLeft-=n-s}}var u=r.scrollTop+r.clientHeight-e;if(u<n){var l=r.scrollTop;r.scrollTop+=n-u;if(l==r.scrollTop&&i){if(this.dialect==mxConstants.DIALECT_SVG){var a=this.view.getDrawPane().ownerSVGElement;var d=this.container.scrollHeight+n-u;a.style.height=d+"px"}else{var d=Math.max(r.clientHeight,r.scrollHeight)+n-u;var h=this.view.getCanvas();h.style.height=d+"px"}r.scrollTop+=n-u}}else{u=e-r.scrollTop;if(u<n){r.scrollTop-=n-u}}}}else if(this.allowAutoPanning&&!this.panningHandler.isActive()){if(this.panningManager==null){this.panningManager=this.createPanningManager()}this.panningManager.panTo(t+this.panDx,e+this.panDy)}};mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)};mxGraph.prototype.getBorderSizes=function(){var t=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(t.paddingLeft)+(t.borderLeftStyle!="none"?mxUtils.parseCssNumber(t.borderLeftWidth):0),mxUtils.parseCssNumber(t.paddingTop)+(t.borderTopStyle!="none"?mxUtils.parseCssNumber(t.borderTopWidth):0),mxUtils.parseCssNumber(t.paddingRight)+(t.borderRightStyle!="none"?mxUtils.parseCssNumber(t.borderRightWidth):0),mxUtils.parseCssNumber(t.paddingBottom)+(t.borderBottomStyle!="none"?mxUtils.parseCssNumber(t.borderBottomWidth):0))};mxGraph.prototype.getPreferredPageSize=function(t,e,i){var n=this.view.translate;var r=this.pageFormat;var s=this.pageScale;var l=new mxRectangle(0,0,Math.ceil(r.width*s),Math.ceil(r.height*s));var a=this.pageBreaksVisible?Math.ceil(e/l.width):1;var o=this.pageBreaksVisible?Math.ceil(i/l.height):1;return new mxRectangle(0,0,a*l.width+2+n.x,o*l.height+2+n.y)};mxGraph.prototype.fit=function(t,e,i,n,r,s,l){if(this.container!=null){t=t!=null?t:this.getBorder();e=e!=null?e:false;i=i!=null?i:0;n=n!=null?n:true;r=r!=null?r:false;s=s!=null?s:false;var a=this.getBorderSizes();var o=this.container.offsetWidth-a.x-a.width-1;var h=l!=null?l:this.container.offsetHeight-a.y-a.height-1;var u=this.view.getGraphBounds();if(u.width>0&&u.height>0){if(e&&u.x!=null&&u.y!=null){u=u.clone();u.width+=u.x;u.height+=u.y;u.x=0;u.y=0}var d=this.view.scale;var p=u.width/d;var m=u.height/d;if(this.backgroundImage!=null){p=Math.max(p,this.backgroundImage.width-u.x/d);m=Math.max(m,this.backgroundImage.height-u.y/d)}var c=(e?t:2*t)+i+1;o-=c;h-=c;var x=r?h/m:s?o/p:Math.min(o/p,h/m);if(this.minFitScale!=null){x=Math.max(x,this.minFitScale)}if(this.maxFitScale!=null){x=Math.min(x,this.maxFitScale)}if(n){if(!e){if(!mxUtils.hasScrollbars(this.container)){var f=u.x!=null?Math.floor(this.view.translate.x-u.x/d+t/x+i/2):t;var g=u.y!=null?Math.floor(this.view.translate.y-u.y/d+t/x+i/2):t;this.view.scaleAndTranslate(x,f,g)}else{this.view.setScale(x);var v=this.getGraphBounds();if(v.x!=null){this.container.scrollLeft=v.x}if(v.y!=null){this.container.scrollTop=v.y}}}else if(this.view.scale!=x){this.view.setScale(x)}}else{return x}}}return this.view.scale};mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(this.container!=null){var e=this.getBorder();var i=Math.max(0,t.x)+t.width+2*e;var n=Math.max(0,t.y)+t.height+2*e;if(this.minimumContainerSize!=null){i=Math.max(i,this.minimumContainerSize.width);n=Math.max(n,this.minimumContainerSize.height)}if(this.resizeContainer){this.doResizeContainer(i,n)}if(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var r=this.getPreferredPageSize(t,Math.max(1,i),Math.max(1,n));if(r!=null){i=r.width*this.view.scale;n=r.height*this.view.scale}}if(this.minimumGraphSize!=null){i=Math.max(i,this.minimumGraphSize.width*this.view.scale);n=Math.max(n,this.minimumGraphSize.height*this.view.scale)}i=Math.ceil(i);n=Math.ceil(n);if(this.dialect==mxConstants.DIALECT_SVG){var s=this.view.getDrawPane().ownerSVGElement;if(s!=null){s.style.minWidth=Math.max(1,i)+"px";s.style.minHeight=Math.max(1,n)+"px";s.style.width="100%";s.style.height="100%"}}else{if(mxClient.IS_QUIRKS){this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,n))}else{this.view.canvas.style.minWidth=Math.max(1,i)+"px";this.view.canvas.style.minHeight=Math.max(1,n)+"px"}}this.updatePageBreaks(this.pageBreaksVisible,i,n)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))};mxGraph.prototype.doResizeContainer=function(t,e){if(this.maximumContainerSize!=null){t=Math.min(this.maximumContainerSize.width,t);e=Math.min(this.maximumContainerSize.height,e)}this.container.style.width=Math.ceil(t)+"px";this.container.style.height=Math.ceil(e)+"px"};mxGraph.prototype.updatePageBreaks=function(t,e,i){var n=this.view.scale;var r=this.view.translate;var s=this.pageFormat;var l=n*this.pageScale;var a=new mxRectangle(0,0,s.width*l,s.height*l);var o=mxRectangle.fromRectangle(this.getGraphBounds());o.width=Math.max(1,o.width);o.height=Math.max(1,o.height);a.x=Math.floor((o.x-r.x*n)/a.width)*a.width+r.x*n;a.y=Math.floor((o.y-r.y*n)/a.height)*a.height+r.y*n;o.width=Math.ceil((o.width+(o.x-a.x))/a.width)*a.width;o.height=Math.ceil((o.height+(o.y-a.y))/a.height)*a.height;t=t&&Math.min(a.width,a.height)>this.minPageBreakDist;var h=t?Math.ceil(o.height/a.height)+1:0;var u=t?Math.ceil(o.width/a.width)+1:0;var d=(u-1)*a.width;var p=(h-1)*a.height;if(this.horizontalPageBreaks==null&&h>0){this.horizontalPageBreaks=[]}if(this.verticalPageBreaks==null&&u>0){this.verticalPageBreaks=[]}var m=mxUtils.bind(this,(function(t){if(t!=null){var e=t==this.horizontalPageBreaks?h:u;for(var i=0;i<=e;i++){var n=t==this.horizontalPageBreaks?[new mxPoint(Math.round(a.x),Math.round(a.y+i*a.height)),new mxPoint(Math.round(a.x+d),Math.round(a.y+i*a.height))]:[new mxPoint(Math.round(a.x+i*a.width),Math.round(a.y)),new mxPoint(Math.round(a.x+i*a.width),Math.round(a.y+p))];if(t[i]!=null){t[i].points=n;t[i].redraw()}else{var r=new mxPolyline(n,this.pageBreakColor);r.dialect=this.dialect;r.pointerEvents=false;r.isDashed=this.pageBreakDashed;r.init(this.view.backgroundPane);r.redraw();t[i]=r}}for(var i=e;i<t.length;i++){t[i].destroy()}t.splice(e,t.length-e)}}));m(this.horizontalPageBreaks);m(this.verticalPageBreaks)};mxGraph.prototype.getCurrentCellStyle=function(t,e){var i=e?null:this.view.getState(t);return i!=null?i.style:this.getCellStyle(t)};mxGraph.prototype.getCellStyle=function(t){var e=this.model.getStyle(t);var i=null;if(this.model.isEdge(t)){i=this.stylesheet.getDefaultEdgeStyle()}else{i=this.stylesheet.getDefaultVertexStyle()}if(e!=null){i=this.postProcessCellStyle(this.stylesheet.getCellStyle(e,i))}if(i==null){i=new Object}return i};mxGraph.prototype.postProcessCellStyle=function(t){if(t!=null){var e=t[mxConstants.STYLE_IMAGE];var i=this.getImageFromBundles(e);if(i!=null){t[mxConstants.STYLE_IMAGE]=i}else{i=e}if(i!=null&&i.substring(0,11)=="data:image/"){if(i.substring(0,20)=="data:image/svg+xml,<"){i=i.substring(0,19)+encodeURIComponent(i.substring(19))}else if(i.substring(0,22)!="data:image/svg+xml,%3C"){var n=i.indexOf(",");if(n>0&&i.substring(n-7,n+1)!=";base64,"){i=i.substring(0,n)+";base64,"+i.substring(n+1)}}t[mxConstants.STYLE_IMAGE]=i}}return t};mxGraph.prototype.setCellStyle=function(t,e){e=e||this.getSelectionCells();if(e!=null){this.model.beginUpdate();try{for(var i=0;i<e.length;i++){this.model.setStyle(e[i],t)}}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(t,e,i){i=i||this.getSelectionCell();return this.toggleCellStyles(t,e,[i])};mxGraph.prototype.toggleCellStyles=function(t,e,i){e=e!=null?e:false;i=i||this.getSelectionCells();var n=null;if(i!=null&&i.length>0){var r=this.getCurrentCellStyle(i[0]);n=mxUtils.getValue(r,t,e)?0:1;this.setCellStyles(t,n,i)}return n};mxGraph.prototype.setCellStyles=function(t,e,i){i=i||this.getSelectionCells();mxUtils.setCellStyles(this.model,i,t,e)};mxGraph.prototype.toggleCellStyleFlags=function(t,e,i){this.setCellStyleFlags(t,e,null,i)};mxGraph.prototype.setCellStyleFlags=function(t,e,i,n){n=n||this.getSelectionCells();if(n!=null&&n.length>0){if(i==null){var r=this.getCurrentCellStyle(n[0]);var s=parseInt(r[t]||0);i=!((s&e)==e)}mxUtils.setCellStyleFlags(this.model,n,t,e,i)}};mxGraph.prototype.alignCells=function(t,e,i){if(e==null){e=this.getSelectionCells()}if(e!=null&&e.length>1){if(i==null){for(var n=0;n<e.length;n++){var r=this.view.getState(e[n]);if(r!=null&&!this.model.isEdge(e[n])){if(i==null){if(t==mxConstants.ALIGN_CENTER){i=r.x+r.width/2;break}else if(t==mxConstants.ALIGN_RIGHT){i=r.x+r.width}else if(t==mxConstants.ALIGN_TOP){i=r.y}else if(t==mxConstants.ALIGN_MIDDLE){i=r.y+r.height/2;break}else if(t==mxConstants.ALIGN_BOTTOM){i=r.y+r.height}else{i=r.x}}else{if(t==mxConstants.ALIGN_RIGHT){i=Math.max(i,r.x+r.width)}else if(t==mxConstants.ALIGN_TOP){i=Math.min(i,r.y)}else if(t==mxConstants.ALIGN_BOTTOM){i=Math.max(i,r.y+r.height)}else{i=Math.min(i,r.x)}}}}}if(i!=null){var s=this.view.scale;this.model.beginUpdate();try{for(var n=0;n<e.length;n++){var r=this.view.getState(e[n]);if(r!=null){var l=this.getCellGeometry(e[n]);if(l!=null&&!this.model.isEdge(e[n])){l=l.clone();if(t==mxConstants.ALIGN_CENTER){l.x+=(i-r.x-r.width/2)/s}else if(t==mxConstants.ALIGN_RIGHT){l.x+=(i-r.x-r.width)/s}else if(t==mxConstants.ALIGN_TOP){l.y+=(i-r.y)/s}else if(t==mxConstants.ALIGN_MIDDLE){l.y+=(i-r.y-r.height/2)/s}else if(t==mxConstants.ALIGN_BOTTOM){l.y+=(i-r.y-r.height)/s}else{l.x+=(i-r.x)/s}this.resizeCell(e[n],l)}}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",e))}finally{this.model.endUpdate()}}}return e};mxGraph.prototype.flipEdge=function(t){if(t!=null&&this.alternateEdgeStyle!=null){this.model.beginUpdate();try{var e=this.model.getStyle(t);if(e==null||e.length==0){this.model.setStyle(t,this.alternateEdgeStyle)}else{this.model.setStyle(t,null)}this.resetEdge(t);this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",t))}finally{this.model.endUpdate()}}return t};mxGraph.prototype.addImageBundle=function(t){this.imageBundles.push(t)};mxGraph.prototype.removeImageBundle=function(t){var e=[];for(var i=0;i<this.imageBundles.length;i++){if(this.imageBundles[i]!=t){e.push(this.imageBundles[i])}}this.imageBundles=e};mxGraph.prototype.getImageFromBundles=function(t){if(t!=null){for(var e=0;e<this.imageBundles.length;e++){var i=this.imageBundles[e].getImage(t);if(i!=null){return i}}}return null};mxGraph.prototype.orderCells=function(t,e){if(e==null){e=mxUtils.sortCells(this.getSelectionCells(),true)}this.model.beginUpdate();try{this.cellsOrdered(e,t);this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",t,"cells",e))}finally{this.model.endUpdate()}return e};mxGraph.prototype.cellsOrdered=function(t,e){if(t!=null){this.model.beginUpdate();try{for(var i=0;i<t.length;i++){var n=this.model.getParent(t[i]);if(e){this.model.add(n,t[i],i)}else{this.model.add(n,t[i],this.model.getChildCount(n)-1)}}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",e,"cells",t))}finally{this.model.endUpdate()}}};mxGraph.prototype.groupCells=function(t,e,i){if(i==null){i=mxUtils.sortCells(this.getSelectionCells(),true)}i=this.getCellsForGroup(i);if(t==null){t=this.createGroupCell(i)}var n=this.getBoundsForGroup(t,i,e);if(i.length>1&&n!=null){var r=this.model.getParent(t);if(r==null){r=this.model.getParent(i[0])}this.model.beginUpdate();try{if(this.getCellGeometry(t)==null){this.model.setGeometry(t,new mxGeometry)}var s=this.model.getChildCount(r);this.cellsAdded([t],r,s,null,null,false,false,false);s=this.model.getChildCount(t);this.cellsAdded(i,t,s,null,null,false,false,false);this.cellsMoved(i,-n.x,-n.y,false,false,false);this.cellsResized([t],[n],false);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",i))}finally{this.model.endUpdate()}}return t};mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(t!=null&&t.length>0){var i=this.model.getParent(t[0]);e.push(t[0]);for(var n=1;n<t.length;n++){if(this.model.getParent(t[n])==i){e.push(t[n])}}}return e};mxGraph.prototype.getBoundsForGroup=function(t,e,i){var n=this.getBoundingBoxFromGeometry(e,true);if(n!=null){if(this.isSwimlane(t)){var r=this.getStartSize(t);n.x-=r.width;n.y-=r.height;n.width+=r.width;n.height+=r.height}if(i!=null){n.x-=i;n.y-=i;n.width+=2*i;n.height+=2*i}}return n};mxGraph.prototype.createGroupCell=function(t){var e=new mxCell("");e.setVertex(true);e.setConnectable(false);return e};mxGraph.prototype.ungroupCells=function(t){var e=[];if(t==null){t=this.getCellsForUngroup()}if(t!=null&&t.length>0){this.model.beginUpdate();try{for(var i=0;i<t.length;i++){var n=this.model.getChildren(t[i]);if(n!=null&&n.length>0){n=n.slice();var r=this.model.getParent(t[i]);var s=this.model.getChildCount(r);this.cellsAdded(n,r,s,null,null,true);e=e.concat(n);for(var l=0;l<n.length;l++){var a=this.view.getState(n[l]);var o=this.getCellGeometry(n[l]);if(a!=null&&o!=null&&o.relative){o=o.clone();o.x=a.origin.x;o.y=a.origin.y;o.relative=false;this.model.setGeometry(n[l],o)}}}}this.removeCellsAfterUngroup(t);this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e};mxGraph.prototype.getCellsForUngroup=function(){var t=this.getSelectionCells();var e=[];for(var i=0;i<t.length;i++){if(this.model.isVertex(t[i])&&this.model.getChildCount(t[i])>0){e.push(t[i])}}return e};mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))};mxGraph.prototype.removeCellsFromParent=function(t){if(t==null){t=this.getSelectionCells()}this.model.beginUpdate();try{var e=this.getDefaultParent();var i=this.model.getChildCount(e);this.cellsAdded(t,e,i,null,null,true);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t};mxGraph.prototype.updateGroupBounds=function(t,e,i,n,r,s,l){if(t==null){t=this.getSelectionCells()}e=e!=null?e:0;i=i!=null?i:false;n=n!=null?n:0;r=r!=null?r:0;s=s!=null?s:0;l=l!=null?l:0;this.model.beginUpdate();try{for(var a=t.length-1;a>=0;a--){var o=this.getCellGeometry(t[a]);if(o!=null){var h=this.getChildCells(t[a]);if(h!=null&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,true);if(u!=null&&u.width>0&&u.height>0){var d=this.isSwimlane(t[a])?this.getActualStartSize(t[a],true):new mxRectangle;o=o.clone();if(i){o.x=Math.round(o.x+u.x-e-d.x-l);o.y=Math.round(o.y+u.y-e-d.y-n)}o.width=Math.round(u.width+2*e+d.x+l+r+d.width);o.height=Math.round(u.height+2*e+d.y+n+s+d.height);this.model.setGeometry(t[a],o);this.moveCells(h,e+d.x-u.x+l,e+d.y-u.y+n)}}}}}finally{this.model.endUpdate()}return t};mxGraph.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){for(var i=0;i<t.length;i++){if(this.model.isVertex(t[i])||this.model.isEdge(t[i])){var n=this.view.getBoundingBox(this.view.getState(t[i]),true);if(n!=null){if(e==null){e=mxRectangle.fromRectangle(n)}else{e.add(n)}}}}}return e};mxGraph.prototype.cloneCell=function(t,e,i,n){return this.cloneCells([t],e,i,n)[0]};mxGraph.prototype.cloneCells=function(t,e,i,n){e=e!=null?e:true;var r=null;if(t!=null){var s=new mxDictionary;var l=[];for(var a=0;a<t.length;a++){s.put(t[a],true);l.push(t[a])}if(l.length>0){var o=this.view.scale;var h=this.view.translate;r=this.model.cloneCells(t,true,i);for(var a=0;a<t.length;a++){if(!e&&this.model.isEdge(r[a])&&this.getEdgeValidationError(r[a],this.model.getTerminal(r[a],true),this.model.getTerminal(r[a],false))!=null){r[a]=null}else{var u=this.model.getGeometry(r[a]);if(u!=null){var d=this.view.getState(t[a]);var p=this.view.getState(this.model.getParent(t[a]));if(d!=null&&p!=null){var m=n?0:p.origin.x;var c=n?0:p.origin.y;if(this.model.isEdge(r[a])){var x=d.absolutePoints;if(x!=null){var f=this.model.getTerminal(t[a],true);while(f!=null&&!s.get(f)){f=this.model.getParent(f)}if(f==null&&x[0]!=null){u.setTerminalPoint(new mxPoint(x[0].x/o-h.x,x[0].y/o-h.y),true)}var g=this.model.getTerminal(t[a],false);while(g!=null&&!s.get(g)){g=this.model.getParent(g)}var v=x.length-1;if(g==null&&x[v]!=null){u.setTerminalPoint(new mxPoint(x[v].x/o-h.x,x[v].y/o-h.y),false)}var y=u.points;if(y!=null){for(var C=0;C<y.length;C++){y[C].x+=m;y[C].y+=c}}}}else{u.translate(m,c)}}}}}}else{r=[]}}return r};mxGraph.prototype.insertVertex=function(t,e,i,n,r,s,l,a,o){var h=this.createVertex(t,e,i,n,r,s,l,a,o);return this.addCell(h,t)};mxGraph.prototype.createVertex=function(t,e,i,n,r,s,l,a,o){var h=new mxGeometry(n,r,s,l);h.relative=o!=null?o:false;var u=new mxCell(i,h,a);u.setId(e);u.setVertex(true);u.setConnectable(true);return u};mxGraph.prototype.insertEdge=function(t,e,i,n,r,s){var l=this.createEdge(t,e,i,n,r,s);return this.addEdge(l,t,n,r)};mxGraph.prototype.createEdge=function(t,e,i,n,r,s){var l=new mxCell(i,new mxGeometry,s);l.setId(e);l.setEdge(true);l.geometry.relative=true;return l};mxGraph.prototype.addEdge=function(t,e,i,n,r){return this.addCell(t,e,r,i,n)};mxGraph.prototype.addCell=function(t,e,i,n,r){return this.addCells([t],e,i,n,r)[0]};mxGraph.prototype.addCells=function(t,e,i,n,r,s){if(e==null){e=this.getDefaultParent()}if(i==null){i=this.model.getChildCount(e)}this.model.beginUpdate();try{this.cellsAdded(t,e,i,n,r,s!=null?s:false,true);this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",t,"parent",e,"index",i,"source",n,"target",r))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellsAdded=function(t,e,i,n,r,s,l,a){if(t!=null&&e!=null&&i!=null){this.model.beginUpdate();try{var o=s?this.view.getState(e):null;var h=o!=null?o.origin:null;var u=new mxPoint(0,0);for(var d=0;d<t.length;d++){if(t[d]==null){i--}else{var p=this.model.getParent(t[d]);if(h!=null&&t[d]!=e&&e!=p){var m=this.view.getState(p);var c=m!=null?m.origin:u;var x=this.model.getGeometry(t[d]);if(x!=null){var f=c.x-h.x;var g=c.y-h.y;x=x.clone();x.translate(f,g);if(!x.relative&&this.model.isVertex(t[d])&&!this.isAllowNegativeCoordinates()){x.x=Math.max(0,x.x);x.y=Math.max(0,x.y)}this.model.setGeometry(t[d],x)}}if(e==p&&i+d>this.model.getChildCount(e)){i--}this.model.add(e,t[d],i+d);if(this.autoSizeCellsOnAdd){this.autoSizeCell(t[d],true)}if((a==null||a)&&this.isExtendParentsOnAdd(t[d])&&this.isExtendParent(t[d])){this.extendParent(t[d])}if(l==null||l){this.constrainChild(t[d])}if(n!=null){this.cellConnected(t[d],n,true)}if(r!=null){this.cellConnected(t[d],r,false)}}}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",i,"source",n,"target",r,"absolute",s))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(t,e){e=e!=null?e:true;if(e){var i=this.model.getChildCount(t);for(var n=0;n<i;n++){this.autoSizeCell(this.model.getChildAt(t,n))}}if(this.getModel().isVertex(t)&&this.isAutoSizeCell(t)){this.updateCellSize(t)}};mxGraph.prototype.removeCells=function(t,e){e=e!=null?e:true;if(t==null){t=this.getDeletableCells(this.getSelectionCells())}if(e){t=this.getDeletableCells(this.addAllEdges(t))}else{t=t.slice();var i=this.getDeletableCells(this.getAllEdges(t));var n=new mxDictionary;for(var r=0;r<t.length;r++){n.put(t[r],true)}for(var r=0;r<i.length;r++){if(this.view.getState(i[r])==null&&!n.get(i[r])){n.put(i[r],true);t.push(i[r])}}}this.model.beginUpdate();try{this.cellsRemoved(t);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",t,"includeEdges",e))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellsRemoved=function(t){if(t!=null&&t.length>0){var e=this.view.scale;var i=this.view.translate;this.model.beginUpdate();try{var n=new mxDictionary;for(var r=0;r<t.length;r++){n.put(t[r],true)}for(var r=0;r<t.length;r++){var s=this.getAllEdges([t[r]]);var l=mxUtils.bind(this,(function(n,s){var l=this.model.getGeometry(n);if(l!=null){var a=this.model.getTerminal(n,s);var o=false;var h=a;while(h!=null){if(t[r]==h){o=true;break}h=this.model.getParent(h)}if(o){l=l.clone();var u=this.view.getState(n);if(u!=null&&u.absolutePoints!=null){var d=u.absolutePoints;var p=s?0:d.length-1;l.setTerminalPoint(new mxPoint(d[p].x/e-i.x-u.origin.x,d[p].y/e-i.y-u.origin.y),s)}else{var m=this.view.getState(a);if(m!=null){l.setTerminalPoint(new mxPoint(m.getCenterX()/e-i.x,m.getCenterY()/e-i.y),s)}}this.model.setGeometry(n,l);this.model.setTerminal(n,null,s)}}}));for(var a=0;a<s.length;a++){if(!n.get(s[a])){n.put(s[a],true);l(s[a],true);l(s[a],false)}}this.model.remove(t[r])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",t))}finally{this.model.endUpdate()}}};mxGraph.prototype.splitEdge=function(t,e,i,n,r,s,l,a){n=n||0;r=r||0;a=a!=null?a:this.model.getParent(t);var o=this.model.getTerminal(t,true);this.model.beginUpdate();try{if(i==null){i=this.cloneCell(t);var h=this.view.getState(t);var u=this.getCellGeometry(i);if(u!=null&&u.points!=null&&h!=null){var d=this.view.translate;var p=this.view.scale;var m=mxUtils.findNearestSegment(h,(n+d.x)*p,(r+d.y)*p);u.points=u.points.slice(0,m);u=this.getCellGeometry(t);if(u!=null&&u.points!=null){u=u.clone();u.points=u.points.slice(m);this.model.setGeometry(t,u)}}}this.cellsMoved(e,n,r,false,false);this.cellsAdded(e,a,this.model.getChildCount(a),null,null,true);this.cellsAdded([i],a,this.model.getChildCount(a),o,e[0],false);this.cellConnected(t,e[0],true);this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",t,"cells",e,"newEdge",i,"dx",n,"dy",r))}finally{this.model.endUpdate()}return i};mxGraph.prototype.toggleCells=function(t,e,i){if(e==null){e=this.getSelectionCells()}if(i){e=this.addAllEdges(e)}this.model.beginUpdate();try{this.cellsToggled(e,t);this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",t,"cells",e,"includeEdges",i))}finally{this.model.endUpdate()}return e};mxGraph.prototype.cellsToggled=function(t,e){if(t!=null&&t.length>0){this.model.beginUpdate();try{for(var i=0;i<t.length;i++){this.model.setVisible(t[i],e)}}finally{this.model.endUpdate()}}};mxGraph.prototype.foldCells=function(t,e,i,n,r){e=e!=null?e:false;if(i==null){i=this.getFoldableCells(this.getSelectionCells(),t)}this.stopEditing(false);this.model.beginUpdate();try{this.cellsFolded(i,t,e,n);this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",t,"recurse",e,"cells",i))}finally{this.model.endUpdate()}return i};mxGraph.prototype.cellsFolded=function(t,e,i,n){if(t!=null&&t.length>0){this.model.beginUpdate();try{for(var r=0;r<t.length;r++){if((!n||this.isCellFoldable(t[r],e))&&e!=this.isCellCollapsed(t[r])){this.model.setCollapsed(t[r],e);this.swapBounds(t[r],e);if(this.isExtendParent(t[r])){this.extendParent(t[r])}if(i){var s=this.model.getChildren(t[r]);this.cellsFolded(s,e,i)}this.constrainChild(t[r])}}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",t,"collapse",e,"recurse",i))}finally{this.model.endUpdate()}}};mxGraph.prototype.swapBounds=function(t,e){if(t!=null){var i=this.model.getGeometry(t);if(i!=null){i=i.clone();this.updateAlternateBounds(t,i,e);i.swap();this.model.setGeometry(t,i)}}};mxGraph.prototype.updateAlternateBounds=function(t,e,i){if(t!=null&&e!=null){var n=this.getCurrentCellStyle(t);if(e.alternateBounds==null){var r=e;if(this.collapseToPreferredSize){var s=this.getPreferredSizeForCell(t);if(s!=null){r=s;var l=mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE);if(l>0){r.height=Math.max(r.height,l)}}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(e.alternateBounds!=null){e.alternateBounds.x=e.x;e.alternateBounds.y=e.y;var a=mxUtils.toRadians(n[mxConstants.STYLE_ROTATION]||0);if(a!=0){var o=e.alternateBounds.getCenterX()-e.getCenterX();var h=e.alternateBounds.getCenterY()-e.getCenterY();var u=Math.cos(a);var d=Math.sin(a);var p=u*o-d*h;var m=d*o+u*h;e.alternateBounds.x+=p-o;e.alternateBounds.y+=m-h}}}};mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))};mxGraph.prototype.getAllEdges=function(t){var e=[];if(t!=null){for(var i=0;i<t.length;i++){var n=this.model.getEdgeCount(t[i]);for(var r=0;r<n;r++){e.push(this.model.getEdgeAt(t[i],r))}var s=this.model.getChildren(t[i]);e=e.concat(this.getAllEdges(s))}}return e};mxGraph.prototype.updateCellSize=function(t,e){e=e!=null?e:false;this.model.beginUpdate();try{this.cellSizeUpdated(t,e);this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",t,"ignoreChildren",e))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellSizeUpdated=function(t,e){if(t!=null){this.model.beginUpdate();try{var i=this.getPreferredSizeForCell(t);var n=this.model.getGeometry(t);if(i!=null&&n!=null){var r=this.isCellCollapsed(t);n=n.clone();if(this.isSwimlane(t)){var s=this.getCellStyle(t);var l=this.model.getStyle(t);if(l==null){l=""}if(mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,true)){l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,i.height+8);if(r){n.height=i.height+8}n.width=i.width}else{l=mxUtils.setStyle(l,mxConstants.STYLE_STARTSIZE,i.width+8);if(r){n.width=i.width+8}n.height=i.height}this.model.setStyle(t,l)}else{var a=this.view.createState(t);var o=a.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER;if(o==mxConstants.ALIGN_RIGHT){n.x+=n.width-i.width}else if(o==mxConstants.ALIGN_CENTER){n.x+=Math.round((n.width-i.width)/2)}var h=this.getVerticalAlign(a);if(h==mxConstants.ALIGN_BOTTOM){n.y+=n.height-i.height}else if(h==mxConstants.ALIGN_MIDDLE){n.y+=Math.round((n.height-i.height)/2)}n.width=i.width;n.height=i.height}if(!e&&!r){var u=this.view.getBounds(this.model.getChildren(t));if(u!=null){var d=this.view.translate;var p=this.view.scale;var m=(u.x+u.width)/p-n.x-d.x;var c=(u.y+u.height)/p-n.y-d.y;n.width=Math.max(n.width,m);n.height=Math.max(n.height,c)}}this.cellsResized([t],[n],false)}}finally{this.model.endUpdate()}}};mxGraph.prototype.getPreferredSizeForCell=function(t,e){var i=null;if(t!=null){var n=this.view.createState(t);var r=n.style;if(!this.model.isEdge(t)){var s=r[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE;var l=0;var a=0;if(this.getImage(n)!=null||r[mxConstants.STYLE_IMAGE]!=null){if(r[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL){if(r[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE){l+=parseFloat(r[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize}if(r[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER){a+=parseFloat(r[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize}}}l+=2*(r[mxConstants.STYLE_SPACING]||0);l+=r[mxConstants.STYLE_SPACING_LEFT]||0;l+=r[mxConstants.STYLE_SPACING_RIGHT]||0;a+=2*(r[mxConstants.STYLE_SPACING]||0);a+=r[mxConstants.STYLE_SPACING_TOP]||0;a+=r[mxConstants.STYLE_SPACING_BOTTOM]||0;var o=this.getFoldingImage(n);if(o!=null){l+=o.width+8}var h=this.cellRenderer.getLabelValue(n);if(h!=null&&h.length>0){if(!this.isHtmlLabel(n.cell)){h=mxUtils.htmlEntities(h,false)}h=h.replace(/\n/g,"<br>");var u=mxUtils.getSizeForString(h,s,r[mxConstants.STYLE_FONTFAMILY],e,r[mxConstants.STYLE_FONTSTYLE]);var d=u.width+l;var p=u.height+a;if(!mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,true)){var m=p;p=d;d=m}if(this.gridEnabled){d=this.snap(d+this.gridSize/2);p=this.snap(p+this.gridSize/2)}i=new mxRectangle(0,0,d,p)}else{var c=4*this.gridSize;i=new mxRectangle(0,0,c,c)}}}return i};mxGraph.prototype.resizeCell=function(t,e,i){return this.resizeCells([t],[e],i)[0]};mxGraph.prototype.resizeCells=function(t,e,i){i=i!=null?i:this.isRecursiveResize();this.model.beginUpdate();try{var n=this.cellsResized(t,e,i);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellsResized=function(t,e,i){i=i!=null?i:false;var n=[];if(t!=null&&e!=null&&t.length==e.length){this.model.beginUpdate();try{for(var r=0;r<t.length;r++){n.push(this.cellResized(t[r],e[r],false,i));if(this.isExtendParent(t[r])){this.extendParent(t[r])}this.constrainChild(t[r])}if(this.resetEdgesOnResize){this.resetEdges(t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",t,"bounds",e,"previous",n))}finally{this.model.endUpdate()}}return n};mxGraph.prototype.cellResized=function(t,e,i,n){var r=this.model.getGeometry(t);if(r!=null&&(r.x!=e.x||r.y!=e.y||r.width!=e.width||r.height!=e.height)){var s=r.clone();if(!i&&s.relative){var l=s.offset;if(l!=null){l.x+=e.x-s.x;l.y+=e.y-s.y}}else{s.x=e.x;s.y=e.y}s.width=e.width;s.height=e.height;if(!s.relative&&this.model.isVertex(t)&&!this.isAllowNegativeCoordinates()){s.x=Math.max(0,s.x);s.y=Math.max(0,s.y)}this.model.beginUpdate();try{if(n){this.resizeChildCells(t,s)}this.model.setGeometry(t,s);this.constrainChildCells(t)}finally{this.model.endUpdate()}}return r};mxGraph.prototype.resizeChildCells=function(t,e){var i=this.model.getGeometry(t);var n=i.width!=0?e.width/i.width:1;var r=i.height!=0?e.height/i.height:1;var s=this.model.getChildCount(t);for(var l=0;l<s;l++){this.scaleCell(this.model.getChildAt(t,l),n,r,true)}};mxGraph.prototype.constrainChildCells=function(t){var e=this.model.getChildCount(t);for(var i=0;i<e;i++){this.constrainChild(this.model.getChildAt(t,i))}};mxGraph.prototype.scaleCell=function(t,e,i,n){var r=this.model.getGeometry(t);if(r!=null){var s=this.getCurrentCellStyle(t);r=r.clone();var l=r.x;var a=r.y;var o=r.width;var h=r.height;r.scale(e,i,s[mxConstants.STYLE_ASPECT]=="fixed");if(s[mxConstants.STYLE_RESIZE_WIDTH]=="1"){r.width=o*e}else if(s[mxConstants.STYLE_RESIZE_WIDTH]=="0"){r.width=o}if(s[mxConstants.STYLE_RESIZE_HEIGHT]=="1"){r.height=h*i}else if(s[mxConstants.STYLE_RESIZE_HEIGHT]=="0"){r.height=h}if(!this.isCellMovable(t)){r.x=l;r.y=a}if(!this.isCellResizable(t)){r.width=o;r.height=h}if(this.model.isVertex(t)){this.cellResized(t,r,true,n)}else{this.model.setGeometry(t,r)}}};mxGraph.prototype.extendParent=function(t){if(t!=null){var e=this.model.getParent(t);var i=this.getCellGeometry(e);if(e!=null&&i!=null&&!this.isCellCollapsed(e)){var n=this.getCellGeometry(t);if(n!=null&&!n.relative&&(i.width<n.x+n.width||i.height<n.y+n.height)){i=i.clone();i.width=Math.max(i.width,n.x+n.width);i.height=Math.max(i.height,n.y+n.height);this.cellsResized([e],[i],false)}}}};mxGraph.prototype.importCells=function(t,e,i,n,r,s){return this.moveCells(t,e,i,true,n,r,s)};mxGraph.prototype.moveCells=function(t,e,i,n,r,s,l){e=e!=null?e:0;i=i!=null?i:0;n=n!=null?n:false;if(t!=null&&(e!=0||i!=0||n||r!=null)){t=this.model.getTopmostCells(t);var a=t;this.model.beginUpdate();try{var o=new mxDictionary;for(var h=0;h<t.length;h++){o.put(t[h],true)}var u=mxUtils.bind(this,(function(t){while(t!=null){if(o.get(t)){return true}t=this.model.getParent(t)}return false}));var d=[];for(var h=0;h<t.length;h++){var p=this.getCellGeometry(t[h]);var m=this.model.getParent(t[h]);if(p==null||!p.relative||!this.model.isEdge(m)||!u(this.model.getTerminal(m,true))&&!u(this.model.getTerminal(m,false))){d.push(t[h])}}t=d;if(n){t=this.cloneCells(t,this.isCloneInvalidEdges(),l);if(r==null){r=this.getDefaultParent()}}var c=this.isAllowNegativeCoordinates();if(r!=null){this.setAllowNegativeCoordinates(true)}this.cellsMoved(t,e,i,!n&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),r==null,this.isExtendParentsOnMove()&&r==null);this.setAllowNegativeCoordinates(c);if(r!=null){var x=this.model.getChildCount(r);this.cellsAdded(t,r,x,null,null,true);if(n){for(var h=0;h<t.length;h++){var p=this.getCellGeometry(t[h]);var m=this.model.getParent(a[h]);if(p!=null&&p.relative&&this.model.isEdge(m)&&this.model.contains(m)){this.model.add(m,t[h])}}}}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",t,"dx",e,"dy",i,"clone",n,"target",r,"event",s))}finally{this.model.endUpdate()}}return t};mxGraph.prototype.cellsMoved=function(t,e,i,n,r,s){if(t!=null&&(e!=0||i!=0)){s=s!=null?s:false;this.model.beginUpdate();try{if(n){this.disconnectGraph(t)}for(var l=0;l<t.length;l++){this.translateCell(t[l],e,i);if(s&&this.isExtendParent(t[l])){this.extendParent(t[l])}else if(r){this.constrainChild(t[l])}}if(this.resetEdgesOnMove){this.resetEdges(t)}this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",t,"dx",e,"dy",i,"disconnect",n))}finally{this.model.endUpdate()}}};mxGraph.prototype.translateCell=function(t,e,i){var n=this.model.getGeometry(t);if(n!=null){e=parseFloat(e);i=parseFloat(i);n=n.clone();n.translate(e,i);if(!n.relative&&this.model.isVertex(t)&&!this.isAllowNegativeCoordinates()){n.x=Math.max(0,parseFloat(n.x));n.y=Math.max(0,parseFloat(n.y))}if(n.relative&&!this.model.isEdge(t)){var r=this.model.getParent(t);var s=0;if(this.model.isVertex(r)){var l=this.getCurrentCellStyle(r);s=mxUtils.getValue(l,mxConstants.STYLE_ROTATION,0)}if(s!=0){var a=mxUtils.toRadians(-s);var o=Math.cos(a);var h=Math.sin(a);var u=mxUtils.getRotatedPoint(new mxPoint(e,i),o,h,new mxPoint(0,0));e=u.x;i=u.y}if(n.offset==null){n.offset=new mxPoint(e,i)}else{n.offset.x=parseFloat(n.offset.x)+e;n.offset.y=parseFloat(n.offset.y)+i}}this.model.setGeometry(t,n)}};mxGraph.prototype.getCellContainmentArea=function(t){if(t!=null&&!this.model.isEdge(t)){var e=this.model.getParent(t);if(e!=null&&e!=this.getDefaultParent()){var i=this.model.getGeometry(e);if(i!=null){var n=0;var r=0;var s=i.width;var l=i.height;if(this.isSwimlane(e)){var a=this.getStartSize(e);var o=this.getCurrentCellStyle(e);var h=mxUtils.getValue(o,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var u=mxUtils.getValue(o,mxConstants.STYLE_FLIPH,0)==1;var d=mxUtils.getValue(o,mxConstants.STYLE_FLIPV,0)==1;if(h==mxConstants.DIRECTION_SOUTH||h==mxConstants.DIRECTION_NORTH){var p=a.width;a.width=a.height;a.height=p}if(h==mxConstants.DIRECTION_EAST&&!d||h==mxConstants.DIRECTION_NORTH&&!u||h==mxConstants.DIRECTION_WEST&&d||h==mxConstants.DIRECTION_SOUTH&&u){n=a.width;r=a.height}s-=a.width;l-=a.height}return new mxRectangle(n,r,s,l)}}}return null};mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds};mxGraph.prototype.constrainChild=function(t,e){if(t!=null){var i=this.getCellGeometry(t);if(i!=null&&(this.isConstrainRelativeChildren()||!i.relative)){var n=this.model.getParent(t);var r=this.getCellGeometry(n);var s=this.getMaximumGraphBounds();if(s!=null){var l=this.getBoundingBoxFromGeometry([n],false);if(l!=null){s=mxRectangle.fromRectangle(s);s.x-=l.x;s.y-=l.y}}if(this.isConstrainChild(t)){var a=this.getCellContainmentArea(t);if(a!=null){var o=this.getOverlap(t);if(o>0){a=mxRectangle.fromRectangle(a);a.x-=a.width*o;a.y-=a.height*o;a.width+=2*a.width*o;a.height+=2*a.height*o}if(s==null){s=a}else{s=mxRectangle.fromRectangle(s);s.intersect(a)}}}if(s!=null){var h=[t];if(!this.isCellCollapsed(t)){var u=this.model.getDescendants(t);for(var d=0;d<u.length;d++){if(this.isCellVisible(u[d])){h.push(u[d])}}}var p=this.getBoundingBoxFromGeometry(h,false);if(p!=null){i=i.clone();var m=0;if(i.width>s.width){m=i.width-s.width;i.width-=m}if(p.x+p.width>s.x+s.width){m-=p.x+p.width-s.x-s.width-m}var c=0;if(i.height>s.height){c=i.height-s.height;i.height-=c}if(p.y+p.height>s.y+s.height){c-=p.y+p.height-s.y-s.height-c}if(p.x<s.x){m-=p.x-s.x}if(p.y<s.y){c-=p.y-s.y}if(m!=0||c!=0){if(i.relative){if(i.offset==null){i.offset=new mxPoint}i.offset.x+=m;i.offset.y+=c}else{i.x+=m;i.y+=c}}this.model.setGeometry(t,i)}}}}};mxGraph.prototype.resetEdges=function(t){if(t!=null){var e=new mxDictionary;for(var i=0;i<t.length;i++){e.put(t[i],true)}this.model.beginUpdate();try{for(var i=0;i<t.length;i++){var n=this.model.getEdges(t[i]);if(n!=null){for(var r=0;r<n.length;r++){var s=this.view.getState(n[r]);var l=s!=null?s.getVisibleTerminal(true):this.view.getVisibleTerminal(n[r],true);var a=s!=null?s.getVisibleTerminal(false):this.view.getVisibleTerminal(n[r],false);if(!e.get(l)||!e.get(a)){this.resetEdge(n[r])}}}this.resetEdges(this.model.getChildren(t[i]))}}finally{this.model.endUpdate()}}};mxGraph.prototype.resetEdge=function(t){var e=this.model.getGeometry(t);if(e!=null&&e.points!=null&&e.points.length>0){e=e.clone();e.points=[];this.model.setGeometry(t,e)}return t};mxGraph.prototype.getOutlineConstraint=function(t,e,i){if(e.shape!=null){var n=this.view.getPerimeterBounds(e);var r=e.style[mxConstants.STYLE_DIRECTION];if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){n.x+=n.width/2-n.height/2;n.y+=n.height/2-n.width/2;var s=n.width;n.width=n.height;n.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(l!=0){var a=Math.cos(-l);var o=Math.sin(-l);var h=new mxPoint(n.getCenterX(),n.getCenterY());t=mxUtils.getRotatedPoint(t,a,o,h)}var u=1;var d=1;var p=0;var m=0;if(this.getModel().isVertex(e.cell)){var c=e.style[mxConstants.STYLE_FLIPH];var x=e.style[mxConstants.STYLE_FLIPV];if(e.shape!=null&&e.shape.stencil!=null){c=mxUtils.getValue(e.style,"stencilFlipH",0)==1||c;x=mxUtils.getValue(e.style,"stencilFlipV",0)==1||x}if(r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH){var s=c;c=x;x=s}if(c){u=-1;p=-n.width}if(x){d=-1;m=-n.height}}t=new mxPoint((t.x-n.x)*u-p+n.x,(t.y-n.y)*d-m+n.y);var f=n.width==0?0:Math.round((t.x-n.x)*1e3/n.width)/1e3;var g=n.height==0?0:Math.round((t.y-n.y)*1e3/n.height)/1e3;return new mxConnectionConstraint(new mxPoint(f,g),false)}return null};mxGraph.prototype.getAllConnectionConstraints=function(t,e){if(t!=null&&t.shape!=null&&t.shape.stencil!=null){return t.shape.stencil.constraints}return null};mxGraph.prototype.getConnectionConstraint=function(t,e,i){var n=null;var r=t.style[i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(r!=null){var s=t.style[i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];if(s!=null){n=new mxPoint(parseFloat(r),parseFloat(s))}}var l=false;var a=0,o=0;if(n!=null){l=mxUtils.getValue(t.style,i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,true);a=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]);o=parseFloat(t.style[i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]);a=isFinite(a)?a:0;o=isFinite(o)?o:0}return new mxConnectionConstraint(n,l,null,a,o)};mxGraph.prototype.setConnectionConstraint=function(t,e,i,n){if(n!=null){this.model.beginUpdate();try{if(n==null||n.point==null){this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])}else if(n.point!=null){this.setCellStyles(i?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,n.point.x,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,n.point.y,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,n.dx,[t]);this.setCellStyles(i?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,n.dy,[t]);if(!n.perimeter){this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t])}else{this.setCellStyles(i?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])}}}finally{this.model.endUpdate()}}};mxGraph.prototype.getConnectionPoint=function(t,e,i){i=i!=null?i:true;var n=null;if(t!=null&&e.point!=null){var r=this.view.getPerimeterBounds(t);var s=new mxPoint(r.getCenterX(),r.getCenterY());var l=t.style[mxConstants.STYLE_DIRECTION];var a=0;if(l!=null&&mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)==1){if(l==mxConstants.DIRECTION_NORTH){a+=270}else if(l==mxConstants.DIRECTION_WEST){a+=180}else if(l==mxConstants.DIRECTION_SOUTH){a+=90}if(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){r.rotate90()}}var o=this.view.scale;n=new mxPoint(r.x+e.point.x*r.width+e.dx*o,r.y+e.point.y*r.height+e.dy*o);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(a!=0){var u=0;var d=0;if(a==90){d=1}else if(a==180){u=-1}else if(a==270){d=-1}n=mxUtils.getRotatedPoint(n,u,d,s)}n=this.view.getPerimeterPoint(t,n,false)}else{h+=a;if(this.getModel().isVertex(t.cell)){var p=t.style[mxConstants.STYLE_FLIPH]==1;var m=t.style[mxConstants.STYLE_FLIPV]==1;if(t.shape!=null&&t.shape.stencil!=null){p=mxUtils.getValue(t.style,"stencilFlipH",0)==1||p;m=mxUtils.getValue(t.style,"stencilFlipV",0)==1||m}if(l==mxConstants.DIRECTION_NORTH||l==mxConstants.DIRECTION_SOUTH){var c=p;p=m;m=c}if(p){n.x=2*r.getCenterX()-n.x}if(m){n.y=2*r.getCenterY()-n.y}}}if(h!=0&&n!=null){var x=mxUtils.toRadians(h);var u=Math.cos(x);var d=Math.sin(x);n=mxUtils.getRotatedPoint(n,u,d,s)}}if(i&&n!=null){n.x=Math.round(n.x);n.y=Math.round(n.y)}return n};mxGraph.prototype.connectCell=function(t,e,i,n){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.cellConnected(t,e,i,n);this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}return t};mxGraph.prototype.cellConnected=function(t,e,i,n){if(t!=null){this.model.beginUpdate();try{var r=this.model.getTerminal(t,i);this.setConnectionConstraint(t,e,i,n);if(this.isPortsEnabled()){var s=null;if(this.isPort(e)){s=e.getId();e=this.getTerminalForPort(e,i)}var l=i?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,i);if(this.resetEdgesOnConnect){this.resetEdge(t)}this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",i,"previous",r))}finally{this.model.endUpdate()}}};mxGraph.prototype.disconnectGraph=function(t){if(t!=null){this.model.beginUpdate();try{var e=this.view.scale;var i=this.view.translate;var n=new mxDictionary;for(var r=0;r<t.length;r++){n.put(t[r],true)}for(var r=0;r<t.length;r++){if(this.model.isEdge(t[r])){var s=this.model.getGeometry(t[r]);if(s!=null){var l=this.view.getState(t[r]);var a=this.view.getState(this.model.getParent(t[r]));if(l!=null&&a!=null){s=s.clone();var o=-a.origin.x;var h=-a.origin.y;var u=l.absolutePoints;var d=this.model.getTerminal(t[r],true);if(d!=null&&this.isCellDisconnectable(t[r],d,true)){while(d!=null&&!n.get(d)){d=this.model.getParent(d)}if(d==null){s.setTerminalPoint(new mxPoint(u[0].x/e-i.x+o,u[0].y/e-i.y+h),true);this.model.setTerminal(t[r],null,true)}}var p=this.model.getTerminal(t[r],false);if(p!=null&&this.isCellDisconnectable(t[r],p,false)){while(p!=null&&!n.get(p)){p=this.model.getParent(p)}if(p==null){var m=u.length-1;s.setTerminalPoint(new mxPoint(u[m].x/e-i.x+o,u[m].y/e-i.y+h),false);this.model.setTerminal(t[r],null,false)}}this.model.setGeometry(t[r],s)}}}}}finally{this.model.endUpdate()}}};mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot};mxGraph.prototype.getTranslateForRoot=function(t){return null};mxGraph.prototype.isPort=function(t){return false};mxGraph.prototype.getTerminalForPort=function(t,e){return this.model.getParent(t)};mxGraph.prototype.getChildOffsetForCell=function(t){return null};mxGraph.prototype.enterGroup=function(t){t=t||this.getSelectionCell();if(t!=null&&this.isValidRoot(t)){this.view.setCurrentRoot(t);this.clearSelection()}};mxGraph.prototype.exitGroup=function(){var t=this.model.getRoot();var e=this.getCurrentRoot();if(e!=null){var i=this.model.getParent(e);while(i!=t&&!this.isValidRoot(i)&&this.model.getParent(i)!=t){i=this.model.getParent(i)}if(i==t||this.model.getParent(i)==t){this.view.setCurrentRoot(null)}else{this.view.setCurrentRoot(i)}var n=this.view.getState(e);if(n!=null){this.setSelectionCell(e)}}};mxGraph.prototype.home=function(){var t=this.getCurrentRoot();if(t!=null){this.view.setCurrentRoot(null);var e=this.view.getState(t);if(e!=null){this.setSelectionCell(t)}}};mxGraph.prototype.isValidRoot=function(t){return t!=null};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()};mxGraph.prototype.getCellBounds=function(t,e,i){var n=[t];if(e){n=n.concat(this.model.getEdges(t))}var r=this.view.getBounds(n);if(i){var s=this.model.getChildCount(t);for(var l=0;l<s;l++){var a=this.getCellBounds(this.model.getChildAt(t,l),e,true);if(r!=null){r.add(a)}else{r=a}}}return r};mxGraph.prototype.getBoundingBoxFromGeometry=function(t,e){e=e!=null?e:false;var i=null;if(t!=null){for(var n=0;n<t.length;n++){if(e||this.model.isVertex(t[n])){var r=this.getCellGeometry(t[n]);if(r!=null){var s=null;if(this.model.isEdge(t[n])){var l=function(t){if(t!=null){if(o==null){o=new mxRectangle(t.x,t.y,0,0)}else{o.add(new mxRectangle(t.x,t.y,0,0))}}};if(this.model.getTerminal(t[n],true)==null){l(r.getTerminalPoint(true))}if(this.model.getTerminal(t[n],false)==null){l(r.getTerminalPoint(false))}var a=r.points;if(a!=null&&a.length>0){var o=new mxRectangle(a[0].x,a[0].y,0,0);for(var h=1;h<a.length;h++){l(a[h])}}s=o}else{var u=this.model.getParent(t[n]);if(r.relative){if(this.model.isVertex(u)&&u!=this.view.currentRoot){var o=this.getBoundingBoxFromGeometry([u],false);if(o!=null){s=new mxRectangle(r.x*o.width,r.y*o.height,r.width,r.height);if(mxUtils.indexOf(t,u)>=0){s.x+=o.x;s.y+=o.y}}}}else{s=mxRectangle.fromRectangle(r);if(this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0){var o=this.getBoundingBoxFromGeometry([u],false);if(o!=null){s.x+=o.x;s.y+=o.y}}}if(s!=null&&r.offset!=null){s.x+=r.offset.x;s.y+=r.offset.y}var d=this.getCurrentCellStyle(t[n]);if(s!=null){var p=mxUtils.getValue(d,mxConstants.STYLE_ROTATION,0);if(p!=0){s=mxUtils.getBoundingBox(s,p)}}}if(s!=null){if(i==null){i=mxRectangle.fromRectangle(s)}else{i.add(s)}}}}}}return i};mxGraph.prototype.refresh=function(t){this.view.clear(t,t==null);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(t){if(this.gridEnabled){t=Math.round(t/this.gridSize)*this.gridSize}return t};mxGraph.prototype.snapDelta=function(t,e,i,n,r){var s=this.view.translate;var l=this.view.scale;if(!i&&this.gridEnabled){var a=this.gridSize*l*.5;if(!n){var o=e.x-(this.snap(e.x/l-s.x)+s.x)*l;if(Math.abs(t.x-o)<a){t.x=0}else{t.x=this.snap(t.x/l)*l-o}}if(!r){var h=e.y-(this.snap(e.y/l-s.y)+s.y)*l;if(Math.abs(t.y-h)<a){t.y=0}else{t.y=this.snap(t.y/l)*l-h}}}else{var a=.5*l;if(!n){var o=e.x-(Math.round(e.x/l-s.x)+s.x)*l;if(Math.abs(t.x-o)<a){t.x=0}else{t.x=Math.round(t.x/l)*l-o}}if(!r){var h=e.y-(Math.round(e.y/l-s.y)+s.y)*l;if(Math.abs(t.y-h)<a){t.y=0}else{t.y=Math.round(t.y/l)*l-h}}}return t};mxGraph.prototype.panGraph=function(t,e){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)){this.container.scrollLeft=-t;this.container.scrollTop=-e}else{var i=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG){if(t==0&&e==0){if(mxClient.IS_IE){i.setAttribute("transform","translate("+t+","+e+")")}else{i.removeAttribute("transform")}if(this.shiftPreview1!=null){var n=this.shiftPreview1.firstChild;while(n!=null){var r=n.nextSibling;this.container.appendChild(n);n=r}if(this.shiftPreview1.parentNode!=null){this.shiftPreview1.parentNode.removeChild(this.shiftPreview1)}this.shiftPreview1=null;this.container.appendChild(i.parentNode);n=this.shiftPreview2.firstChild;while(n!=null){var r=n.nextSibling;this.container.appendChild(n);n=r}if(this.shiftPreview2.parentNode!=null){this.shiftPreview2.parentNode.removeChild(this.shiftPreview2)}this.shiftPreview2=null}}else{i.setAttribute("transform","translate("+t+","+e+")");if(this.shiftPreview1==null){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position="absolute";this.shiftPreview1.style.overflow="visible";this.shiftPreview2=document.createElement("div");this.shiftPreview2.style.position="absolute";this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;var n=this.container.firstChild;while(n!=null){var r=n.nextSibling;if(n!=i.parentNode){s.appendChild(n)}else{s=this.shiftPreview2}n=r}if(this.shiftPreview1.firstChild!=null){this.container.insertBefore(this.shiftPreview1,i.parentNode)}if(this.shiftPreview2.firstChild!=null){this.container.appendChild(this.shiftPreview2)}}this.shiftPreview1.style.left=t+"px";this.shiftPreview1.style.top=e+"px";this.shiftPreview2.style.left=t+"px";this.shiftPreview2.style.top=e+"px"}}else{i.style.left=t+"px";i.style.top=e+"px"}this.panDx=t;this.panDy=e;this.fireEvent(new mxEventObject(mxEvent.PAN))}};mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)};mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)};mxGraph.prototype.zoomActual=function(){if(this.view.scale==1){this.view.setTranslate(0,0)}else{this.view.translate.x=0;this.view.translate.y=0;this.view.setScale(1)}};mxGraph.prototype.zoomTo=function(t,e){this.zoom(t/this.view.scale,e)};mxGraph.prototype.center=function(t,e,i,n){t=t!=null?t:true;e=e!=null?e:true;i=i!=null?i:.5;n=n!=null?n:.5;var r=mxUtils.hasScrollbars(this.container);var s=2*this.getBorder();var l=this.container.clientWidth-s;var a=this.container.clientHeight-s;var o=this.getGraphBounds();var h=this.view.translate;var u=this.view.scale;var d=t?l-o.width:0;var p=e?a-o.height:0;if(!r){this.view.setTranslate(t?Math.floor(h.x-o.x*u+d*i/u):h.x,e?Math.floor(h.y-o.y*u+p*n/u):h.y)}else{o.x-=h.x;o.y-=h.y;var m=this.container.scrollWidth;var c=this.container.scrollHeight;if(m>l){d=0}if(c>a){p=0}this.view.setTranslate(Math.floor(d/2-o.x),Math.floor(p/2-o.y));this.container.scrollLeft=(m-l)/2;this.container.scrollTop=(c-a)/2}};mxGraph.prototype.zoom=function(t,e){e=e!=null?e:this.centerZoom;var i=Math.round(this.view.scale*t*100)/100;var n=this.view.getState(this.getSelectionCell());t=i/this.view.scale;if(this.keepSelectionVisibleOnZoom&&n!=null){var r=new mxRectangle(n.x*t,n.y*t,n.width*t,n.height*t);this.view.scale=i;if(!this.scrollRectToVisible(r)){this.view.revalidate();this.view.setScale(i)}}else{var s=mxUtils.hasScrollbars(this.container);if(e&&!s){var l=this.container.offsetWidth;var a=this.container.offsetHeight;if(t>1){var o=(t-1)/(i*2);l*=-o;a*=-o}else{var o=(1/t-1)/(this.view.scale*2);l*=o;a*=o}this.view.scaleAndTranslate(i,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x;var u=this.view.translate.y;var d=this.container.scrollLeft;var p=this.container.scrollTop;this.view.setScale(i);if(s){var l=0;var a=0;if(e){l=this.container.offsetWidth*(t-1)/2;a=this.container.offsetHeight*(t-1)/2}this.container.scrollLeft=(this.view.translate.x-h)*this.view.scale+Math.round(d*t+l);this.container.scrollTop=(this.view.translate.y-u)*this.view.scale+Math.round(p*t+a)}}}};mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width;var i=this.container.clientHeight/t.height;var n=e/i;t.x=Math.max(0,t.x);t.y=Math.max(0,t.y);var r=Math.min(this.container.scrollWidth,t.x+t.width);var s=Math.min(this.container.scrollHeight,t.y+t.height);t.width=r-t.x;t.height=s-t.y;if(n<1){var l=t.height/n;var a=(l-t.height)/2;t.height=l;var o=Math.min(t.y,a);t.y=t.y-o;s=Math.min(this.container.scrollHeight,t.y+t.height);t.height=s-t.y}else{var h=t.width*n;var u=(h-t.width)/2;t.width=h;var d=Math.min(t.x,u);t.x=t.x-d;r=Math.min(this.container.scrollWidth,t.x+t.width);t.width=r-t.x}var p=this.container.clientWidth/t.width;var m=this.view.scale*p;if(!mxUtils.hasScrollbars(this.container)){this.view.scaleAndTranslate(m,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)}else{this.view.setScale(m);this.container.scrollLeft=Math.round(t.x*p);this.container.scrollTop=Math.round(t.y*p)}};mxGraph.prototype.scrollCellToVisible=function(t,e){var i=-this.view.translate.x;var n=-this.view.translate.y;var r=this.view.getState(t);if(r!=null){var s=new mxRectangle(i+r.x,n+r.y,r.width,r.height);if(e&&this.container!=null){var l=this.container.clientWidth;var a=this.container.clientHeight;s.x=s.getCenterX()-l/2;s.width=l;s.y=s.getCenterY()-a/2;s.height=a}var o=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=o.x;this.view.translate.y=o.y;this.view.setTranslate(h.x,h.y)}}};mxGraph.prototype.scrollRectToVisible=function(t){var e=false;if(t!=null){var i=this.container.offsetWidth;var n=this.container.offsetHeight;var r=Math.min(i,t.width);var s=Math.min(n,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x;t.y+=this.view.translate.y;var a=l.scrollLeft-t.x;var o=Math.max(a-l.scrollLeft,0);if(a>0){l.scrollLeft-=a+2}else{a=t.x+r-l.scrollLeft-l.clientWidth;if(a>0){l.scrollLeft+=a+2}}var h=l.scrollTop-t.y;var u=Math.max(0,h-l.scrollTop);if(h>0){l.scrollTop-=h+2}else{h=t.y+s-l.scrollTop-l.clientHeight;if(h>0){l.scrollTop+=h+2}}if(!this.useScrollbarsForPanning&&(o!=0||u!=0)){this.view.setTranslate(o,u)}}else{var d=-this.view.translate.x;var p=-this.view.translate.y;var m=this.view.scale;if(t.x+r>d+i){this.view.translate.x-=(t.x+r-i-d)/m;e=true}if(t.y+s>p+n){this.view.translate.y-=(t.y+s-n-p)/m;e=true}if(t.x<d){this.view.translate.x+=(d-t.x)/m;e=true}if(t.y<p){this.view.translate.y+=(p-t.y)/m;e=true}if(e){this.view.refresh();if(this.selectionCellsHandler!=null){this.selectionCellsHandler.refresh()}}}}return e};mxGraph.prototype.getCellGeometry=function(t){return this.model.getGeometry(t)};mxGraph.prototype.isCellVisible=function(t){return this.model.isVisible(t)};mxGraph.prototype.isCellCollapsed=function(t){return this.model.isCollapsed(t)};mxGraph.prototype.isCellConnectable=function(t){return this.model.isConnectable(t)};mxGraph.prototype.isOrthogonal=function(t){var e=t.style[mxConstants.STYLE_ORTHOGONAL];if(e!=null){return e}var i=this.view.getEdgeStyle(t);return i==mxEdgeStyle.SegmentConnector||i==mxEdgeStyle.ElbowConnector||i==mxEdgeStyle.SideToSide||i==mxEdgeStyle.TopToBottom||i==mxEdgeStyle.EntityRelation||i==mxEdgeStyle.OrthConnector};mxGraph.prototype.isLoop=function(t){var e=t.getVisibleTerminalState(true);var i=t.getVisibleTerminalState(false);return e!=null&&e==i};mxGraph.prototype.isCloneEvent=function(t){return mxEvent.isControlDown(t)};mxGraph.prototype.isTransparentClickEvent=function(t){return false};mxGraph.prototype.isToggleEvent=function(t){return mxClient.IS_MAC?mxEvent.isMetaDown(t):mxEvent.isControlDown(t)};mxGraph.prototype.isGridEnabledEvent=function(t){return t!=null&&!mxEvent.isAltDown(t)};mxGraph.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t)};mxGraph.prototype.isIgnoreTerminalEvent=function(t){return false};mxGraph.prototype.validationAlert=function(t){mxUtils.alert(t)};mxGraph.prototype.isEdgeValid=function(t,e,i){return this.getEdgeValidationError(t,e,i)==null};mxGraph.prototype.getEdgeValidationError=function(t,e,i){if(t!=null&&!this.isAllowDanglingEdges()&&(e==null||i==null)){return""}if(t!=null&&this.model.getTerminal(t,true)==null&&this.model.getTerminal(t,false)==null){return null}if(!this.allowLoops&&e==i&&e!=null){return""}if(!this.isValidConnection(e,i)){return""}if(e!=null&&i!=null){var n="";if(!this.multigraph){var r=this.model.getEdgesBetween(e,i,true);if(r.length>1||r.length==1&&r[0]!=t){n+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n"}}var s=this.model.getDirectedEdgeCount(e,true,t);var l=this.model.getDirectedEdgeCount(i,false,t);if(this.multiplicities!=null){for(var a=0;a<this.multiplicities.length;a++){var o=this.multiplicities[a].check(this,t,e,i,s,l);if(o!=null){n+=o}}}var o=this.validateEdge(t,e,i);if(o!=null){n+=o}return n.length>0?n:null}return this.allowDanglingEdges?null:""};mxGraph.prototype.validateEdge=function(t,e,i){return null};mxGraph.prototype.validateGraph=function(t,e){t=t!=null?t:this.model.getRoot();e=e!=null?e:new Object;var i=true;var n=this.model.getChildCount(t);for(var r=0;r<n;r++){var s=this.model.getChildAt(t,r);var l=e;if(this.isValidRoot(s)){l=new Object}var a=this.validateGraph(s,l);if(a!=null){this.setCellWarning(s,a.replace(/\n/g,"<br>"))}else{this.setCellWarning(s,null)}i=i&&a==null}var o="";if(this.isCellCollapsed(t)&&!i){o+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"}if(this.model.isEdge(t)){o+=this.getEdgeValidationError(t,this.model.getTerminal(t,true),this.model.getTerminal(t,false))||""}else{o+=this.getCellValidationError(t)||""}var h=this.validateCell(t,e);if(h!=null){o+=h}if(this.model.getParent(t)==null){this.view.validate()}return o.length>0||!i?o:null};mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,true);var i=this.model.getDirectedEdgeCount(t,false);var n=this.model.getValue(t);var r="";if(this.multiplicities!=null){for(var s=0;s<this.multiplicities.length;s++){var l=this.multiplicities[s];if(l.source&&mxUtils.isNode(n,l.type,l.attr,l.value)&&(e>l.max||e<l.min)){r+=l.countError+"\n"}else if(!l.source&&mxUtils.isNode(n,l.type,l.attr,l.value)&&(i>l.max||i<l.min)){r+=l.countError+"\n"}}}return r.length>0?r:null};mxGraph.prototype.validateCell=function(t,e){return null};mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage};mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t};mxGraph.prototype.getFoldingImage=function(t){if(t!=null&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e)){return e?this.collapsedImage:this.expandedImage}}return null};mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(e!=null){if(mxUtils.isNode(e)){return e.nodeName}else if(typeof e.toString=="function"){return e.toString()}}return""};mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&t!=null){var i=this.getCurrentCellStyle(t);if(!mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,false)){e=this.convertValueToString(t)}}return e};mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()};mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels};mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t};mxGraph.prototype.isWrapping=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]=="wrap"};mxGraph.prototype.isLabelClipped=function(t){return this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]=="hidden"};mxGraph.prototype.getTooltip=function(t,e,i,n){var r=null;if(t!=null){if(t.control!=null&&(e==t.control.node||e.parentNode==t.control.node)){r=this.collapseExpandResource;r=mxUtils.htmlEntities(mxResources.get(r)||r).replace(/\\n/g,"<br>")}if(r==null&&t.overlays!=null){t.overlays.visit((function(t,i){if(r==null&&(e==i.node||e.parentNode==i.node)){r=i.overlay.toString()}}))}if(r==null){var s=this.selectionCellsHandler.getHandler(t.cell);if(s!=null&&typeof s.getTooltipForNode=="function"){r=s.getTooltipForNode(e)}}if(r==null){r=this.getTooltipForCell(t.cell)}}return r};mxGraph.prototype.getTooltipForCell=function(t){var e=null;if(t!=null&&t.getTooltip!=null){e=t.getTooltip()}else{e=this.convertValueToString(t)}return e};mxGraph.prototype.getLinkForCell=function(t){return null};mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())};mxGraph.prototype.getCursorForCell=function(t){return null};mxGraph.prototype.getStartSize=function(t,e){var i=new mxRectangle;var n=this.getCurrentCellStyle(t,e);var r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));if(mxUtils.getValue(n,mxConstants.STYLE_HORIZONTAL,true)){i.height=r}else{i.width=r}return i};mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var i=mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0)==1;var n=mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0)==1;var r=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,true);var s=r?0:3;if(e==mxConstants.DIRECTION_NORTH){s--}else if(e==mxConstants.DIRECTION_WEST){s+=2}else if(e==mxConstants.DIRECTION_SOUTH){s+=1}var l=mxUtils.mod(s,2);if(i&&l==1){s+=2}if(n&&l==0){s+=2}return[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]};mxGraph.prototype.getActualStartSize=function(t,e){var i=new mxRectangle;if(this.isSwimlane(t,e)){var n=this.getCurrentCellStyle(t,e);var r=parseInt(mxUtils.getValue(n,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));var s=this.getSwimlaneDirection(n);if(s==mxConstants.DIRECTION_NORTH){i.y=r}else if(s==mxConstants.DIRECTION_WEST){i.x=r}else if(s==mxConstants.DIRECTION_SOUTH){i.height=r}else{i.width=r}}return i};mxGraph.prototype.getImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_IMAGE]:null};mxGraph.prototype.isTransparentState=function(t){var e=false;if(t!=null){var i=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE);var n=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=i==mxConstants.NONE&&n==mxConstants.NONE&&this.getImage(t)==null}return e};mxGraph.prototype.getVerticalAlign=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null};mxGraph.prototype.getIndicatorColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null};mxGraph.prototype.getIndicatorGradientColor=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null};mxGraph.prototype.getIndicatorShape=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null};mxGraph.prototype.getIndicatorImage=function(t){return t!=null&&t.style!=null?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null};mxGraph.prototype.getBorder=function(){return this.border};mxGraph.prototype.setBorder=function(t){this.border=t};mxGraph.prototype.isSwimlane=function(t,e){if(t!=null&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)){return this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE}return false};mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer};mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t};mxGraph.prototype.isEnabled=function(){return this.enabled};mxGraph.prototype.setEnabled=function(t){this.enabled=t};mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled};mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t};mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing};mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t};mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing};mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t};mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||e!=null&&this.model.isVertex(t)&&e.relative};mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked};mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t};mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellCloneable(t)})))};mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&e[mxConstants.STYLE_CLONEABLE]!=0};mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable};mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t};mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canExportCell(t)})))};mxGraph.prototype.canExportCell=function(t){return this.exportEnabled};mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canImportCell(t)})))};mxGraph.prototype.canImportCell=function(t){return this.importEnabled};mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()};mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable};mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t};mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellDeletable(t)})))};mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&e[mxConstants.STYLE_DELETABLE]!=0};mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable};mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t};mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)};mxGraph.prototype.isCellRotatable=function(t){var e=this.getCurrentCellStyle(t);return e[mxConstants.STYLE_ROTATABLE]!=0};mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellMovable(t)})))};mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_MOVABLE]!=0};mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable};mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t};mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled};mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t};mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled};mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t};mxGraph.prototype.getGridSize=function(){return this.gridSize};mxGraph.prototype.setGridSize=function(t){this.gridSize=t};mxGraph.prototype.getTolerance=function(){return this.tolerance};mxGraph.prototype.setTolerance=function(t){this.tolerance=t};mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable};mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t};mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable};mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t};mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting};mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t};mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled};mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t};mxGraph.prototype.isMultigraph=function(){return this.multigraph};mxGraph.prototype.setMultigraph=function(t){this.multigraph=t};mxGraph.prototype.isAllowLoops=function(){return this.allowLoops};mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t};mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges};mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t};mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges};mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t};mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges};mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t};mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove};mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t};mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled};mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t};mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled};mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t};mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")!="0"};mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable};mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t};mxGraph.prototype.isTerminalPointMovable=function(t,e){return true};mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_BENDABLE]!=0};mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable};mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t};mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&e[mxConstants.STYLE_EDITABLE]!=0};mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable};mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t};mxGraph.prototype.isCellDisconnectable=function(t,e,i){return this.isCellsDisconnectable()&&!this.isCellLocked(t)};mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable};mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t};mxGraph.prototype.isValidSource=function(t){return t==null&&this.allowDanglingEdges||t!=null&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)};mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)};mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)};mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)};mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()};mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)};mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t};mxGraph.prototype.isEditing=function(t){if(this.cellEditor!=null){var e=this.cellEditor.getEditingCell();return t==null?e!=null:t==e}return false};mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||e[mxConstants.STYLE_AUTOSIZE]==1};mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells};mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t};mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()};mxGraph.prototype.isExtendParents=function(){return this.extendParents};mxGraph.prototype.setExtendParents=function(t){this.extendParents=t};mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd};mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t};mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove};mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t};mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize};mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t};mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))};mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren};mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t};mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren};mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t};mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates};mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t};mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0};mxGraph.prototype.isAllowOverlapParent=function(t){return false};mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellFoldable(t,e)})))};mxGraph.prototype.isCellFoldable=function(t,e){var i=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&i[mxConstants.STYLE_FOLDABLE]!=0};mxGraph.prototype.isValidDropTarget=function(t,e,i){return t!=null&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,i)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))};mxGraph.prototype.isSplitTarget=function(t,e,i){if(this.model.isEdge(t)&&e!=null&&e.length==1&&this.isCellConnectable(e[0])&&this.getEdgeValidationError(t,this.model.getTerminal(t,true),e[0])==null){var n=this.model.getTerminal(t,true);var r=this.model.getTerminal(t,false);return!this.model.isAncestor(e[0],n)&&!this.model.isAncestor(e[0],r)}return false};mxGraph.prototype.getDropTarget=function(t,e,i,n){if(!this.isSwimlaneNesting()){for(var r=0;r<t.length;r++){if(this.isSwimlane(t[r])){return null}}}var s=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));s.x-=this.panDx;s.y-=this.panDy;var l=this.getSwimlaneAt(s.x,s.y);if(i==null){i=l}else if(l!=null){var a=this.model.getParent(l);while(a!=null&&this.isSwimlane(a)&&a!=i){a=this.model.getParent(a)}if(a==i){i=l}}while(i!=null&&!this.isValidDropTarget(i,t,e)&&!this.model.isLayer(i)){i=this.model.getParent(i)}if(n==null||!n){var o=i;while(o!=null&&mxUtils.indexOf(t,o)<0){o=this.model.getParent(o)}}return!this.model.isLayer(i)&&o==null?i:null};mxGraph.prototype.getDefaultParent=function(){var t=this.getCurrentRoot();if(t==null){t=this.defaultParent;if(t==null){var e=this.model.getRoot();t=this.model.getChildAt(e,0)}}return t};mxGraph.prototype.setDefaultParent=function(t){this.defaultParent=t};mxGraph.prototype.getSwimlane=function(t){while(t!=null&&!this.isSwimlane(t)){t=this.model.getParent(t)}return t};mxGraph.prototype.getSwimlaneAt=function(t,e,i){if(i==null){i=this.getCurrentRoot();if(i==null){i=this.model.getRoot()}}if(i!=null){var n=this.model.getChildCount(i);for(var r=0;r<n;r++){var s=this.model.getChildAt(i,r);if(s!=null){var l=this.getSwimlaneAt(t,e,s);if(l!=null){return l}else if(this.isCellVisible(s)&&this.isSwimlane(s)){var a=this.view.getState(s);if(this.intersects(a,t,e)){return s}}}}}return null};mxGraph.prototype.getCellAt=function(t,e,i,n,r,s){n=n!=null?n:true;r=r!=null?r:true;if(i==null){i=this.getCurrentRoot();if(i==null){i=this.getModel().getRoot()}}if(i!=null){var l=this.model.getChildCount(i);for(var a=l-1;a>=0;a--){var o=this.model.getChildAt(i,a);var h=this.getCellAt(t,e,o,n,r,s);if(h!=null){return h}else if(this.isCellVisible(o)&&(r&&this.model.isEdge(o)||n&&this.model.isVertex(o))){var u=this.view.getState(o);if(u!=null&&(s==null||!s(u,t,e))&&this.intersects(u,t,e)){return o}}}}return null};mxGraph.prototype.intersects=function(t,e,i){if(t!=null){var n=t.absolutePoints;if(n!=null){var r=this.tolerance*this.tolerance;var s=n[0];for(var l=1;l<n.length;l++){var a=n[l];var o=mxUtils.ptSegDistSq(s.x,s.y,a.x,a.y,e,i);if(o<=r){return true}s=a}}else{var h=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(h!=0){var u=Math.cos(-h);var d=Math.sin(-h);var p=new mxPoint(t.getCenterX(),t.getCenterY());var s=mxUtils.getRotatedPoint(new mxPoint(e,i),u,d,p);e=s.x;i=s.y}if(mxUtils.contains(t,e,i)){return true}}}return false};mxGraph.prototype.hitsSwimlaneContent=function(t,e,i){var n=this.getView().getState(t);var r=this.getStartSize(t);if(n!=null){var s=this.getView().getScale();e-=n.x;i-=n.y;if(r.width>0&&e>0&&e>r.width*s){return true}else if(r.height>0&&i>0&&i>r.height*s){return true}}return false};mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,true,false)};mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,false,true)};mxGraph.prototype.getChildCells=function(t,e,i){t=t!=null?t:this.getDefaultParent();e=e!=null?e:false;i=i!=null?i:false;var n=this.model.getChildCells(t,e,i);var r=[];for(var s=0;s<n.length;s++){if(this.isCellVisible(n[s])){r.push(n[s])}}return r};mxGraph.prototype.getConnections=function(t,e){return this.getEdges(t,e,true,true,false)};mxGraph.prototype.getIncomingEdges=function(t,e){return this.getEdges(t,e,true,false,false)};mxGraph.prototype.getOutgoingEdges=function(t,e){return this.getEdges(t,e,false,true,false)};mxGraph.prototype.getEdges=function(t,e,i,n,r,s){i=i!=null?i:true;n=n!=null?n:true;r=r!=null?r:true;s=s!=null?s:false;var l=[];var a=this.isCellCollapsed(t);var o=this.model.getChildCount(t);for(var h=0;h<o;h++){var u=this.model.getChildAt(t,h);if(a||!this.isCellVisible(u)){l=l.concat(this.model.getEdges(u,i,n))}}l=l.concat(this.model.getEdges(t,i,n));var d=[];for(var h=0;h<l.length;h++){var p=this.view.getState(l[h]);var m=p!=null?p.getVisibleTerminal(true):this.view.getVisibleTerminal(l[h],true);var c=p!=null?p.getVisibleTerminal(false):this.view.getVisibleTerminal(l[h],false);if(r&&m==c||m!=c&&(i&&c==t&&(e==null||this.isValidAncestor(m,e,s))||n&&m==t&&(e==null||this.isValidAncestor(c,e,s)))){d.push(l[h])}}return d};mxGraph.prototype.isValidAncestor=function(t,e,i){return i?this.model.isAncestor(e,t):this.model.getParent(t)==e};mxGraph.prototype.getOpposites=function(t,e,i,n){i=i!=null?i:true;n=n!=null?n:true;var r=[];var s=new mxDictionary;if(t!=null){for(var l=0;l<t.length;l++){var a=this.view.getState(t[l]);var o=a!=null?a.getVisibleTerminal(true):this.view.getVisibleTerminal(t[l],true);var h=a!=null?a.getVisibleTerminal(false):this.view.getVisibleTerminal(t[l],false);if(o==e&&h!=null&&h!=e&&n){if(!s.get(h)){s.put(h,true);r.push(h)}}else if(h==e&&o!=null&&o!=e&&i){if(!s.get(o)){s.put(o,true);r.push(o)}}}}return r};mxGraph.prototype.getEdgesBetween=function(t,e,i){i=i!=null?i:false;var n=this.getEdges(t);var r=[];for(var s=0;s<n.length;s++){var l=this.view.getState(n[s]);var a=l!=null?l.getVisibleTerminal(true):this.view.getVisibleTerminal(n[s],true);var o=l!=null?l.getVisibleTerminal(false):this.view.getVisibleTerminal(n[s],false);if(a==t&&o==e||!i&&a==e&&o==t){r.push(n[s])}}return r};mxGraph.prototype.getPointForEvent=function(t,e){var i=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t));var n=this.view.scale;var r=this.view.translate;var s=e!=false?this.gridSize/2:0;i.x=this.snap(i.x/n-r.x-s);i.y=this.snap(i.y/n-r.y-s);return i};mxGraph.prototype.getCells=function(t,e,i,n,r,s,l,a,o){s=s!=null?s:[];if(i>0||n>0||l!=null){var h=this.getModel();var u=t+i;var d=e+n;if(r==null){r=this.getCurrentRoot();if(r==null){r=h.getRoot()}}if(r!=null){var p=h.getChildCount(r);for(var m=0;m<p;m++){var c=h.getChildAt(r,m);var x=this.view.getState(c);if(x!=null&&this.isCellVisible(c)&&(a==null||!a(x))){var f=mxUtils.getValue(x.style,mxConstants.STYLE_ROTATION)||0;var g=x;if(f!=0){g=mxUtils.getBoundingBox(g,f)}var v=l!=null&&h.isVertex(c)&&mxUtils.intersects(l,g)||l==null&&(h.isEdge(c)||h.isVertex(c))&&g.x>=t&&g.y+g.height<=d&&g.y>=e&&g.x+g.width<=u;if(v){s.push(c)}if(!v||o){this.getCells(t,e,i,n,c,s,l,a,o)}}}}}return s};mxGraph.prototype.getCellsBeyond=function(t,e,i,n,r){var s=[];if(n||r){if(i==null){i=this.getDefaultParent()}if(i!=null){var l=this.model.getChildCount(i);for(var a=0;a<l;a++){var o=this.model.getChildAt(i,a);var h=this.view.getState(o);if(this.isCellVisible(o)&&h!=null){if((!n||h.x>=t)&&(!r||h.y>=e)){s.push(o)}}}}}return s};mxGraph.prototype.findTreeRoots=function(t,e,i){e=e!=null?e:false;i=i!=null?i:false;var n=[];if(t!=null){var r=this.getModel();var s=r.getChildCount(t);var l=null;var a=0;for(var o=0;o<s;o++){var h=r.getChildAt(t,o);if(this.model.isVertex(h)&&this.isCellVisible(h)){var u=this.getConnections(h,e?t:null);var d=0;var p=0;for(var m=0;m<u.length;m++){var c=this.view.getVisibleTerminal(u[m],true);if(c==h){d++}else{p++}}if(i&&d==0&&p>0||!i&&p==0&&d>0){n.push(h)}var x=i?p-d:d-p;if(x>a){a=x;l=h}}}if(n.length==0&&l!=null){n.push(l)}}return n};mxGraph.prototype.traverse=function(t,e,i,n,r,s){if(i!=null&&t!=null){e=e!=null?e:true;s=s!=null?s:false;r=r||new mxDictionary;if(!r.get(t)){r.put(t,true);var l=i(t,n);if(l==null||l){var a=this.model.getEdgeCount(t);if(a>0){for(var o=0;o<a;o++){var h=this.model.getEdgeAt(t,o);var u=this.model.getTerminal(h,true)==t;if(!e||!s==u){var d=this.model.getTerminal(h,!u);this.traverse(d,e,i,h,r,s)}}}}}}};mxGraph.prototype.isCellSelected=function(t){return this.getSelectionModel().isSelected(t)};mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()};mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()};mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length};mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]};mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()};mxGraph.prototype.setSelectionCell=function(t){this.getSelectionModel().setCell(t)};mxGraph.prototype.setSelectionCells=function(t){this.getSelectionModel().setCells(t)};mxGraph.prototype.addSelectionCell=function(t){this.getSelectionModel().addCell(t)};mxGraph.prototype.addSelectionCells=function(t){this.getSelectionModel().addCells(t)};mxGraph.prototype.removeSelectionCell=function(t){this.getSelectionModel().removeCell(t)};mxGraph.prototype.removeSelectionCells=function(t){this.getSelectionModel().removeCells(t)};mxGraph.prototype.selectRegion=function(t,e){var i=this.getCells(t.x,t.y,t.width,t.height);this.selectCellsForEvent(i,e);return i};mxGraph.prototype.selectNextCell=function(){this.selectCell(true)};mxGraph.prototype.selectPreviousCell=function(){this.selectCell()};mxGraph.prototype.selectParentCell=function(){this.selectCell(false,true)};mxGraph.prototype.selectChildCell=function(){this.selectCell(false,false,true)};mxGraph.prototype.selectCell=function(t,e,i){var n=this.selectionModel;var r=n.cells.length>0?n.cells[0]:null;if(n.cells.length>1){n.clear()}var s=r!=null?this.model.getParent(r):this.getDefaultParent();var l=this.model.getChildCount(s);if(r==null&&l>0){var a=this.model.getChildAt(s,0);this.setSelectionCell(a)}else if((r==null||e)&&this.view.getState(s)!=null&&this.model.getGeometry(s)!=null){if(this.getCurrentRoot()!=s){this.setSelectionCell(s)}}else if(r!=null&&i){var o=this.model.getChildCount(r);if(o>0){var a=this.model.getChildAt(r,0);this.setSelectionCell(a)}}else if(l>0){var h=s.getIndex(r);if(t){h++;var a=this.model.getChildAt(s,h%l);this.setSelectionCell(a)}else{h--;var u=h<0?l-1:h;var a=this.model.getChildAt(s,u);this.setSelectionCell(a)}}};mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var i=e?this.model.filterDescendants(mxUtils.bind(this,(function(e){return e!=t&&this.view.getState(e)!=null})),t):this.model.getChildren(t);if(i!=null){this.setSelectionCells(i)}};mxGraph.prototype.selectVertices=function(t,e){this.selectCells(true,false,t,e)};mxGraph.prototype.selectEdges=function(t){this.selectCells(false,true,t)};mxGraph.prototype.selectCells=function(t,e,i,n){i=i||this.getDefaultParent();var r=mxUtils.bind(this,(function(i){return this.view.getState(i)!=null&&((n||this.model.getChildCount(i)==0)&&this.model.isVertex(i)&&t&&!this.model.isEdge(this.model.getParent(i))||this.model.isEdge(i)&&e)}));var s=this.model.filterDescendants(r,i);if(s!=null){this.setSelectionCells(s)}};mxGraph.prototype.selectCellForEvent=function(t,e){var i=this.isCellSelected(t);if(this.isToggleEvent(e)){if(i){this.removeSelectionCell(t)}else{this.addSelectionCell(t)}}else if(!i||this.getSelectionCount()!=1){this.setSelectionCell(t)}};mxGraph.prototype.selectCellsForEvent=function(t,e){if(this.isToggleEvent(e)){this.addSelectionCells(t)}else{this.setSelectionCells(t)}};mxGraph.prototype.createHandler=function(t){var e=null;if(t!=null){if(this.model.isEdge(t.cell)){var i=t.getVisibleTerminalState(true);var n=t.getVisibleTerminalState(false);var r=this.getCellGeometry(t.cell);var s=this.view.getEdgeStyle(t,r!=null?r.points:null,i,n);e=this.createEdgeHandler(t,s)}else{e=this.createVertexHandler(t)}}return e};mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)};mxGraph.prototype.createEdgeHandler=function(t,e){var i=null;if(e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom){i=this.createElbowEdgeHandler(t)}else if(e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector){i=this.createEdgeSegmentHandler(t)}else{i=new mxEdgeHandler(t)}return i};mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)};mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)};mxGraph.prototype.addMouseListener=function(t){if(this.mouseListeners==null){this.mouseListeners=[]}this.mouseListeners.push(t)};mxGraph.prototype.removeMouseListener=function(t){if(this.mouseListeners!=null){for(var e=0;e<this.mouseListeners.length;e++){if(this.mouseListeners[e]==t){this.mouseListeners.splice(e,1);break}}}};mxGraph.prototype.updateMouseEvent=function(t,e){if(t.graphX==null||t.graphY==null){var i=mxUtils.convertPoint(this.container,t.getX(),t.getY());t.graphX=i.x-this.panDx;t.graphY=i.y-this.panDy;if(t.getCell()==null&&this.isMouseDown&&e==mxEvent.MOUSE_MOVE){t.state=this.view.getState(this.getCellAt(i.x,i.y,null,null,null,(function(t){return t.shape==null||t.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||mxUtils.getValue(t.style,mxConstants.STYLE_POINTER_EVENTS,"1")=="1"||t.shape.fill!=null&&t.shape.fill!=mxConstants.NONE})))}}return t};mxGraph.prototype.getStateForTouchEvent=function(t){var e=mxEvent.getClientX(t);var i=mxEvent.getClientY(t);var n=mxUtils.convertPoint(this.container,e,i);return this.view.getState(this.getCellAt(n.x,n.y))};mxGraph.prototype.isEventIgnored=function(t,e,i){var n=mxEvent.isMouseEvent(e.getEvent());var r=false;if(e.getEvent()==this.lastEvent){r=true}else{this.lastEvent=e.getEvent()}if(this.eventSource!=null&&t!=mxEvent.MOUSE_MOVE){mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect);this.mouseMoveRedirect=null;this.mouseUpRedirect=null;this.eventSource=null}else if(!mxClient.IS_GC&&this.eventSource!=null&&e.getSource()!=this.eventSource){r=true}else if(mxClient.IS_TOUCH&&t==mxEvent.MOUSE_DOWN&&!n&&!mxEvent.isPenEvent(e.getEvent())){this.eventSource=e.getSource();this.mouseMoveRedirect=mxUtils.bind(this,(function(t){this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}));this.mouseUpRedirect=mxUtils.bind(this,(function(t){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}));mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect)}if(this.isSyntheticEventIgnored(t,e,i)){r=true}if(!mxEvent.isPopupTrigger(this.lastEvent)&&t!=mxEvent.MOUSE_MOVE&&this.lastEvent.detail==2){return true}if(t==mxEvent.MOUSE_UP&&this.isMouseDown){this.isMouseDown=false}else if(t==mxEvent.MOUSE_DOWN&&!this.isMouseDown){this.isMouseDown=true;this.isMouseTrigger=n}else if(!r&&((!mxClient.IS_FF||t!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=n||t==mxEvent.MOUSE_DOWN&&this.isMouseDown||t==mxEvent.MOUSE_UP&&!this.isMouseDown)){r=true}if(!r&&t==mxEvent.MOUSE_DOWN){this.lastMouseX=e.getX();this.lastMouseY=e.getY()}return r};mxGraph.prototype.isSyntheticEventIgnored=function(t,e,i){var n=false;var r=mxEvent.isMouseEvent(e.getEvent());if(this.ignoreMouseEvents&&r&&t!=mxEvent.MOUSE_MOVE){this.ignoreMouseEvents=t!=mxEvent.MOUSE_UP;n=true}else if(mxClient.IS_FF&&!r&&t==mxEvent.MOUSE_UP){this.ignoreMouseEvents=true}return n};mxGraph.prototype.isEventSourceIgnored=function(t,e){var i=e.getSource();var n=i.nodeName!=null?i.nodeName.toLowerCase():"";var r=!mxEvent.isMouseEvent(e.getEvent())||mxEvent.isLeftMouseButton(e.getEvent());return t==mxEvent.MOUSE_DOWN&&r&&(n=="select"||n=="option"||n=="input"&&i.type!="checkbox"&&i.type!="radio"&&i.type!="button"&&i.type!="submit"&&i.type!="file")};mxGraph.prototype.getEventState=function(t){return t};mxGraph.prototype.fireMouseEvent=function(t,e,i){if(this.isEventSourceIgnored(t,e)){if(this.tooltipHandler!=null){this.tooltipHandler.hide()}return}if(i==null){i=this}e=this.updateMouseEvent(e,t);if(!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(e.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))){var n=(new Date).getTime();if(!mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_DOWN||mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_UP&&!this.fireDoubleClick){if(this.lastTouchEvent!=null&&this.lastTouchEvent!=e.getEvent()&&n-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance&&this.doubleClickCounter<2){this.doubleClickCounter++;var r=false;if(t==mxEvent.MOUSE_UP){if(e.getCell()==this.lastTouchCell&&this.lastTouchCell!=null){this.lastTouchTime=0;var s=this.lastTouchCell;this.lastTouchCell=null;if(mxClient.IS_QUIRKS){e.getSource().fireEvent("ondblclick")}this.dblClick(e.getEvent(),s);r=true}}else{this.fireDoubleClick=true;this.lastTouchTime=0}if(!mxClient.IS_QUIRKS||r){mxEvent.consume(e.getEvent());return}}else if(this.lastTouchEvent==null||this.lastTouchEvent!=e.getEvent()){this.lastTouchCell=e.getCell();this.lastTouchX=e.getX();this.lastTouchY=e.getY();this.lastTouchTime=n;this.lastTouchEvent=e.getEvent();this.doubleClickCounter=0}}else if((this.isMouseDown||t==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=false;var s=this.lastTouchCell;this.lastTouchCell=null;this.isMouseDown=false;var l=s!=null||(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF);if(l&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance){this.dblClick(e.getEvent(),s)}else{mxEvent.consume(e.getEvent())}return}}if(!this.isEventIgnored(t,e,i)){e.state=this.getEventState(e.getState());this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",t,"event",e));if(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE11||mxClient.IS_IE&&mxClient.IS_SVG||e.getEvent().target!=this.container){if(t==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(e.getEvent)){this.scrollPointToVisible(e.getGraphX(),e.getGraphY(),this.autoExtend)}else if(t==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(this.container.scrollLeft!=0||this.container.scrollTop!=0)){var a=this.view.scale;var o=this.view.translate;this.view.setTranslate(o.x-this.container.scrollLeft/a,o.y-this.container.scrollTop/a);this.container.scrollLeft=0;this.container.scrollTop=0}if(this.mouseListeners!=null){var h=[i,e];if(!e.getEvent().preventDefault){e.getEvent().returnValue=true}for(var u=0;u<this.mouseListeners.length;u++){var d=this.mouseListeners[u];if(t==mxEvent.MOUSE_DOWN){d.mouseDown.apply(d,h)}else if(t==mxEvent.MOUSE_MOVE){d.mouseMove.apply(d,h)}else if(t==mxEvent.MOUSE_UP){d.mouseUp.apply(d,h)}}}if(t==mxEvent.MOUSE_UP){this.click(e)}}if((mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&t==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress){this.tapAndHoldInProgress=true;this.initialTouchX=e.getGraphX();this.initialTouchY=e.getGraphY();var p=function(){if(this.tapAndHoldValid){this.tapAndHold(e)}this.tapAndHoldInProgress=false;this.tapAndHoldValid=false};if(this.tapAndHoldThread){window.clearTimeout(this.tapAndHoldThread)}this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,p),this.tapAndHoldDelay);this.tapAndHoldValid=true}else if(t==mxEvent.MOUSE_UP){this.tapAndHoldInProgress=false;this.tapAndHoldValid=false}else if(this.tapAndHoldValid){this.tapAndHoldValid=Math.abs(this.initialTouchX-e.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-e.getGraphY())<this.tolerance}if(t==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(e.getEvent())){this.stopEditing(!this.isInvokesStopCellEditing())}this.consumeMouseEvent(t,e,i)}};mxGraph.prototype.consumeMouseEvent=function(t,e,i){if(t==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(e.getEvent())){e.consume(false)}};mxGraph.prototype.fireGestureEvent=function(t,e){this.lastTouchTime=0;this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",t,"cell",e))};mxGraph.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;if(this.tooltipHandler!=null){this.tooltipHandler.destroy()}if(this.selectionCellsHandler!=null){this.selectionCellsHandler.destroy()}if(this.panningHandler!=null){this.panningHandler.destroy()}if(this.popupMenuHandler!=null){this.popupMenuHandler.destroy()}if(this.connectionHandler!=null){this.connectionHandler.destroy()}if(this.graphHandler!=null){this.graphHandler.destroy()}if(this.cellEditor!=null){this.cellEditor.destroy()}if(this.view!=null){this.view.destroy()}if(this.model!=null&&this.graphModelChangeListener!=null){this.model.removeListener(this.graphModelChangeListener);this.graphModelChangeListener=null}this.container=null}};__mxOutput.mxGraph=typeof mxGraph!=="undefined"?mxGraph:undefined;function mxCellOverlay(t,e,i,n,r,s){this.image=t;this.tooltip=e;this.align=i!=null?i:this.align;this.verticalAlign=n!=null?n:this.verticalAlign;this.offset=r!=null?r:new mxPoint;this.cursor=s!=null?s:"help"}mxCellOverlay.prototype=new mxEventSource;mxCellOverlay.prototype.constructor=mxCellOverlay;mxCellOverlay.prototype.image=null;mxCellOverlay.prototype.tooltip=null;mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT;mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM;mxCellOverlay.prototype.offset=null;mxCellOverlay.prototype.cursor=null;mxCellOverlay.prototype.defaultOverlap=.5;mxCellOverlay.prototype.getBounds=function(t){var e=t.view.graph.getModel().isEdge(t.cell);var i=t.view.scale;var n=null;var r=this.image.width;var s=this.image.height;if(e){var l=t.absolutePoints;if(l.length%2==1){n=l[Math.floor(l.length/2)]}else{var a=l.length/2;var o=l[a-1];var h=l[a];n=new mxPoint(o.x+(h.x-o.x)/2,o.y+(h.y-o.y)/2)}}else{n=new mxPoint;if(this.align==mxConstants.ALIGN_LEFT){n.x=t.x}else if(this.align==mxConstants.ALIGN_CENTER){n.x=t.x+t.width/2}else{n.x=t.x+t.width}if(this.verticalAlign==mxConstants.ALIGN_TOP){n.y=t.y}else if(this.verticalAlign==mxConstants.ALIGN_MIDDLE){n.y=t.y+t.height/2}else{n.y=t.y+t.height}}return new mxRectangle(Math.round(n.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(n.y-(s*this.defaultOverlap-this.offset.y)*i),r*i,s*i)};mxCellOverlay.prototype.toString=function(){return this.tooltip};__mxOutput.mxCellOverlay=typeof mxCellOverlay!=="undefined"?mxCellOverlay:undefined;function mxOutline(t,e){this.source=t;if(e!=null){this.init(e)}}mxOutline.prototype.source=null;mxOutline.prototype.outline=null;mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER;mxOutline.prototype.enabled=true;mxOutline.prototype.showViewport=true;mxOutline.prototype.border=10;mxOutline.prototype.sizerSize=8;mxOutline.prototype.labelsVisible=false;mxOutline.prototype.updateOnPan=false;mxOutline.prototype.sizerImage=null;mxOutline.prototype.minScale=1e-4;mxOutline.prototype.suspended=false;mxOutline.prototype.forceVmlHandles=document.documentMode==8;mxOutline.prototype.createGraph=function(t){var e=new mxGraph(t,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet());e.foldingEnabled=false;e.autoScroll=false;return e};mxOutline.prototype.init=function(t){this.outline=this.createGraph(t);var e=this.outline.graphModelChanged;this.outline.graphModelChanged=mxUtils.bind(this,(function(t){if(!this.suspended&&this.outline!=null){e.apply(this.outline,arguments)}}));if(mxClient.IS_SVG){var i=this.outline.getView().getCanvas().parentNode;i.setAttribute("shape-rendering","optimizeSpeed");i.setAttribute("image-rendering","optimizeSpeed")}this.outline.labelsVisible=this.labelsVisible;this.outline.setEnabled(false);this.updateHandler=mxUtils.bind(this,(function(t,e){if(!this.suspended&&!this.active){this.update()}}));this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler);this.outline.addMouseListener(this);var n=this.source.getView();n.addListener(mxEvent.SCALE,this.updateHandler);n.addListener(mxEvent.TRANSLATE,this.updateHandler);n.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler);n.addListener(mxEvent.DOWN,this.updateHandler);n.addListener(mxEvent.UP,this.updateHandler);mxEvent.addListener(this.source.container,"scroll",this.updateHandler);this.panHandler=mxUtils.bind(this,(function(t){if(this.updateOnPan){this.updateHandler.apply(this,arguments)}}));this.source.addListener(mxEvent.PAN,this.panHandler);this.refreshHandler=mxUtils.bind(this,(function(t){this.outline.setStylesheet(this.source.getStylesheet());this.outline.refresh()}));this.source.addListener(mxEvent.REFRESH,this.refreshHandler);this.bounds=new mxRectangle(0,0,0,0);this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH);this.selectionBorder.dialect=this.outline.dialect;if(this.forceVmlHandles){this.selectionBorder.isHtmlAllowed=function(){return false}}this.selectionBorder.init(this.outline.getView().getOverlayPane());var r=mxUtils.bind(this,(function(t){var e=mxEvent.getSource(t);var i=mxUtils.bind(this,(function(t){this.outline.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}));var n=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(e,null,i,n);this.outline.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}));mxEvent.addGestureListeners(e,null,i,n);this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}));mxEvent.addGestureListeners(this.selectionBorder.node,r);this.sizer=this.createSizer();if(this.forceVmlHandles){this.sizer.isHtmlAllowed=function(){return false}}this.sizer.init(this.outline.getView().getOverlayPane());if(this.enabled){this.sizer.node.style.cursor="nwse-resize"}mxEvent.addGestureListeners(this.sizer.node,r);this.selectionBorder.node.style.display=this.showViewport?"":"none";this.sizer.node.style.display=this.selectionBorder.node.style.display;this.selectionBorder.node.style.cursor="move";this.update(false)};mxOutline.prototype.isEnabled=function(){return this.enabled};mxOutline.prototype.setEnabled=function(t){this.enabled=t};mxOutline.prototype.setZoomEnabled=function(t){this.sizer.node.style.visibility=t?"visible":"hidden"};mxOutline.prototype.refresh=function(){this.update(true)};mxOutline.prototype.createSizer=function(){if(this.sizerImage!=null){var t=new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src);t.dialect=this.outline.dialect;return t}else{var t=new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR);t.dialect=this.outline.dialect;return t}};mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)};mxOutline.prototype.getOutlineOffset=function(t){return null};mxOutline.prototype.getSourceGraphBounds=function(){return this.source.getGraphBounds()};mxOutline.prototype.update=function(t){if(this.source!=null&&this.source.container!=null&&this.outline!=null&&this.outline.container!=null){var e=this.source.view.scale;var i=this.getSourceGraphBounds();var n=new mxRectangle(i.x/e+this.source.panDx,i.y/e+this.source.panDy,i.width/e,i.height/e);var r=new mxRectangle(0,0,this.source.container.clientWidth/e,this.source.container.clientHeight/e);var s=n.clone();s.add(r);var l=this.getSourceContainerSize();var a=Math.max(l.width/e,s.width);var o=Math.max(l.height/e,s.height);var h=Math.max(0,this.outline.container.clientWidth-this.border);var u=Math.max(0,this.outline.container.clientHeight-this.border);var d=Math.min(h/a,u/o);var p=isNaN(d)?this.minScale:Math.max(this.minScale,d);if(p>0){if(this.outline.getView().scale!=p){this.outline.getView().scale=p;t=true}var m=this.outline.getView();if(m.currentRoot!=this.source.getView().currentRoot){m.setCurrentRoot(this.source.getView().currentRoot)}var c=this.source.view.translate;var x=c.x+this.source.panDx;var f=c.y+this.source.panDy;var g=this.getOutlineOffset(p);if(g!=null){x+=g.x;f+=g.y}if(n.x<0){x=x-n.x}if(n.y<0){f=f-n.y}if(m.translate.x!=x||m.translate.y!=f){m.translate.x=x;m.translate.y=f;t=true}var v=m.translate;p=this.source.getView().scale;var y=p/m.scale;var C=1/m.scale;var E=this.source.container;this.bounds=new mxRectangle((v.x-c.x-this.source.panDx)/C,(v.y-c.y-this.source.panDy)/C,E.clientWidth/y,E.clientHeight/y);this.bounds.x+=this.source.container.scrollLeft*m.scale/p;this.bounds.y+=this.source.container.scrollTop*m.scale/p;var S=this.selectionBorder.bounds;if(S.x!=this.bounds.x||S.y!=this.bounds.y||S.width!=this.bounds.width||S.height!=this.bounds.height){this.selectionBorder.bounds=this.bounds;this.selectionBorder.redraw()}var S=this.sizer.bounds;var b=new mxRectangle(this.bounds.x+this.bounds.width-S.width/2,this.bounds.y+this.bounds.height-S.height/2,S.width,S.height);if(S.x!=b.x||S.y!=b.y||S.width!=b.width||S.height!=b.height){this.sizer.bounds=b;if(this.sizer.node.style.visibility!="hidden"){this.sizer.redraw()}}if(t){this.outline.view.revalidate()}}}};mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var i=!mxEvent.isMouseEvent(e.getEvent())?this.source.tolerance:0;var n=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(e.getGraphX()-i,e.getGraphY()-i,2*i,2*i):null;this.zoom=e.isSource(this.sizer)||n!=null&&mxUtils.intersects(shape.bounds,n);this.startX=e.getX();this.startY=e.getY();this.active=true;if(this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)){this.dx0=this.source.container.scrollLeft;this.dy0=this.source.container.scrollTop}else{this.dx0=0;this.dy0=0}}e.consume()};mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none";this.sizer.node.style.display=this.selectionBorder.node.style.display;var i=this.getTranslateForEvent(e);var n=i.x;var r=i.y;var s=null;if(!this.zoom){var l=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+n,this.bounds.y+r,this.bounds.width,this.bounds.height);this.selectionBorder.bounds=s;this.selectionBorder.redraw();n/=l;n*=this.source.getView().scale;r/=l;r*=this.source.getView().scale;this.source.panGraph(-n-this.dx0,-r-this.dy0)}else{var a=this.source.container;var o=a.clientWidth/a.clientHeight;r=n/o;s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+n),Math.max(1,this.bounds.height+r));this.selectionBorder.bounds=s;this.selectionBorder.redraw()}var h=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-h.width/2,s.y+s.height-h.height/2,h.width,h.height);if(this.sizer.node.style.visibility!="hidden"){this.sizer.redraw()}e.consume()}};mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)};mxOutline.prototype.mouseUp=function(t,e){if(this.active){var i=this.getTranslateForEvent(e);var n=i.x;var r=i.y;if(Math.abs(n)>0||Math.abs(r)>0){if(!this.zoom){if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0);n/=this.outline.getView().scale;r/=this.outline.getView().scale;var s=this.source.getView().translate;this.source.getView().setTranslate(s.x-n,s.y-r)}}else{var l=this.selectionBorder.bounds.width;var a=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,a-n*a/l),false)}this.update();e.consume()}this.index=null;this.active=false}};mxOutline.prototype.destroy=function(){if(this.source!=null){this.source.removeListener(this.panHandler);this.source.removeListener(this.refreshHandler);this.source.getModel().removeListener(this.updateHandler);this.source.getView().removeListener(this.updateHandler);mxEvent.removeListener(this.source.container,"scroll",this.updateHandler);this.source=null}if(this.outline!=null){this.outline.removeMouseListener(this);this.outline.destroy();this.outline=null}if(this.selectionBorder!=null){this.selectionBorder.destroy();this.selectionBorder=null}if(this.sizer!=null){this.sizer.destroy();this.sizer=null}};__mxOutput.mxOutline=typeof mxOutline!=="undefined"?mxOutline:undefined;function mxMultiplicity(t,e,i,n,r,s,l,a,o,h){this.source=t;this.type=e;this.attr=i;this.value=n;this.min=r!=null?r:0;this.max=s!=null?s:"n";this.validNeighbors=l;this.countError=mxResources.get(a)||a;this.typeError=mxResources.get(o)||o;this.validNeighborsAllowed=h!=null?h:true}mxMultiplicity.prototype.type=null;mxMultiplicity.prototype.attr=null;mxMultiplicity.prototype.value=null;mxMultiplicity.prototype.source=null;mxMultiplicity.prototype.min=null;mxMultiplicity.prototype.max=null;mxMultiplicity.prototype.validNeighbors=null;mxMultiplicity.prototype.validNeighborsAllowed=true;mxMultiplicity.prototype.countError=null;mxMultiplicity.prototype.typeError=null;mxMultiplicity.prototype.check=function(t,e,i,n,r,s){var l="";if(this.source&&this.checkTerminal(t,i,e)||!this.source&&this.checkTerminal(t,n,e)){if(this.countError!=null&&(this.source&&(this.max==0||r>=this.max)||!this.source&&(this.max==0||s>=this.max))){l+=this.countError+"\n"}if(this.validNeighbors!=null&&this.typeError!=null&&this.validNeighbors.length>0){var a=this.checkNeighbors(t,e,i,n);if(!a){l+=this.typeError+"\n"}}}return l.length>0?l:null};mxMultiplicity.prototype.checkNeighbors=function(t,e,i,n){var r=t.model.getValue(i);var s=t.model.getValue(n);var l=!this.validNeighborsAllowed;var a=this.validNeighbors;for(var o=0;o<a.length;o++){if(this.source&&this.checkType(t,s,a[o])){l=this.validNeighborsAllowed;break}else if(!this.source&&this.checkType(t,r,a[o])){l=this.validNeighborsAllowed;break}}return l};mxMultiplicity.prototype.checkTerminal=function(t,e,i){var n=t.model.getValue(e);return this.checkType(t,n,this.type,this.attr,this.value)};mxMultiplicity.prototype.checkType=function(t,e,i,n,r){if(e!=null){if(!isNaN(e.nodeType)){return mxUtils.isNode(e,i,n,r)}else{return e==i}}return false};__mxOutput.mxMultiplicity=typeof mxMultiplicity!=="undefined"?mxMultiplicity:undefined;function mxLayoutManager(t){this.undoHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.beforeUndo(e.getProperty("edit"))}}));this.moveHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.cellsMoved(e.getProperty("cells"),e.getProperty("event"))}}));this.resizeHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.cellsResized(e.getProperty("cells"),e.getProperty("bounds"),e.getProperty("previous"))}}));this.setGraph(t)}mxLayoutManager.prototype=new mxEventSource;mxLayoutManager.prototype.constructor=mxLayoutManager;mxLayoutManager.prototype.graph=null;mxLayoutManager.prototype.bubbling=true;mxLayoutManager.prototype.enabled=true;mxLayoutManager.prototype.undoHandler=null;mxLayoutManager.prototype.moveHandler=null;mxLayoutManager.prototype.resizeHandler=null;mxLayoutManager.prototype.isEnabled=function(){return this.enabled};mxLayoutManager.prototype.setEnabled=function(t){this.enabled=t};mxLayoutManager.prototype.isBubbling=function(){return this.bubbling};mxLayoutManager.prototype.setBubbling=function(t){this.bubbling=t};mxLayoutManager.prototype.getGraph=function(){return this.graph};mxLayoutManager.prototype.setGraph=function(t){if(this.graph!=null){var e=this.graph.getModel();e.removeListener(this.undoHandler);this.graph.removeListener(this.moveHandler);this.graph.removeListener(this.resizeHandler)}this.graph=t;if(this.graph!=null){var e=this.graph.getModel();e.addListener(mxEvent.BEFORE_UNDO,this.undoHandler);this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler);this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler)}};mxLayoutManager.prototype.hasLayout=function(t){return this.getLayout(t,mxEvent.LAYOUT_CELLS)};mxLayoutManager.prototype.getLayout=function(t,e){return null};mxLayoutManager.prototype.beforeUndo=function(t){this.executeLayoutForCells(this.getCellsForChanges(t.changes))};mxLayoutManager.prototype.cellsMoved=function(t,e){if(t!=null&&e!=null){var i=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e));var n=this.getGraph().getModel();for(var r=0;r<t.length;r++){var s=this.getLayout(n.getParent(t[r]),mxEvent.MOVE_CELLS);if(s!=null){s.moveCell(t[r],i.x,i.y)}}}};mxLayoutManager.prototype.cellsResized=function(t,e,i){if(t!=null&&e!=null){var n=this.getGraph().getModel();for(var r=0;r<t.length;r++){var s=this.getLayout(n.getParent(t[r]),mxEvent.RESIZE_CELLS);if(s!=null){s.resizeCell(t[r],e[r],i[r])}}}};mxLayoutManager.prototype.getCellsForChanges=function(t){var e=[];for(var i=0;i<t.length;i++){var n=t[i];if(n instanceof mxRootChange){return[]}else{e=e.concat(this.getCellsForChange(n))}}return e};mxLayoutManager.prototype.getCellsForChange=function(t){if(t instanceof mxChildChange){return this.addCellsWithLayout(t.child,this.addCellsWithLayout(t.previous))}else if(t instanceof mxTerminalChange||t instanceof mxGeometryChange){return this.addCellsWithLayout(t.cell)}else if(t instanceof mxVisibleChange||t instanceof mxStyleChange){return this.addCellsWithLayout(t.cell)}return[]};mxLayoutManager.prototype.addCellsWithLayout=function(t,e){return this.addDescendantsWithLayout(t,this.addAncestorsWithLayout(t,e))};mxLayoutManager.prototype.addAncestorsWithLayout=function(t,e){e=e!=null?e:[];if(t!=null){var i=this.hasLayout(t);if(i!=null){e.push(t)}if(this.isBubbling()){var n=this.getGraph().getModel();this.addAncestorsWithLayout(n.getParent(t),e)}}return e};mxLayoutManager.prototype.addDescendantsWithLayout=function(t,e){e=e!=null?e:[];if(t!=null&&this.hasLayout(t)){var i=this.getGraph().getModel();for(var n=0;n<i.getChildCount(t);n++){var r=i.getChildAt(t,n);if(this.hasLayout(r)){e.push(r);this.addDescendantsWithLayout(r,e)}}}return e};mxLayoutManager.prototype.executeLayoutForCells=function(t){var e=mxUtils.sortCells(t,false);this.layoutCells(e,true);this.layoutCells(e.reverse(),false)};mxLayoutManager.prototype.layoutCells=function(t,e){if(t.length>0){var i=this.getGraph().getModel();i.beginUpdate();try{var n=null;for(var r=0;r<t.length;r++){if(t[r]!=i.getRoot()&&t[r]!=n){this.executeLayout(t[r],e);n=t[r]}}this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",t))}finally{i.endUpdate()}}};mxLayoutManager.prototype.executeLayout=function(t,e){var i=this.getLayout(t,e?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);if(i!=null){i.execute(t)}};mxLayoutManager.prototype.destroy=function(){this.setGraph(null)};__mxOutput.mxLayoutManager=typeof mxLayoutManager!=="undefined"?mxLayoutManager:undefined;function mxSwimlaneManager(t,e,i,n){this.horizontal=e!=null?e:true;this.addEnabled=i!=null?i:true;this.resizeEnabled=n!=null?n:true;this.addHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()&&this.isAddEnabled()){this.cellsAdded(e.getProperty("cells"))}}));this.resizeHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()&&this.isResizeEnabled()){this.cellsResized(e.getProperty("cells"))}}));this.setGraph(t)}mxSwimlaneManager.prototype=new mxEventSource;mxSwimlaneManager.prototype.constructor=mxSwimlaneManager;mxSwimlaneManager.prototype.graph=null;mxSwimlaneManager.prototype.enabled=true;mxSwimlaneManager.prototype.horizontal=true;mxSwimlaneManager.prototype.addEnabled=true;mxSwimlaneManager.prototype.resizeEnabled=true;mxSwimlaneManager.prototype.addHandler=null;mxSwimlaneManager.prototype.resizeHandler=null;mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled};mxSwimlaneManager.prototype.setEnabled=function(t){this.enabled=t};mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal};mxSwimlaneManager.prototype.setHorizontal=function(t){this.horizontal=t};mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled};mxSwimlaneManager.prototype.setAddEnabled=function(t){this.addEnabled=t};mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled};mxSwimlaneManager.prototype.setResizeEnabled=function(t){this.resizeEnabled=t};mxSwimlaneManager.prototype.getGraph=function(){return this.graph};mxSwimlaneManager.prototype.setGraph=function(t){if(this.graph!=null){this.graph.removeListener(this.addHandler);this.graph.removeListener(this.resizeHandler)}this.graph=t;if(this.graph!=null){this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler);this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler)}};mxSwimlaneManager.prototype.isSwimlaneIgnored=function(t){return!this.getGraph().isSwimlane(t)};mxSwimlaneManager.prototype.isCellHorizontal=function(t){if(this.graph.isSwimlane(t)){var e=this.graph.getCellStyle(t);return mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)==1}return!this.isHorizontal()};mxSwimlaneManager.prototype.cellsAdded=function(t){if(t!=null){var e=this.getGraph().getModel();e.beginUpdate();try{for(var i=0;i<t.length;i++){if(!this.isSwimlaneIgnored(t[i])){this.swimlaneAdded(t[i])}}}finally{e.endUpdate()}}};mxSwimlaneManager.prototype.swimlaneAdded=function(t){var e=this.getGraph().getModel();var i=e.getParent(t);var n=e.getChildCount(i);var r=null;for(var s=0;s<n;s++){var l=e.getChildAt(i,s);if(l!=t&&!this.isSwimlaneIgnored(l)){r=e.getGeometry(l);if(r!=null){break}}}if(r!=null){var a=i!=null?this.isCellHorizontal(i):this.horizontal;this.resizeSwimlane(t,r.width,r.height,a)}};mxSwimlaneManager.prototype.cellsResized=function(t){if(t!=null){var e=this.getGraph().getModel();e.beginUpdate();try{for(var i=0;i<t.length;i++){if(!this.isSwimlaneIgnored(t[i])){var n=e.getGeometry(t[i]);if(n!=null){var r=new mxRectangle(0,0,n.width,n.height);var s=t[i];var l=s;while(l!=null){s=l;l=e.getParent(l);var a=this.graph.isSwimlane(l)?this.graph.getStartSize(l):new mxRectangle;r.width+=a.width;r.height+=a.height}var o=l!=null?this.isCellHorizontal(l):this.horizontal;this.resizeSwimlane(s,r.width,r.height,o)}}}}finally{e.endUpdate()}}};mxSwimlaneManager.prototype.resizeSwimlane=function(t,e,i,n){var r=this.getGraph().getModel();r.beginUpdate();try{var s=this.isCellHorizontal(t);if(!this.isSwimlaneIgnored(t)){var l=r.getGeometry(t);if(l!=null){if(n&&l.height!=i||!n&&l.width!=e){l=l.clone();if(n){l.height=i}else{l.width=e}r.setGeometry(t,l)}}}var a=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;e-=a.width;i-=a.height;var o=r.getChildCount(t);for(var h=0;h<o;h++){var u=r.getChildAt(t,h);this.resizeSwimlane(u,e,i,s)}}finally{r.endUpdate()}};mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)};__mxOutput.mxSwimlaneManager=typeof mxSwimlaneManager!=="undefined"?mxSwimlaneManager:undefined;function mxTemporaryCellStates(t,e,i,n,r){e=e!=null?e:1;this.view=t;this.oldValidateCellState=t.validateCellState;this.oldBounds=t.getGraphBounds();this.oldStates=t.getStates();this.oldScale=t.getScale();this.oldDoRedrawShape=t.graph.cellRenderer.doRedrawShape;var s=this;if(r!=null){t.graph.cellRenderer.doRedrawShape=function(e){var i=e.shape.paint;e.shape.paint=function(t){var n=r(e);if(n!=null){t.setLink(n)}i.apply(this,arguments);if(n!=null){t.setLink(null)}};s.oldDoRedrawShape.apply(t.graph.cellRenderer,arguments);e.shape.paint=i}}t.validateCellState=function(e,i){if(e==null||n==null||n(e)){return s.oldValidateCellState.apply(t,arguments)}return null};t.setStates(new mxDictionary);t.setScale(e);if(i!=null){t.resetValidationState();var l=null;for(var a=0;a<i.length;a++){var o=t.getBoundingBox(t.validateCellState(t.validateCell(i[a])));if(l==null){l=o}else{l.add(o)}}t.setGraphBounds(l||new mxRectangle)}}mxTemporaryCellStates.prototype.view=null;mxTemporaryCellStates.prototype.oldStates=null;mxTemporaryCellStates.prototype.oldBounds=null;mxTemporaryCellStates.prototype.oldScale=null;mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale);this.view.setStates(this.oldStates);this.view.setGraphBounds(this.oldBounds);this.view.validateCellState=this.oldValidateCellState;this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape};__mxOutput.mxTemporaryCellStates=typeof mxTemporaryCellStates!=="undefined"?mxTemporaryCellStates:undefined;function mxCellStatePreview(t){this.deltas=new mxDictionary;this.graph=t}mxCellStatePreview.prototype.graph=null;mxCellStatePreview.prototype.deltas=null;mxCellStatePreview.prototype.count=0;mxCellStatePreview.prototype.isEmpty=function(){return this.count==0};mxCellStatePreview.prototype.moveState=function(t,e,i,n,r){n=n!=null?n:true;r=r!=null?r:true;var s=this.deltas.get(t.cell);if(s==null){s={point:new mxPoint(e,i),state:t};this.deltas.put(t.cell,s);this.count++}else if(n){s.point.x+=e;s.point.y+=i}else{s.point.x=e;s.point.y=i}if(r){this.addEdges(t)}return s.point};mxCellStatePreview.prototype.show=function(t){this.deltas.visit(mxUtils.bind(this,(function(t,e){this.translateState(e.state,e.point.x,e.point.y)})));this.deltas.visit(mxUtils.bind(this,(function(e,i){this.revalidateState(i.state,i.point.x,i.point.y,t)})))};mxCellStatePreview.prototype.translateState=function(t,e,i){if(t!=null){var n=this.graph.getModel();if(n.isVertex(t.cell)){t.view.updateCellState(t);var r=n.getGeometry(t.cell);if((e!=0||i!=0)&&r!=null&&(!r.relative||this.deltas.get(t.cell)!=null)){t.x+=e;t.y+=i}}var s=n.getChildCount(t.cell);for(var l=0;l<s;l++){this.translateState(t.view.getState(n.getChildAt(t.cell,l)),e,i)}}};mxCellStatePreview.prototype.revalidateState=function(t,e,i,n){if(t!=null){var r=this.graph.getModel();if(r.isEdge(t.cell)){t.view.updateCellState(t)}var s=this.graph.getCellGeometry(t.cell);var l=t.view.getState(r.getParent(t.cell));if((e!=0||i!=0)&&s!=null&&s.relative&&r.isVertex(t.cell)&&(l==null||r.isVertex(l.cell)||this.deltas.get(t.cell)!=null)){t.x+=e;t.y+=i}this.graph.cellRenderer.redraw(t);if(n!=null){n(t)}var a=r.getChildCount(t.cell);for(var o=0;o<a;o++){this.revalidateState(this.graph.view.getState(r.getChildAt(t.cell,o)),e,i,n)}}};mxCellStatePreview.prototype.addEdges=function(t){var e=this.graph.getModel();var i=e.getEdgeCount(t.cell);for(var n=0;n<i;n++){var r=t.view.getState(e.getEdgeAt(t.cell,n));if(r!=null){this.moveState(r,0,0)}}};__mxOutput.mxCellStatePreview=typeof mxCellStatePreview!=="undefined"?mxCellStatePreview:undefined;function mxConnectionConstraint(t,e,i,n,r){this.point=t;this.perimeter=e!=null?e:true;this.name=i;this.dx=n?n:0;this.dy=r?r:0}mxConnectionConstraint.prototype.point=null;mxConnectionConstraint.prototype.perimeter=null;mxConnectionConstraint.prototype.name=null;mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=null;__mxOutput.mxConnectionConstraint=typeof mxConnectionConstraint!=="undefined"?mxConnectionConstraint:undefined;function mxGraphHandler(t){this.graph=t;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,(function(){if(!this.suspended){this.updatePreview();this.updateHint()}}));this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,(function(t,e){this.reset()}));this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,(function(t,e){if(this.refreshThread){window.clearTimeout(this.refreshThread)}this.refreshThread=window.setTimeout(mxUtils.bind(this,(function(){this.refreshThread=null;if(this.first!=null&&!this.suspended){var t=this.currentDx;var e=this.currentDy;this.currentDx=0;this.currentDy=0;this.updatePreview();this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);if(this.pBounds==null&&!this.livePreviewUsed){this.reset()}else{this.currentDx=t;this.currentDy=e;this.updatePreview();this.updateHint();if(this.livePreviewUsed){this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),false,true);this.updatePreview()}}}})),0)}));this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.addListener(mxEvent.REFRESH,this.refreshHandler);this.keyHandler=mxUtils.bind(this,(function(t){if(this.graph.container!=null&&this.graph.container.style.visibility!="hidden"&&this.first!=null&&!this.suspended){var e=this.graph.isCloneEvent(t)&&this.graph.isCellsCloneable()&&this.isCloneEnabled();if(e!=this.cloning){this.cloning=e;this.checkPreview();this.updatePreview()}}}));mxEvent.addListener(document,"keydown",this.keyHandler);mxEvent.addListener(document,"keyup",this.keyHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50;mxGraphHandler.prototype.enabled=true;mxGraphHandler.prototype.highlightEnabled=true;mxGraphHandler.prototype.cloneEnabled=true;mxGraphHandler.prototype.moveEnabled=true;mxGraphHandler.prototype.guidesEnabled=false;mxGraphHandler.prototype.handlesVisible=true;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=true;mxGraphHandler.prototype.selectEnabled=true;mxGraphHandler.prototype.removeCellsFromParent=true;mxGraphHandler.prototype.removeEmptyParents=false;mxGraphHandler.prototype.connectOnDrop=false;mxGraphHandler.prototype.scrollOnMove=true;mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=false;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=false;mxGraphHandler.prototype.rotationEnabled=true;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(t){this.enabled=t};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};mxGraphHandler.prototype.setCloneEnabled=function(t){this.cloneEnabled=t};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};mxGraphHandler.prototype.setMoveEnabled=function(t){this.moveEnabled=t};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(t){this.selectEnabled=t};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(t){this.removeCellsFromParent=t};mxGraphHandler.prototype.isPropagateSelectionCell=function(t,e,i){var n=this.graph.model.getParent(t);if(e){var r=this.graph.model.isEdge(t)?null:this.graph.getCellGeometry(t);return!this.graph.isSiblingSelected(t)&&(r!=null&&r.relative||!this.graph.isSwimlane(n))}else{return(!this.graph.isToggleEvent(i.getEvent())||(!this.graph.isSiblingSelected(t)&&!this.graph.isCellSelected(t)&&!this.graph.isSwimlane(n)||this.graph.isCellSelected(n)))&&(this.graph.isToggleEvent(i.getEvent())||!this.graph.isCellSelected(n))}};mxGraphHandler.prototype.getInitialCellForEvent=function(t){var e=t.getState();if((!this.graph.isToggleEvent(t.getEvent())||!mxEvent.isAltDown(t.getEvent()))&&e!=null&&!this.graph.isCellSelected(e.cell)){var i=this.graph.model;var n=this.graph.view.getState(i.getParent(e.cell));while(n!=null&&!this.graph.isCellSelected(n.cell)&&(i.isVertex(n.cell)||i.isEdge(n.cell))&&this.isPropagateSelectionCell(e.cell,true,t)){e=n;n=this.graph.view.getState(this.graph.getModel().getParent(e.cell))}}return e!=null?e.cell:null};mxGraphHandler.prototype.isDelayedSelection=function(t,e){if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent())){while(t!=null){if(this.graph.selectionCellsHandler.isHandled(t)){return this.graph.cellEditor.getEditingCell()!=t}t=this.graph.model.getParent(t)}}return this.graph.isToggleEvent(e.getEvent())&&!mxEvent.isAltDown(e.getEvent())};mxGraphHandler.prototype.selectDelayed=function(t){if(!this.graph.popupMenuHandler.isPopupTrigger(t)){var e=t.getCell();if(e==null){e=this.cell}this.selectCellForEvent(e,t)}};mxGraphHandler.prototype.selectCellForEvent=function(t,e){var i=this.graph.view.getState(t);if(i!=null){if(e.isSource(i.control)){this.graph.selectCellForEvent(t,e.getEvent())}else{if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent())){var n=this.graph.getModel();var r=n.getParent(t);while(this.graph.view.getState(r)!=null&&(n.isVertex(r)||n.isEdge(r))&&this.isPropagateSelectionCell(t,false,e)){t=r;r=n.getParent(t)}}this.graph.selectCellForEvent(t,e.getEvent())}}return t};mxGraphHandler.prototype.consumeMouseEvent=function(t,e){e.consume()};mxGraphHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&e.getState()!=null&&!mxEvent.isMultiTouchEvent(e.getEvent())){var i=this.getInitialCellForEvent(e);this.delayedSelection=this.isDelayedSelection(i,e);this.cell=null;if(this.isSelectEnabled()&&!this.delayedSelection){this.graph.selectCellForEvent(i,e.getEvent())}if(this.isMoveEnabled()){var n=this.graph.model;var r=n.getGeometry(i);if(this.graph.isCellMovable(i)&&(!n.isEdge(i)||this.graph.getSelectionCount()>1||r.points!=null&&r.points.length>0||n.getTerminal(i,true)==null||n.getTerminal(i,false)==null||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())){this.start(i,e.getX(),e.getY())}else if(this.delayedSelection){this.cell=i}this.cellWasClicked=true;this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}};mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent();var e=this.graph.getModel();var i=mxUtils.bind(this,(function(t){return this.graph.view.getState(t)!=null&&e.isVertex(t)&&e.getGeometry(t)!=null&&!e.getGeometry(t).relative}));return this.graph.view.getCellStates(e.filterDescendants(i,t))};mxGraphHandler.prototype.getCells=function(t){if(!this.delayedSelection&&this.graph.isCellMovable(t)){return[t]}else{return this.graph.getMovableCells(this.graph.getSelectionCells())}};mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(e!=null){e.width=Math.max(0,e.width-1);e.height=Math.max(0,e.height-1);if(e.width<this.minimumSize){var i=this.minimumSize-e.width;e.x-=i/2;e.width=this.minimumSize}else{e.x=Math.round(e.x);e.width=Math.ceil(e.width)}if(e.height<this.minimumSize){var n=this.minimumSize-e.height;e.y-=n/2;e.height=this.minimumSize}else{e.y=Math.round(e.y);e.height=Math.ceil(e.height)}}return e};mxGraphHandler.prototype.getBoundingBox=function(t){var e=null;if(t!=null&&t.length>0){var i=this.graph.getModel();for(var n=0;n<t.length;n++){if(i.isVertex(t[n])||i.isEdge(t[n])){var r=this.graph.view.getState(t[n]);if(r!=null){var s=r;if(i.isVertex(t[n])&&r.shape!=null&&r.shape.boundingBox!=null){s=r.shape.boundingBox}if(e==null){e=mxRectangle.fromRectangle(s)}else{e.add(s)}}}}}return e};mxGraphHandler.prototype.createPreviewShape=function(t){var e=new mxRectangleShape(t,null,this.previewColor);e.isDashed=true;if(this.htmlPreview){e.dialect=mxConstants.DIALECT_STRICTHTML;e.init(this.graph.container)}else{e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;e.init(this.graph.getView().getOverlayPane());e.pointerEvents=false;if(mxClient.IS_IOS){e.getSvgScreenOffset=function(){return 0}}}return e};mxGraphHandler.prototype.start=function(t,e,i,n){this.cell=t;this.first=mxUtils.convertPoint(this.graph.container,e,i);this.cells=n!=null?n:this.getCells(this.cell);this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);this.allCells=new mxDictionary;this.cloning=false;this.cellCount=0;for(var r=0;r<this.cells.length;r++){this.cellCount+=this.addStates(this.cells[r],this.allCells)}if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var s=this.graph.model.getParent(t);var l=this.graph.model.getChildCount(s)<2;var a=new mxDictionary;var o=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(var r=0;r<o.length;r++){var h=this.graph.view.getState(o[r]);if(h!=null&&!a.get(h)){a.put(h,true)}}this.guide.isStateIgnored=mxUtils.bind(this,(function(t){var e=this.graph.model.getParent(t.cell);return t.cell!=null&&(!this.cloning&&this.isCellMoving(t.cell)||t.cell!=(this.target||s)&&!l&&!a.get(t)&&(this.target==null||this.graph.model.getChildCount(this.target)>=2)&&e!=(this.target||s))}))}};mxGraphHandler.prototype.addStates=function(t,e){var i=this.graph.view.getState(t);var n=0;if(i!=null&&e.get(t)==null){e.put(t,i);n++;var r=this.graph.model.getChildCount(t);for(var s=0;s<r;s++){n+=this.addStates(this.graph.model.getChildAt(t,s),e)}}return n};mxGraphHandler.prototype.isCellMoving=function(t){return this.allCells.get(t)!=null};mxGraphHandler.prototype.useGuidesForEvent=function(t){return this.guide!=null?this.guide.isEnabledForEvent(t.getEvent())&&!this.graph.isConstrainedEvent(t.getEvent()):true};mxGraphHandler.prototype.snap=function(t){var e=this.scaleGrid?this.graph.view.scale:1;t.x=this.graph.snap(t.x/e)*e;t.y=this.graph.snap(t.y/e)*e;return t};mxGraphHandler.prototype.getDelta=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());return new mxPoint(e.x-this.first.x-this.graph.panDx,e.y-this.first.y-this.graph.panDy)};mxGraphHandler.prototype.updateHint=function(t){};mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(t){return Math.round(t*100)/100};mxGraphHandler.prototype.isValidDropTarget=function(t,e){return this.graph.model.getParent(this.cell)!=t};mxGraphHandler.prototype.checkPreview=function(){if(this.livePreviewActive&&this.cloning){this.resetLivePreview();this.livePreviewActive=false}else if(this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview){if(!this.cloning||!this.livePreviewActive){this.livePreviewActive=true;this.livePreviewUsed=true}}else if(!this.livePreviewUsed&&this.shape==null){this.shape=this.createPreviewShape(this.bounds)}};mxGraphHandler.prototype.mouseMove=function(t,e){var i=this.graph;if(!e.isConsumed()&&i.isMouseDown&&this.cell!=null&&this.first!=null&&this.bounds!=null&&!this.suspended){if(mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var n=this.getDelta(e);var r=i.tolerance;if(this.shape!=null||this.livePreviewActive||Math.abs(n.x)>r||Math.abs(n.y)>r){if(this.highlight==null){this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)}var s=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled();var l=i.isGridEnabledEvent(e.getEvent());var a=e.getCell();var o=true;var h=null;this.cloning=s;if(i.isDropEnabled()&&this.highlightEnabled){h=i.getDropTarget(this.cells,e.getEvent(),a,s)}var u=i.getView().getState(h);var d=false;if(u!=null&&(s||this.isValidDropTarget(h,e))){if(this.target!=h){this.target=h;this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)}d=true}else{this.target=null;if(this.connectOnDrop&&a!=null&&this.cells.length==1&&i.getModel().isVertex(a)&&i.isCellConnectable(a)){u=i.getView().getState(a);if(u!=null){var p=i.getEdgeValidationError(null,this.cell,a);var m=p==null?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(m);d=true}}}if(u!=null&&d){this.highlight.highlight(u)}else{this.highlight.hide()}if(this.guide!=null&&this.useGuidesForEvent(e)){n=this.guide.move(this.bounds,n,l,s);o=false}else{n=this.graph.snapDelta(n,this.bounds,!l,false,false)}if(this.guide!=null&&o){this.guide.hide()}if(i.isConstrainedEvent(e.getEvent())){if(Math.abs(n.x)>Math.abs(n.y)){n.y=0}else{n.x=0}}this.checkPreview();if(this.currentDx!=n.x||this.currentDy!=n.y){this.currentDx=n.x;this.currentDy=n.y;this.updatePreview()}}this.updateHint(e);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e);mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!i.isMouseDown){var c=i.getCursorForMouseEvent(e);if(c==null&&i.isEnabled()&&i.isCellMovable(e.getCell())){if(i.getModel().isEdge(e.getCell())){c=mxConstants.CURSOR_MOVABLE_EDGE}else{c=mxConstants.CURSOR_MOVABLE_VERTEX}}if(c!=null&&e.sourceState!=null){e.sourceState.setCursor(c)}}};mxGraphHandler.prototype.updatePreview=function(t){if(this.livePreviewUsed&&!t){if(this.cells!=null){this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),false);this.updateLivePreview(this.currentDx,this.currentDy)}}else{this.updatePreviewShape()}};mxGraphHandler.prototype.updatePreviewShape=function(){if(this.shape!=null&&this.pBounds!=null){this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height);this.shape.redraw()}};mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var i=[];if(this.allCells!=null){this.allCells.visit(mxUtils.bind(this,(function(n,r){var s=this.graph.view.getState(r.cell);if(s!=r){r.destroy();if(s!=null){this.allCells.put(r.cell,s)}else{this.allCells.remove(r.cell)}r=s}if(r!=null){var l=r.clone();i.push([r,l]);if(r.shape!=null){if(r.shape.originalPointerEvents==null){r.shape.originalPointerEvents=r.shape.pointerEvents}r.shape.pointerEvents=false;if(r.text!=null){if(r.text.originalPointerEvents==null){r.text.originalPointerEvents=r.text.pointerEvents}r.text.pointerEvents=false}}if(this.graph.model.isVertex(r.cell)){r.x+=t;r.y+=e;if(!this.cloning){r.view.graph.cellRenderer.redraw(r,true);r.view.invalidate(r.cell);r.invalid=false;if(r.control!=null&&r.control.node!=null){r.control.node.style.visibility="hidden"}}else if(r.text!=null){r.text.updateBoundingBox();if(r.text.boundingBox!=null){r.text.boundingBox.x+=t;r.text.boundingBox.y+=e}if(r.text.unrotatedBoundingBox!=null){r.text.unrotatedBoundingBox.x+=t;r.text.unrotatedBoundingBox.y+=e}}}}})))}if(i.length==0){this.reset()}else{var n=this.graph.view.scale;for(var r=0;r<i.length;r++){var s=i[r][0];if(this.graph.model.isEdge(s.cell)){var l=this.graph.getCellGeometry(s.cell);var a=[];if(l!=null&&l.points!=null){for(var o=0;o<l.points.length;o++){if(l.points[o]!=null){a.push(new mxPoint(l.points[o].x+t/n,l.points[o].y+e/n))}}}var h=s.visibleSourceState;var u=s.visibleTargetState;var d=i[r][1].absolutePoints;if(h==null||!this.isCellMoving(h.cell)){var p=d[0];s.setAbsoluteTerminalPoint(new mxPoint(p.x+t,p.y+e),true);h=null}else{s.view.updateFixedTerminalPoint(s,h,true,this.graph.getConnectionConstraint(s,h,true))}if(u==null||!this.isCellMoving(u.cell)){var m=d[d.length-1];s.setAbsoluteTerminalPoint(new mxPoint(m.x+t,m.y+e),false);u=null}else{s.view.updateFixedTerminalPoint(s,u,false,this.graph.getConnectionConstraint(s,u,false))}s.view.updatePoints(s,a,h,u);s.view.updateFloatingTerminalPoints(s,h,u);s.view.updateEdgeLabelOffset(s);s.invalid=false;if(!this.cloning){s.view.graph.cellRenderer.redraw(s,true)}}}this.graph.view.validate();this.redrawHandles(i);this.resetPreviewStates(i)}}};mxGraphHandler.prototype.redrawHandles=function(t){for(var e=0;e<t.length;e++){var i=this.graph.selectionCellsHandler.getHandler(t[e][0].cell);if(i!=null){i.redraw(true)}}};mxGraphHandler.prototype.resetPreviewStates=function(t){for(var e=0;e<t.length;e++){t[e][0].setState(t[e][1])}};mxGraphHandler.prototype.suspend=function(){if(!this.suspended){if(this.livePreviewUsed){this.updateLivePreview(0,0)}if(this.shape!=null){this.shape.node.style.visibility="hidden"}if(this.guide!=null){this.guide.setVisible(false)}this.suspended=true}};mxGraphHandler.prototype.resume=function(){if(this.suspended){this.suspended=null;if(this.livePreviewUsed){this.livePreviewActive=true}if(this.shape!=null){this.shape.node.style.visibility="visible"}if(this.guide!=null){this.guide.setVisible(true)}}};mxGraphHandler.prototype.resetLivePreview=function(){if(this.allCells!=null){this.allCells.visit(mxUtils.bind(this,(function(t,e){if(e.shape!=null&&e.shape.originalPointerEvents!=null){e.shape.pointerEvents=e.shape.originalPointerEvents;e.shape.originalPointerEvents=null;e.shape.bounds=null;if(e.text!=null){e.text.pointerEvents=e.text.originalPointerEvents;e.text.originalPointerEvents=null}}if(e.control!=null&&e.control.node!=null&&e.control.node.style.visibility=="hidden"){e.control.node.style.visibility=""}if(!this.cloning){if(e.text!=null){e.text.updateBoundingBox()}}e.view.invalidate(e.cell)})));this.graph.view.validate()}};mxGraphHandler.prototype.setHandlesVisibleForCells=function(t,e,i){if(i||this.handlesVisible!=e){this.handlesVisible=e;for(var n=0;n<t.length;n++){var r=this.graph.selectionCellsHandler.getHandler(t[n]);if(r!=null){r.setHandlesVisible(e);if(e){r.redraw()}}}}};mxGraphHandler.prototype.setHighlightColor=function(t){if(this.highlight!=null){this.highlight.setHighlightColor(t)}};mxGraphHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()){if(this.livePreviewUsed){this.resetLivePreview()}if(this.cell!=null&&this.first!=null&&(this.shape!=null||this.livePreviewUsed)&&this.currentDx!=null&&this.currentDy!=null){var i=this.graph;var n=e.getCell();if(this.connectOnDrop&&this.target==null&&n!=null&&i.getModel().isVertex(n)&&i.isCellConnectable(n)&&i.isEdgeValid(null,this.cell,n)){i.connectionHandler.connect(this.cell,n,e.getEvent())}else{var r=i.isCloneEvent(e.getEvent())&&i.isCellsCloneable()&&this.isCloneEnabled();var s=i.getView().scale;var l=this.roundLength(this.currentDx/s);var a=this.roundLength(this.currentDy/s);var o=this.target;if(i.isSplitEnabled()&&i.isSplitTarget(o,this.cells,e.getEvent())){i.splitEdge(o,this.cells,null,l,a,e.getGraphX(),e.getGraphY())}else{this.moveCells(this.cells,l,a,r,this.target,e.getEvent())}}}else if(this.isSelectEnabled()&&this.delayedSelection&&this.cell!=null){this.selectDelayed(e)}}if(this.cellWasClicked){this.consumeMouseEvent(mxEvent.MOUSE_UP,e)}this.reset()};mxGraphHandler.prototype.reset=function(){if(this.livePreviewUsed){this.resetLivePreview();this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),true)}this.destroyShapes();this.removeHint();this.delayedSelection=false;this.livePreviewActive=null;this.livePreviewUsed=null;this.cellWasClicked=false;this.suspended=null;this.currentDx=null;this.currentDy=null;this.cellCount=null;this.cloning=false;this.allCells=null;this.pBounds=null;this.guides=null;this.target=null;this.first=null;this.cells=null;this.cell=null};mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(t,e,i){if(this.graph.getModel().isVertex(t)){var n=this.graph.getView().getState(t);if(n!=null){var r=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(i),mxEvent.getClientY(i));var s=mxUtils.toRadians(mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION)||0);if(s!=0){var l=Math.cos(-s);var a=Math.sin(-s);var o=new mxPoint(n.getCenterX(),n.getCenterY());r=mxUtils.getRotatedPoint(r,l,a,o)}return!mxUtils.contains(n,r.x,r.y)}}return false};mxGraphHandler.prototype.moveCells=function(t,e,i,n,r,s){if(n){t=this.graph.getCloneableCells(t)}var l=this.graph.getModel().getParent(this.cell);if(r==null&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(l,t,s)){r=this.graph.getDefaultParent()}n=n&&!this.graph.isCellLocked(r||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{var a=[];if(!n&&r!=null&&this.removeEmptyParents){var o=new mxDictionary;for(var h=0;h<t.length;h++){o.put(t[h],true)}for(var h=0;h<t.length;h++){var u=this.graph.model.getParent(t[h]);if(u!=null&&!o.get(u)){o.put(u,true);a.push(u)}}}t=this.graph.moveCells(t,e,i,n,r,s);var d=[];for(var h=0;h<a.length;h++){if(this.shouldRemoveParent(a[h])){d.push(a[h])}}this.graph.removeCells(d,false)}finally{this.graph.getModel().endUpdate()}if(n){this.graph.setSelectionCells(t)}if(this.isSelectEnabled()&&this.scrollOnMove){this.graph.scrollCellToVisible(t[0])}};mxGraphHandler.prototype.shouldRemoveParent=function(t){var e=this.graph.view.getState(t);return e!=null&&(this.graph.model.isEdge(e.cell)||this.graph.model.isVertex(e.cell))&&this.graph.isCellDeletable(e.cell)&&this.graph.model.getChildCount(e.cell)==0&&this.graph.isTransparentState(e)};mxGraphHandler.prototype.destroyShapes=function(){if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.guide!=null){this.guide.destroy();this.guide=null}if(this.highlight!=null){this.highlight.destroy();this.highlight=null}};mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);if(this.escapeHandler!=null){this.graph.removeListener(this.escapeHandler);this.escapeHandler=null}if(this.refreshHandler!=null){this.graph.getModel().removeListener(this.refreshHandler);this.graph.removeListener(this.refreshHandler);this.refreshHandler=null}mxEvent.removeListener(document,"keydown",this.keyHandler);mxEvent.removeListener(document,"keyup",this.keyHandler);this.destroyShapes();this.removeHint()};__mxOutput.mxGraphHandler=typeof mxGraphHandler!=="undefined"?mxGraphHandler:undefined;function mxPanningHandler(t){if(t!=null){this.graph=t;this.graph.addMouseListener(this);this.forcePanningHandler=mxUtils.bind(this,(function(t,e){var i=e.getProperty("eventName");var n=e.getProperty("event");if(i==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(n)){this.start(n);this.active=true;this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",n));n.consume()}}));this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler);this.gestureHandler=mxUtils.bind(this,(function(t,e){if(this.isPinchEnabled()){var i=e.getProperty("event");if(!mxEvent.isConsumed(i)&&i.type=="gesturestart"){this.initialScale=this.graph.view.scale;if(!this.active&&this.mouseDownEvent!=null){this.start(this.mouseDownEvent);this.mouseDownEvent=null}}else if(i.type=="gestureend"&&this.initialScale!=null){this.initialScale=null}if(this.initialScale!=null){this.zoomGraph(i)}}}));this.graph.addListener(mxEvent.GESTURE,this.gestureHandler);this.mouseUpListener=mxUtils.bind(this,(function(){if(this.active){this.reset()}}));mxEvent.addListener(document,"mouseup",this.mouseUpListener)}}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=false;mxPanningHandler.prototype.usePopupTrigger=true;mxPanningHandler.prototype.ignoreCell=false;mxPanningHandler.prototype.previewEnabled=true;mxPanningHandler.prototype.useGrid=false;mxPanningHandler.prototype.panningEnabled=true;mxPanningHandler.prototype.pinchEnabled=true;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||this.initialScale!=null};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled};mxPanningHandler.prototype.setPanningEnabled=function(t){this.panningEnabled=t};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(t){this.pinchEnabled=t};mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return this.useLeftButtonForPanning&&t.getState()==null&&mxEvent.isLeftMouseButton(e)||mxEvent.isControlDown(e)&&mxEvent.isShiftDown(e)||this.usePopupTrigger&&mxEvent.isPopupTrigger(e)};mxPanningHandler.prototype.isForcePanningEvent=function(t){return this.ignoreCell||mxEvent.isMultiTouchEvent(t.getEvent())};mxPanningHandler.prototype.mouseDown=function(t,e){this.mouseDownEvent=e;if(!e.isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(e)){this.start(e);this.consumePanningTrigger(e)}};mxPanningHandler.prototype.start=function(t){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=t.getX();this.startY=t.getY();this.dx=null;this.dy=null;this.panningTrigger=true};mxPanningHandler.prototype.consumePanningTrigger=function(t){t.consume()};mxPanningHandler.prototype.mouseMove=function(t,e){this.dx=e.getX()-this.startX;this.dy=e.getY()-this.startY;if(this.active){if(this.previewEnabled){if(this.useGrid){this.dx=this.graph.snap(this.dx);this.dy=this.graph.snap(this.dy)}this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)}this.fireEvent(new mxEventObject(mxEvent.PAN,"event",e))}else if(this.panningTrigger){var i=this.active;this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance;if(!i&&this.active){this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}}if(this.active||this.panningTrigger){e.consume()}};mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(this.dx!=null&&this.dy!=null){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var i=this.graph.getView().scale;var n=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(n.x+this.dx/i,n.y+this.dy/i)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()};mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;if(this.minScale!=null){e=Math.max(this.minScale,e)}if(this.maxScale!=null){e=Math.min(this.maxScale,e)}if(this.graph.view.scale!=e){this.graph.zoomTo(e);mxEvent.consume(t)}};mxPanningHandler.prototype.reset=function(){this.panningTrigger=false;this.mouseDownEvent=null;this.active=false;this.dx=null;this.dy=null};mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)};mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.forcePanningHandler);this.graph.removeListener(this.gestureHandler);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)};__mxOutput.mxPanningHandler=typeof mxPanningHandler!=="undefined"?mxPanningHandler:undefined;function mxPopupMenuHandler(t,e){if(t!=null){this.graph=t;this.factoryMethod=e;this.graph.addMouseListener(this);this.gestureHandler=mxUtils.bind(this,(function(t,e){this.inTolerance=false}));this.graph.addListener(mxEvent.GESTURE,this.gestureHandler);this.init()}}mxPopupMenuHandler.prototype=new mxPopupMenu;mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler;mxPopupMenuHandler.prototype.graph=null;mxPopupMenuHandler.prototype.selectOnPopup=true;mxPopupMenuHandler.prototype.clearSelectionOnBackground=true;mxPopupMenuHandler.prototype.triggerX=null;mxPopupMenuHandler.prototype.triggerY=null;mxPopupMenuHandler.prototype.screenX=null;mxPopupMenuHandler.prototype.screenY=null;mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,(function(t){this.graph.tooltipHandler.hide()})))};mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup};mxPopupMenuHandler.prototype.mouseDown=function(t,e){if(this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())){this.hideMenu();this.triggerX=e.getGraphX();this.triggerY=e.getGraphY();this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX;this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY;this.popupTrigger=this.isPopupTrigger(e);this.inTolerance=true}};mxPopupMenuHandler.prototype.mouseMove=function(t,e){if(this.inTolerance&&this.screenX!=null&&this.screenY!=null){if(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance){this.inTolerance=false}}};mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&this.triggerX!=null&&this.triggerY!=null){var i=this.getCellForPopupEvent(e);if(this.graph.isEnabled()&&this.isSelectOnPopup(e)&&i!=null&&!this.graph.isCellSelected(i)){this.graph.setSelectionCell(i)}else if(this.clearSelectionOnBackground&&i==null){this.graph.clearSelection()}this.graph.tooltipHandler.hide();var n=mxUtils.getScrollOrigin();this.popup(e.getX()+n.x+1,e.getY()+n.y+1,i,e.getEvent());e.consume()}this.popupTrigger=false;this.inTolerance=false};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()};mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.gestureHandler);mxPopupMenu.prototype.destroy.apply(this)};__mxOutput.mxPopupMenuHandler=typeof mxPopupMenuHandler!=="undefined"?mxPopupMenuHandler:undefined;function mxCellMarker(t,e,i,n){mxEventSource.call(this);if(t!=null){this.graph=t;this.validColor=e!=null?e:mxConstants.DEFAULT_VALID_COLOR;this.invalidColor=i!=null?i:mxConstants.DEFAULT_INVALID_COLOR;this.hotspot=n!=null?n:mxConstants.DEFAULT_HOTSPOT;this.highlight=new mxCellHighlight(t)}}mxUtils.extend(mxCellMarker,mxEventSource);mxCellMarker.prototype.graph=null;mxCellMarker.prototype.enabled=true;mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT;mxCellMarker.prototype.hotspotEnabled=false;mxCellMarker.prototype.validColor=null;mxCellMarker.prototype.invalidColor=null;mxCellMarker.prototype.currentColor=null;mxCellMarker.prototype.validState=null;mxCellMarker.prototype.markedState=null;mxCellMarker.prototype.setEnabled=function(t){this.enabled=t};mxCellMarker.prototype.isEnabled=function(){return this.enabled};mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t};mxCellMarker.prototype.getHotspot=function(){return this.hotspot};mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t};mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled};mxCellMarker.prototype.hasValidState=function(){return this.validState!=null};mxCellMarker.prototype.getValidState=function(){return this.validState};mxCellMarker.prototype.getMarkedState=function(){return this.markedState};mxCellMarker.prototype.reset=function(){this.validState=null;if(this.markedState!=null){this.markedState=null;this.unmark()}};mxCellMarker.prototype.process=function(t){var e=null;if(this.isEnabled()){e=this.getState(t);this.setCurrentState(e,t)}return e};mxCellMarker.prototype.setCurrentState=function(t,e,i){var n=t!=null?this.isValidState(t):false;i=i!=null?i:this.getMarkerColor(e.getEvent(),t,n);if(n){this.validState=t}else{this.validState=null}if(t!=this.markedState||i!=this.currentColor){this.currentColor=i;if(t!=null&&this.currentColor!=null){this.markedState=t;this.mark()}else if(this.markedState!=null){this.markedState=null;this.unmark()}}};mxCellMarker.prototype.markCell=function(t,e){var i=this.graph.getView().getState(t);if(i!=null){this.currentColor=e!=null?e:this.validColor;this.markedState=i;this.mark()}};mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor);this.highlight.highlight(this.markedState);this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))};mxCellMarker.prototype.unmark=function(){this.mark()};mxCellMarker.prototype.isValidState=function(t){return true};mxCellMarker.prototype.getMarkerColor=function(t,e,i){return i?this.validColor:this.invalidColor};mxCellMarker.prototype.getState=function(t){var e=this.graph.getView();var i=this.getCell(t);var n=this.getStateToMark(e.getState(i));return n!=null&&this.intersects(n,t)?n:null};mxCellMarker.prototype.getCell=function(t){return t.getCell()};mxCellMarker.prototype.getStateToMark=function(t){return t};mxCellMarker.prototype.intersects=function(t,e){if(this.hotspotEnabled){return mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)}return true};mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getModel().removeListener(this.resetHandler);this.highlight.destroy()};__mxOutput.mxCellMarker=typeof mxCellMarker!=="undefined"?mxCellMarker:undefined;function mxSelectionCellsHandler(t){mxEventSource.call(this);this.graph=t;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.refreshHandler=mxUtils.bind(this,(function(t,e){if(this.isEnabled()){this.refresh()}}));this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource);mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=true;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100;mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t};mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)};mxSelectionCellsHandler.prototype.isHandled=function(t){return this.getHandler(t)!=null};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit((function(t,e){e.reset.apply(e)}))};mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()};mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;var e=mxUtils.sortCells(this.getHandledSelectionCells(),false);for(var i=0;i<e.length;i++){var n=this.graph.view.getState(e[i]);if(n!=null){var r=t.remove(e[i]);if(r!=null){if(r.state!=n){r.destroy();r=null}else if(!this.isHandlerActive(r)){if(r.refresh!=null){r.refresh()}r.redraw()}}if(r!=null){this.handlers.put(e[i],r)}}}t.visit(mxUtils.bind(this,(function(t,e){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",e.state));e.destroy()})));for(var i=0;i<e.length;i++){var n=this.graph.view.getState(e[i]);if(n!=null){var r=this.handlers.get(e[i]);if(r==null){r=this.graph.createHandler(n);this.fireEvent(new mxEventObject(mxEvent.ADD,"state",n));this.handlers.put(e[i],r)}else{r.updateParentHighlight()}}}};mxSelectionCellsHandler.prototype.isHandlerActive=function(t){return t.index!=null};mxSelectionCellsHandler.prototype.updateHandler=function(t){var e=this.handlers.remove(t.cell);if(e!=null){var i=e.index;var n=e.startX;var r=e.startY;e.destroy();e=this.graph.createHandler(t);if(e!=null){this.handlers.put(t.cell,e);if(i!=null&&n!=null&&r!=null){e.start(n,r,i)}}}};mxSelectionCellsHandler.prototype.mouseDown=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var i=[t,e];this.handlers.visit((function(t,e){e.mouseDown.apply(e,i)}))}};mxSelectionCellsHandler.prototype.mouseMove=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var i=[t,e];this.handlers.visit((function(t,e){e.mouseMove.apply(e,i)}))}};mxSelectionCellsHandler.prototype.mouseUp=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var i=[t,e];this.handlers.visit((function(t,e){e.mouseUp.apply(e,i)}))}};mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);if(this.refreshHandler!=null){this.graph.getSelectionModel().removeListener(this.refreshHandler);this.graph.getModel().removeListener(this.refreshHandler);this.graph.getView().removeListener(this.refreshHandler);this.refreshHandler=null}};__mxOutput.mxSelectionCellsHandler=typeof mxSelectionCellsHandler!=="undefined"?mxSelectionCellsHandler:undefined;function mxConnectionHandler(t,e){mxEventSource.call(this);if(t!=null){this.graph=t;this.factoryMethod=e;this.init();this.escapeHandler=mxUtils.bind(this,(function(t,e){this.reset()}));this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}}mxUtils.extend(mxConnectionHandler,mxEventSource);mxConnectionHandler.prototype.graph=null;mxConnectionHandler.prototype.factoryMethod=true;mxConnectionHandler.prototype.moveIconFront=false;mxConnectionHandler.prototype.moveIconBack=false;mxConnectionHandler.prototype.connectImage=null;mxConnectionHandler.prototype.targetConnectImage=false;mxConnectionHandler.prototype.enabled=true;mxConnectionHandler.prototype.select=true;mxConnectionHandler.prototype.createTarget=false;mxConnectionHandler.prototype.marker=null;mxConnectionHandler.prototype.constraintHandler=null;mxConnectionHandler.prototype.error=null;mxConnectionHandler.prototype.waypointsEnabled=false;mxConnectionHandler.prototype.ignoreMouseDown=false;mxConnectionHandler.prototype.first=null;mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET);mxConnectionHandler.prototype.edgeState=null;mxConnectionHandler.prototype.changeHandler=null;mxConnectionHandler.prototype.drillHandler=null;mxConnectionHandler.prototype.mouseDownCounter=0;mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML;mxConnectionHandler.prototype.outlineConnect=false;mxConnectionHandler.prototype.livePreview=false;mxConnectionHandler.prototype.cursor=null;mxConnectionHandler.prototype.insertBeforeSource=false;mxConnectionHandler.prototype.isEnabled=function(){return this.enabled};mxConnectionHandler.prototype.setEnabled=function(t){this.enabled=t};mxConnectionHandler.prototype.isInsertBefore=function(t,e,i,n,r){return this.insertBeforeSource&&e!=i};mxConnectionHandler.prototype.isCreateTarget=function(t){return this.createTarget};mxConnectionHandler.prototype.setCreateTarget=function(t){this.createTarget=t};mxConnectionHandler.prototype.createShape=function(){var t=this.livePreview&&this.edgeState!=null?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;t.scale=this.graph.view.scale;t.pointerEvents=false;t.isDashed=true;t.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(t.node,this.graph,null);return t};mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this);this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.changeHandler=mxUtils.bind(this,(function(t){if(this.iconState!=null){this.iconState=this.graph.getView().getState(this.iconState.cell)}if(this.iconState!=null){this.redrawIcons(this.icons,this.iconState);this.constraintHandler.reset()}else if(this.previous!=null&&this.graph.view.getState(this.previous.cell)==null){this.reset()}}));this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler);this.drillHandler=mxUtils.bind(this,(function(t){this.reset()}));this.graph.addListener(mxEvent.START_EDITING,this.drillHandler);this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler);this.graph.getView().addListener(mxEvent.UP,this.drillHandler)};mxConnectionHandler.prototype.isConnectableCell=function(t){return true};mxConnectionHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph);t.hotspotEnabled=true;t.getCell=mxUtils.bind(this,(function(e){var i=mxCellMarker.prototype.getCell.apply(t,arguments);this.error=null;if(i==null&&this.currentPoint!=null){i=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y)}if(i!=null&&!this.graph.isCellConnectable(i)){var n=this.graph.getModel().getParent(i);if(this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)){i=n}}if(this.graph.isSwimlane(i)&&this.currentPoint!=null&&this.graph.hitsSwimlaneContent(i,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(i)){i=null}if(i!=null){if(this.isConnecting()){if(this.previous!=null){this.error=this.validateConnection(this.previous.cell,i);if(this.error!=null&&this.error.length==0){i=null;if(this.isCreateTarget(e.getEvent())){this.error=null}}}}else if(!this.isValidSource(i,e)){i=null}}else if(this.isConnecting()&&!this.isCreateTarget(e.getEvent())&&!this.graph.allowDanglingEdges){this.error=""}return i}));t.isValidState=mxUtils.bind(this,(function(e){if(this.isConnecting()){return this.error==null}else{return mxCellMarker.prototype.isValidState.apply(t,arguments)}}));t.getMarkerColor=mxUtils.bind(this,(function(e,i,n){return this.connectImage==null||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(t,arguments):null}));t.intersects=mxUtils.bind(this,(function(e,i){if(this.connectImage!=null||this.isConnecting()){return true}return mxCellMarker.prototype.intersects.apply(t,arguments)}));return t};mxConnectionHandler.prototype.start=function(t,e,i,n){this.previous=t;this.first=new mxPoint(e,i);this.edgeState=n!=null?n:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=t;this.marker.mark();this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))};mxConnectionHandler.prototype.isConnecting=function(){return this.first!=null&&this.shape!=null};mxConnectionHandler.prototype.isValidSource=function(t,e){return this.graph.isValidSource(t)};mxConnectionHandler.prototype.isValidTarget=function(t){return true};mxConnectionHandler.prototype.validateConnection=function(t,e){if(!this.isValidTarget(e)){return""}return this.graph.getEdgeValidationError(null,t,e)};mxConnectionHandler.prototype.getConnectImage=function(t){return this.connectImage};mxConnectionHandler.prototype.isMoveIconToFrontForState=function(t){if(t.text!=null&&t.text.node.parentNode==this.graph.container){return true}return this.moveIconFront};mxConnectionHandler.prototype.createIcons=function(t){var e=this.getConnectImage(t);if(e!=null&&t!=null){this.iconState=t;var i=[];var n=new mxRectangle(0,0,e.width,e.height);var r=new mxImageShape(n,e.src,null,null,0);r.preserveImageAspect=false;if(this.isMoveIconToFrontForState(t)){r.dialect=mxConstants.DIALECT_STRICTHTML;r.init(this.graph.container)}else{r.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML;r.init(this.graph.getView().getOverlayPane());if(this.moveIconBack&&r.node.previousSibling!=null){r.node.parentNode.insertBefore(r.node,r.node.parentNode.firstChild)}}r.node.style.cursor=mxConstants.CURSOR_CONNECT;var s=mxUtils.bind(this,(function(){return this.currentState!=null?this.currentState:t}));var l=mxUtils.bind(this,(function(t){if(!mxEvent.isConsumed(t)){this.icon=r;this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,s()))}}));mxEvent.redirectMouseEvents(r.node,this.graph,s,l);i.push(r);this.redrawIcons(i,this.iconState);return i}return null};mxConnectionHandler.prototype.redrawIcons=function(t,e){if(t!=null&&t[0]!=null&&e!=null){var i=this.getIconPosition(t[0],e);t[0].bounds.x=i.x;t[0].bounds.y=i.y;t[0].redraw()}};mxConnectionHandler.prototype.getIconPosition=function(t,e){var i=this.graph.getView().scale;var n=e.getCenterX();var r=e.getCenterY();if(this.graph.isSwimlane(e.cell)){var s=this.graph.getStartSize(e.cell);n=s.width!=0?e.x+s.width*i/2:n;r=s.height!=0?e.y+s.height*i/2:r;var l=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0);if(l!=0){var a=Math.cos(l);var o=Math.sin(l);var h=new mxPoint(e.getCenterX(),e.getCenterY());var u=mxUtils.getRotatedPoint(new mxPoint(n,r),a,o,h);n=u.x;r=u.y}}return new mxPoint(n-t.bounds.width/2,r-t.bounds.height/2)};mxConnectionHandler.prototype.destroyIcons=function(){if(this.icons!=null){for(var t=0;t<this.icons.length;t++){this.icons[t].destroy()}this.icons=null;this.icon=null;this.selectedIcon=null;this.iconState=null}};mxConnectionHandler.prototype.isStartEvent=function(t){return this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentConstraint!=null||this.previous!=null&&this.error==null&&(this.icons==null||this.icons!=null&&this.icon!=null)};mxConnectionHandler.prototype.mouseDown=function(t,e){this.mouseDownCounter++;if(this.isEnabled()&&this.graph.isEnabled()&&!e.isConsumed()&&!this.isConnecting()&&this.isStartEvent(e)){if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null){this.sourceConstraint=this.constraintHandler.currentConstraint;this.previous=this.constraintHandler.currentFocus;this.first=this.constraintHandler.currentPoint.clone()}else{this.first=new mxPoint(e.getGraphX(),e.getGraphY())}this.edgeState=this.createEdgeState(e);this.mouseDownCounter=1;if(this.waypointsEnabled&&this.shape==null){this.waypoints=null;this.shape=this.createShape();if(this.edgeState!=null){this.shape.apply(this.edgeState)}}if(this.previous==null&&this.edgeState!=null){var i=this.graph.getPointForEvent(e.getEvent());this.edgeState.cell.geometry.setTerminalPoint(i,true)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous));e.consume()}this.selectedIcon=this.icon;this.icon=null};mxConnectionHandler.prototype.isImmediateConnectSource=function(t){return!this.graph.isCellMovable(t.cell)};mxConnectionHandler.prototype.createEdgeState=function(t){return null};mxConnectionHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container);var i=t.getEvent();var n=mxEvent.getClientX(i);var r=mxEvent.getClientY(i);var s=document.documentElement;var l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0);var a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0);var o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l;var h=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||h!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,h))};mxConnectionHandler.prototype.updateCurrentState=function(t,e){this.constraintHandler.update(t,this.first==null,false,this.first==null||t.isSource(this.marker.highlight.shape)?null:e);if(this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentConstraint!=null){if(this.marker.highlight!=null&&this.marker.highlight.state!=null&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell){if(this.marker.highlight.shape.stroke!="transparent"){this.marker.highlight.shape.stroke="transparent";this.marker.highlight.repaint()}}else{this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent")}if(this.previous!=null){this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell);if(this.error==null){this.currentState=this.constraintHandler.currentFocus}if(this.error!=null||this.currentState!=null&&!this.isCellEnabled(this.currentState.cell)){this.constraintHandler.reset()}}}else{if(this.graph.isIgnoreTerminalEvent(t.getEvent())){this.marker.reset();this.currentState=null}else{this.marker.process(t);this.currentState=this.marker.getValidState()}if(this.currentState!=null&&!this.isCellEnabled(this.currentState.cell)){this.constraintHandler.reset();this.marker.reset();this.currentState=null}var i=this.isOutlineConnectEvent(t);if(this.currentState!=null&&i){if(t.isSource(this.marker.highlight.shape)){e=new mxPoint(t.getGraphX(),t.getGraphY())}var n=this.graph.getOutlineConstraint(e,this.currentState,t);this.constraintHandler.setFocus(t,this.currentState,false);this.constraintHandler.currentConstraint=n;this.constraintHandler.currentPoint=e}if(this.outlineConnect){if(this.marker.highlight!=null&&this.marker.highlight.shape!=null){var r=this.graph.view.scale;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR;this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/r/r;this.marker.highlight.repaint()}else if(this.marker.hasValidState()){if(this.graph.isCellConnectable(t.getCell())&&this.marker.getValidState()!=t.getState()){this.marker.highlight.shape.stroke="transparent";this.currentState=null}else{this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR}this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/r/r;this.marker.highlight.repaint()}}}}};mxConnectionHandler.prototype.isCellEnabled=function(t){return true};mxConnectionHandler.prototype.convertWaypoint=function(t){var e=this.graph.getView().getScale();var i=this.graph.getView().getTranslate();t.x=t.x/e-i.x;t.y=t.y/e-i.y};mxConnectionHandler.prototype.snapToPreview=function(t,e){if(!mxEvent.isAltDown(t.getEvent())&&this.previous!=null){var i=this.graph.gridSize*this.graph.view.scale/2;var n=this.sourceConstraint!=null?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());if(Math.abs(n.x-t.getGraphX())<i){e.x=n.x}if(Math.abs(n.y-t.getGraphY())<i){e.y=n.y}}};mxConnectionHandler.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&(this.ignoreMouseDown||this.first!=null||!this.graph.isMouseDown)){if(!this.isEnabled()&&this.currentState!=null){this.destroyIcons();this.currentState=null}var i=this.graph.getView();var n=i.scale;var r=i.translate;var s=new mxPoint(e.getGraphX(),e.getGraphY());this.error=null;if(this.graph.isGridEnabledEvent(e.getEvent())){s=new mxPoint((this.graph.snap(s.x/n-r.x)+r.x)*n,(this.graph.snap(s.y/n-r.y)+r.y)*n)}this.snapToPreview(e,s);this.currentPoint=s;if((this.first!=null||this.isEnabled()&&this.graph.isEnabled())&&(this.shape!=null||this.first==null||Math.abs(e.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)){this.updateCurrentState(e,s)}if(this.first!=null){var l=null;var a=s;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null){l=this.constraintHandler.currentConstraint;a=this.constraintHandler.currentPoint.clone()}else if(this.previous!=null&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())){if(Math.abs(this.previous.getCenterX()-s.x)<Math.abs(this.previous.getCenterY()-s.y)){s.x=this.previous.getCenterX()}else{s.y=this.previous.getCenterY()}}var o=this.first;if(this.selectedIcon!=null){var h=this.selectedIcon.bounds.width;var u=this.selectedIcon.bounds.height;if(this.currentState!=null&&this.targetConnectImage){var d=this.getIconPosition(this.selectedIcon,this.currentState);this.selectedIcon.bounds.x=d.x;this.selectedIcon.bounds.y=d.y}else{var p=new mxRectangle(e.getGraphX()+this.connectIconOffset.x,e.getGraphY()+this.connectIconOffset.y,h,u);this.selectedIcon.bounds=p}this.selectedIcon.redraw()}if(this.edgeState!=null){this.updateEdgeState(a,l);a=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1];o=this.edgeState.absolutePoints[0]}else{if(this.currentState!=null){if(this.constraintHandler.currentConstraint==null){var m=this.getTargetPerimeterPoint(this.currentState,e);if(m!=null){a=m}}}if(this.sourceConstraint==null&&this.previous!=null){var c=this.waypoints!=null&&this.waypoints.length>0?this.waypoints[0]:a;var m=this.getSourcePerimeterPoint(this.previous,c,e);if(m!=null){o=m}}}if(this.currentState==null&&this.movePreviewAway){var m=o;if(this.edgeState!=null&&this.edgeState.absolutePoints.length>=2){var x=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];if(x!=null){m=x}}var f=a.x-m.x;var g=a.y-m.y;var v=Math.sqrt(f*f+g*g);if(v==0){return}this.originalPoint=a.clone();a.x-=f*4/v;a.y-=g*4/v}else{this.originalPoint=null}if(this.shape==null){var f=Math.abs(e.getGraphX()-this.first.x);var g=Math.abs(e.getGraphY()-this.first.y);if(f>this.graph.tolerance||g>this.graph.tolerance){this.shape=this.createShape();if(this.edgeState!=null){this.shape.apply(this.edgeState)}this.updateCurrentState(e,s)}}if(this.shape!=null){if(this.edgeState!=null){this.shape.points=this.edgeState.absolutePoints}else{var y=[o];if(this.waypoints!=null){y=y.concat(this.waypoints)}y.push(a);this.shape.points=y}this.drawPreview()}if(this.cursor!=null){this.graph.container.style.cursor=this.cursor}mxEvent.consume(e.getEvent());e.consume()}else if(!this.isEnabled()||!this.graph.isEnabled()){this.constraintHandler.reset()}else if(this.previous!=this.currentState&&this.edgeState==null){this.destroyIcons();if(this.currentState!=null&&this.error==null&&this.constraintHandler.currentConstraint==null){this.icons=this.createIcons(this.currentState);if(this.icons==null){this.currentState.setCursor(mxConstants.CURSOR_CONNECT);e.consume()}}this.previous=this.currentState}else if(this.previous==this.currentState&&this.currentState!=null&&this.icons==null&&!this.graph.isMouseDown){e.consume()}if(!this.graph.isMouseDown&&this.currentState!=null&&this.icons!=null){var C=false;var E=e.getSource();for(var S=0;S<this.icons.length&&!C;S++){C=E==this.icons[S].node||E.parentNode==this.icons[S].node}if(!C){this.updateIcons(this.currentState,this.icons,e)}}}else{this.constraintHandler.reset()}};mxConnectionHandler.prototype.updateEdgeState=function(t,e){if(this.sourceConstraint!=null&&this.sourceConstraint.point!=null){this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x;this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y}if(e!=null&&e.point!=null){this.edgeState.style[mxConstants.STYLE_ENTRY_X]=e.point.x;this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=e.point.y}else{delete this.edgeState.style[mxConstants.STYLE_ENTRY_X];delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]}this.edgeState.absolutePoints=[null,this.currentState!=null?null:t];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,true,this.sourceConstraint);if(this.currentState!=null){if(e==null){e=this.graph.getConnectionConstraint(this.edgeState,this.previous,false)}this.edgeState.setAbsoluteTerminalPoint(null,false);this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,false,e)}var i=null;if(this.waypoints!=null){i=[];for(var n=0;n<this.waypoints.length;n++){var r=this.waypoints[n].clone();this.convertWaypoint(r);i[n]=r}}this.graph.view.updatePoints(this.edgeState,i,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)};mxConnectionHandler.prototype.getTargetPerimeterPoint=function(t,e){var i=null;var n=t.view;var r=n.getPerimeterFunction(t);if(r!=null){var s=this.waypoints!=null&&this.waypoints.length>0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());var l=r(n.getPerimeterBounds(t),this.edgeState,s,false);if(l!=null){i=l}}else{i=new mxPoint(t.getCenterX(),t.getCenterY())}return i};mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,i){var n=null;var r=t.view;var s=r.getPerimeterFunction(t);var l=new mxPoint(t.getCenterX(),t.getCenterY());if(s!=null){var a=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);var o=-a*(Math.PI/180);if(a!=0){e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(o),Math.sin(o),l)}var h=s(r.getPerimeterBounds(t),t,e,false);if(h!=null){if(a!=0){h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-o),Math.sin(-o),l)}n=h}}else{n=l}return n};mxConnectionHandler.prototype.updateIcons=function(t,e,i){};mxConnectionHandler.prototype.isStopEvent=function(t){return t.getState()!=null};mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY());var i=Math.abs(e.x-this.first.x);var n=Math.abs(e.y-this.first.y);var r=this.waypoints!=null||this.mouseDownCounter>1&&(i>this.graph.tolerance||n>this.graph.tolerance);if(r){if(this.waypoints==null){this.waypoints=[]}var s=this.graph.view.scale;var e=new mxPoint(this.graph.snap(t.getGraphX()/s)*s,this.graph.snap(t.getGraphY()/s)*s);this.waypoints.push(e)}};mxConnectionHandler.prototype.checkConstraints=function(t,e){return t==null||e==null||t.point==null||e.point==null||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter};mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e)){this.addWaypointForEvent(e);e.consume();return}var i=this.sourceConstraint;var n=this.constraintHandler.currentConstraint;var r=this.previous!=null?this.previous.cell:null;var s=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){s=this.constraintHandler.currentFocus.cell}if(s==null&&this.currentState!=null){s=this.currentState.cell}if(this.error==null&&(r==null||s==null||r!=s||this.checkConstraints(i,n))){this.connect(r,s,e.getEvent(),e.getCell())}else{if(this.previous!=null&&this.marker.validState!=null&&this.previous.cell==this.marker.validState.cell){this.graph.selectCellForEvent(this.marker.source,e.getEvent())}if(this.error!=null&&this.error.length>0){this.graph.validationAlert(this.error)}}this.destroyIcons();e.consume()}if(this.first!=null){this.reset()}};mxConnectionHandler.prototype.reset=function(){if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.cursor!=null&&this.graph.container!=null){this.graph.container.style.cursor=""}this.destroyIcons();this.marker.reset();this.constraintHandler.reset();this.originalPoint=null;this.currentPoint=null;this.edgeState=null;this.previous=null;this.error=null;this.sourceConstraint=null;this.mouseDownCounter=0;this.first=null;this.fireEvent(new mxEventObject(mxEvent.RESET))};mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(this.error==null);this.shape.redraw()};mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t);this.shape.stroke=this.getEdgeColor(t)};mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR};mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1};mxConnectionHandler.prototype.connect=function(t,e,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel();var s=false;var l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)){e=this.createTargetVertex(i,t);if(e!=null){n=this.graph.getDropTarget([e],i,n);s=true;if(n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x;o.y-=a.origin.y}}else{n=this.graph.getDefaultParent()}this.graph.addCell(e,n)}}var h=this.graph.getDefaultParent();if(t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()){h=r.getParent(t);if(t.geometry!=null&&t.geometry.relative&&(e.geometry!=null&&e.geometry.relative)){h=r.getParent(h)}}var u=null;var d=null;if(this.edgeState!=null){u=this.edgeState.cell.value;d=this.edgeState.cell.style}l=this.insertEdge(h,null,u,t,e,d);if(l!=null){this.graph.setConnectionConstraint(l,t,true,this.sourceConstraint);this.graph.setConnectionConstraint(l,e,false,this.constraintHandler.currentConstraint);if(this.edgeState!=null){r.setGeometry(l,this.edgeState.cell.geometry)}var h=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){var o=t;while(o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent){o=this.graph.model.getParent(o)}if(o!=null&&o.parent!=null&&o.parent==l.parent){r.add(h,l,o.parent.getIndex(o))}}var p=r.getGeometry(l);if(p==null){p=new mxGeometry;p.relative=true;r.setGeometry(l,p)}if(this.waypoints!=null&&this.waypoints.length>0){var m=this.graph.view.scale;var c=this.graph.view.translate;p.points=[];for(var x=0;x<this.waypoints.length;x++){var f=this.waypoints[x];p.points.push(new mxPoint(f.x/m-c.x,f.y/m-c.y))}}if(e==null){var g=this.graph.view.translate;var m=this.graph.view.scale;var f=this.originalPoint!=null?new mxPoint(this.originalPoint.x/m-g.x,this.originalPoint.y/m-g.y):new mxPoint(this.currentPoint.x/m-g.x,this.currentPoint.y/m-g.y);f.x-=this.graph.panDx/this.graph.view.scale;f.y-=this.graph.panDy/this.graph.view.scale;p.setTerminalPoint(f,false)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",l,"terminal",e,"event",i,"target",n,"terminalInserted",s))}}catch(v){mxLog.show();mxLog.debug(v.message)}finally{r.endUpdate()}if(this.select){this.selectCells(l,s?e:null)}}};mxConnectionHandler.prototype.selectCells=function(t,e){this.graph.setSelectionCell(t)};mxConnectionHandler.prototype.insertEdge=function(t,e,i,n,r,s){if(this.factoryMethod==null){return this.graph.insertEdge(t,e,i,n,r,s)}else{var l=this.createEdge(i,n,r,s);l=this.graph.addEdge(l,t,n,r);return l}};mxConnectionHandler.prototype.createTargetVertex=function(t,e){var i=this.graph.getCellGeometry(e);while(i!=null&&i.relative){e=this.graph.getModel().getParent(e);i=this.graph.getCellGeometry(e)}var n=this.graph.cloneCell(e);var i=this.graph.getModel().getGeometry(n);if(i!=null){var r=this.graph.view.translate;var s=this.graph.view.scale;var l=new mxPoint(this.currentPoint.x/s-r.x,this.currentPoint.y/s-r.y);i.x=Math.round(l.x-i.width/2-this.graph.panDx/s);i.y=Math.round(l.y-i.height/2-this.graph.panDy/s);var a=this.getAlignmentTolerance();if(a>0){var o=this.graph.view.getState(e);if(o!=null){var h=o.x/s-r.x;var u=o.y/s-r.y;if(Math.abs(h-i.x)<=a){i.x=Math.round(h)}if(Math.abs(u-i.y)<=a){i.y=Math.round(u)}}}}return n};mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance};mxConnectionHandler.prototype.createEdge=function(t,e,i,n){var r=null;if(this.factoryMethod!=null){r=this.factoryMethod(e,i,n)}if(r==null){r=new mxCell(t||"");r.setEdge(true);r.setStyle(n);var s=new mxGeometry;s.relative=true;r.setGeometry(s)}return r};mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.marker!=null){this.marker.destroy();this.marker=null}if(this.constraintHandler!=null){this.constraintHandler.destroy();this.constraintHandler=null}if(this.changeHandler!=null){this.graph.getModel().removeListener(this.changeHandler);this.graph.getView().removeListener(this.changeHandler);this.changeHandler=null}if(this.drillHandler!=null){this.graph.removeListener(this.drillHandler);this.graph.getView().removeListener(this.drillHandler);this.drillHandler=null}if(this.escapeHandler!=null){this.graph.removeListener(this.escapeHandler);this.escapeHandler=null}};__mxOutput.mxConnectionHandler=typeof mxConnectionHandler!=="undefined"?mxConnectionHandler:undefined;function mxConstraintHandler(t){this.graph=t;this.resetHandler=mxUtils.bind(this,(function(t,e){if(this.currentFocus!=null&&this.graph.view.getState(this.currentFocus.cell)==null){this.reset()}else{this.redraw()}}));this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE,this.resetHandler);this.graph.addListener(mxEvent.ROOT,this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5);mxConstraintHandler.prototype.graph=null;mxConstraintHandler.prototype.enabled=true;mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR;mxConstraintHandler.prototype.isEnabled=function(){return this.enabled};mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t};mxConstraintHandler.prototype.reset=function(){if(this.focusIcons!=null){for(var t=0;t<this.focusIcons.length;t++){this.focusIcons[t].destroy()}this.focusIcons=null}if(this.focusHighlight!=null){this.focusHighlight.destroy();this.focusHighlight=null}this.currentConstraint=null;this.currentFocusArea=null;this.currentPoint=null;this.currentFocus=null;this.focusPoints=null};mxConstraintHandler.prototype.getTolerance=function(t){return this.graph.getTolerance()};mxConstraintHandler.prototype.getImageForConstraint=function(t,e,i){return this.pointImage};mxConstraintHandler.prototype.isEventIgnored=function(t,e){return false};mxConstraintHandler.prototype.isStateIgnored=function(t,e){return false};mxConstraintHandler.prototype.destroyIcons=function(){if(this.focusIcons!=null){for(var t=0;t<this.focusIcons.length;t++){this.focusIcons[t].destroy()}this.focusIcons=null;this.focusPoints=null}};mxConstraintHandler.prototype.destroyFocusHighlight=function(){if(this.focusHighlight!=null){this.focusHighlight.destroy();this.focusHighlight=null}};mxConstraintHandler.prototype.isKeepFocusEvent=function(t){return mxEvent.isShiftDown(t.getEvent())};mxConstraintHandler.prototype.getCellForEvent=function(t,e){var i=t.getCell();if(i==null&&e!=null&&(t.getGraphX()!=e.x||t.getGraphY()!=e.y)){i=this.graph.getCellAt(e.x,e.y)}if(i!=null&&!this.graph.isCellConnectable(i)){var n=this.graph.getModel().getParent(i);if(this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)){i=n}}return this.graph.isCellLocked(i)?null:i};mxConstraintHandler.prototype.update=function(t,e,i,n){if(this.isEnabled()&&!this.isEventIgnored(t)){if(this.mouseleaveHandler==null&&this.graph.container!=null){this.mouseleaveHandler=mxUtils.bind(this,(function(){this.reset()}));mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler)}var r=this.getTolerance(t);var s=n!=null?n.x:t.getGraphX();var l=n!=null?n.y:t.getGraphY();var a=new mxRectangle(s-r,l-r,2*r,2*r);var o=new mxRectangle(t.getGraphX()-r,t.getGraphY()-r,2*r,2*r);var h=this.graph.view.getState(this.getCellForEvent(t,n));if(!this.isKeepFocusEvent(t)&&(this.currentFocusArea==null||this.currentFocus==null||h!=null||!this.graph.getModel().isVertex(this.currentFocus.cell)||!mxUtils.intersects(this.currentFocusArea,o))&&h!=this.currentFocus){this.currentFocusArea=null;this.currentFocus=null;this.setFocus(t,h,e)}this.currentConstraint=null;this.currentPoint=null;var u=null;if(this.focusIcons!=null&&this.constraints!=null&&(h==null||this.currentFocus==h)){var d=o.getCenterX();var p=o.getCenterY();for(var m=0;m<this.focusIcons.length;m++){var c=d-this.focusIcons[m].bounds.getCenterX();var x=p-this.focusIcons[m].bounds.getCenterY();var f=c*c+x*x;if((this.intersects(this.focusIcons[m],o,e,i)||n!=null&&this.intersects(this.focusIcons[m],a,e,i))&&(u==null||f<u)){this.currentConstraint=this.constraints[m];this.currentPoint=this.focusPoints[m];u=f;var f=this.focusIcons[m].bounds.clone();f.grow(mxConstants.HIGHLIGHT_SIZE+1);f.width-=1;f.height-=1;if(this.focusHighlight==null){var g=this.createHighlightShape();g.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML;g.pointerEvents=false;g.init(this.graph.getView().getOverlayPane());this.focusHighlight=g;var v=mxUtils.bind(this,(function(){return this.currentFocus!=null?this.currentFocus:h}));mxEvent.redirectMouseEvents(g.node,this.graph,v)}this.focusHighlight.bounds=f;this.focusHighlight.redraw()}}}if(this.currentConstraint==null){this.destroyFocusHighlight()}}else{this.currentConstraint=null;this.currentFocus=null;this.currentPoint=null}};mxConstraintHandler.prototype.redraw=function(){if(this.currentFocus!=null&&this.constraints!=null&&this.focusIcons!=null){var t=this.graph.view.getState(this.currentFocus.cell);this.currentFocus=t;this.currentFocusArea=new mxRectangle(t.x,t.y,t.width,t.height);for(var e=0;e<this.constraints.length;e++){var i=this.graph.getConnectionPoint(t,this.constraints[e]);var n=this.getImageForConstraint(t,this.constraints[e],i);var r=new mxRectangle(Math.round(i.x-n.width/2),Math.round(i.y-n.height/2),n.width,n.height);this.focusIcons[e].bounds=r;this.focusIcons[e].redraw();this.currentFocusArea.add(this.focusIcons[e].bounds);this.focusPoints[e]=i}}};mxConstraintHandler.prototype.setFocus=function(t,e,i){this.constraints=e!=null&&!this.isStateIgnored(e,i)&&this.graph.isCellConnectable(e.cell)?this.isEnabled()?this.graph.getAllConnectionConstraints(e,i)||[]:[]:null;if(this.constraints!=null){this.currentFocus=e;this.currentFocusArea=new mxRectangle(e.x,e.y,e.width,e.height);if(this.focusIcons!=null){for(var n=0;n<this.focusIcons.length;n++){this.focusIcons[n].destroy()}this.focusIcons=null;this.focusPoints=null}this.focusPoints=[];this.focusIcons=[];for(var n=0;n<this.constraints.length;n++){var r=this.graph.getConnectionPoint(e,this.constraints[n]);var s=this.getImageForConstraint(e,this.constraints[n],r);var l=s.src;var a=new mxRectangle(Math.round(r.x-s.width/2),Math.round(r.y-s.height/2),s.width,s.height);var o=new mxImageShape(a,l);o.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;o.preserveImageAspect=false;o.init(this.graph.getView().getDecoratorPane());if(mxClient.IS_QUIRKS||document.documentMode==8){mxEvent.addListener(o.node,"dragstart",(function(t){mxEvent.consume(t);return false}))}if(o.node.previousSibling!=null){o.node.parentNode.insertBefore(o.node,o.node.parentNode.firstChild)}var h=mxUtils.bind(this,(function(){return this.currentFocus!=null?this.currentFocus:e}));o.redraw();mxEvent.redirectMouseEvents(o.node,this.graph,h);this.currentFocusArea.add(o.bounds);this.focusIcons.push(o);this.focusPoints.push(r)}this.currentFocusArea.grow(this.getTolerance(t))}else{this.destroyIcons();this.destroyFocusHighlight()}};mxConstraintHandler.prototype.createHighlightShape=function(){var t=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);t.opacity=mxConstants.HIGHLIGHT_OPACITY;return t};mxConstraintHandler.prototype.intersects=function(t,e,i,n){return mxUtils.intersects(t.bounds,e)};mxConstraintHandler.prototype.destroy=function(){this.reset();if(this.resetHandler!=null){this.graph.model.removeListener(this.resetHandler);this.graph.view.removeListener(this.resetHandler);this.graph.removeListener(this.resetHandler);this.resetHandler=null}if(this.mouseleaveHandler!=null&&this.graph.container!=null){mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler);this.mouseleaveHandler=null}};__mxOutput.mxConstraintHandler=typeof mxConstraintHandler!=="undefined"?mxConstraintHandler:undefined;function mxRubberband(t){if(t!=null){this.graph=t;this.graph.addMouseListener(this);this.forceRubberbandHandler=mxUtils.bind(this,(function(t,e){var i=e.getProperty("eventName");var n=e.getProperty("event");if(i==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(n)){var r=mxUtils.getOffset(this.graph.container);var s=mxUtils.getScrollOrigin(this.graph.container);s.x-=r.x;s.y-=r.y;this.start(n.getX()+s.x,n.getY()+s.y);n.consume(false)}}));this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler);this.panHandler=mxUtils.bind(this,(function(){this.repaint()}));this.graph.addListener(mxEvent.PAN,this.panHandler);this.gestureHandler=mxUtils.bind(this,(function(t,e){if(this.first!=null){this.reset()}}));this.graph.addListener(mxEvent.GESTURE,this.gestureHandler);if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}}mxRubberband.prototype.defaultOpacity=20;mxRubberband.prototype.enabled=true;mxRubberband.prototype.div=null;mxRubberband.prototype.sharedDiv=null;mxRubberband.prototype.currentX=0;mxRubberband.prototype.currentY=0;mxRubberband.prototype.fadeOut=false;mxRubberband.prototype.isEnabled=function(){return this.enabled};mxRubberband.prototype.setEnabled=function(t){this.enabled=t};mxRubberband.prototype.isForceRubberbandEvent=function(t){return mxEvent.isAltDown(t.getEvent())};mxRubberband.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&e.getState()==null&&!mxEvent.isMultiTouchEvent(e.getEvent())){var i=mxUtils.getOffset(this.graph.container);var n=mxUtils.getScrollOrigin(this.graph.container);n.x-=i.x;n.y-=i.y;this.start(e.getX()+n.x,e.getY()+n.y);e.consume(false)}};mxRubberband.prototype.start=function(t,e){this.first=new mxPoint(t,e);var i=this.graph.container;function n(t){var e=new mxMouseEvent(t);var n=mxUtils.convertPoint(i,e.getX(),e.getY());e.graphX=n.x;e.graphY=n.y;return e}this.dragHandler=mxUtils.bind(this,(function(t){this.mouseMove(this.graph,n(t))}));this.dropHandler=mxUtils.bind(this,(function(t){this.mouseUp(this.graph,n(t))}));if(mxClient.IS_FF){mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)}};mxRubberband.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&this.first!=null){var i=mxUtils.getScrollOrigin(this.graph.container);var n=mxUtils.getOffset(this.graph.container);i.x-=n.x;i.y-=n.y;var r=e.getX()+i.x;var s=e.getY()+i.y;var l=this.first.x-r;var a=this.first.y-s;var o=this.graph.tolerance;if(this.div!=null||Math.abs(l)>o||Math.abs(a)>o){if(this.div==null){this.div=this.createShape()}mxUtils.clearSelection();this.update(r,s);e.consume()}}};mxRubberband.prototype.createShape=function(){if(this.sharedDiv==null){this.sharedDiv=document.createElement("div");this.sharedDiv.className="mxRubberband";mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)}this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){this.sharedDiv=null}return t};mxRubberband.prototype.isActive=function(t,e){return this.div!=null&&this.div.style.display!="none"};mxRubberband.prototype.mouseUp=function(t,e){var i=this.isActive();this.reset();if(i){this.execute(e.getEvent());e.consume()}};mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)};mxRubberband.prototype.reset=function(){if(this.div!=null){if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear");t.style.pointerEvents="none";t.style.opacity=0;window.setTimeout((function(){t.parentNode.removeChild(t)}),200)}else{this.div.parentNode.removeChild(this.div)}}mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dragHandler=null;this.dropHandler=null;this.currentX=0;this.currentY=0;this.first=null;this.div=null};mxRubberband.prototype.update=function(t,e){this.currentX=t;this.currentY=e;this.repaint()};mxRubberband.prototype.repaint=function(){if(this.div!=null){var t=this.currentX-this.graph.panDx;var e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t);this.y=Math.min(this.first.y,e);this.width=Math.max(this.first.x,t)-this.x;this.height=Math.max(this.first.y,e)-this.y;var i=mxClient.IS_VML?this.graph.panDx:0;var n=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+i+"px";this.div.style.top=this.y+n+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1,this.height)+"px"}};mxRubberband.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;this.graph.removeMouseListener(this);this.graph.removeListener(this.forceRubberbandHandler);this.graph.removeListener(this.panHandler);this.reset();if(this.sharedDiv!=null){this.sharedDiv=null}}};__mxOutput.mxRubberband=typeof mxRubberband!=="undefined"?mxRubberband:undefined;function mxHandle(t,e,i,n){this.graph=t.view.graph;this.state=t;this.cursor=e!=null?e:this.cursor;this.image=i!=null?i:this.image;this.shape=n!=null?n:null;this.init()}mxHandle.prototype.cursor="default";mxHandle.prototype.image=null;mxHandle.prototype.ignoreGrid=false;mxHandle.prototype.getPosition=function(t){};mxHandle.prototype.setPosition=function(t,e,i){};mxHandle.prototype.execute=function(t){};mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])};mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale;var i=this.graph.view.translate;var n=new mxPoint(t.getGraphX()/e-i.x,t.getGraphY()/e-i.y);if(this.shape!=null&&this.shape.bounds!=null){n.x-=this.shape.bounds.width/e/4;n.y-=this.shape.bounds.height/e/4}var r=-mxUtils.toRadians(this.getRotation());var s=-mxUtils.toRadians(this.getTotalRotation())-r;n=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(n,r),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s));this.setPosition(this.state.getPaintBounds(),n,t);this.redraw()};mxHandle.prototype.positionChanged=function(){if(this.state.text!=null){this.state.text.apply(this.state)}if(this.state.shape!=null){this.state.shape.apply(this.state)}this.graph.cellRenderer.redraw(this.state,true)};mxHandle.prototype.getRotation=function(){if(this.state.shape!=null){return this.state.shape.getRotation()}return 0};mxHandle.prototype.getTotalRotation=function(){if(this.state.shape!=null){return this.state.shape.getShapeRotation()}return 0};mxHandle.prototype.init=function(){var t=this.isHtmlRequired();if(this.image!=null){this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src);this.shape.preserveImageAspect=false}else if(this.shape==null){this.shape=this.createShape(t)}this.initShape(t)};mxHandle.prototype.createShape=function(t){var e=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(e,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};mxHandle.prototype.initShape=function(t){if(t&&this.shape.isHtmlAllowed()){this.shape.dialect=mxConstants.DIALECT_STRICTHTML;this.shape.init(this.graph.container)}else{this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;if(this.cursor!=null){this.shape.init(this.graph.getView().getOverlayPane())}}mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.shape.node.style.cursor=this.cursor};mxHandle.prototype.redraw=function(){if(this.shape!=null&&this.state.shape!=null){var t=this.getPosition(this.state.getPaintBounds());if(t!=null){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var i=this.graph.view.scale;var n=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+n.x)*i-this.shape.bounds.width/2);this.shape.bounds.y=Math.floor((t.y+n.y)*i-this.shape.bounds.height/2);this.shape.redraw()}}};mxHandle.prototype.isHtmlRequired=function(){return this.state.text!=null&&this.state.text.node.parentNode==this.graph.container};mxHandle.prototype.rotatePoint=function(t,e){var i=this.state.getCellBounds();var n=new mxPoint(i.getCenterX(),i.getCenterY());var r=Math.cos(e);var s=Math.sin(e);return mxUtils.getRotatedPoint(t,r,s,n)};mxHandle.prototype.flipPoint=function(t){if(this.state.shape!=null){var e=this.state.getCellBounds();if(this.state.shape.flipH){t.x=2*e.x+e.width-t.x}if(this.state.shape.flipV){t.y=2*e.y+e.height-t.y}}return t};mxHandle.prototype.snapPoint=function(t,e){if(!e){t.x=this.graph.snap(t.x);t.y=this.graph.snap(t.y)}return t};mxHandle.prototype.setVisible=function(t){if(this.shape!=null&&this.shape.node!=null){this.shape.node.style.display=t?"":"none"}};mxHandle.prototype.reset=function(){this.setVisible(true);this.state.style=this.graph.getCellStyle(this.state.cell);this.positionChanged()};mxHandle.prototype.destroy=function(){if(this.shape!=null){this.shape.destroy();this.shape=null}};__mxOutput.mxHandle=typeof mxHandle!=="undefined"?mxHandle:undefined;function mxVertexHandler(t){if(t!=null){this.state=t;this.init();this.escapeHandler=mxUtils.bind(this,(function(t,e){if(this.livePreview&&this.index!=null){this.state.view.graph.cellRenderer.redraw(this.state,true);this.state.view.invalidate(this.state.cell);this.state.invalid=false;this.state.view.validate()}this.reset()}));this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}}mxVertexHandler.prototype.graph=null;mxVertexHandler.prototype.state=null;mxVertexHandler.prototype.singleSizer=false;mxVertexHandler.prototype.index=null;mxVertexHandler.prototype.allowHandleBoundsCheck=true;mxVertexHandler.prototype.handleImage=null;mxVertexHandler.prototype.handlesVisible=true;mxVertexHandler.prototype.tolerance=0;mxVertexHandler.prototype.rotationEnabled=false;mxVertexHandler.prototype.parentHighlightEnabled=false;mxVertexHandler.prototype.rotationRaster=true;mxVertexHandler.prototype.rotationCursor="crosshair";mxVertexHandler.prototype.livePreview=false;mxVertexHandler.prototype.movePreviewToFront=false;mxVertexHandler.prototype.manageSizers=false;mxVertexHandler.prototype.constrainGroupByChildren=false;mxVertexHandler.prototype.rotationHandleVSpacing=-16;mxVertexHandler.prototype.horizontalOffset=0;mxVertexHandler.prototype.verticalOffset=0;mxVertexHandler.prototype.init=function(){this.graph=this.state.view.graph;this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.selectionBorder=this.createSelectionShape(this.bounds);this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.selectionBorder.pointerEvents=false;this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");this.selectionBorder.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state);if(this.graph.isCellMovable(this.state.cell)){this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX)}if(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var t=this.graph.isCellResizable(this.state.cell);this.sizers=[];if(t||this.graph.isLabelMovable(this.state.cell)&&this.state.width>=2&&this.state.height>=2){var e=0;if(t){if(!this.singleSizer){this.sizers.push(this.createSizer("nw-resize",e++));this.sizers.push(this.createSizer("n-resize",e++));this.sizers.push(this.createSizer("ne-resize",e++));this.sizers.push(this.createSizer("w-resize",e++));this.sizers.push(this.createSizer("e-resize",e++));this.sizers.push(this.createSizer("sw-resize",e++));this.sizers.push(this.createSizer("s-resize",e++))}this.sizers.push(this.createSizer("se-resize",e++))}var i=this.graph.model.getGeometry(this.state.cell);if(i!=null&&!i.relative&&!this.graph.isSwimlane(this.state.cell)&&this.graph.isLabelMovable(this.state.cell)){this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR);this.sizers.push(this.labelShape)}}else if(this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2){this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR);this.sizers.push(this.labelShape)}}if(this.isRotationHandleVisible()){this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR);this.sizers.push(this.rotationShape)}this.customHandles=this.createCustomHandles();this.redraw();if(this.constrainGroupByChildren){this.updateMinBounds()}};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t.getEvent())||this.state.style[mxConstants.STYLE_ASPECT]=="fixed"};mxVertexHandler.prototype.isCenteredEvent=function(t,e){return false};mxVertexHandler.prototype.createCustomHandles=function(){return null};mxVertexHandler.prototype.updateMinBounds=function(){var t=this.graph.getChildCells(this.state.cell);if(t.length>0){this.minBounds=this.graph.view.getBounds(t);if(this.minBounds!=null){var e=this.state.view.scale;var i=this.state.view.translate;this.minBounds.x-=this.state.x;this.minBounds.y-=this.state.y;this.minBounds.x/=e;this.minBounds.y/=e;this.minBounds.width/=e;this.minBounds.height/=e;this.x0=this.state.x/e-i.x;this.y0=this.state.y/e-i.y}}};mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))};mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)};mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());e.strokewidth=this.getSelectionStrokeWidth();e.isDashed=this.isSelectionDashed();return e};mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR};mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH};mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED};mxVertexHandler.prototype.createSizer=function(t,e,i,n){i=i||mxConstants.HANDLE_SIZE;var r=new mxRectangle(0,0,i,i);var s=this.createSizerShape(r,e,n);if(s.isHtmlAllowed()&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container){s.bounds.height-=1;s.bounds.width-=1;s.dialect=mxConstants.DIALECT_STRICTHTML;s.init(this.graph.container)}else{s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;s.init(this.graph.getView().getOverlayPane())}mxEvent.redirectMouseEvents(s.node,this.graph,this.state);if(this.graph.isEnabled()){s.setCursor(t)}if(!this.isSizerVisible(e)){s.visible=false}return s};mxVertexHandler.prototype.isSizerVisible=function(t){return true};mxVertexHandler.prototype.createSizerShape=function(t,e,i){if(this.handleImage!=null){t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height);var n=new mxImageShape(t,this.handleImage.src);n.preserveImageAspect=false;return n}else if(e==mxEvent.ROTATION_HANDLE){return new mxEllipse(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}else{return new mxRectangleShape(t,i||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}};mxVertexHandler.prototype.moveSizerTo=function(t,e,i){if(t!=null){t.bounds.x=Math.floor(e-t.bounds.width/2);t.bounds.y=Math.floor(i-t.bounds.height/2);if(t.node!=null&&t.node.style.display!="none"){t.redraw()}}};mxVertexHandler.prototype.getHandleForEvent=function(t){var e=!mxEvent.isMouseEvent(t.getEvent())?this.tolerance:1;var i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null;var n=mxUtils.bind(this,(function(e){var n=e!=null&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null;var r=n!=null?new mxRectangle(t.getGraphX()-Math.floor(n/2),t.getGraphY()-Math.floor(n/2),n,n):i;return e!=null&&(t.isSource(e)||r!=null&&mxUtils.intersects(e.bounds,r)&&e.node.style.display!="none"&&e.node.style.visibility!="hidden")}));if(n(this.rotationShape)){return mxEvent.ROTATION_HANDLE}else if(n(this.labelShape)){return mxEvent.LABEL_HANDLE}if(this.sizers!=null){for(var r=0;r<this.sizers.length;r++){if(n(this.sizers[r])){return r}}}if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var r=this.customHandles.length-1;r>=0;r--){if(n(this.customHandles[r].shape)){return mxEvent.CUSTOM_HANDLE-r}}}return null};mxVertexHandler.prototype.isCustomHandleEvent=function(t){return true};mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var i=this.getHandleForEvent(e);if(i!=null){this.start(e.getGraphX(),e.getGraphY(),i);e.consume()}}};mxVertexHandler.prototype.isLivePreviewBorder=function(){return this.state.shape!=null&&this.state.shape.fill==null&&this.state.shape.stroke==null};mxVertexHandler.prototype.start=function(t,e,i){if(this.selectionBorder!=null){this.livePreviewActive=this.livePreview&&this.graph.model.getChildCount(this.state.cell)==0;this.inTolerance=true;this.childOffsetX=0;this.childOffsetY=0;this.index=i;this.startX=t;this.startY=e;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview()){this.ghostPreview=this.createGhostPreview()}else{var n=this.state.view.graph.model;var r=n.getParent(this.state.cell);if(this.state.view.currentRoot!=r&&(n.isVertex(r)||n.isEdge(r))){this.parentState=this.state.view.graph.view.getState(r)}this.selectionBorder.node.style.display=i==mxEvent.ROTATION_HANDLE?"inline":"none";if(!this.livePreviewActive||this.isLivePreviewBorder()){this.preview=this.createSelectionShape(this.bounds);if(!(mxClient.IS_SVG&&Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")!=0)&&this.state.text!=null&&this.state.text.node.parentNode==this.graph.container){this.preview.dialect=mxConstants.DIALECT_STRICTHTML;this.preview.init(this.graph.container)}else{this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.preview.init(this.graph.view.getOverlayPane())}}if(i==mxEvent.ROTATION_HANDLE){var s=this.getRotationHandlePosition();var l=s.x-this.state.getCenterX();var a=s.y-this.state.getCenterY();this.startAngle=l!=0?Math.atan(a/l)*180/Math.PI+90:0;this.startDist=Math.sqrt(l*l+a*a)}if(this.livePreviewActive){this.hideSizers();if(i==mxEvent.ROTATION_HANDLE){this.rotationShape.node.style.display=""}else if(i==mxEvent.LABEL_HANDLE){this.labelShape.node.style.display=""}else if(this.sizers!=null&&this.sizers[i]!=null){this.sizers[i].node.style.display=""}else if(i<=mxEvent.CUSTOM_HANDLE&&this.customHandles!=null){this.customHandles[mxEvent.CUSTOM_HANDLE-i].setVisible(true)}var o=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var h=0;h<o.length;h++){var u=this.graph.selectionCellsHandler.getHandler(o[h]);if(u!=null){this.edgeHandlers.push(u)}}}}}};mxVertexHandler.prototype.createGhostPreview=function(){var t=this.graph.cellRenderer.createShape(this.state);t.init(this.graph.view.getOverlayPane());t.scale=this.state.view.scale;t.bounds=this.bounds;t.outline=true;return t};mxVertexHandler.prototype.setHandlesVisible=function(t){this.handlesVisible=t;if(this.sizers!=null){for(var e=0;e<this.sizers.length;e++){this.sizers[e].node.style.display=t?"":"none"}}if(this.customHandles!=null){for(var e=0;e<this.customHandles.length;e++){this.customHandles[e].setVisible(t)}}};mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(false)};mxVertexHandler.prototype.checkTolerance=function(t){if(this.inTolerance&&this.startX!=null&&this.startY!=null){if(mxEvent.isMouseEvent(t.getEvent())||Math.abs(t.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance){this.inTolerance=false}}};mxVertexHandler.prototype.updateHint=function(t){};mxVertexHandler.prototype.removeHint=function(){};mxVertexHandler.prototype.roundAngle=function(t){return Math.round(t*10)/10};mxVertexHandler.prototype.roundLength=function(t){return Math.round(t*100)/100};mxVertexHandler.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&this.index!=null){this.checkTolerance(e);if(!this.inTolerance){if(this.index<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=true;if(this.ghostPreview!=null){this.ghostPreview.apply(this.state);this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale;this.ghostPreview.isDashed=this.isSelectionDashed();this.ghostPreview.stroke=this.getSelectionColor();this.ghostPreview.redraw();if(this.selectionBounds!=null){this.selectionBorder.node.style.display="none"}}else{if(this.movePreviewToFront){this.moveToFront()}this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged()}}}else if(this.index==mxEvent.LABEL_HANDLE){this.moveLabel(e)}else{if(this.index==mxEvent.ROTATION_HANDLE){this.rotateVertex(e)}else{this.resizeVertex(e)}this.updateHint(e)}}e.consume()}else if(!this.graph.isMouseDown&&this.getHandleForEvent(e)!=null){e.consume(false)}};mxVertexHandler.prototype.isGhostPreview=function(){return this.state.view.graph.model.getChildCount(this.state.cell)>0};mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY());var i=this.graph.view.translate;var n=this.graph.view.scale;if(this.graph.isGridEnabledEvent(t.getEvent())){e.x=(this.graph.snap(e.x/n-i.x)+i.x)*n;e.y=(this.graph.snap(e.y/n-i.y)+i.y)*n}var r=this.rotationShape!=null?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[r],e.x,e.y)};mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY());var i=this.state.x+this.state.width/2-e.x;var n=this.state.y+this.state.height/2-e.y;this.currentAlpha=i!=0?Math.atan(n/i)*180/Math.PI+90:n<0?180:0;if(i>0){this.currentAlpha-=180}this.currentAlpha-=this.startAngle;if(this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){var i=e.x-this.state.getCenterX();var n=e.y-this.state.getCenterY();var r=Math.sqrt(i*i+n*n);if(r-this.startDist<2){raster=15}else if(r-this.startDist<25){raster=5}else{raster=1}this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else{this.currentAlpha=this.roundAngle(this.currentAlpha)}this.selectionBorder.rotation=this.currentAlpha;this.selectionBorder.redraw();if(this.livePreviewActive){this.redrawHandles()}};mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY());var i=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var n=new mxPoint(t.getGraphX(),t.getGraphY());var r=this.graph.view.translate;var s=this.graph.view.scale;var l=Math.cos(-i);var a=Math.sin(-i);var o=n.x-this.startX;var h=n.y-this.startY;var u=l*o-a*h;var d=a*o+l*h;o=u;h=d;var p=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(p,o/s,h/s,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t));if(!p.relative){var m=this.graph.getMaximumGraphBounds();if(m!=null&&this.parentState!=null){m=mxRectangle.fromRectangle(m);m.x-=(this.parentState.x-r.x*s)/s;m.y-=(this.parentState.y-r.y*s)/s}if(this.graph.isConstrainChild(this.state.cell)){var c=this.graph.getCellContainmentArea(this.state.cell);if(c!=null){var x=this.graph.getOverlap(this.state.cell);if(x>0){c=mxRectangle.fromRectangle(c);c.x-=c.width*x;c.y-=c.height*x;c.width+=2*c.width*x;c.height+=2*c.height*x}if(m==null){m=c}else{m=mxRectangle.fromRectangle(m);m.intersect(c)}}}if(m!=null){if(this.unscaledBounds.x<m.x){this.unscaledBounds.width-=m.x-this.unscaledBounds.x;this.unscaledBounds.x=m.x}if(this.unscaledBounds.y<m.y){this.unscaledBounds.height-=m.y-this.unscaledBounds.y;this.unscaledBounds.y=m.y}if(this.unscaledBounds.x+this.unscaledBounds.width>m.x+m.width){this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-m.x-m.width}if(this.unscaledBounds.y+this.unscaledBounds.height>m.y+m.height){this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-m.y-m.height}}}var f=this.bounds;this.bounds=new mxRectangle((this.parentState!=null?this.parentState.x:r.x*s)+this.unscaledBounds.x*s,(this.parentState!=null?this.parentState.y:r.y*s)+this.unscaledBounds.y*s,this.unscaledBounds.width*s,this.unscaledBounds.height*s);if(p.relative&&this.parentState!=null){this.bounds.x+=this.state.x-this.parentState.x;this.bounds.y+=this.state.y-this.parentState.y}l=Math.cos(i);a=Math.sin(i);var g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY());var o=g.x-e.x;var h=g.y-e.y;var v=l*o-a*h;var y=a*o+l*h;var C=v-o;var E=y-h;var S=this.bounds.x-this.state.x;var b=this.bounds.y-this.state.y;var w=l*S-a*b;var T=a*S+l*b;this.bounds.x+=C;this.bounds.y+=E;this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+C/s);this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+E/s);this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width);this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height);if(!this.graph.isCellCollapsed(this.state.cell)&&(C!=0||E!=0)){this.childOffsetX=this.state.x-this.bounds.x+w;this.childOffsetY=this.state.y-this.bounds.y+T}else{this.childOffsetX=0;this.childOffsetY=0}if(!f.equals(this.bounds)){if(this.livePreviewActive){this.updateLivePreview(t)}if(this.preview!=null){this.drawPreview()}else{this.updateParentHighlight()}}};mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale;var i=this.graph.view.translate;var n=this.state.clone();this.state.x=this.bounds.x;this.state.y=this.bounds.y;this.state.origin=new mxPoint(this.state.x/e-i.x,this.state.y/e-i.y);this.state.width=this.bounds.width;this.state.height=this.bounds.height;this.state.absoluteOffset.x=0;this.state.absoluteOffset.y=0;var r=this.graph.getCellGeometry(this.state.cell);if(r!=null){var s=r.offset||this.EMPTY_POINT;if(s!=null&&!r.relative){this.state.absoluteOffset.x=this.state.view.scale*s.x;this.state.absoluteOffset.y=this.state.view.scale*s.y}this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,true);this.state.view.invalidate(this.state.cell);this.state.invalid=false;this.state.view.validate();this.redrawHandles();if(this.movePreviewToFront){this.moveToFront()}if(this.state.control!=null&&this.state.control.node!=null){this.state.control.node.style.visibility="hidden"}this.state.setState(n)};mxVertexHandler.prototype.moveToFront=function(){if(this.state.text!=null&&this.state.text.node!=null&&this.state.text.node.nextSibling!=null||this.state.shape!=null&&this.state.shape.node!=null&&this.state.shape.node.nextSibling!=null&&(this.state.text==null||this.state.shape.node.nextSibling!=this.state.text.node)){if(this.state.shape!=null&&this.state.shape.node!=null){this.state.shape.node.parentNode.appendChild(this.state.shape.node)}if(this.state.text!=null&&this.state.text.node!=null){this.state.text.node.parentNode.appendChild(this.state.text.node)}}};mxVertexHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.state!=null){var i=new mxPoint(e.getGraphX(),e.getGraphY());var n=this.index;this.index=null;if(this.ghostPreview==null){this.state.view.invalidate(this.state.cell,false,false);this.state.view.validate()}this.graph.getModel().beginUpdate();try{if(n<=mxEvent.CUSTOM_HANDLE){if(this.customHandles!=null){var r=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-n].active=false;this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e);if(this.customHandles!=null&&this.customHandles[mxEvent.CUSTOM_HANDLE-n]!=null){this.state.style=r;this.customHandles[mxEvent.CUSTOM_HANDLE-n].positionChanged()}}}else if(n==mxEvent.ROTATION_HANDLE){if(this.currentAlpha!=null){var s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);if(s!=0){this.rotateCell(this.state.cell,s)}}else{this.rotateClick()}}else{var l=this.graph.isGridEnabledEvent(e.getEvent());var a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var o=Math.cos(-a);var h=Math.sin(-a);var u=i.x-this.startX;var d=i.y-this.startY;var p=o*u-h*d;var m=h*u+o*d;u=p;d=m;var c=this.graph.view.scale;var x=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(u/c),this.roundLength(d/c),n,l,this.isConstrainedEvent(e),x)}}finally{this.graph.getModel().endUpdate()}e.consume();this.reset();this.redrawHandles()}};mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)};mxVertexHandler.prototype.rotateClick=function(){};mxVertexHandler.prototype.rotateCell=function(t,e,i){if(e!=0){var n=this.graph.getModel();if(n.isVertex(t)||n.isEdge(t)){if(!n.isEdge(t)){var r=this.graph.getCurrentCellStyle(t);var s=(r[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var l=this.graph.getCellGeometry(t);if(l!=null){var a=this.graph.getCellGeometry(i);if(a!=null&&!n.isEdge(i)){l=l.clone();l.rotate(e,new mxPoint(a.width/2,a.height/2));n.setGeometry(t,l)}if(n.isVertex(t)&&!l.relative||n.isEdge(t)){var o=n.getChildCount(t);for(var h=0;h<o;h++){this.rotateCell(n.getChildAt(t,h),e,t)}}}}}};mxVertexHandler.prototype.reset=function(){if(this.sizers!=null&&this.index!=null&&this.sizers[this.index]!=null&&this.sizers[this.index].node.style.display=="none"){this.sizers[this.index].node.style.display=""}this.currentAlpha=null;this.inTolerance=null;this.index=null;if(this.preview!=null){this.preview.destroy();this.preview=null}if(this.ghostPreview!=null){this.ghostPreview.destroy();this.ghostPreview=null}if(this.livePreviewActive&&this.sizers!=null){for(var t=0;t<this.sizers.length;t++){if(this.sizers[t]!=null){this.sizers[t].node.style.display=""}}if(this.state.control!=null&&this.state.control.node!=null){this.state.control.node.style.visibility=""}}if(this.customHandles!=null){for(var t=0;t<this.customHandles.length;t++){if(this.customHandles[t].active){this.customHandles[t].active=false;this.customHandles[t].reset()}else{this.customHandles[t].setVisible(true)}}}if(this.selectionBorder!=null){this.selectionBorder.node.style.display="inline";this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview()}this.removeHint();this.redrawHandles();this.edgeHandlers=null;this.handlesVisible=true;this.unscaledBounds=null;this.livePreviewActive=null};mxVertexHandler.prototype.resizeCell=function(t,e,i,n,r,s,l){var a=this.graph.model.getGeometry(t);if(a!=null){if(n==mxEvent.LABEL_HANDLE){var o=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var h=Math.cos(o);var u=Math.sin(o);var d=this.graph.view.scale;var p=mxUtils.getRotatedPoint(new mxPoint(Math.round((this.labelShape.bounds.getCenterX()-this.startX)/d),Math.round((this.labelShape.bounds.getCenterY()-this.startY)/d)),h,u);a=a.clone();if(a.offset==null){a.offset=p}else{a.offset.x+=p.x;a.offset.y+=p.y}this.graph.model.setGeometry(t,a)}else if(this.unscaledBounds!=null){var d=this.graph.view.scale;if(this.childOffsetX!=0||this.childOffsetY!=0){this.moveChildren(t,Math.round(this.childOffsetX/d),Math.round(this.childOffsetY/d))}this.graph.resizeCell(t,this.unscaledBounds,l)}}};mxVertexHandler.prototype.moveChildren=function(t,e,i){var n=this.graph.getModel();var r=n.getChildCount(t);for(var s=0;s<r;s++){var l=n.getChildAt(t,s);var a=this.graph.getCellGeometry(l);if(a!=null){a=a.clone();a.translate(e,i);n.setGeometry(l,a)}}};mxVertexHandler.prototype.union=function(t,e,i,n,r,s,l,a,o){r=r!=null?r&&this.graph.gridEnabled:this.graph.gridEnabled;if(this.singleSizer){var h=t.x+t.width+e;var u=t.y+t.height+i;if(r){h=this.graph.snap(h/s)*s;u=this.graph.snap(u/s)*s}var d=new mxRectangle(t.x,t.y,0,0);d.add(new mxRectangle(h,u,0,0));return d}else{var p=t.width;var m=t.height;var c=t.x-l.x*s;var x=c+p;var f=t.y-l.y*s;var g=f+m;var v=c+p/2;var y=f+m/2;if(n>4){g=g+i;if(r){g=this.graph.snap(g/s)*s}else{g=Math.round(g/s)*s}}else if(n<3){f=f+i;if(r){f=this.graph.snap(f/s)*s}else{f=Math.round(f/s)*s}}if(n==0||n==3||n==5){c+=e;if(r){c=this.graph.snap(c/s)*s}else{c=Math.round(c/s)*s}}else if(n==2||n==4||n==7){x+=e;if(r){x=this.graph.snap(x/s)*s}else{x=Math.round(x/s)*s}}var C=x-c;var E=g-f;if(a){var S=this.graph.getCellGeometry(this.state.cell);if(S!=null){var b=S.width/S.height;if(n==1||n==2||n==7||n==6){C=E*b}else{E=C/b}if(n==0){c=x-C;f=g-E}}}if(o){C+=C-p;E+=E-m;var w=v-(c+C/2);var T=y-(f+E/2);c+=w;f+=T;x+=w;g+=T}if(C<0){c+=C;C=Math.abs(C)}if(E<0){f+=E;E=Math.abs(E)}var L=new mxRectangle(c+l.x*s,f+l.y*s,C,E);if(this.minBounds!=null){L.width=Math.max(L.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-L.x));L.height=Math.max(L.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-L.y))}return L}};mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview();if(!t){this.redrawHandles()}};mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0);var e=this.tolerance;if(this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)){e/=2;t.x=this.sizers[0].bounds.width+e;t.y=this.sizers[0].bounds.height+e}return t};mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds};mxVertexHandler.prototype.redrawHandles=function(){var t=this.getSizerBounds();var e=this.tolerance;this.horizontalOffset=0;this.verticalOffset=0;if(this.customHandles!=null){for(var i=0;i<this.customHandles.length;i++){var n=this.customHandles[i].shape.node.style.display;this.customHandles[i].redraw();this.customHandles[i].shape.node.style.display=n;this.customHandles[i].shape.node.style.visibility=this.handlesVisible&&this.isCustomHandleVisible(this.customHandles[i])?"":"hidden"}}if(this.sizers!=null&&this.sizers.length>0&&this.sizers[0]!=null){if(this.index==null&&this.manageSizers&&this.sizers.length>=8){var r=this.getHandlePadding();this.horizontalOffset=r.x;this.verticalOffset=r.y;if(this.horizontalOffset!=0||this.verticalOffset!=0){t=new mxRectangle(t.x,t.y,t.width,t.height);t.x-=this.horizontalOffset/2;t.width+=this.horizontalOffset;t.y-=this.verticalOffset/2;t.height+=this.verticalOffset}if(this.sizers.length>=8){if(t.width<2*this.sizers[0].bounds.width+2*e||t.height<2*this.sizers[0].bounds.height+2*e){this.sizers[0].node.style.display="none";this.sizers[2].node.style.display="none";this.sizers[5].node.style.display="none";this.sizers[7].node.style.display="none"}else if(this.handlesVisible){this.sizers[0].node.style.display="";this.sizers[2].node.style.display="";this.sizers[5].node.style.display="";this.sizers[7].node.style.display=""}}}var s=t.x+t.width;var l=t.y+t.height;if(this.singleSizer){this.moveSizerTo(this.sizers[0],s,l)}else{var a=t.x+t.width/2;var o=t.y+t.height/2;if(this.sizers.length>=8){var h=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"];var u=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");var d=Math.cos(u);var p=Math.sin(u);var m=Math.round(u*4/Math.PI);var c=new mxPoint(t.getCenterX(),t.getCenterY());var x=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),d,p,c);this.moveSizerTo(this.sizers[0],x.x,x.y);this.sizers[0].setCursor(h[mxUtils.mod(0+m,h.length)]);x.x=a;x.y=t.y;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[1],x.x,x.y);this.sizers[1].setCursor(h[mxUtils.mod(1+m,h.length)]);x.x=s;x.y=t.y;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[2],x.x,x.y);this.sizers[2].setCursor(h[mxUtils.mod(2+m,h.length)]);x.x=t.x;x.y=o;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[3],x.x,x.y);this.sizers[3].setCursor(h[mxUtils.mod(7+m,h.length)]);x.x=s;x.y=o;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[4],x.x,x.y);this.sizers[4].setCursor(h[mxUtils.mod(3+m,h.length)]);x.x=t.x;x.y=l;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[5],x.x,x.y);this.sizers[5].setCursor(h[mxUtils.mod(6+m,h.length)]);x.x=a;x.y=l;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[6],x.x,x.y);this.sizers[6].setCursor(h[mxUtils.mod(5+m,h.length)]);x.x=s;x.y=l;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[7],x.x,x.y);this.sizers[7].setCursor(h[mxUtils.mod(4+m,h.length)]);x.x=a+this.state.absoluteOffset.x;x.y=o+this.state.absoluteOffset.y;x=mxUtils.getRotatedPoint(x,d,p,c);this.moveSizerTo(this.sizers[8],x.x,x.y)}else if(this.state.width>=2&&this.state.height>=2){this.moveSizerTo(this.sizers[0],a+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y)}else{this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}}if(this.rotationShape!=null){var u=mxUtils.toRadians(this.currentAlpha!=null?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");var d=Math.cos(u);var p=Math.sin(u);var c=new mxPoint(this.state.getCenterX(),this.state.getCenterY());var x=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),d,p,c);if(this.rotationShape.node!=null){this.moveSizerTo(this.rotationShape,x.x,x.y);this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":""}}if(this.selectionBorder!=null){this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")}if(this.edgeHandlers!=null){for(var i=0;i<this.edgeHandlers.length;i++){this.edgeHandlers[i].redraw()}}};mxVertexHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&this.state.view.graph.getSelectionCount()==1};mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};mxVertexHandler.prototype.isParentHighlightVisible=function(){return!this.graph.isCellSelected(this.graph.model.getParent(this.state.cell))};mxVertexHandler.prototype.updateParentHighlight=function(){if(!this.isDestroyed()){var t=this.isParentHighlightVisible();var e=this.graph.model.getParent(this.state.cell);var i=this.graph.view.getState(e);if(this.parentHighlight!=null){if(this.graph.model.isVertex(e)&&t){var n=this.parentHighlight.bounds;if(i!=null&&(n.x!=i.x||n.y!=i.y||n.width!=i.width||n.height!=i.height)){this.parentHighlight.bounds=mxRectangle.fromRectangle(i);this.parentHighlight.redraw()}}else{if(i!=null&&i.parentHighlight==this.parentHighlight){i.parentHighlight=null}this.parentHighlight.destroy();this.parentHighlight=null}}else if(this.parentHighlightEnabled&&t){if(this.graph.model.isVertex(e)&&i!=null&&i.parentHighlight==null){this.parentHighlight=this.createParentHighlightShape(i);this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;this.parentHighlight.pointerEvents=false;this.parentHighlight.rotation=Number(i.style[mxConstants.STYLE_ROTATION]||"0");this.parentHighlight.init(this.graph.getView().getOverlayPane());this.parentHighlight.redraw();i.parentHighlight=this.parentHighlight}}}};mxVertexHandler.prototype.drawPreview=function(){if(this.preview!=null){this.preview.bounds=this.bounds;if(this.preview.node.parentNode==this.graph.container){this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1);this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)}this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");this.preview.redraw()}this.selectionBorder.bounds=this.getSelectionBorderBounds();this.selectionBorder.redraw();this.updateParentHighlight()};mxVertexHandler.prototype.getSelectionBorderBounds=function(){return this.bounds};mxVertexHandler.prototype.isDestroyed=function(){return this.selectionBorder==null};mxVertexHandler.prototype.destroy=function(){if(this.escapeHandler!=null){this.state.view.graph.removeListener(this.escapeHandler);this.escapeHandler=null}if(this.preview!=null){this.preview.destroy();this.preview=null}if(this.parentHighlight!=null){var t=this.graph.model.getParent(this.state.cell);var e=this.graph.view.getState(t);if(e!=null&&e.parentHighlight==this.parentHighlight){e.parentHighlight=null}this.parentHighlight.destroy();this.parentHighlight=null}if(this.ghostPreview!=null){this.ghostPreview.destroy();this.ghostPreview=null}if(this.selectionBorder!=null){this.selectionBorder.destroy();this.selectionBorder=null}this.labelShape=null;this.removeHint();if(this.sizers!=null){for(var i=0;i<this.sizers.length;i++){this.sizers[i].destroy()}this.sizers=null}if(this.customHandles!=null){for(var i=0;i<this.customHandles.length;i++){this.customHandles[i].destroy()}this.customHandles=null}};__mxOutput.mxVertexHandler=typeof mxVertexHandler!=="undefined"?mxVertexHandler:undefined;function mxEdgeHandler(t){if(t!=null&&t.shape!=null){this.state=t;this.init();this.escapeHandler=mxUtils.bind(this,(function(e,i){var n=this.index!=null;this.reset();if(n){this.graph.cellRenderer.redraw(this.state,false,t.view.isRendering())}}));this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}}mxEdgeHandler.prototype.graph=null;mxEdgeHandler.prototype.state=null;mxEdgeHandler.prototype.marker=null;mxEdgeHandler.prototype.constraintHandler=null;mxEdgeHandler.prototype.error=null;mxEdgeHandler.prototype.shape=null;mxEdgeHandler.prototype.bends=null;mxEdgeHandler.prototype.labelShape=null;mxEdgeHandler.prototype.cloneEnabled=true;mxEdgeHandler.prototype.addEnabled=false;mxEdgeHandler.prototype.removeEnabled=false;mxEdgeHandler.prototype.dblClickRemoveEnabled=false;mxEdgeHandler.prototype.mergeRemoveEnabled=false;mxEdgeHandler.prototype.straightRemoveEnabled=false;mxEdgeHandler.prototype.virtualBendsEnabled=false;mxEdgeHandler.prototype.virtualBendOpacity=20;mxEdgeHandler.prototype.parentHighlightEnabled=false;mxEdgeHandler.prototype.preferHtml=false;mxEdgeHandler.prototype.allowHandleBoundsCheck=true;mxEdgeHandler.prototype.snapToTerminals=false;mxEdgeHandler.prototype.handleImage=null;mxEdgeHandler.prototype.tolerance=0;mxEdgeHandler.prototype.outlineConnect=false;mxEdgeHandler.prototype.manageLabelHandle=false;mxEdgeHandler.prototype.init=function(){this.graph=this.state.view.graph;this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.points=[];this.abspoints=this.getSelectionPoints(this.state);this.shape=this.createSelectionShape(this.abspoints);this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;this.shape.init(this.graph.getView().getOverlayPane());this.shape.pointerEvents=false;this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE);mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.preferHtml=this.state.text!=null&&this.state.text.node.parentNode==this.graph.container;if(!this.preferHtml){var t=this.state.getVisibleTerminalState(true);if(t!=null){this.preferHtml=t.text!=null&&t.text.node.parentNode==this.graph.container}if(!this.preferHtml){var e=this.state.getVisibleTerminalState(false);if(e!=null){this.preferHtml=e.text!=null&&e.text.node.parentNode==this.graph.container}}}if(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0){this.bends=this.createBends();if(this.isVirtualBendsEnabled()){this.virtualBends=this.createVirtualBends()}}this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape=this.createLabelHandleShape();this.initBend(this.labelShape);this.labelShape.setCursor(mxConstants.CURSOR_LABEL_HANDLE);this.customHandles=this.createCustomHandles();this.updateParentHighlight();this.redraw()};mxEdgeHandler.prototype.isParentHighlightVisible=mxVertexHandler.prototype.isParentHighlightVisible;mxEdgeHandler.prototype.updateParentHighlight=mxVertexHandler.prototype.updateParentHighlight;mxEdgeHandler.prototype.createCustomHandles=function(){return null};mxEdgeHandler.prototype.isVirtualBendsEnabled=function(t){return this.virtualBendsEnabled&&(this.state.style[mxConstants.STYLE_EDGE]==null||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||this.state.style[mxConstants.STYLE_NOEDGESTYLE]==1)&&mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)!="arrow"};mxEdgeHandler.prototype.isCellEnabled=function(t){return true};mxEdgeHandler.prototype.isAddPointEvent=function(t){return mxEvent.isShiftDown(t)};mxEdgeHandler.prototype.isRemovePointEvent=function(t){return mxEvent.isShiftDown(t)};mxEdgeHandler.prototype.getSelectionPoints=function(t){return t.absolutePoints};mxEdgeHandler.prototype.createParentHighlightShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());e.strokewidth=this.getSelectionStrokeWidth();e.isDashed=this.isSelectionDashed();return e};mxEdgeHandler.prototype.createSelectionShape=function(t){var e=new this.state.shape.constructor;e.outline=true;e.apply(this.state);e.isDashed=this.isSelectionDashed();e.stroke=this.getSelectionColor();e.isShadow=false;return e};mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR};mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH};mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED};mxEdgeHandler.prototype.isConnectableCell=function(t){return true};mxEdgeHandler.prototype.getCellAt=function(t,e){return!this.outlineConnect?this.graph.getCellAt(t,e):null};mxEdgeHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph);var e=this;t.getCell=function(t){var i=mxCellMarker.prototype.getCell.apply(this,arguments);if((i==e.state.cell||i==null)&&e.currentPoint!=null){i=e.graph.getCellAt(e.currentPoint.x,e.currentPoint.y)}if(i!=null&&!this.graph.isCellConnectable(i)){var n=this.graph.getModel().getParent(i);if(this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)){i=n}}var r=e.graph.getModel();if(this.graph.isSwimlane(i)&&e.currentPoint!=null&&this.graph.hitsSwimlaneContent(i,e.currentPoint.x,e.currentPoint.y)||!e.isConnectableCell(i)||(i==e.state.cell||i!=null&&!e.graph.connectableEdges&&r.isEdge(i))||r.isAncestor(e.state.cell,i)){i=null}if(!this.graph.isCellConnectable(i)){i=null}return i};t.isValidState=function(t){var i=e.graph.getModel();var n=e.graph.view.getTerminalPort(t,e.graph.view.getState(i.getTerminal(e.state.cell,!e.isSource)),!e.isSource);var r=n!=null?n.cell:null;var s=e.isSource?t.cell:r;var l=e.isSource?r:t.cell;e.error=e.validateConnection(s,l);return e.error==null};return t};mxEdgeHandler.prototype.validateConnection=function(t,e){return this.graph.getEdgeValidationError(this.state.cell,t,e)};mxEdgeHandler.prototype.createBends=function(){var t=this.state.cell;var e=[];for(var i=0;i<this.abspoints.length;i++){if(this.isHandleVisible(i)){var n=i==0;var r=i==this.abspoints.length-1;var s=n||r;if(s||this.graph.isCellBendable(t)){mxUtils.bind(this,(function(t){var n=this.createHandleShape(t);this.initBend(n,mxUtils.bind(this,mxUtils.bind(this,(function(){if(this.dblClickRemoveEnabled){this.removePoint(this.state,t)}}))));if(this.isHandleEnabled(i)){n.setCursor(s?mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE)}e.push(n);if(!s){this.points.push(new mxPoint(0,0));n.node.style.visibility="hidden"}}))(i)}}}return e};mxEdgeHandler.prototype.createVirtualBends=function(){var t=this.state.cell;var e=[];if(this.graph.isCellBendable(t)){for(var i=1;i<this.abspoints.length;i++){mxUtils.bind(this,(function(t){this.initBend(t);t.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE);e.push(t)}))(this.createHandleShape())}}return e};mxEdgeHandler.prototype.isHandleEnabled=function(t){return true};mxEdgeHandler.prototype.isHandleVisible=function(t){var e=this.state.getVisibleTerminalState(true);var i=this.state.getVisibleTerminalState(false);var n=this.graph.getCellGeometry(this.state.cell);var r=n!=null?this.graph.view.getEdgeStyle(this.state,n.points,e,i):null;return r!=mxEdgeStyle.EntityRelation||t==0||t==this.abspoints.length-1};mxEdgeHandler.prototype.createHandleShape=function(t){if(this.handleImage!=null){var e=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src);e.preserveImageAspect=false;return e}else{var i=mxConstants.HANDLE_SIZE;if(this.preferHtml){i-=1}return new mxRectangleShape(new mxRectangle(0,0,i,i),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}};mxEdgeHandler.prototype.createLabelHandleShape=function(){if(this.labelHandleImage!=null){var t=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);t.preserveImageAspect=false;return t}else{var e=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}};mxEdgeHandler.prototype.initBend=function(t,e){if(this.preferHtml){t.dialect=mxConstants.DIALECT_STRICTHTML;t.init(this.graph.container)}else{t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;t.init(this.graph.getView().getOverlayPane())}mxEvent.redirectMouseEvents(t.node,this.graph,this.state,null,null,null,e);if(mxClient.IS_QUIRKS||document.documentMode==8){mxEvent.addListener(t.node,"dragstart",(function(t){mxEvent.consume(t);return false}))}if(mxClient.IS_TOUCH){t.node.setAttribute("pointer-events","none")}};mxEdgeHandler.prototype.getHandleForEvent=function(t){var e=null;if(this.state!=null){var i=!mxEvent.isMouseEvent(t.getEvent())?this.tolerance:1;var n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||i>0)?new mxRectangle(t.getGraphX()-i,t.getGraphY()-i,2*i,2*i):null;var r=null;function s(e){if(e!=null&&e.node!=null&&e.node.style.display!="none"&&e.node.style.visibility!="hidden"&&(t.isSource(e)||n!=null&&mxUtils.intersects(e.bounds,n))){var i=t.getGraphX()-e.bounds.getCenterX();var s=t.getGraphY()-e.bounds.getCenterY();var l=i*i+s*s;if(r==null||l<=r){r=l;return true}}return false}if(this.customHandles!=null&&this.isCustomHandleEvent(t)){for(var l=this.customHandles.length-1;l>=0;l--){if(s(this.customHandles[l].shape)){return mxEvent.CUSTOM_HANDLE-l}}}if(t.isSource(this.state.text)||s(this.labelShape)){e=mxEvent.LABEL_HANDLE}if(this.bends!=null){for(var l=0;l<this.bends.length;l++){if(s(this.bends[l])){e=l}}}if(this.virtualBends!=null&&this.isAddVirtualBendEvent(t)){for(var l=0;l<this.virtualBends.length;l++){if(s(this.virtualBends[l])){e=mxEvent.VIRTUAL_HANDLE-l}}}}return e};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(t){return true};mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return true};mxEdgeHandler.prototype.mouseDown=function(t,e){var i=this.getHandleForEvent(e);if(this.bends!=null&&this.bends[i]!=null){var n=this.bends[i].bounds;this.snapPoint=new mxPoint(n.getCenterX(),n.getCenterY())}if(this.addEnabled&&i==null&&this.isAddPointEvent(e.getEvent())){this.addPoint(this.state,e.getEvent());e.consume()}else if(i!=null&&!e.isConsumed()&&this.graph.isEnabled()){if(this.removeEnabled&&this.isRemovePointEvent(e.getEvent())){this.removePoint(this.state,i)}else if(i!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(e.getCell())){if(i<=mxEvent.VIRTUAL_HANDLE){mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-i].node,100)}this.start(e.getX(),e.getY(),i)}e.consume()}};mxEdgeHandler.prototype.start=function(t,e,i){this.startX=t;this.startY=e;this.isSource=this.bends==null?false:i==0;this.isTarget=this.bends==null?false:i==this.bends.length-1;this.isLabel=i==mxEvent.LABEL_HANDLE;if(this.isSource||this.isTarget){var n=this.state.cell;var r=this.graph.model.getTerminal(n,this.isSource);if(r==null&&this.graph.isTerminalPointMovable(n,this.isSource)||r!=null&&this.graph.isCellDisconnectable(n,r,this.isSource)){this.index=i}}else{this.index=i}if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){for(var s=0;s<this.customHandles.length;s++){if(s!=mxEvent.CUSTOM_HANDLE-this.index){this.customHandles[s].setVisible(false)}}}}};mxEdgeHandler.prototype.clonePreviewState=function(t,e){return this.state.clone()};mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2};mxEdgeHandler.prototype.updateHint=function(t,e){};mxEdgeHandler.prototype.removeHint=function(){};mxEdgeHandler.prototype.roundLength=function(t){return Math.round(t)};mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(t){return this.snapToTerminals&&!mxEvent.isAltDown(t.getEvent())};mxEdgeHandler.prototype.getPointForEvent=function(t){var e=this.graph.getView();var i=e.scale;var n=new mxPoint(this.roundLength(t.getGraphX()/i)*i,this.roundLength(t.getGraphY()/i)*i);var r=this.getSnapToTerminalTolerance();var s=false;var l=false;if(r>0&&this.isSnapToTerminalsEvent(t)){function a(t){if(t!=null){var e=t.x;if(Math.abs(n.x-e)<r){n.x=e;s=true}var i=t.y;if(Math.abs(n.y-i)<r){n.y=i;l=true}}}function o(t){if(t!=null){a.call(this,new mxPoint(e.getRoutingCenterX(t),e.getRoutingCenterY(t)))}}o.call(this,this.state.getVisibleTerminalState(true));o.call(this,this.state.getVisibleTerminalState(false));if(this.state.absolutePoints!=null){for(var h=0;h<this.state.absolutePoints.length;h++){a.call(this,this.state.absolutePoints[h])}}}if(this.graph.isGridEnabledEvent(t.getEvent())){var u=e.translate;if(!s){n.x=(this.graph.snap(n.x/i-u.x)+u.x)*i}if(!l){n.y=(this.graph.snap(n.y/i-u.y)+u.y)*i}}return n};mxEdgeHandler.prototype.getPreviewTerminalState=function(t){this.constraintHandler.update(t,this.isSource,true,t.isSource(this.marker.highlight.shape)?null:this.currentPoint);if(this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentConstraint!=null){if(this.marker.highlight!=null&&this.marker.highlight.state!=null&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell){if(this.marker.highlight.shape.stroke!="transparent"){this.marker.highlight.shape.stroke="transparent";this.marker.highlight.repaint()}}else{this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent")}var e=this.graph.getModel();var i=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(e.getTerminal(this.state.cell,!this.isSource)),!this.isSource);var n=i!=null?i.cell:null;var r=this.isSource?this.constraintHandler.currentFocus.cell:n;var s=this.isSource?n:this.constraintHandler.currentFocus.cell;this.error=this.validateConnection(r,s);var l=null;if(this.error==null){l=this.constraintHandler.currentFocus}if(this.error!=null||l!=null&&!this.isCellEnabled(l.cell)){this.constraintHandler.reset()}return l}else if(!this.graph.isIgnoreTerminalEvent(t.getEvent())){this.marker.process(t);var a=this.marker.getValidState();if(a!=null&&!this.isCellEnabled(a.cell)){this.constraintHandler.reset();this.marker.reset()}return this.marker.getValidState()}else{this.marker.reset();return null}};mxEdgeHandler.prototype.getPreviewPoints=function(t,e){var i=this.graph.getCellGeometry(this.state.cell);var n=i.points!=null?i.points.slice():null;var r=new mxPoint(t.x,t.y);var s=null;if(!this.isSource&&!this.isTarget){this.convertPoint(r,false);if(n==null){n=[r]}else{if(this.index<=mxEvent.VIRTUAL_HANDLE){n.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,r)}if(!this.isSource&&!this.isTarget){for(var l=0;l<this.bends.length;l++){if(l!=this.index){var a=this.bends[l];if(a!=null&&mxUtils.contains(a.bounds,t.x,t.y)){if(this.index<=mxEvent.VIRTUAL_HANDLE){n.splice(mxEvent.VIRTUAL_HANDLE-this.index,1)}else{n.splice(this.index-1,1)}s=n}}}if(s==null&&this.straightRemoveEnabled&&(e==null||!mxEvent.isAltDown(e.getEvent()))){var o=this.graph.tolerance*this.graph.tolerance;var h=this.state.absolutePoints.slice();h[this.index]=t;var u=this.state.getVisibleTerminalState(true);if(u!=null){var d=this.graph.getConnectionConstraint(this.state,u,true);if(d==null||this.graph.getConnectionPoint(u,d)==null){h[0]=new mxPoint(u.view.getRoutingCenterX(u),u.view.getRoutingCenterY(u))}}var p=this.state.getVisibleTerminalState(false);if(p!=null){var d=this.graph.getConnectionConstraint(this.state,p,false);if(d==null||this.graph.getConnectionPoint(p,d)==null){h[h.length-1]=new mxPoint(p.view.getRoutingCenterX(p),p.view.getRoutingCenterY(p))}}function m(t,e){if(t>0&&t<h.length-1&&mxUtils.ptSegDistSq(h[t-1].x,h[t-1].y,h[t+1].x,h[t+1].y,e.x,e.y)<o){n.splice(t-1,1);s=n}}m(this.index,t)}}if(s==null&&this.index>mxEvent.VIRTUAL_HANDLE){n[this.index-1]=r}}}else if(this.graph.resetEdgesOnConnect){n=null}return s!=null?s:n};mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container);var i=t.getEvent();var n=mxEvent.getClientX(i);var r=mxEvent.getClientY(i);var s=document.documentElement;var l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0);var a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0);var o=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l;var h=this.currentPoint.y-this.graph.container.scrollTop+e.y-a;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&t.getState()!=null||this.marker.highlight.isHighlightAt(n,r)||(o!=n||h!=r)&&t.getState()==null&&this.marker.highlight.isHighlightAt(o,h))};mxEdgeHandler.prototype.updatePreviewState=function(t,e,i,n,r){var s=this.isSource?i:this.state.getVisibleTerminalState(true);var l=this.isTarget?i:this.state.getVisibleTerminalState(false);var a=this.graph.getConnectionConstraint(t,s,true);var o=this.graph.getConnectionConstraint(t,l,false);var h=this.constraintHandler.currentConstraint;if(h==null&&r){if(i!=null){if(n.isSource(this.marker.highlight.shape)){e=new mxPoint(n.getGraphX(),n.getGraphY())}h=this.graph.getOutlineConstraint(e,i,n);this.constraintHandler.setFocus(n,i,this.isSource);this.constraintHandler.currentConstraint=h;this.constraintHandler.currentPoint=e}else{h=new mxConnectionConstraint}}if(this.outlineConnect&&this.marker.highlight!=null&&this.marker.highlight.shape!=null){var u=this.graph.view.scale;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){this.marker.highlight.shape.stroke=r?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent";this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/u/u;this.marker.highlight.repaint()}else if(this.marker.hasValidState()){this.marker.highlight.shape.stroke=this.graph.isCellConnectable(n.getCell())&&this.marker.getValidState()!=n.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR;this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/u/u;this.marker.highlight.repaint()}}if(this.isSource){a=h}else if(this.isTarget){o=h}if(this.isSource||this.isTarget){if(h!=null&&h.point!=null){t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=h.point.x;t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=h.point.y}else{delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]}}t.setVisibleTerminalState(s,true);t.setVisibleTerminalState(l,false);if(!this.isSource||s!=null){t.view.updateFixedTerminalPoint(t,s,true,a)}if(!this.isTarget||l!=null){t.view.updateFixedTerminalPoint(t,l,false,o)}if((this.isSource||this.isTarget)&&i==null){t.setAbsoluteTerminalPoint(e,this.isSource);if(this.marker.getMarkedState()==null){this.error=this.graph.allowDanglingEdges?null:""}}t.view.updatePoints(t,this.points,s,l);t.view.updateFloatingTerminalPoints(t,s,l)};mxEdgeHandler.prototype.mouseMove=function(t,e){if(this.index!=null&&this.marker!=null){this.currentPoint=this.getPointForEvent(e);this.error=null;if(!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&this.snapPoint!=null){if(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)){this.currentPoint.x=this.snapPoint.x}else{this.currentPoint.y=this.snapPoint.y}}if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged();if(this.shape!=null&&this.shape.node!=null){this.shape.node.style.display="none"}}}else if(this.isLabel){this.label.x=this.currentPoint.x;this.label.y=this.currentPoint.y}else{this.points=this.getPreviewPoints(this.currentPoint,e);var i=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null&&this.constraintHandler.currentPoint!=null){this.currentPoint=this.constraintHandler.currentPoint.clone()}else if(this.outlineConnect){var n=this.isSource||this.isTarget?this.isOutlineConnectEvent(e):false;if(n){i=this.marker.highlight.state}else if(i!=null&&i!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&this.marker.highlight.shape!=null){this.marker.highlight.shape.stroke="transparent";this.marker.highlight.repaint();i=null}}if(i!=null&&!this.isCellEnabled(i.cell)){i=null;this.marker.reset()}var r=this.clonePreviewState(this.currentPoint,i!=null?i.cell:null);this.updatePreviewState(r,this.currentPoint,i,e,n);var s=this.error==null?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(s);this.abspoints=r.absolutePoints;this.active=true;this.updateHint(e,this.currentPoint)}this.drawPreview();mxEvent.consume(e.getEvent());e.consume()}else if(mxClient.IS_IE&&this.getHandleForEvent(e)!=null){e.consume(false)}};mxEdgeHandler.prototype.mouseUp=function(t,e){if(this.index!=null&&this.marker!=null){if(this.shape!=null&&this.shape.node!=null){this.shape.node.style.display=""}var i=this.state.cell;var n=this.index;this.index=null;if(e.getX()!=this.startX||e.getY()!=this.startY){var r=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(this.error!=null){if(this.error.length>0){this.graph.validationAlert(this.error)}}else if(n<=mxEvent.CUSTOM_HANDLE&&n>mxEvent.VIRTUAL_HANDLE){if(this.customHandles!=null){var s=this.graph.getModel();s.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-n].execute(e);if(this.shape!=null&&this.shape.node!=null){this.shape.apply(this.state);this.shape.redraw()}}finally{s.endUpdate()}}}else if(this.isLabel){this.moveLabel(this.state,this.label.x,this.label.y)}else if(this.isSource||this.isTarget){var l=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){l=this.constraintHandler.currentFocus.cell}if(l==null&&this.marker.hasValidState()&&this.marker.highlight!=null&&this.marker.highlight.shape!=null&&this.marker.highlight.shape.stroke!="transparent"&&this.marker.highlight.shape.stroke!="white"){l=this.marker.validState.cell}if(l!=null){var s=this.graph.getModel();var a=s.getParent(i);s.beginUpdate();try{if(r){var o=s.getGeometry(i);var r=this.graph.cloneCell(i);s.add(a,r,s.getChildCount(a));if(o!=null){o=o.clone();s.setGeometry(r,o)}var h=s.getTerminal(i,!this.isSource);this.graph.connectCell(r,h,!this.isSource);i=r}i=this.connect(i,l,this.isSource,r,e)}finally{s.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var u=this.abspoints[this.isSource?0:this.abspoints.length-1];u.x=this.roundLength(u.x/this.graph.view.scale-this.graph.view.translate.x);u.y=this.roundLength(u.y/this.graph.view.scale-this.graph.view.translate.y);var d=this.graph.getView().getState(this.graph.getModel().getParent(i));if(d!=null){u.x-=d.origin.x;u.y-=d.origin.y}u.x-=this.graph.panDx/this.graph.view.scale;u.y-=this.graph.panDy/this.graph.view.scale;i=this.changeTerminalPoint(i,u,this.isSource,r)}}else if(this.active){i=this.changePoints(i,this.points,r)}else{this.graph.getView().invalidate(this.state.cell);this.graph.getView().validate(this.state.cell)}}else if(this.graph.isToggleEvent(e.getEvent())){this.graph.selectCellForEvent(this.state.cell,e.getEvent())}if(this.marker!=null){this.reset();if(i!=this.state.cell){this.graph.setSelectionCell(i)}}e.consume()}};mxEdgeHandler.prototype.reset=function(){if(this.active){this.refresh()}this.error=null;this.index=null;this.label=null;this.points=null;this.snapPoint=null;this.isLabel=false;this.isSource=false;this.isTarget=false;this.active=false;if(this.livePreview&&this.sizers!=null){for(var t=0;t<this.sizers.length;t++){if(this.sizers[t]!=null){this.sizers[t].node.style.display=""}}}if(this.marker!=null){this.marker.reset()}if(this.constraintHandler!=null){this.constraintHandler.reset()}if(this.customHandles!=null){for(var t=0;t<this.customHandles.length;t++){this.customHandles[t].reset()}}this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR);this.removeHint();this.redraw()};mxEdgeHandler.prototype.setPreviewColor=function(t){if(this.shape!=null){this.shape.stroke=t}};mxEdgeHandler.prototype.convertPoint=function(t,e){var i=this.graph.getView().getScale();var n=this.graph.getView().getTranslate();if(e){t.x=this.graph.snap(t.x);t.y=this.graph.snap(t.y)}t.x=Math.round(t.x/i-n.x);t.y=Math.round(t.y/i-n.y);var r=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));if(r!=null){t.x-=r.origin.x;t.y-=r.origin.y}return t};mxEdgeHandler.prototype.moveLabel=function(t,e,i){var n=this.graph.getModel();var r=n.getGeometry(t.cell);if(r!=null){var s=this.graph.getView().scale;r=r.clone();if(r.relative){var l=this.graph.getView().getRelativePoint(t,e,i);r.x=Math.round(l.x*1e4)/1e4;r.y=Math.round(l.y);r.offset=new mxPoint(0,0);var l=this.graph.view.getPoint(t,r);r.offset=new mxPoint(Math.round((e-l.x)/s),Math.round((i-l.y)/s))}else{var a=t.absolutePoints;var o=a[0];var h=a[a.length-1];if(o!=null&&h!=null){var u=o.x+(h.x-o.x)/2;var d=o.y+(h.y-o.y)/2;r.offset=new mxPoint(Math.round((e-u)/s),Math.round((i-d)/s));r.x=0;r.y=0}}n.setGeometry(t.cell,r)}};mxEdgeHandler.prototype.connect=function(t,e,i,n,r){var s=this.graph.getModel();var l=s.getParent(t);s.beginUpdate();try{var a=this.constraintHandler.currentConstraint;if(a==null){a=new mxConnectionConstraint}this.graph.connectCell(t,e,i,a)}finally{s.endUpdate()}return t};mxEdgeHandler.prototype.changeTerminalPoint=function(t,e,i,n){var r=this.graph.getModel();r.beginUpdate();try{if(n){var s=r.getParent(t);var l=r.getTerminal(t,!i);t=this.graph.cloneCell(t);r.add(s,t,r.getChildCount(s));r.setTerminal(t,l,!i)}var a=r.getGeometry(t);if(a!=null){a=a.clone();a.setTerminalPoint(e,i);r.setGeometry(t,a);this.graph.connectCell(t,null,i,new mxConnectionConstraint)}}finally{r.endUpdate()}return t};mxEdgeHandler.prototype.changePoints=function(t,e,i){var n=this.graph.getModel();n.beginUpdate();try{if(i){var r=n.getParent(t);var s=n.getTerminal(t,true);var l=n.getTerminal(t,false);t=this.graph.cloneCell(t);n.add(r,t,n.getChildCount(r));n.setTerminal(t,s,true);n.setTerminal(t,l,false)}var a=n.getGeometry(t);if(a!=null){a=a.clone();a.points=e;n.setGeometry(t,a)}}finally{n.endUpdate()}return t};mxEdgeHandler.prototype.addPoint=function(t,e){var i=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));var n=this.graph.isGridEnabledEvent(e);this.convertPoint(i,n);this.addPointAt(t,i.x,i.y);mxEvent.consume(e)};mxEdgeHandler.prototype.addPointAt=function(t,e,i){var n=this.graph.getCellGeometry(t.cell);var r=new mxPoint(e,i);if(n!=null){n=n.clone();var s=this.graph.view.translate;var l=this.graph.view.scale;var a=new mxPoint(s.x*l,s.y*l);var o=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(o)){var h=this.graph.view.getState(o);a=new mxPoint(h.x,h.y)}var u=mxUtils.findNearestSegment(t,r.x*l+a.x,r.y*l+a.y);if(n.points==null){n.points=[r]}else{n.points.splice(u,0,r)}this.graph.getModel().setGeometry(t.cell,n);this.refresh();this.redraw()}};mxEdgeHandler.prototype.removePoint=function(t,e){if(e>0&&e<this.abspoints.length-1){var i=this.graph.getCellGeometry(this.state.cell);if(i!=null&&i.points!=null){i=i.clone();i.points.splice(e-1,1);this.graph.getModel().setGeometry(t.cell,i);this.refresh();this.redraw()}}};mxEdgeHandler.prototype.getHandleFillColor=function(t){var e=t==0;var i=this.state.cell;var n=this.graph.getModel().getTerminal(i,e);var r=mxConstants.HANDLE_FILLCOLOR;if(n!=null&&!this.graph.isCellDisconnectable(i,n,e)||n==null&&!this.graph.isTerminalPointMovable(i,e)){r=mxConstants.LOCKED_HANDLE_FILLCOLOR}else if(n!=null&&this.graph.isCellDisconnectable(i,n,e)){r=mxConstants.CONNECT_HANDLE_FILLCOLOR}return r};mxEdgeHandler.prototype.redraw=function(t){if(this.state!=null){this.abspoints=this.state.absolutePoints.slice();var e=this.graph.getModel().getGeometry(this.state.cell);if(e!=null){var i=e.points;if(this.bends!=null&&this.bends.length>0){if(i!=null){if(this.points==null){this.points=[]}for(var n=1;n<this.bends.length-1;n++){if(this.bends[n]!=null&&this.abspoints[n]!=null){this.points[n-1]=i[n-1]}}}}}this.drawPreview();if(!t){this.redrawHandles()}}};mxEdgeHandler.prototype.redrawHandles=function(){var t=this.state.cell;var e=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-e.width/2),Math.round(this.label.y-e.height/2),e.width,e.height);var i=this.graph.getLabel(t);this.labelShape.visible=i!=null&&i.length>0&&this.graph.isLabelMovable(t);if(this.bends!=null&&this.bends.length>0){var n=this.abspoints.length-1;var r=this.abspoints[0];var s=r.x;var l=r.y;e=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(l-e.height/2),e.width,e.height);this.bends[0].fill=this.getHandleFillColor(0);this.bends[0].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[0].bounds)}var a=this.abspoints[n];var o=a.x;var h=a.y;var u=this.bends.length-1;e=this.bends[u].bounds;this.bends[u].bounds=new mxRectangle(Math.floor(o-e.width/2),Math.floor(h-e.height/2),e.width,e.height);this.bends[u].fill=this.getHandleFillColor(u);this.bends[u].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[u].bounds)}this.redrawInnerBends(r,a)}if(this.abspoints!=null&&this.virtualBends!=null&&this.virtualBends.length>0){var d=this.abspoints[0];for(var p=0;p<this.virtualBends.length;p++){if(this.virtualBends[p]!=null&&this.abspoints[p+1]!=null){var m=this.abspoints[p+1];var e=this.virtualBends[p];var c=d.x+(m.x-d.x)/2;var x=d.y+(m.y-d.y)/2;e.bounds=new mxRectangle(Math.floor(c-e.bounds.width/2),Math.floor(x-e.bounds.height/2),e.bounds.width,e.bounds.height);e.redraw();mxUtils.setOpacity(e.node,this.virtualBendOpacity);d=m;if(this.manageLabelHandle){this.checkLabelHandle(e.bounds)}}}}if(this.labelShape!=null){this.labelShape.redraw()}if(this.customHandles!=null){for(var p=0;p<this.customHandles.length;p++){var f=this.customHandles[p].shape.node.style.display;this.customHandles[p].redraw();this.customHandles[p].shape.node.style.display=f;this.customHandles[p].shape.node.style.visibility=this.isCustomHandleVisible(this.customHandles[p])?"":"hidden"}}};mxEdgeHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&this.state.view.graph.getSelectionCount()==1};mxEdgeHandler.prototype.setHandlesVisible=function(t){if(this.bends!=null){for(var e=0;e<this.bends.length;e++){this.bends[e].node.style.display=t?"":"none"}}if(this.virtualBends!=null){for(var e=0;e<this.virtualBends.length;e++){this.virtualBends[e].node.style.display=t?"":"none"}}if(this.labelShape!=null){this.labelShape.node.style.display=t?"":"none"}if(this.customHandles!=null){for(var e=0;e<this.customHandles.length;e++){this.customHandles[e].setVisible(t)}}};mxEdgeHandler.prototype.redrawInnerBends=function(t,e){for(var i=1;i<this.bends.length-1;i++){if(this.bends[i]!=null){if(this.abspoints[i]!=null){var n=this.abspoints[i].x;var r=this.abspoints[i].y;var s=this.bends[i].bounds;this.bends[i].node.style.visibility="visible";this.bends[i].bounds=new mxRectangle(Math.round(n-s.width/2),Math.round(r-s.height/2),s.width,s.height);if(this.manageLabelHandle){this.checkLabelHandle(this.bends[i].bounds)}else if(this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(this.bends[i].bounds,this.labelShape.bounds)){w=mxConstants.HANDLE_SIZE+3;h=mxConstants.HANDLE_SIZE+3;this.bends[i].bounds=new mxRectangle(Math.round(n-w/2),Math.round(r-h/2),w,h)}this.bends[i].redraw()}else{this.bends[i].destroy();this.bends[i]=null}}}};mxEdgeHandler.prototype.checkLabelHandle=function(t){if(this.labelShape!=null){var e=this.labelShape.bounds;if(mxUtils.intersects(t,e)){if(t.getCenterY()<e.getCenterY()){e.y=t.y+t.height}else{e.y=t.y-e.height}}}};mxEdgeHandler.prototype.drawPreview=function(){try{if(this.isLabel){var t=this.labelShape.bounds;var e=new mxRectangle(Math.round(this.label.x-t.width/2),Math.round(this.label.y-t.height/2),t.width,t.height);if(!this.labelShape.bounds.equals(e)){this.labelShape.bounds=e;this.labelShape.redraw()}}if(this.shape!=null&&!mxUtils.equalPoints(this.shape.points,this.abspoints)){this.shape.apply(this.state);this.shape.points=this.abspoints.slice();this.shape.scale=this.state.view.scale;this.shape.isDashed=this.isSelectionDashed();this.shape.stroke=this.getSelectionColor();this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale;this.shape.isShadow=false;this.shape.redraw()}this.updateParentHighlight()}catch(i){}};mxEdgeHandler.prototype.refresh=function(){if(this.state!=null){this.abspoints=this.getSelectionPoints(this.state);this.points=[];if(this.bends!=null){this.destroyBends(this.bends);this.bends=this.createBends()}if(this.virtualBends!=null){this.destroyBends(this.virtualBends);this.virtualBends=this.createVirtualBends()}if(this.customHandles!=null){this.destroyBends(this.customHandles);this.customHandles=this.createCustomHandles()}if(this.labelShape!=null&&this.labelShape.node!=null&&this.labelShape.node.parentNode!=null){this.labelShape.node.parentNode.appendChild(this.labelShape.node)}}};mxEdgeHandler.prototype.isDestroyed=function(){return this.shape==null};mxEdgeHandler.prototype.destroyBends=function(t){if(t!=null){for(var e=0;e<t.length;e++){if(t[e]!=null){t[e].destroy()}}}};mxEdgeHandler.prototype.destroy=function(){if(this.escapeHandler!=null){this.state.view.graph.removeListener(this.escapeHandler);this.escapeHandler=null}if(this.marker!=null){this.marker.destroy();this.marker=null}if(this.shape!=null){this.shape.destroy();this.shape=null}if(this.parentHighlight!=null){var t=this.graph.model.getParent(this.state.cell);var e=this.graph.view.getState(t);if(e!=null&&e.parentHighlight==this.parentHighlight){e.parentHighlight=null}this.parentHighlight.destroy();this.parentHighlight=null}if(this.labelShape!=null){this.labelShape.destroy();this.labelShape=null}if(this.constraintHandler!=null){this.constraintHandler.destroy();this.constraintHandler=null}this.destroyBends(this.virtualBends);this.virtualBends=null;this.destroyBends(this.customHandles);this.customHandles=null;this.destroyBends(this.bends);this.bends=null;this.removeHint()};__mxOutput.mxEdgeHandler=typeof mxEdgeHandler!=="undefined"?mxEdgeHandler:undefined;function mxElbowEdgeHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler);mxElbowEdgeHandler.prototype.flipEnabled=true;mxElbowEdgeHandler.prototype.doubleClickOrientationResource=mxClient.language!="none"?"doubleClickOrientation":"";mxElbowEdgeHandler.prototype.createBends=function(){var t=[];var e=this.createHandleShape(0);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);t.push(this.createVirtualBend(mxUtils.bind(this,(function(t){if(!mxEvent.isConsumed(t)&&this.flipEnabled){this.graph.flipEdge(this.state.cell,t);mxEvent.consume(t)}}))));this.points.push(new mxPoint(0,0));e=this.createHandleShape(2);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);return t};mxElbowEdgeHandler.prototype.createVirtualBend=function(t){var e=this.createHandleShape();this.initBend(e,t);e.setCursor(this.getCursorForBend());if(!this.graph.isCellBendable(this.state.cell)){e.node.style.display="none"}return e};mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"};mxElbowEdgeHandler.prototype.getTooltipForNode=function(t){var e=null;if(this.bends!=null&&this.bends[1]!=null&&(t==this.bends[1].node||t.parentNode==this.bends[1].node)){e=this.doubleClickOrientationResource;e=mxResources.get(e)||e}return e};mxElbowEdgeHandler.prototype.convertPoint=function(t,e){var i=this.graph.getView().getScale();var n=this.graph.getView().getTranslate();var r=this.state.origin;if(e){t.x=this.graph.snap(t.x);t.y=this.graph.snap(t.y)}t.x=Math.round(t.x/i-n.x-r.x);t.y=Math.round(t.y/i-n.y-r.y);return t};mxElbowEdgeHandler.prototype.redrawInnerBends=function(t,e){var i=this.graph.getModel().getGeometry(this.state.cell);var n=this.state.absolutePoints;var r=null;if(n.length>1){t=n[1];e=n[n.length-2]}else if(i.points!=null&&i.points.length>0){r=n[0]}if(r==null){r=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2)}else{r=new mxPoint(this.graph.getView().scale*(r.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(r.y+this.graph.getView().translate.y+this.state.origin.y))}var s=this.bends[1].bounds;var l=s.width;var a=s.height;var o=new mxRectangle(Math.round(r.x-l/2),Math.round(r.y-a/2),l,a);if(this.manageLabelHandle){this.checkLabelHandle(o)}else if(this.handleImage==null&&this.labelShape.visible&&mxUtils.intersects(o,this.labelShape.bounds)){l=mxConstants.HANDLE_SIZE+3;a=mxConstants.HANDLE_SIZE+3;o=new mxRectangle(Math.floor(r.x-l/2),Math.floor(r.y-a/2),l,a)}this.bends[1].bounds=o;this.bends[1].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[1].bounds)}};__mxOutput.mxElbowEdgeHandler=typeof mxElbowEdgeHandler!=="undefined"?mxElbowEdgeHandler:undefined;function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler);mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(t!=null){var e=Math.max(1,this.graph.view.scale);if(t.length==2||t.length==3&&(Math.abs(t[0].x-t[1].x)<e&&Math.abs(t[1].x-t[2].x)<e||Math.abs(t[0].y-t[1].y)<e&&Math.abs(t[1].y-t[2].y)<e)){var i=t[0].x+(t[t.length-1].x-t[0].x)/2;var n=t[0].y+(t[t.length-1].y-t[0].y)/2;t=[t[0],new mxPoint(i,n),new mxPoint(i,n),t[t.length-1]]}}return t};mxEdgeSegmentHandler.prototype.getPreviewPoints=function(t){if(this.isSource||this.isTarget){return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments)}else{var e=this.getCurrentPoints();var i=this.convertPoint(e[0].clone(),false);t=this.convertPoint(t.clone(),false);var n=[];for(var r=1;r<e.length;r++){var s=this.convertPoint(e[r].clone(),false);if(r==this.index){if(Math.round(i.x-s.x)==0){i.x=t.x;s.x=t.x}if(Math.round(i.y-s.y)==0){i.y=t.y;s.y=t.y}}if(r<e.length-1){n.push(s)}i=s}if(n.length==1){var l=this.state.getVisibleTerminalState(true);var a=this.state.getVisibleTerminalState(false);var o=this.state.view.getScale();var h=this.state.view.getTranslate();var u=n[0].x*o+h.x;var d=n[0].y*o+h.y;if(l!=null&&mxUtils.contains(l,u,d)||a!=null&&mxUtils.contains(a,u,d)){n=[t,t]}}return n}};mxEdgeSegmentHandler.prototype.updatePreviewState=function(t,e,i,n){mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments);if(!this.isSource&&!this.isTarget){e=this.convertPoint(e.clone(),false);var r=t.absolutePoints;var s=r[0];var l=r[1];var a=[];for(var o=2;o<r.length;o++){var h=r[o];if((Math.round(s.x-l.x)!=0||Math.round(l.x-h.x)!=0)&&(Math.round(s.y-l.y)!=0||Math.round(l.y-h.y)!=0)){a.push(this.convertPoint(l.clone(),false))}s=l;l=h}var u=this.state.getVisibleTerminalState(true);var d=this.state.getVisibleTerminalState(false);var p=this.state.absolutePoints;if(a.length==0&&(Math.round(r[0].x-r[r.length-1].x)==0||Math.round(r[0].y-r[r.length-1].y)==0)){a=[e,e]}else if(r.length==5&&a.length==2&&u!=null&&d!=null&&p!=null&&Math.round(p[0].x-p[p.length-1].x)==0){var m=this.graph.getView();var c=m.getScale();var x=m.getTranslate();var f=m.getRoutingCenterY(u)/c-x.y;var g=this.graph.getConnectionConstraint(t,u,true);if(g!=null){var v=this.graph.getConnectionPoint(u,g);if(v!=null){this.convertPoint(v,false);f=v.y}}var y=m.getRoutingCenterY(d)/c-x.y;var C=this.graph.getConnectionConstraint(t,d,false);if(C){var v=this.graph.getConnectionPoint(d,C);if(v!=null){this.convertPoint(v,false);y=v.y}}a=[new mxPoint(e.x,f),new mxPoint(e.x,y)]}this.points=a;t.view.updateFixedTerminalPoints(t,u,d);t.view.updatePoints(t,this.points,u,d);t.view.updateFloatingTerminalPoints(t,u,d)}};mxEdgeSegmentHandler.prototype.connect=function(t,e,i,n,r){var s=this.graph.getModel();var l=s.getGeometry(t);var a=null;if(l!=null&&l.points!=null&&l.points.length>0){var o=this.abspoints;var h=o[0];var u=o[1];a=[];for(var d=2;d<o.length;d++){var p=o[d];if((Math.round(h.x-u.x)!=0||Math.round(u.x-p.x)!=0)&&(Math.round(h.y-u.y)!=0||Math.round(u.y-p.y)!=0)){a.push(this.convertPoint(u.clone(),false))}h=u;u=p}}s.beginUpdate();try{if(a!=null){var l=s.getGeometry(t);if(l!=null){l=l.clone();l.points=a;s.setGeometry(t,l)}}t=mxEdgeHandler.prototype.connect.apply(this,arguments)}finally{s.endUpdate()}return t};mxEdgeSegmentHandler.prototype.getTooltipForNode=function(t){return null};mxEdgeSegmentHandler.prototype.start=function(t,e,i){mxEdgeHandler.prototype.start.apply(this,arguments);if(this.bends!=null&&this.bends[i]!=null&&!this.isSource&&!this.isTarget){mxUtils.setOpacity(this.bends[i].node,100)}};mxEdgeSegmentHandler.prototype.createBends=function(){var t=[];var e=this.createHandleShape(0);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);var i=this.getCurrentPoints();if(this.graph.isCellBendable(this.state.cell)){if(this.points==null){this.points=[]}for(var n=0;n<i.length-1;n++){e=this.createVirtualBend();t.push(e);var r=Math.round(i[n].x-i[n+1].x)==0;if(Math.round(i[n].y-i[n+1].y)==0&&n<i.length-2){r=Math.round(i[n].x-i[n+2].x)==0}e.setCursor(r?"col-resize":"row-resize");this.points.push(new mxPoint(0,0))}}var e=this.createHandleShape(i.length);this.initBend(e);e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);t.push(e);return t};mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh();mxEdgeHandler.prototype.redraw.apply(this,arguments)};mxEdgeSegmentHandler.prototype.redrawInnerBends=function(t,e){if(this.graph.isCellBendable(this.state.cell)){var i=this.getCurrentPoints();if(i!=null&&i.length>1){var n=false;if(i.length==4&&Math.round(i[1].x-i[2].x)==0&&Math.round(i[1].y-i[2].y)==0){n=true;if(Math.round(i[0].y-i[i.length-1].y)==0){var r=i[0].x+(i[i.length-1].x-i[0].x)/2;i[1]=new mxPoint(r,i[1].y);i[2]=new mxPoint(r,i[2].y)}else{var s=i[0].y+(i[i.length-1].y-i[0].y)/2;i[1]=new mxPoint(i[1].x,s);i[2]=new mxPoint(i[2].x,s)}}for(var l=0;l<i.length-1;l++){if(this.bends[l+1]!=null){var t=i[l];var e=i[l+1];var a=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2);var o=this.bends[l+1].bounds;this.bends[l+1].bounds=new mxRectangle(Math.floor(a.x-o.width/2),Math.floor(a.y-o.height/2),o.width,o.height);this.bends[l+1].redraw();if(this.manageLabelHandle){this.checkLabelHandle(this.bends[l+1].bounds)}}}if(n){mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity);mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity)}}}};__mxOutput.mxEdgeSegmentHandler=typeof mxEdgeSegmentHandler!=="undefined"?mxEdgeSegmentHandler:undefined;function mxKeyHandler(t,e){if(t!=null){this.graph=t;this.target=e||document.documentElement;this.normalKeys=[];this.shiftKeys=[];this.controlKeys=[];this.controlShiftKeys=[];this.keydownHandler=mxUtils.bind(this,(function(t){this.keyDown(t)}));mxEvent.addListener(this.target,"keydown",this.keydownHandler);if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}}mxKeyHandler.prototype.graph=null;mxKeyHandler.prototype.target=null;mxKeyHandler.prototype.normalKeys=null;mxKeyHandler.prototype.shiftKeys=null;mxKeyHandler.prototype.controlKeys=null;mxKeyHandler.prototype.controlShiftKeys=null;mxKeyHandler.prototype.enabled=true;mxKeyHandler.prototype.isEnabled=function(){return this.enabled};mxKeyHandler.prototype.setEnabled=function(t){this.enabled=t};mxKeyHandler.prototype.bindKey=function(t,e){this.normalKeys[t]=e};mxKeyHandler.prototype.bindShiftKey=function(t,e){this.shiftKeys[t]=e};mxKeyHandler.prototype.bindControlKey=function(t,e){this.controlKeys[t]=e};mxKeyHandler.prototype.bindControlShiftKey=function(t,e){this.controlShiftKeys[t]=e};mxKeyHandler.prototype.isControlDown=function(t){return mxEvent.isControlDown(t)};mxKeyHandler.prototype.getFunction=function(t){if(t!=null&&!mxEvent.isAltDown(t)){if(this.isControlDown(t)){if(mxEvent.isShiftDown(t)){return this.controlShiftKeys[t.keyCode]}else{return this.controlKeys[t.keyCode]}}else{if(mxEvent.isShiftDown(t)){return this.shiftKeys[t.keyCode]}else{return this.normalKeys[t.keyCode]}}}return null};mxKeyHandler.prototype.isGraphEvent=function(t){var e=mxEvent.getSource(t);if(e==this.target||e.parentNode==this.target||this.graph.cellEditor!=null&&this.graph.cellEditor.isEventSource(t)){return true}return mxUtils.isAncestorNode(this.graph.container,e)};mxKeyHandler.prototype.keyDown=function(t){if(this.isEnabledForEvent(t)){if(t.keyCode==27){this.escape(t)}else if(!this.isEventIgnored(t)){var e=this.getFunction(t);if(e!=null){e(t);mxEvent.consume(t)}}}};mxKeyHandler.prototype.isEnabledForEvent=function(t){return this.graph.isEnabled()&&!mxEvent.isConsumed(t)&&this.isGraphEvent(t)&&this.isEnabled()};mxKeyHandler.prototype.isEventIgnored=function(t){return this.graph.isEditing()};mxKeyHandler.prototype.escape=function(t){if(this.graph.isEscapeEnabled()){this.graph.escape(t)}};mxKeyHandler.prototype.destroy=function(){if(this.target!=null&&this.keydownHandler!=null){mxEvent.removeListener(this.target,"keydown",this.keydownHandler);this.keydownHandler=null}this.target=null};__mxOutput.mxKeyHandler=typeof mxKeyHandler!=="undefined"?mxKeyHandler:undefined;function mxTooltipHandler(t,e){if(t!=null){this.graph=t;this.delay=e||500;this.graph.addMouseListener(this)}}mxTooltipHandler.prototype.zIndex=10005;mxTooltipHandler.prototype.graph=null;mxTooltipHandler.prototype.delay=null;mxTooltipHandler.prototype.ignoreTouchEvents=true;mxTooltipHandler.prototype.hideOnHover=false;mxTooltipHandler.prototype.destroyed=false;mxTooltipHandler.prototype.enabled=true;mxTooltipHandler.prototype.isEnabled=function(){return this.enabled};mxTooltipHandler.prototype.setEnabled=function(t){this.enabled=t};mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover};mxTooltipHandler.prototype.setHideOnHover=function(t){this.hideOnHover=t};mxTooltipHandler.prototype.init=function(){if(document.body!=null){this.div=document.createElement("div");this.div.className="mxTooltip";this.div.style.visibility="hidden";document.body.appendChild(this.div);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,(function(t){var e=mxEvent.getSource(t);if(e.nodeName!="A"){this.hideTooltip()}})))}};mxTooltipHandler.prototype.getStateForEvent=function(t){return t.getState()};mxTooltipHandler.prototype.mouseDown=function(t,e){this.reset(e,false);this.hideTooltip()};mxTooltipHandler.prototype.mouseMove=function(t,e){if(e.getX()!=this.lastX||e.getY()!=this.lastY){this.reset(e,true);var i=this.getStateForEvent(e);if(this.isHideOnHover()||i!=this.state||e.getSource()!=this.node&&(!this.stateSource||i!=null&&this.stateSource==(e.isSource(i.shape)||!e.isSource(i.text)))){this.hideTooltip()}}this.lastX=e.getX();this.lastY=e.getY()};mxTooltipHandler.prototype.mouseUp=function(t,e){this.reset(e,true);this.hideTooltip()};mxTooltipHandler.prototype.resetTimer=function(){if(this.thread!=null){window.clearTimeout(this.thread);this.thread=null}};mxTooltipHandler.prototype.reset=function(t,e,i){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(t.getEvent())){this.resetTimer();i=i!=null?i:this.getStateForEvent(t);if(e&&this.isEnabled()&&i!=null&&(this.div==null||this.div.style.visibility=="hidden")){var n=t.getSource();var r=t.getX();var s=t.getY();var l=t.isSource(i.shape)||t.isSource(i.text);this.thread=window.setTimeout(mxUtils.bind(this,(function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var t=this.graph.getTooltip(i,n,r,s);this.show(t,r,s);this.state=i;this.node=n;this.stateSource=l}})),this.delay)}}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){if(this.div!=null){this.div.style.visibility="hidden";this.div.innerHTML=""}};mxTooltipHandler.prototype.show=function(t,e,i){if(!this.destroyed&&t!=null&&t.length>0){if(this.div==null){this.init()}var n=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex;this.div.style.left=e+n.x+"px";this.div.style.top=i+mxConstants.TOOLTIP_VERTICAL_OFFSET+n.y+"px";if(!mxUtils.isNode(t)){this.div.innerHTML=t.replace(/\n/g,"<br>")}else{this.div.innerHTML="";this.div.appendChild(t)}this.div.style.visibility="";mxUtils.fit(this.div)}};mxTooltipHandler.prototype.destroy=function(){if(!this.destroyed){this.graph.removeMouseListener(this);mxEvent.release(this.div);if(this.div!=null&&this.div.parentNode!=null){this.div.parentNode.removeChild(this.div)}this.destroyed=true;this.div=null}};__mxOutput.mxTooltipHandler=typeof mxTooltipHandler!=="undefined"?mxTooltipHandler:undefined;function mxCellTracker(t,e,i){mxCellMarker.call(this,t,e);this.graph.addMouseListener(this);if(i!=null){this.getCell=i}if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}mxUtils.extend(mxCellTracker,mxCellMarker);mxCellTracker.prototype.mouseDown=function(t,e){};mxCellTracker.prototype.mouseMove=function(t,e){if(this.isEnabled()){this.process(e)}};mxCellTracker.prototype.mouseUp=function(t,e){};mxCellTracker.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;this.graph.removeMouseListener(this);mxCellMarker.prototype.destroy.apply(this)}};__mxOutput.mxCellTracker=typeof mxCellTracker!=="undefined"?mxCellTracker:undefined;function mxCellHighlight(t,e,i,n){if(t!=null){this.graph=t;this.highlightColor=e!=null?e:mxConstants.DEFAULT_VALID_COLOR;this.strokeWidth=i!=null?i:mxConstants.HIGHLIGHT_STROKEWIDTH;this.dashed=n!=null?n:false;this.opacity=mxConstants.HIGHLIGHT_OPACITY;this.repaintHandler=mxUtils.bind(this,(function(){if(this.state!=null){var t=this.graph.view.getState(this.state.cell);if(t==null){this.hide()}else{this.state=t;this.repaint()}}}));this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler);this.resetHandler=mxUtils.bind(this,(function(){this.hide()}));this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler);this.graph.getView().addListener(mxEvent.UP,this.resetHandler)}}mxCellHighlight.prototype.keepOnTop=false;mxCellHighlight.prototype.graph=null;mxCellHighlight.prototype.state=null;mxCellHighlight.prototype.spacing=2;mxCellHighlight.prototype.resetHandler=null;mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t;if(this.shape!=null){this.shape.stroke=t}};mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape();this.repaint();if(!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node){this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)}};mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);t.svgStrokeTolerance=this.graph.tolerance;t.points=this.state.absolutePoints;t.apply(this.state);t.stroke=this.highlightColor;t.opacity=this.opacity;t.isDashed=this.dashed;t.isShadow=false;t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;t.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(t.node,this.graph,this.state);if(this.graph.dialect!=mxConstants.DIALECT_SVG){t.pointerEvents=false}else{t.svgPointerEvents="stroke"}return t};mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth};mxCellHighlight.prototype.repaint=function(){if(this.state!=null&&this.shape!=null){this.shape.scale=this.state.view.scale;if(this.graph.model.isEdge(this.state.cell)){this.shape.strokewidth=this.getStrokeWidth();this.shape.points=this.state.absolutePoints;this.shape.outline=false}else{this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing);this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0");this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale;this.shape.outline=true}if(this.state.shape!=null){this.shape.setCursor(this.state.shape.getCursor())}if(mxClient.IS_QUIRKS||document.documentMode==8){if(this.shape.stroke=="transparent"){this.shape.stroke="white";this.shape.opacity=1}else{this.shape.opacity=this.opacity}}this.shape.redraw()}};mxCellHighlight.prototype.hide=function(){this.highlight(null)};mxCellHighlight.prototype.highlight=function(t){if(this.state!=t){if(this.shape!=null){this.shape.destroy();this.shape=null}this.state=t;if(this.state!=null){this.drawHighlight()}}};mxCellHighlight.prototype.isHighlightAt=function(t,e){var i=false;if(this.shape!=null&&document.elementFromPoint!=null&&!mxClient.IS_QUIRKS){var n=document.elementFromPoint(t,e);while(n!=null){if(n==this.shape.node){i=true;break}n=n.parentNode}}return i};mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getView().removeListener(this.repaintHandler);this.graph.getModel().removeListener(this.repaintHandler);if(this.shape!=null){this.shape.destroy();this.shape=null}};__mxOutput.mxCellHighlight=typeof mxCellHighlight!=="undefined"?mxCellHighlight:undefined;function mxDefaultKeyHandler(t){if(t!=null){this.editor=t;this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(i){e.apply(this,arguments);t.hideProperties();t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",i))}}}mxDefaultKeyHandler.prototype.editor=null;mxDefaultKeyHandler.prototype.handler=null;mxDefaultKeyHandler.prototype.bindAction=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(e)}));if(i){this.handler.bindControlKey(t,n)}else{this.handler.bindKey(t,n)}};mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy();this.handler=null};__mxOutput.mxDefaultKeyHandler=typeof mxDefaultKeyHandler!=="undefined"?mxDefaultKeyHandler:undefined;function mxDefaultPopupMenu(t){this.config=t}mxDefaultPopupMenu.prototype.imageBasePath=null;mxDefaultPopupMenu.prototype.config=null;mxDefaultPopupMenu.prototype.createMenu=function(t,e,i,n){if(this.config!=null){var r=this.createConditions(t,i,n);var s=this.config.firstChild;this.addItems(t,e,i,n,r,s,null)}};mxDefaultPopupMenu.prototype.addItems=function(t,e,i,n,r,s,l){var a=false;while(s!=null){if(s.nodeName=="add"){var o=s.getAttribute("if");if(o==null||r[o]){var h=s.getAttribute("as");h=mxResources.get(h)||h;var u=mxUtils.eval(mxUtils.getTextContent(s));var d=s.getAttribute("action");var p=s.getAttribute("icon");var m=s.getAttribute("iconCls");var c=s.getAttribute("enabled-if");var x=c==null||r[c];if(a){e.addSeparator(l);a=false}if(p!=null&&this.imageBasePath){p=this.imageBasePath+p}var f=this.addAction(e,t,h,p,u,d,i,l,m,x);this.addItems(t,e,i,n,r,s.firstChild,f)}}else if(s.nodeName=="separator"){a=true}s=s.nextSibling}};mxDefaultPopupMenu.prototype.addAction=function(t,e,i,n,r,s,l,a,o,h){var u=function(t){if(typeof r=="function"){r.call(e,e,l,t)}if(s!=null){e.execute(s,l,t)}};return t.addItem(i,n,u,a,o,h)};mxDefaultPopupMenu.prototype.createConditions=function(t,e,i){var n=t.graph.getModel();var r=n.getChildCount(e);var s=[];s["nocell"]=e==null;s["ncells"]=t.graph.getSelectionCount()>1;s["notRoot"]=n.getRoot()!=n.getParent(t.graph.getDefaultParent());s["cell"]=e!=null;var l=e!=null&&t.graph.getSelectionCount()==1;s["nonEmpty"]=l&&r>0;s["expandable"]=l&&t.graph.isCellFoldable(e,false);s["collapsable"]=l&&t.graph.isCellFoldable(e,true);s["validRoot"]=l&&t.graph.isValidRoot(e);s["emptyValidRoot"]=s["validRoot"]&&r==0;s["swimlane"]=l&&t.graph.isSwimlane(e);var a=this.config.getElementsByTagName("condition");for(var o=0;o<a.length;o++){var h=mxUtils.eval(mxUtils.getTextContent(a[o]));var u=a[o].getAttribute("name");if(u!=null&&typeof h=="function"){s[u]=h(t,e,i)}}return s};__mxOutput.mxDefaultPopupMenu=typeof mxDefaultPopupMenu!=="undefined"?mxDefaultPopupMenu:undefined;function mxDefaultToolbar(t,e){this.editor=e;if(t!=null&&e!=null){this.init(t)}}mxDefaultToolbar.prototype.editor=null;mxDefaultToolbar.prototype.toolbar=null;mxDefaultToolbar.prototype.resetHandler=null;mxDefaultToolbar.prototype.spacing=4;mxDefaultToolbar.prototype.connectOnDrop=false;mxDefaultToolbar.prototype.init=function(t){if(t!=null){this.toolbar=new mxToolbar(t);this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,(function(t,e){var i=e.getProperty("function");if(i!=null){this.editor.insertFunction=mxUtils.bind(this,(function(){i.apply(this,arguments);this.toolbar.resetMode()}))}else{this.editor.insertFunction=null}})));this.resetHandler=mxUtils.bind(this,(function(){if(this.toolbar!=null){this.toolbar.resetMode(true)}}));this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler);this.editor.addListener(mxEvent.ESCAPE,this.resetHandler)}};mxDefaultToolbar.prototype.addItem=function(t,e,i,n){var r=mxUtils.bind(this,(function(){if(i!=null&&i.length>0){this.editor.execute(i)}}));return this.toolbar.addItem(t,e,r,n)};mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif";this.toolbar.addSeparator(t)};mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()};mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)};mxDefaultToolbar.prototype.addActionOption=function(t,e,i){var n=mxUtils.bind(this,(function(){this.editor.execute(i)}));this.addOption(t,e,n)};mxDefaultToolbar.prototype.addOption=function(t,e,i){return this.toolbar.addOption(t,e,i)};mxDefaultToolbar.prototype.addMode=function(t,e,i,n,r){var s=mxUtils.bind(this,(function(){this.editor.setMode(i);if(r!=null){r(this.editor)}}));return this.toolbar.addSwitchMode(t,e,s,n)};mxDefaultToolbar.prototype.addPrototype=function(t,e,i,n,r,s){var l=mxUtils.bind(this,(function(){if(typeof i=="function"){return i()}else if(i!=null){return this.editor.graph.cloneCell(i)}return null}));var a=mxUtils.bind(this,(function(t,e){if(typeof r=="function"){r(this.editor,l(),t,e)}else{this.drop(l(),t,e)}this.toolbar.resetMode();mxEvent.consume(t)}));var o=this.toolbar.addMode(t,e,a,n,null,s);var h=function(t,e,i){a(e,i)};this.installDropHandler(o,h);return o};mxDefaultToolbar.prototype.drop=function(t,e,i){var n=this.editor.graph;var r=n.getModel();if(i==null||r.isEdge(i)||!this.connectOnDrop||!n.isCellConnectable(i)){while(i!=null&&!n.isValidDropTarget(i,[t],e)){i=r.getParent(i)}this.insert(t,e,i)}else{this.connect(t,e,i)}};mxDefaultToolbar.prototype.insert=function(t,e,i){var n=this.editor.graph;if(n.canImportCell(t)){var r=mxEvent.getClientX(e);var s=mxEvent.getClientY(e);var l=mxUtils.convertPoint(n.container,r,s);if(n.isSplitEnabled()&&n.isSplitTarget(i,[t],e)){return n.splitEdge(i,[t],null,l.x,l.y)}else{return this.editor.addVertex(i,t,l.x,l.y)}}return null};mxDefaultToolbar.prototype.connect=function(t,e,i){var n=this.editor.graph;var r=n.getModel();if(i!=null&&n.isCellConnectable(t)&&n.isEdgeValid(null,i,t)){var s=null;r.beginUpdate();try{var l=r.getGeometry(i);var a=r.getGeometry(t).clone();a.x=l.x+(l.width-a.width)/2;a.y=l.y+(l.height-a.height)/2;var o=this.spacing*n.gridSize;var h=r.getDirectedEdgeCount(i,true)*20;if(this.editor.horizontalFlow){a.x+=(a.width+l.width)/2+o+h}else{a.y+=(a.height+l.height)/2+o+h}t.setGeometry(a);var u=r.getParent(i);n.addCell(t,u);n.constrainChild(t);s=this.editor.createEdge(i,t);if(r.getGeometry(s)==null){var d=new mxGeometry;d.relative=true;r.setGeometry(s,d)}n.addEdge(s,u,i,t)}finally{r.endUpdate()}n.setSelectionCells([t,s]);n.scrollCellToVisible(t)}};mxDefaultToolbar.prototype.installDropHandler=function(t,e){var i=document.createElement("img");i.setAttribute("src",t.getAttribute("src"));var n=mxUtils.bind(this,(function(r){i.style.width=2*t.offsetWidth+"px";i.style.height=2*t.offsetHeight+"px";mxUtils.makeDraggable(t,this.editor.graph,e,i);mxEvent.removeListener(i,"load",n)}));if(mxClient.IS_IE){n()}else{mxEvent.addListener(i,"load",n)}};mxDefaultToolbar.prototype.destroy=function(){if(this.resetHandler!=null){this.editor.graph.removeListener("dblclick",this.resetHandler);this.editor.removeListener("escape",this.resetHandler);this.resetHandler=null}if(this.toolbar!=null){this.toolbar.destroy();this.toolbar=null}};__mxOutput.mxDefaultToolbar=typeof mxDefaultToolbar!=="undefined"?mxDefaultToolbar:undefined;function mxEditor(t){this.actions=[];this.addActions();if(document.body!=null){this.cycleAttributeValues=[];this.popupHandler=new mxDefaultPopupMenu;this.undoManager=new mxUndoManager;this.graph=this.createGraph();this.toolbar=this.createToolbar();this.keyHandler=new mxDefaultKeyHandler(this);this.configure(t);this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName;if(this.onInit!=null){this.onInit()}if(mxClient.IS_IE){mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}}}if(mxLoadResources){mxResources.add(mxClient.basePath+"/resources/editor")}else{mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor")}mxEditor.prototype=new mxEventSource;mxEditor.prototype.constructor=mxEditor;mxEditor.prototype.askZoomResource=mxClient.language!="none"?"askZoom":"";mxEditor.prototype.lastSavedResource=mxClient.language!="none"?"lastSaved":"";mxEditor.prototype.currentFileResource=mxClient.language!="none"?"currentFile":"";mxEditor.prototype.propertiesResource=mxClient.language!="none"?"properties":"";mxEditor.prototype.tasksResource=mxClient.language!="none"?"tasks":"";mxEditor.prototype.helpResource=mxClient.language!="none"?"help":"";mxEditor.prototype.outlineResource=mxClient.language!="none"?"outline":"";mxEditor.prototype.outline=null;mxEditor.prototype.graph=null;mxEditor.prototype.graphRenderHint=null;mxEditor.prototype.toolbar=null;mxEditor.prototype.status=null;mxEditor.prototype.popupHandler=null;mxEditor.prototype.undoManager=null;mxEditor.prototype.keyHandler=null;mxEditor.prototype.actions=null;mxEditor.prototype.dblClickAction="edit";mxEditor.prototype.swimlaneRequired=false;mxEditor.prototype.disableContextMenu=true;mxEditor.prototype.insertFunction=null;mxEditor.prototype.forcedInserting=false;mxEditor.prototype.templates=null;mxEditor.prototype.defaultEdge=null;mxEditor.prototype.defaultEdgeStyle=null;mxEditor.prototype.defaultGroup=null;mxEditor.prototype.groupBorderSize=null;mxEditor.prototype.filename=null;mxEditor.prototype.linefeed="&#xa;";mxEditor.prototype.postParameterName="xml";mxEditor.prototype.escapePostData=true;mxEditor.prototype.urlPost=null;mxEditor.prototype.urlImage=null;mxEditor.prototype.horizontalFlow=false;mxEditor.prototype.layoutDiagram=false;mxEditor.prototype.swimlaneSpacing=0;mxEditor.prototype.maintainSwimlanes=false;mxEditor.prototype.layoutSwimlanes=false;mxEditor.prototype.cycleAttributeValues=null;mxEditor.prototype.cycleAttributeIndex=0;mxEditor.prototype.cycleAttributeName="fillColor";mxEditor.prototype.tasks=null;mxEditor.prototype.tasksWindowImage=null;mxEditor.prototype.tasksTop=20;mxEditor.prototype.help=null;mxEditor.prototype.helpWindowImage=null;mxEditor.prototype.urlHelp=null;mxEditor.prototype.helpWidth=300;mxEditor.prototype.helpHeight=260;mxEditor.prototype.propertiesWidth=240;mxEditor.prototype.propertiesHeight=null;mxEditor.prototype.movePropertiesDialog=false;mxEditor.prototype.validating=false;mxEditor.prototype.modified=false;mxEditor.prototype.isModified=function(){return this.modified};mxEditor.prototype.setModified=function(t){this.modified=t};mxEditor.prototype.addActions=function(){this.addAction("save",(function(t){t.save()}));this.addAction("print",(function(t){var e=new mxPrintPreview(t.graph,1);e.open()}));this.addAction("show",(function(t){mxUtils.show(t.graph,null,10,10)}));this.addAction("exportImage",(function(t){var e=t.getUrlImage();if(e==null||mxClient.IS_LOCAL){t.execute("show")}else{var i=mxUtils.getViewXml(t.graph,1);var n=mxUtils.getXml(i,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(n),document,"_blank")}}));this.addAction("refresh",(function(t){t.graph.refresh()}));this.addAction("cut",(function(t){if(t.graph.isEnabled()){mxClipboard.cut(t.graph)}}));this.addAction("copy",(function(t){if(t.graph.isEnabled()){mxClipboard.copy(t.graph)}}));this.addAction("paste",(function(t){if(t.graph.isEnabled()){mxClipboard.paste(t.graph)}}));this.addAction("delete",(function(t){if(t.graph.isEnabled()){t.graph.removeCells()}}));this.addAction("group",(function(t){if(t.graph.isEnabled()){t.graph.setSelectionCell(t.groupCells())}}));this.addAction("ungroup",(function(t){if(t.graph.isEnabled()){t.graph.setSelectionCells(t.graph.ungroupCells())}}));this.addAction("removeFromParent",(function(t){if(t.graph.isEnabled()){t.graph.removeCellsFromParent()}}));this.addAction("undo",(function(t){if(t.graph.isEnabled()){t.undo()}}));this.addAction("redo",(function(t){if(t.graph.isEnabled()){t.redo()}}));this.addAction("zoomIn",(function(t){t.graph.zoomIn()}));this.addAction("zoomOut",(function(t){t.graph.zoomOut()}));this.addAction("actualSize",(function(t){t.graph.zoomActual()}));this.addAction("fit",(function(t){t.graph.fit()}));this.addAction("showProperties",(function(t,e){t.showProperties(e)}));this.addAction("selectAll",(function(t){if(t.graph.isEnabled()){t.graph.selectAll()}}));this.addAction("selectNone",(function(t){if(t.graph.isEnabled()){t.graph.clearSelection()}}));this.addAction("selectVertices",(function(t){if(t.graph.isEnabled()){t.graph.selectVertices()}}));this.addAction("selectEdges",(function(t){if(t.graph.isEnabled()){t.graph.selectEdges()}}));this.addAction("edit",(function(t,e){if(t.graph.isEnabled()&&t.graph.isCellEditable(e)){t.graph.startEditingAtCell(e)}}));this.addAction("toBack",(function(t,e){if(t.graph.isEnabled()){t.graph.orderCells(true)}}));this.addAction("toFront",(function(t,e){if(t.graph.isEnabled()){t.graph.orderCells(false)}}));this.addAction("enterGroup",(function(t,e){t.graph.enterGroup(e)}));this.addAction("exitGroup",(function(t){t.graph.exitGroup()}));this.addAction("home",(function(t){t.graph.home()}));this.addAction("selectPrevious",(function(t){if(t.graph.isEnabled()){t.graph.selectPreviousCell()}}));this.addAction("selectNext",(function(t){if(t.graph.isEnabled()){t.graph.selectNextCell()}}));this.addAction("selectParent",(function(t){if(t.graph.isEnabled()){t.graph.selectParentCell()}}));this.addAction("selectChild",(function(t){if(t.graph.isEnabled()){t.graph.selectChildCell()}}));this.addAction("collapse",(function(t){if(t.graph.isEnabled()){t.graph.foldCells(true)}}));this.addAction("collapseAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(true,false,e)}}));this.addAction("expand",(function(t){if(t.graph.isEnabled()){t.graph.foldCells(false)}}));this.addAction("expandAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(false,false,e)}}));this.addAction("bold",(function(t){if(t.graph.isEnabled()){t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}}));this.addAction("italic",(function(t){if(t.graph.isEnabled()){t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}}));this.addAction("underline",(function(t){if(t.graph.isEnabled()){t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}}));this.addAction("alignCellsLeft",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_LEFT)}}));this.addAction("alignCellsCenter",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_CENTER)}}));this.addAction("alignCellsRight",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_RIGHT)}}));this.addAction("alignCellsTop",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_TOP)}}));this.addAction("alignCellsMiddle",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_MIDDLE)}}));this.addAction("alignCellsBottom",(function(t){if(t.graph.isEnabled()){t.graph.alignCells(mxConstants.ALIGN_BOTTOM)}}));this.addAction("alignFontLeft",(function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}));this.addAction("alignFontCenter",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}}));this.addAction("alignFontRight",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}}));this.addAction("alignFontTop",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}}));this.addAction("alignFontMiddle",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}}));this.addAction("alignFontBottom",(function(t){if(t.graph.isEnabled()){t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}}));this.addAction("zoom",(function(t){var e=t.graph.getView().scale*100;var i=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;if(!isNaN(i)){t.graph.getView().setScale(i)}}));this.addAction("toggleTasks",(function(t){if(t.tasks!=null){t.tasks.setVisible(!t.tasks.isVisible())}else{t.showTasks()}}));this.addAction("toggleHelp",(function(t){if(t.help!=null){t.help.setVisible(!t.help.isVisible())}else{t.showHelp()}}));this.addAction("toggleOutline",(function(t){if(t.outline==null){t.showOutline()}else{t.outline.setVisible(!t.outline.isVisible())}}));this.addAction("toggleConsole",(function(t){mxLog.setVisible(!mxLog.isVisible())}))};mxEditor.prototype.configure=function(t){if(t!=null){var e=new mxCodec(t.ownerDocument);e.decode(t,this);this.resetHistory()}};mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"};mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime();this.undoManager.clear();this.ignoredChanges=0;this.setModified(false)};mxEditor.prototype.addAction=function(t,e){this.actions[t]=e};mxEditor.prototype.execute=function(t,e,i){var n=this.actions[t];if(n!=null){try{var r=arguments;r[0]=this;n.apply(this,r)}catch(s){mxUtils.error("Cannot execute "+t+": "+s.message,280,true);throw s}}else{mxUtils.error("Cannot find action "+t,280,true)}};mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e};mxEditor.prototype.getTemplate=function(t){return this.templates[t]};mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);t.setTooltips(true);t.setPanning(true);this.installDblClickHandler(t);this.installUndoHandler(t);this.installDrillHandler(t);this.installChangeHandler(t);this.installInsertHandler(t);t.popupMenuHandler.factoryMethod=mxUtils.bind(this,(function(t,e,i){return this.createPopupMenu(t,e,i)}));t.connectionHandler.factoryMethod=mxUtils.bind(this,(function(t,e){return this.createEdge(t,e)}));this.createSwimlaneManager(t);this.createLayoutManager(t);return t};mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,false);e.isHorizontal=mxUtils.bind(this,(function(){return this.horizontalFlow}));e.isEnabled=mxUtils.bind(this,(function(){return this.maintainSwimlanes}));return e};mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t);var i=this;e.getLayout=function(e){var n=null;var r=i.graph.getModel();if(r.getParent(e)!=null){if(i.layoutSwimlanes&&t.isSwimlane(e)){if(i.swimlaneLayout==null){i.swimlaneLayout=i.createSwimlaneLayout()}n=i.swimlaneLayout}else if(i.layoutDiagram&&(t.isValidRoot(e)||r.getParent(r.getParent(e))==null)){if(i.diagramLayout==null){i.diagramLayout=i.createDiagramLayout()}n=i.diagramLayout}}return n};return e};mxEditor.prototype.setGraphContainer=function(t){if(this.graph.container==null){this.graph.init(t);this.rubberband=new mxRubberband(this.graph);if(this.disableContextMenu){mxEvent.disableContextMenu(t)}if(mxClient.IS_QUIRKS){new mxDivResizer(t)}}};mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,(function(e,i){var n=i.getProperty("cell");if(n!=null&&t.isEnabled()&&this.dblClickAction!=null){this.execute(this.dblClickAction,n);i.consume()}})))};mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,(function(t,e){var i=e.getProperty("edit");this.undoManager.undoableEditHappened(i)}));t.getModel().addListener(mxEvent.UNDO,e);t.getView().addListener(mxEvent.UNDO,e);var i=function(e,i){var n=i.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(n))};this.undoManager.addListener(mxEvent.UNDO,i);this.undoManager.addListener(mxEvent.REDO,i)};mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.ROOT))}));t.getView().addListener(mxEvent.DOWN,e);t.getView().addListener(mxEvent.UP,e)};mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,(function(e,i){this.setModified(true);if(this.validating==true){t.validateGraph()}var n=i.getProperty("edit").changes;for(var r=0;r<n.length;r++){var s=n[r];if(s instanceof mxRootChange||s instanceof mxValueChange&&s.cell==this.graph.model.root||s instanceof mxCellAttributeChange&&s.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}}));t.getModel().addListener(mxEvent.CHANGE,e)};mxEditor.prototype.installInsertHandler=function(t){var e=this;var i={mouseDown:function(t,i){if(e.insertFunction!=null&&!i.isPopupTrigger()&&(e.forcedInserting||i.getState()==null)){e.graph.clearSelection();e.insertFunction(i.getEvent(),i.getCell());this.isActive=true;i.consume()}},mouseMove:function(t,e){if(this.isActive){e.consume()}},mouseUp:function(t,e){if(this.isActive){this.isActive=false;e.consume()}}};t.addMouseListener(i)};mxEditor.prototype.createDiagramLayout=function(){var t=this.graph.gridSize;var e=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*t,2*t);e.isVertexIgnored=function(t){return!e.graph.isSwimlane(t)};return e};mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)};mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)};mxEditor.prototype.setToolbarContainer=function(t){this.toolbar.init(t);if(mxClient.IS_QUIRKS){new mxDivResizer(t)}};mxEditor.prototype.setStatusContainer=function(t){if(this.status==null){this.status=t;this.addListener(mxEvent.SAVE,mxUtils.bind(this,(function(){var t=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+t)})));this.addListener(mxEvent.OPEN,mxUtils.bind(this,(function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})));if(mxClient.IS_QUIRKS){new mxDivResizer(t)}}};mxEditor.prototype.setStatus=function(t){if(this.status!=null&&t!=null){this.status.innerHTML=t}};mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,(function(e){t.innerHTML=this.getTitle()})));if(mxClient.IS_QUIRKS){new mxDivResizer(t)}};mxEditor.prototype.treeLayout=function(t,e){if(t!=null){var i=new mxCompactTreeLayout(this.graph,e);i.execute(t)}};mxEditor.prototype.getTitle=function(){var t="";var e=this.graph;var i=e.getCurrentRoot();while(i!=null&&e.getModel().getParent(e.getModel().getParent(i))!=null){if(e.isValidRoot(i)){t=" > "+e.convertValueToString(i)+t}i=e.getModel().getParent(i)}var n=this.getRootTitle();return n+t};mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)};mxEditor.prototype.undo=function(){this.undoManager.undo()};mxEditor.prototype.redo=function(){this.undoManager.redo()};mxEditor.prototype.groupCells=function(){var t=this.groupBorderSize!=null?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)};mxEditor.prototype.createGroup=function(){var t=this.graph.getModel();return t.cloneCell(this.defaultGroup)};mxEditor.prototype.open=function(t){if(t!=null){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement);this.filename=t;this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}};mxEditor.prototype.readGraphModel=function(t){var e=new mxCodec(t.ownerDocument);e.decode(t,this.graph.getModel());this.resetHistory()};mxEditor.prototype.save=function(t,e){t=t||this.getUrlPost();if(t!=null&&t.length>0){var i=this.writeGraphModel(e);this.postDiagram(t,i);this.setModified(false)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))};mxEditor.prototype.postDiagram=function(t,e){if(this.escapePostData){e=encodeURIComponent(e)}mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,(function(i){this.fireEvent(new mxEventObject(mxEvent.POST,"request",i,"url",t,"data",e))})))};mxEditor.prototype.writeGraphModel=function(t){t=t!=null?t:this.linefeed;var e=new mxCodec;var i=e.encode(this.graph.getModel());return mxUtils.getXml(i,t)};mxEditor.prototype.getUrlPost=function(){return this.urlPost};mxEditor.prototype.getUrlImage=function(){return this.urlImage};mxEditor.prototype.swapStyles=function(t,e){var i=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]);this.graph.getStylesheet().putCellStyle(t,i);this.graph.refresh()};mxEditor.prototype.showProperties=function(t){t=t||this.graph.getSelectionCell();if(t==null){t=this.graph.getCurrentRoot();if(t==null){t=this.graph.getModel().getRoot()}}if(t!=null){this.graph.stopEditing(true);var e=mxUtils.getOffset(this.graph.container);var i=e.x+10;var n=e.y;if(this.properties!=null&&!this.movePropertiesDialog){i=this.properties.getX();n=this.properties.getY()}else{var r=this.graph.getCellBounds(t);if(r!=null){i+=r.x+Math.min(200,r.width);n+=r.y}}this.hideProperties();var s=this.createProperties(t);if(s!=null){this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,i,n,this.propertiesWidth,this.propertiesHeight,false);this.properties.setVisible(true)}}};mxEditor.prototype.isPropertiesVisible=function(){return this.properties!=null};mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel();var i=e.getValue(t);if(mxUtils.isNode(i)){var n=new mxForm("properties");var r=n.addText("ID",t.getId());r.setAttribute("readonly","true");var s=null;var l=null;var a=null;var o=null;var h=null;if(e.isVertex(t)){s=e.getGeometry(t);if(s!=null){l=n.addText("top",s.y);a=n.addText("left",s.x);o=n.addText("width",s.width);h=n.addText("height",s.height)}}var u=e.getStyle(t);var d=n.addText("Style",u||"");var p=i.attributes;var m=[];for(var c=0;c<p.length;c++){var x=p[c].value;m[c]=n.addTextarea(p[c].nodeName,x,p[c].nodeName=="label"?4:2)}var f=mxUtils.bind(this,(function(){this.hideProperties();e.beginUpdate();try{if(s!=null){s=s.clone();s.x=parseFloat(a.value);s.y=parseFloat(l.value);s.width=parseFloat(o.value);s.height=parseFloat(h.value);e.setGeometry(t,s)}if(d.value.length>0){e.setStyle(t,d.value)}else{e.setStyle(t,null)}for(var i=0;i<p.length;i++){var n=new mxCellAttributeChange(t,p[i].nodeName,m[i].value);e.execute(n)}if(this.graph.isAutoSizeCell(t)){this.graph.updateCellSize(t)}}finally{e.endUpdate()}}));var g=mxUtils.bind(this,(function(){this.hideProperties()}));n.addButtons(f,g);return n.table}return null};mxEditor.prototype.hideProperties=function(){if(this.properties!=null){this.properties.destroy();this.properties=null}};mxEditor.prototype.showTasks=function(){if(this.tasks==null){var t=document.createElement("div");t.style.padding="4px";t.style.paddingLeft="20px";var e=document.body.clientWidth;var i=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200);i.setClosable(true);i.destroyOnClose=false;var n=mxUtils.bind(this,(function(e){mxEvent.release(t);t.innerHTML="";this.createTasks(t)}));this.graph.getModel().addListener(mxEvent.CHANGE,n);this.graph.getSelectionModel().addListener(mxEvent.CHANGE,n);this.graph.addListener(mxEvent.ROOT,n);if(this.tasksWindowImage!=null){i.setImage(this.tasksWindowImage)}this.tasks=i;this.createTasks(t)}this.tasks.setVisible(true)};mxEditor.prototype.refreshTasks=function(t){if(this.tasks!=null){var t=this.tasks.content;mxEvent.release(t);t.innerHTML="";this.createTasks(t)}};mxEditor.prototype.createTasks=function(t){};mxEditor.prototype.showHelp=function(t){if(this.help==null){var e=document.createElement("iframe");e.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp);e.setAttribute("height","100%");e.setAttribute("width","100%");e.setAttribute("frameBorder","0");e.style.backgroundColor="white";var i=document.body.clientWidth;var n=document.body.clientHeight||document.documentElement.clientHeight;var r=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,e,(i-this.helpWidth)/2,(n-this.helpHeight)/3,this.helpWidth,this.helpHeight);r.setMaximizable(true);r.setClosable(true);r.destroyOnClose=false;r.setResizable(true);if(this.helpWindowImage!=null){r.setImage(this.helpWindowImage)}if(mxClient.IS_NS){var s=function(t){var i=r.div.offsetHeight;e.setAttribute("height",i-26+"px")};r.addListener(mxEvent.RESIZE_END,s);r.addListener(mxEvent.MAXIMIZE,s);r.addListener(mxEvent.NORMALIZE,s);r.addListener(mxEvent.SHOW,s)}this.help=r}this.help.setVisible(true)};mxEditor.prototype.showOutline=function(){var t=this.outline==null;if(t){var e=document.createElement("div");e.style.overflow="hidden";e.style.position="relative";e.style.width="100%";e.style.height="100%";e.style.background="white";e.style.cursor="move";if(document.documentMode==8){e.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=100)"}var i=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,e,600,480,200,200,false);var n=new mxOutline(this.graph,e);i.setClosable(true);i.setResizable(true);i.destroyOnClose=false;i.addListener(mxEvent.RESIZE_END,(function(){n.update()}));this.outline=i;this.outline.outline=n}this.outline.setVisible(true);this.outline.outline.update(true)};mxEditor.prototype.setMode=function(t){if(t=="select"){this.graph.panningHandler.useLeftButtonForPanning=false;this.graph.setConnectable(false)}else if(t=="connect"){this.graph.panningHandler.useLeftButtonForPanning=false;this.graph.setConnectable(true)}else if(t=="pan"){this.graph.panningHandler.useLeftButtonForPanning=true;this.graph.setConnectable(false)}};mxEditor.prototype.createPopupMenu=function(t,e,i){this.popupHandler.createMenu(this,t,e,i)};mxEditor.prototype.createEdge=function(t,e){var i=null;if(this.defaultEdge!=null){var n=this.graph.getModel();i=n.cloneCell(this.defaultEdge)}else{i=new mxCell("");i.setEdge(true);var r=new mxGeometry;r.relative=true;i.setGeometry(r)}var s=this.getEdgeStyle();if(s!=null){i.setStyle(s)}return i};mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle};mxEditor.prototype.consumeCycleAttribute=function(t){return this.cycleAttributeValues!=null&&this.cycleAttributeValues.length>0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null};mxEditor.prototype.cycleAttribute=function(t){if(this.cycleAttributeName!=null){var e=this.consumeCycleAttribute(t);if(e!=null){t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}}};mxEditor.prototype.addVertex=function(t,e,i,n){var r=this.graph.getModel();while(t!=null&&!this.graph.isValidDropTarget(t)){t=r.getParent(t)}t=t!=null?t:this.graph.getSwimlaneAt(i,n);var s=this.graph.getView().scale;var l=r.getGeometry(e);var a=r.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting){t=null}else if(t==null&&this.swimlaneRequired){return null}else if(t!=null&&a!=null){var o=this.graph.getView().getState(t);if(o!=null){i-=o.origin.x*s;n-=o.origin.y*s;if(this.graph.isConstrainedMoving){var h=l.width;var u=l.height;var d=o.x+o.width;if(i+h>d){i-=i+h-d}d=o.y+o.height;if(n+u>d){n-=n+u-d}}}else if(a!=null){i-=a.x*s;n-=a.y*s}}l=l.clone();l.x=this.graph.snap(i/s-this.graph.getView().translate.x-this.graph.gridSize/2);l.y=this.graph.snap(n/s-this.graph.getView().translate.y-this.graph.gridSize/2);e.setGeometry(l);if(t==null){t=this.graph.getDefaultParent()}this.cycleAttribute(e);this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t));r.beginUpdate();try{e=this.graph.addCell(e,t);if(e!=null){this.graph.constrainChild(e);this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e))}}finally{r.endUpdate()}if(e!=null){this.graph.setSelectionCell(e);this.graph.scrollCellToVisible(e);this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))}return e};mxEditor.prototype.destroy=function(){if(!this.destroyed){this.destroyed=true;if(this.tasks!=null){this.tasks.destroy()}if(this.outline!=null){this.outline.destroy()}if(this.properties!=null){this.properties.destroy()}if(this.keyHandler!=null){this.keyHandler.destroy()}if(this.rubberband!=null){this.rubberband.destroy()}if(this.toolbar!=null){this.toolbar.destroy()}if(this.graph!=null){this.graph.destroy()}this.status=null;this.templates=null}};__mxOutput.mxEditor=typeof mxEditor!=="undefined"?mxEditor:undefined;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(t!=null){var e=t.getName();mxCodecRegistry.codecs[e]=t;var i=mxUtils.getFunctionName(t.template.constructor);if(i!=e){mxCodecRegistry.addAlias(i,e)}}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(t!=null){var i=mxUtils.getFunctionName(t);var n=mxCodecRegistry.aliases[i];if(n!=null){i=n}e=mxCodecRegistry.codecs[i];if(e==null){try{e=new mxObjectCodec(new t);mxCodecRegistry.register(e)}catch(r){}}}return e}};__mxOutput.mxCodecRegistry=typeof mxCodecRegistry!=="undefined"?mxCodecRegistry:undefined;function mxCodec(t){this.document=t||mxUtils.createXmlDocument();this.objects=[]}mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.encodeDefaults=false;mxCodec.prototype.putObject=function(t,e){this.objects[t]=e;return e};mxCodec.prototype.getObject=function(t){var e=null;if(t!=null){e=this.objects[t];if(e==null){e=this.lookup(t);if(e==null){var i=this.getElementById(t);if(i!=null){e=this.decode(i)}}}}return e};mxCodec.prototype.lookup=function(t){return null};mxCodec.prototype.getElementById=function(t){this.updateElements();return this.elements[t]};mxCodec.prototype.updateElements=function(){if(this.elements==null){this.elements=new Object;if(this.document.documentElement!=null){this.addElement(this.document.documentElement)}}};mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(e!=null){if(this.elements[e]==null){this.elements[e]=t}else if(this.elements[e]!=t){throw new Error(e+": Duplicate ID")}}}t=t.firstChild;while(t!=null){this.addElement(t);t=t.nextSibling}};mxCodec.prototype.getId=function(t){var e=null;if(t!=null){e=this.reference(t);if(e==null&&t instanceof mxCell){e=t.getId();if(e==null){e=mxCellPath.create(t);if(e.length==0){e="root"}}}}return e};mxCodec.prototype.reference=function(t){return null};mxCodec.prototype.encode=function(t){var e=null;if(t!=null&&t.constructor!=null){var i=mxCodecRegistry.getCodec(t.constructor);if(i!=null){e=i.encode(this,t)}else{if(mxUtils.isNode(t)){e=mxUtils.importNode(this.document,t,true)}else{mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}}}return e};mxCodec.prototype.decode=function(t,e){this.updateElements();var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=null;try{n=window[t.nodeName]}catch(s){}var r=mxCodecRegistry.getCodec(n);if(r!=null){i=r.decode(this,t,e)}else{i=t.cloneNode(true);i.removeAttribute("as")}}return i};mxCodec.prototype.encodeCell=function(t,e,i){e.appendChild(this.encode(t));if(i==null||i){var n=t.getChildCount();for(var r=0;r<n;r++){this.encodeCell(t.getChildAt(r),e)}}};mxCodec.prototype.isCellCodec=function(t){if(t!=null&&typeof t.isCellCodec=="function"){return t.isCellCodec()}return false};mxCodec.prototype.decodeCell=function(t,e){e=e!=null?e:true;var i=null;if(t!=null&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var n=mxCodecRegistry.getCodec(t.nodeName);if(!this.isCellCodec(n)){var r=t.firstChild;while(r!=null&&!this.isCellCodec(n)){n=mxCodecRegistry.getCodec(r.nodeName);r=r.nextSibling}}if(!this.isCellCodec(n)){n=mxCodecRegistry.getCodec(mxCell)}i=n.decode(this,t);if(e){this.insertIntoGraph(i)}}return i};mxCodec.prototype.insertIntoGraph=function(t){var e=t.parent;var i=t.getTerminal(true);var n=t.getTerminal(false);t.setTerminal(null,false);t.setTerminal(null,true);t.parent=null;if(e!=null){if(e==t){throw new Error(e.id+": Self Reference")}else{e.insert(t)}}if(i!=null){i.insertEdge(t,true)}if(n!=null){n.insertEdge(t,false)}};mxCodec.prototype.setAttribute=function(t,e,i){if(e!=null&&i!=null){t.setAttribute(e,i)}};__mxOutput.mxCodec=typeof mxCodec!=="undefined"?mxCodec:undefined;function mxObjectCodec(t,e,i,n){this.template=t;this.exclude=e!=null?e:[];this.idrefs=i!=null?i:[];this.mapping=n!=null?n:[];this.reverse=new Object;for(var r in this.mapping){this.reverse[this.mapping[r]]=r}}mxObjectCodec.allowEval=false;mxObjectCodec.prototype.template=null;mxObjectCodec.prototype.exclude=null;mxObjectCodec.prototype.idrefs=null;mxObjectCodec.prototype.mapping=null;mxObjectCodec.prototype.reverse=null;mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)};mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor};mxObjectCodec.prototype.getFieldName=function(t){if(t!=null){var e=this.reverse[t];if(e!=null){t=e}}return t};mxObjectCodec.prototype.getAttributeName=function(t){if(t!=null){var e=this.mapping[t];if(e!=null){t=e}}return t};mxObjectCodec.prototype.isExcluded=function(t,e,i,n){return e==mxObjectIdentity.FIELD_NAME||mxUtils.indexOf(this.exclude,e)>=0};mxObjectCodec.prototype.isReference=function(t,e,i,n){return mxUtils.indexOf(this.idrefs,e)>=0};mxObjectCodec.prototype.encode=function(t,e){var i=t.document.createElement(this.getName());e=this.beforeEncode(t,e,i);this.encodeObject(t,e,i);return this.afterEncode(t,e,i)};mxObjectCodec.prototype.encodeObject=function(t,e,i){t.setAttribute(i,"id",t.getId(e));for(var n in e){var r=n;var s=e[r];if(s!=null&&!this.isExcluded(e,r,s,true)){if(mxUtils.isInteger(r)){r=null}this.encodeValue(t,e,r,s,i)}}};mxObjectCodec.prototype.encodeValue=function(t,e,i,n,r){if(n!=null){if(this.isReference(e,i,n,true)){var s=t.getId(n);if(s==null){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+i+"="+n);return}n=s}var l=this.template[i];if(i==null||t.encodeDefaults||l!=n){i=this.getAttributeName(i);this.writeAttribute(t,e,i,n,r)}}};mxObjectCodec.prototype.writeAttribute=function(t,e,i,n,r){if(typeof n!="object"){this.writePrimitiveAttribute(t,e,i,n,r)}else{this.writeComplexAttribute(t,e,i,n,r)}};mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,i,n,r){n=this.convertAttributeToXml(t,e,i,n,r);if(i==null){var s=t.document.createElement("add");if(typeof n=="function"){s.appendChild(t.document.createTextNode(n))}else{t.setAttribute(s,"value",n)}r.appendChild(s)}else if(typeof n!="function"){t.setAttribute(r,i,n)}};mxObjectCodec.prototype.writeComplexAttribute=function(t,e,i,n,r){var s=t.encode(n);if(s!=null){if(i!=null){s.setAttribute("as",i)}r.appendChild(s)}else{mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+i+": "+n)}};mxObjectCodec.prototype.convertAttributeToXml=function(t,e,i,n){if(this.isBooleanAttribute(t,e,i,n)){n=n==true?"1":"0"}return n};mxObjectCodec.prototype.isBooleanAttribute=function(t,e,i,n){return typeof n.length=="undefined"&&(n==true||n==false)};mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,i){var n=e.value;if(this.isNumericAttribute(t,e,i)){n=parseFloat(n);if(isNaN(n)||!isFinite(n)){n=0}}return n};mxObjectCodec.prototype.isNumericAttribute=function(t,e,i){var n=i.constructor==mxGeometry&&(e.name=="x"||e.name=="y"||e.name=="width"||e.name=="height")||i.constructor==mxPoint&&(e.name=="x"||e.name=="y")||mxUtils.isNumeric(e.value);return n};mxObjectCodec.prototype.beforeEncode=function(t,e,i){return e};mxObjectCodec.prototype.afterEncode=function(t,e,i){return i};mxObjectCodec.prototype.decode=function(t,e,i){var n=e.getAttribute("id");var r=t.objects[n];if(r==null){r=i||this.cloneTemplate();if(n!=null){t.putObject(n,r)}}e=this.beforeDecode(t,e,r);this.decodeNode(t,e,r);return this.afterDecode(t,e,r)};mxObjectCodec.prototype.decodeNode=function(t,e,i){if(e!=null){this.decodeAttributes(t,e,i);this.decodeChildren(t,e,i)}};mxObjectCodec.prototype.decodeAttributes=function(t,e,i){var n=e.attributes;if(n!=null){for(var r=0;r<n.length;r++){this.decodeAttribute(t,n[r],i)}}};mxObjectCodec.prototype.isIgnoredAttribute=function(t,e,i){return e.nodeName=="as"||e.nodeName=="id"};mxObjectCodec.prototype.decodeAttribute=function(t,e,i){if(!this.isIgnoredAttribute(t,e,i)){var n=e.nodeName;var r=this.convertAttributeFromXml(t,e,i);var s=this.getFieldName(n);if(this.isReference(i,s,r,false)){var l=t.getObject(r);if(l==null){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+n+"="+r);return}r=l}if(!this.isExcluded(i,n,r,false)){i[n]=r}}};mxObjectCodec.prototype.decodeChildren=function(t,e,i){var n=e.firstChild;while(n!=null){var r=n.nextSibling;if(n.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,n,i)){this.decodeChild(t,n,i)}n=r}};mxObjectCodec.prototype.decodeChild=function(t,e,i){var n=this.getFieldName(e.getAttribute("as"));if(n==null||!this.isExcluded(i,n,e,false)){var r=this.getFieldTemplate(i,n,e);var s=null;if(e.nodeName=="add"){s=e.getAttribute("value");if(s==null&&mxObjectCodec.allowEval){s=mxUtils.eval(mxUtils.getTextContent(e))}}else{s=t.decode(e,r)}try{this.addObjectValue(i,n,s,r)}catch(l){throw new Error(l.message+" for "+e.nodeName)}}};mxObjectCodec.prototype.getFieldTemplate=function(t,e,i){var n=t[e];if(n instanceof Array&&n.length>0){n=null}return n};mxObjectCodec.prototype.addObjectValue=function(t,e,i,n){if(i!=null&&i!=n){if(e!=null&&e.length>0){t[e]=i}else{t.push(i)}}};mxObjectCodec.prototype.processInclude=function(t,e,i){if(e.nodeName=="include"){var n=e.getAttribute("name");if(n!=null){try{var r=mxUtils.load(n).getDocumentElement();if(r!=null){t.decode(r,i)}}catch(s){}}return true}return false};mxObjectCodec.prototype.beforeDecode=function(t,e,i){return e};mxObjectCodec.prototype.afterDecode=function(t,e,i){return i};__mxOutput.mxObjectCodec=typeof mxObjectCodec!=="undefined"?mxObjectCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);t.isCellCodec=function(){return true};t.isNumericAttribute=function(t,e,i){return e.nodeName!=="value"&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};t.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&e=="value"&&i.nodeType==mxConstants.NODETYPE_ELEMENT};t.afterEncode=function(t,e,i){if(e.value!=null&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var n=i;i=mxUtils.importNode(t.document,e.value,true);i.appendChild(n);var r=n.getAttribute("id");i.setAttribute("id",r);n.removeAttribute("id")}return i};t.beforeDecode=function(t,e,i){var n=e.cloneNode(true);var r=this.getName();if(e.nodeName!=r){var s=e.getElementsByTagName(r)[0];if(s!=null&&s.parentNode==e){mxUtils.removeWhitespace(s,true);mxUtils.removeWhitespace(s,false);s.parentNode.removeChild(s);n=s}else{n=null}i.value=e.cloneNode(true);var l=i.value.getAttribute("id");if(l!=null){i.setId(l);i.value.removeAttribute("id")}}else{i.setId(e.getAttribute("id"))}if(n!=null){for(var a=0;a<this.idrefs.length;a++){var o=this.idrefs[a];var h=n.getAttribute(o);if(h!=null){n.removeAttribute(o);var u=t.objects[h]||t.lookup(h);if(u==null){var d=t.getElementById(h);if(d!=null){var p=mxCodecRegistry.codecs[d.nodeName]||this;u=p.decode(t,d)}}i[o]=u}}}return n};return t}());__mxOutput.mxCellCodec=typeof mxCellCodec!=="undefined"?mxCellCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphModel);t.encodeObject=function(t,e,i){var n=t.document.createElement("root");t.encodeCell(e.getRoot(),n);i.appendChild(n)};t.decodeChild=function(t,e,i){if(e.nodeName=="root"){this.decodeRoot(t,e,i)}else{mxObjectCodec.prototype.decodeChild.apply(this,arguments)}};t.decodeRoot=function(t,e,i){var n=null;var r=e.firstChild;while(r!=null){var s=t.decodeCell(r);if(s!=null&&s.getParent()==null){n=s}r=r.nextSibling}if(n!=null){i.setRoot(n)}};return t}());__mxOutput.mxModelCodec=typeof mxModelCodec!=="undefined"?mxModelCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxRootChange,["model","previous","root"]);t.afterEncode=function(t,e,i){t.encodeCell(e.root,i);return i};t.beforeDecode=function(t,e,i){if(e.firstChild!=null&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){e=e.cloneNode(true);var n=e.firstChild;i.root=t.decodeCell(n,false);var r=n.nextSibling;n.parentNode.removeChild(n);n=r;while(n!=null){r=n.nextSibling;t.decodeCell(n);n.parentNode.removeChild(n);n=r}}return e};t.afterDecode=function(t,e,i){i.previous=i.root;return i};return t}());__mxOutput.mxRootChangeCodec=typeof mxRootChangeCodec!=="undefined"?mxRootChangeCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);t.isReference=function(t,e,i,n){if(e=="child"&&(!n||t.model.contains(t.previous))){return true}return mxUtils.indexOf(this.idrefs,e)>=0};t.isExcluded=function(t,e,i,n){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||n&&i!=null&&(e=="previous"||e=="parent")&&!t.model.contains(i)};t.afterEncode=function(t,e,i){if(this.isReference(e,"child",e.child,true)){i.setAttribute("child",t.getId(e.child))}else{t.encodeCell(e.child,i)}return i};t.beforeDecode=function(t,e,i){if(e.firstChild!=null&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){e=e.cloneNode(true);var n=e.firstChild;i.child=t.decodeCell(n,false);var r=n.nextSibling;n.parentNode.removeChild(n);n=r;while(n!=null){r=n.nextSibling;if(n.nodeType==mxConstants.NODETYPE_ELEMENT){var s=n.getAttribute("id");if(t.lookup(s)==null){t.decodeCell(n)}}n.parentNode.removeChild(n);n=r}}else{var l=e.getAttribute("child");i.child=t.getObject(l)}return e};t.afterDecode=function(t,e,i){if(i.child!=null){if(i.child.parent!=null&&i.previous!=null&&i.child.parent!=i.previous){i.previous=i.child.parent}i.child.parent=i.previous;i.previous=i.parent;i.previousIndex=i.index}return i};return t}());__mxOutput.mxChildChangeCodec=typeof mxChildChangeCodec!=="undefined"?mxChildChangeCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);t.afterDecode=function(t,e,i){i.previous=i.terminal;return i};return t}());__mxOutput.mxTerminalChangeCodec=typeof mxTerminalChangeCodec!=="undefined"?mxTerminalChangeCodec:undefined;var mxGenericChangeCodec=function(t,e){var i=new mxObjectCodec(t,["model","previous"],["cell"]);i.afterDecode=function(t,i,n){if(mxUtils.isNode(n.cell)){n.cell=t.decodeCell(n.cell,false)}n.previous=n[e];return n};return i};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value"));mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style"));mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed"));mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value"));__mxOutput.mxGenericChangeCodec=typeof mxGenericChangeCodec!=="undefined"?mxGenericChangeCodec:undefined;mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])}());__mxOutput.mxGraphCodec=typeof mxGraphCodec!=="undefined"?mxGraphCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())};t.encodeCell=function(t,e,i){var n=e.graph.getModel();var r=e.getState(i);var s=n.getParent(i);if(s==null||r!=null){var l=n.getChildCount(i);var a=e.graph.getCellGeometry(i);var o=null;if(s==n.getRoot()){o="layer"}else if(s==null){o="graph"}else if(n.isEdge(i)){o="edge"}else if(l>0&&a!=null){o="group"}else if(n.isVertex(i)){o="vertex"}if(o!=null){var h=t.document.createElement(o);var u=e.graph.getLabel(i);if(u!=null){h.setAttribute("label",e.graph.getLabel(i));if(e.graph.isHtmlLabel(i)){h.setAttribute("html",true)}}if(s==null){var d=e.getGraphBounds();if(d!=null){h.setAttribute("x",Math.round(d.x));h.setAttribute("y",Math.round(d.y));h.setAttribute("width",Math.round(d.width));h.setAttribute("height",Math.round(d.height))}h.setAttribute("scale",e.scale)}else if(r!=null&&a!=null){for(var p in r.style){var m=r.style[p];if(typeof m=="function"&&typeof m=="object"){m=mxStyleRegistry.getName(m)}if(m!=null&&typeof m!="function"&&typeof m!="object"){h.setAttribute(p,m)}}var c=r.absolutePoints;if(c!=null&&c.length>0){var x=Math.round(c[0].x)+","+Math.round(c[0].y);for(var p=1;p<c.length;p++){x+=" "+Math.round(c[p].x)+","+Math.round(c[p].y)}h.setAttribute("points",x)}else{h.setAttribute("x",Math.round(r.x));h.setAttribute("y",Math.round(r.y));h.setAttribute("width",Math.round(r.width));h.setAttribute("height",Math.round(r.height))}var f=r.absoluteOffset;if(f!=null){if(f.x!=0){h.setAttribute("dx",Math.round(f.x))}if(f.y!=0){h.setAttribute("dy",Math.round(f.y))}}}for(var p=0;p<l;p++){var g=this.encodeCell(t,e,n.getChildAt(i,p));if(g!=null){h.appendChild(g)}}}}return h};return t}());__mxOutput.mxGraphViewCodec=typeof mxGraphViewCodec!=="undefined"?mxGraphViewCodec:undefined;var mxStylesheetCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxStylesheet);t.encode=function(t,e){var i=t.document.createElement(this.getName());for(var n in e.styles){var r=e.styles[n];var s=t.document.createElement("add");if(n!=null){s.setAttribute("as",n);for(var l in r){var a=this.getStringValue(l,r[l]);if(a!=null){var o=t.document.createElement("add");o.setAttribute("value",a);o.setAttribute("as",l);s.appendChild(o)}}if(s.childNodes.length>0){i.appendChild(s)}}}return i};t.getStringValue=function(t,e){var i=typeof e;if(i=="function"){e=mxStyleRegistry.getName(e)}else if(i=="object"){e=null}return e};t.decode=function(t,e,i){var n=i||new this.template.constructor;var r=e.getAttribute("id");if(r!=null){t.objects[r]=n}e=e.firstChild;while(e!=null){if(!this.processInclude(t,e,n)&&e.nodeName=="add"){var s=e.getAttribute("as");if(s!=null){var l=e.getAttribute("extend");var a=l!=null?mxUtils.clone(n.styles[l]):null;if(a==null){if(l!=null){mxLog.warn("mxStylesheetCodec.decode: stylesheet "+l+" not found to extend")}a=new Object}var o=e.firstChild;while(o!=null){if(o.nodeType==mxConstants.NODETYPE_ELEMENT){var h=o.getAttribute("as");if(o.nodeName=="add"){var u=mxUtils.getTextContent(o);var d=null;if(u!=null&&u.length>0&&mxStylesheetCodec.allowEval){d=mxUtils.eval(u)}else{d=o.getAttribute("value");if(mxUtils.isNumeric(d)){d=parseFloat(d)}}if(d!=null){a[h]=d}}else if(o.nodeName=="remove"){delete a[h]}}o=o.nextSibling}n.putCellStyle(s,a)}}e=e.nextSibling}return n};return t}());mxStylesheetCodec.allowEval=true;__mxOutput.mxStylesheetCodec=typeof mxStylesheetCodec!=="undefined"?mxStylesheetCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);t.encode=function(t,e){return null};t.decode=function(t,e,i){if(i!=null){e=e.firstChild;while(e!=null){if(!this.processInclude(t,e,i)&&e.nodeName=="add"){var n=e.getAttribute("as");var r=e.getAttribute("action");var s=e.getAttribute("control");i.bindAction(n,r,s)}e=e.nextSibling}}return i};return t}());__mxOutput.mxDefaultKeyHandlerCodec=typeof mxDefaultKeyHandlerCodec!=="undefined"?mxDefaultKeyHandlerCodec:undefined;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);t.encode=function(t,e){return null};t.decode=function(t,e,i){if(i!=null){var n=i.editor;e=e.firstChild;while(e!=null){if(e.nodeType==mxConstants.NODETYPE_ELEMENT){if(!this.processInclude(t,e,i)){if(e.nodeName=="separator"){i.addSeparator()}else if(e.nodeName=="br"){i.toolbar.addBreak()}else if(e.nodeName=="hr"){i.toolbar.addLine()}else if(e.nodeName=="add"){var r=e.getAttribute("as");r=mxResources.get(r)||r;var s=e.getAttribute("icon");var l=e.getAttribute("pressedIcon");var a=e.getAttribute("action");var o=e.getAttribute("mode");var h=e.getAttribute("template");var u=e.getAttribute("toggle")!="0";var d=mxUtils.getTextContent(e);var p=null;if(a!=null){p=i.addItem(r,s,a,l)}else if(o!=null){var m=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;p=i.addMode(r,s,o,l,m)}else if(h!=null||d!=null&&d.length>0){var c=n.templates[h];var x=e.getAttribute("style");if(c!=null&&x!=null){c=n.graph.cloneCell(c);c.setStyle(x)}var f=null;if(d!=null&&d.length>0&&mxDefaultToolbarCodec.allowEval){f=mxUtils.eval(d)}p=i.addPrototype(r,s,c,l,f,u)}else{var g=mxUtils.getChildNodes(e);if(g.length>0){if(s==null){var v=i.addActionCombo(r);for(var y=0;y<g.length;y++){var C=g[y];if(C.nodeName=="separator"){i.addOption(v,"---")}else if(C.nodeName=="add"){var E=C.getAttribute("as");var S=C.getAttribute("action");i.addActionOption(v,E,S)}}}else{var b=null;var w=function(){var t=n.templates[b.value];if(t!=null){var e=t.clone();var i=b.options[b.selectedIndex].cellStyle;if(i!=null){e.setStyle(i)}return e}else{mxLog.warn("Template "+t+" not found")}return null};var T=i.addPrototype(r,s,w,null,null,u);b=i.addCombo();mxEvent.addListener(b,"change",(function(){i.toolbar.selectMode(T,(function(t){var e=mxUtils.convertPoint(n.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t));return n.addVertex(null,m(),e.x,e.y)}));i.toolbar.noReset=false}));for(var y=0;y<g.length;y++){var C=g[y];if(C.nodeName=="separator"){i.addOption(b,"---")}else if(C.nodeName=="add"){var E=C.getAttribute("as");var L=C.getAttribute("template");var A=i.addOption(b,E,L||h);A.cellStyle=C.getAttribute("style")}}}}}if(p!=null){var M=e.getAttribute("id");if(M!=null&&M.length>0){p.setAttribute("id",M)}}}}}e=e.nextSibling}}return i};return t}());mxDefaultToolbarCodec.allowEval=true;__mxOutput.mxDefaultToolbarCodec=typeof mxDefaultToolbarCodec!=="undefined"?mxDefaultToolbarCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);t.encode=function(t,e){return null};t.decode=function(t,e,i){var n=e.getElementsByTagName("include")[0];if(n!=null){this.processInclude(t,n,i)}else if(i!=null){i.config=e}return i};return t}());__mxOutput.mxDefaultPopupMenuCodec=typeof mxDefaultPopupMenuCodec!=="undefined"?mxDefaultPopupMenuCodec:undefined;mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);t.afterDecode=function(t,e,i){var n=e.getAttribute("defaultEdge");if(n!=null){e.removeAttribute("defaultEdge");i.defaultEdge=i.templates[n]}var r=e.getAttribute("defaultGroup");if(r!=null){e.removeAttribute("defaultGroup");i.defaultGroup=i.templates[r]}return i};t.decodeChild=function(t,e,i){if(e.nodeName=="Array"){var n=e.getAttribute("as");if(n=="templates"){this.decodeTemplates(t,e,i);return}}else if(e.nodeName=="ui"){this.decodeUi(t,e,i);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)};t.decodeUi=function(t,e,i){var n=e.firstChild;while(n!=null){if(n.nodeName=="add"){var r=n.getAttribute("as");var s=n.getAttribute("element");var l=n.getAttribute("style");var a=null;if(s!=null){a=document.getElementById(s);if(a!=null&&l!=null){a.style.cssText+=";"+l}}else{var o=parseInt(n.getAttribute("x"));var h=parseInt(n.getAttribute("y"));var u=n.getAttribute("width");var d=n.getAttribute("height");a=document.createElement("div");a.style.cssText=l;var p=new mxWindow(mxResources.get(r)||r,a,o,h,u,d,false,true);p.setVisible(true)}if(r=="graph"){i.setGraphContainer(a)}else if(r=="toolbar"){i.setToolbarContainer(a)}else if(r=="title"){i.setTitleContainer(a)}else if(r=="status"){i.setStatusContainer(a)}else if(r=="map"){i.setMapContainer(a)}}else if(n.nodeName=="resource"){mxResources.add(n.getAttribute("basename"))}else if(n.nodeName=="stylesheet"){mxClient.link("stylesheet",n.getAttribute("name"))}n=n.nextSibling}};t.decodeTemplates=function(t,e,i){if(i.templates==null){i.templates=[]}var n=mxUtils.getChildNodes(e);for(var r=0;r<n.length;r++){var s=n[r].getAttribute("as");var l=n[r].firstChild;while(l!=null&&l.nodeType!=1){l=l.nextSibling}if(l!=null){i.templates[s]=t.decodeCell(l)}}};return t}());__mxOutput.mxEditorCodec=typeof mxEditorCodec!=="undefined"?mxEditorCodec:undefined;return __mxOutput}}))}));var CommonStyleTokens;(function(t){t.HANDLE_COLOR="#4ba3d4";t.HANDLE_SIZE=4;t.PREVIEW_COLOR="#5bb2ff";t.EDGE_SELECTION_COLOR="red";t.HIGHLIGHT_CONNECTION_COLOR="#ffb754";t.GUIDE_COLOR=t.PREVIEW_COLOR;t.GUIDE_STROKE_WIDTH=2;t.DROP_TARGET_COLOR=t.GUIDE_COLOR})(CommonStyleTokens||(CommonStyleTokens={}));var w$1=window;w$1.mxLoadResources=false;w$1.mxForceIncludes=false;w$1.mxResourceExtension=undefined;w$1.mxLoadStylesheets=false;w$1.mxBasePath=getAssetPath("./assets");var mx=exports("m",build({}));mx.mxConstants.HANDLE_STROKECOLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.HANDLE_FILLCOLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.HANDLE_SIZE=CommonStyleTokens.HANDLE_SIZE;mx.mxConstants.VERTEX_SELECTION_COLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.EDGE_SELECTION_COLOR=CommonStyleTokens.HANDLE_COLOR;mx.mxConstants.DEFAULT_VALID_COLOR=CommonStyleTokens.HIGHLIGHT_CONNECTION_COLOR;mx.mxConstants.VALID_COLOR=CommonStyleTokens.HIGHLIGHT_CONNECTION_COLOR;mx.mxConstants.GUIDE_COLOR=CommonStyleTokens.GUIDE_COLOR;mx.mxConstants.GUIDE_STROKEWIDTH=CommonStyleTokens.GUIDE_STROKE_WIDTH;mx.mxConstants.DROP_TARGET_COLOR=CommonStyleTokens.DROP_TARGET_COLOR;mx.mxEdgeHandler.prototype.livePreview=true;mx.mxConnectionHandler.prototype.livePreview=true;mx.mxVertexHandler.prototype.livePreview=true;mx.mxGraphHandler.prototype.maxLivePreview=10;mx.mxUrlConverter.prototype.isRelativeUrl=function(t){return t.substring(0,2)!="//"&&t.substring(0,7)!="http://"&&t.substring(0,8)!="https://"&&t.substring(0,10)!="data:image"&&t.substring(0,7)!="file://"&&t.substring(0,7)!="gxjs://"&&t.substring(0,10)!="gx-file://"};mx.mxMarker.addMarker("oval",(function(t,e,i,n,r,s,l,a,o,h){var u=l/2;var d=n.clone();d.x-=r*(u+1);d.y-=s*(u+1);return function(){t.ellipse(d.x-u,d.y-u,l,l);if(h){t.fillAndStroke()}else{t.stroke()}}}));mx.mxEdgeHandler.prototype.snapToTerminals=true;var _SYM_SVG_GROUPS=Symbol("svgGrpups");var svgCanvas=mx.mxSvgCanvas2D.prototype;svgCanvas[_SYM_SVG_GROUPS]=[];svgCanvas._getCurrentSvgGroup=function(){var t=svgCanvas[_SYM_SVG_GROUPS];if(t.length>0)return t[t.length-1];return this.root};svgCanvas.beginSvgGroup=function(t){if(t===void 0){t={}}var e=this.createElement("g");for(var i=0,n=Object.getOwnPropertyNames(t);i<n.length;i++){var r=n[i];e.setAttribute(r,t[r])}var s=this._getCurrentSvgGroup();s.appendChild(e);var l=svgCanvas[_SYM_SVG_GROUPS];l.push(e)};svgCanvas.closeSvgGroup=function(){var t=svgCanvas[_SYM_SVG_GROUPS];if(t.length>0)return t.pop()};svgCanvas.addSvgElement=function(t,e){if(e===void 0){e={}}var i=this.createElement(t);this._getCurrentSvgGroup().appendChild(i);this.node=i;this.updateFill();this.updateStroke();for(var n=0,r=Object.getOwnPropertyNames(e);n<r.length;n++){var s=r[n];var l=e[s];if(l!==undefined)i.setAttribute(s,l)}return i};var Cell=function(t){__extends(e,t);function e(e,i,n){var r=t.call(this,i!==null&&i!==void 0?i:{},n)||this;r._descriptor=e;r.setId(Guid.newInstance().toString());return r}Object.defineProperty(e.prototype,"descriptor",{get:function(){return this._descriptor},enumerable:false,configurable:true});e.prototype.setAttribute=function(t,e){var i=this.getValue();i[t]=e};e.prototype.getAttribute=function(t){var e=this.getValue();return e[t]};e.prototype.getSlot=function(t){if(this.descriptor.isSlot&&t===this.descriptor.slotId)return this;if(this.children){for(var i=0,n=this.children;i<n.length;i++){var r=n[i];if(r instanceof e&&!r.descriptor.isDiagramElement&&r.descriptor.isSlot&&r.descriptor.slotId===t){return r}}}return null};e.prototype.getParentDiagramElement=function(){var t=this.getParent();while(t&&(!(t instanceof e)||!t.descriptor.isDiagramElement))t=t.getParent();return t};e.prototype.getDiagramElements=function(){var t=[];if(this.descriptor.isSlot&&this.children){for(var i=0,n=this.children;i<n.length;i++){var r=n[i];if(r instanceof e&&r.descriptor.isDiagramElement)t.push(r)}}return t};e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._descriptor=this._descriptor;return e};e.prototype.cloneValue=function(){var t=this.getValue();return Object.assign({},t)};return e}(mx.mxCell);exports("a",Cell);Cell.prototype.mxTransient=__spreadArrays(Cell.prototype.mxTransient,["_descriptor"]);var _LABEL_ATTR="label";var CellDescriptor=function(){function t(e){var i,n,r;this._isDiagramElement=e.isDiagramElement!==undefined?e.isDiagramElement:true;this._id=e.id;this._baseName=e.baseName;this._icon=e.icon;this._isVertex=(i=e.isVertex)!==null&&i!==void 0?i:false;this._isEdge=(n=e.isEdge)!==null&&n!==void 0?n:false;this._isSlot=!!e.isSlot;this._slotId=this._isSlot?e.slotId||t.DEFAULT_SLOT_NAME:null;this._labelAttribute=e.labelAttribute;this._nameAttribute=e.nameAttribute;this._resizable=e.resizable;this._cellConectionRestrictions=e.cellConectionRestrictions;if(this._isVertex&&!e.size)this._size={width:100,height:50};else this._size=e.size;this._labelOffset=e.labelOffset;this._style=e.style;this._shape=e.shape;this._radialMenu=e.radialMenu;this._value=(r=e.value)!==null&&r!==void 0?r:{};this._factory=e.factory}Object.defineProperty(t.prototype,"isDiagramElement",{get:function(){return this._isDiagramElement},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"baseName",{get:function(){return this._baseName},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isVertex",{get:function(){return this._isVertex},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEdge",{get:function(){return this._isEdge},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isSlot",{get:function(){return this._isSlot},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"slotId",{get:function(){return this._slotId},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"labelAttribute",{get:function(){var t;return(t=this._labelAttribute)!==null&&t!==void 0?t:_LABEL_ATTR},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"nameAttribute",{get:function(){return this._nameAttribute||this.labelAttribute},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"labelOffset",{get:function(){return this._labelOffset},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"style",{get:function(){return this._style},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"shape",{get:function(){return this._shape},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"cellConectionRestrictions",{get:function(){return this._cellConectionRestrictions},enumerable:false,configurable:true});t.prototype.getRadialMenu=function(t,e){if(typeof this._radialMenu==="function")return this._radialMenu.call(this,t,e);return this._radialMenu};t.prototype.isResizable=function(t,e){if(typeof this._resizable==="function")return this._resizable.call(this,t,e);if(typeof this._resizable==="boolean")return this._resizable;return true};t.prototype.getDefaultStyle=function(){var t;var e=this.isVertex?"defaultVertex":"defaultEdge";return((t=this.style)!==null&&t!==void 0?t:e)+";"+(this.shape?mx.mxConstants.STYLE_SHAPE+"="+this.id.toString():"")};t.prototype.newInstance=function(t){return this._factory?this._factory(this,t):new Cell(this,t.value,t.geometry)};t.prototype.toString=function(){return this.id.toString()+", "+this.baseName};return t}();exports("b",CellDescriptor);CellDescriptor.DEFAULT_SLOT_NAME="Children";var EventType;(function(t){t["ChildChange"]="ChildChange";t["CachedPropertiesChange"]="CachedPropertiesChange";t["TerminalChange"]="TerminalChange";t["GraphicalPropertiesChange"]="GraphicalPropertiesChange"})(EventType||(EventType={}));var EventConverter=function(){function t(){}t.convert=function(e,i){var n=[];for(var r=0,s=e.properties.changes;r<s.length;r++){var l=s[r];var a=null;switch(l.constructor.name){case mxEventType.ChildChange:a=t.convertChildChange(l,i);break;case mxEventType.ValueChange:a=t.convertValueChange(l);break;case mxEventType.GeometryChange:a=t.convertGeometryChange(l,i);break;case mxEventType.TerminalChange:a=t.convertTerminalChange(l);break}if(a)n.push(a)}return n};t.convertChildChange=function(e,i){if(e.child instanceof Cell){var n=e.child;var r=null,s=void 0;if(e.parent){if(e.parent instanceof Cell){var l=e.child.getParentDiagramElement();r=l.id;s=e.parent.descriptor.slotId}else r=Guid.EMPTY.toString()}return{type:EventType.ChildChange,args:{parentGuid:r,parentSlotId:s,guid:n.id,type:n.descriptor.id,properties:n.getValue(),graphicalProperties:t.convertGeometry(n,i),index:e.index}}}return null};t.convertValueChange=function(t){if(t.cell instanceof Cell){return{type:EventType.CachedPropertiesChange,args:{guid:t.cell.id,properties:t.cell.getValue()}}}return null};t.convertGeometryChange=function(e,i){if(e.cell instanceof Cell){var n=e.geometry;if(n.offset){var r=i.view.getState(e.cell,true);var s=i.view.getTranslate();var l=Object.assign({},r.absoluteOffset);l.x-=s.x;l.y-=s.y}return{type:EventType.GraphicalPropertiesChange,args:{guid:e.cell.id,properties:t.convertGeometry(e.cell,i)}}}return null};t.convertTerminalChange=function(t){if(t.cell instanceof Cell){return{type:EventType.TerminalChange,args:{guid:t.cell.id,terminalGuid:t.terminal?t.terminal.id:null,source:t.source}}}};t.convertGeometry=function(t,e){return e.getCellGraphicalProperties(t)};return t}();var mxEventType;(function(t){t["ChildChange"]="mxChildChange";t["ValueChange"]="mxValueChange";t["TerminalChange"]="mxTerminalChange";t["GeometryChange"]="mxGeometryChange"})(mxEventType||(mxEventType={}));var CellEditor=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.init=function(){t.prototype.init.call(this);var e=this;e.textarea.className+=" native-key-bindings"};return e}(mx.mxCellEditor);var CellTypes=exports("C",{TASK:"Task",SUB_PROCESS:"SubProcess",EMBEDDED_SUB_PROCESS:"EmbeddedSubProcess",EXPANDED_EMBEDDED_SUB_PROCESS:"ExpandedEmbeddedSubProcess",SUB_PROCESS_CHILDREN_SLOT:"SubProcessChildrenSlot",START_EVENT:"StartEvent",INTERMEDIATE_EVENT:"IntermediateEvent",END_EVENT:"EndEvent",GATEWAY:"Gateway",POOL:"Pool",LANE:"Lane",CONNECTOR:"Connector",TEXT_ANNOTATION:"TextAnnotation"});mx.mxConnectionHandler.prototype.start=function(t,e,i,n){this.previous=t;this.first=new mx.mxPoint(e,i);this.edgeState=n!=null?n:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=t;this.marker.mark();console.log("previous",this.previous,"actual",this.edgeState);this.fireEvent(new mx.mxEventObject(mx.mxEvent.START,"state",this.previous))};var ConnectionHandler=function(t){__extends(e,t);function e(e,i){var n=t.call(this,e,i)||this;n.createTarget=true;return n}e.prototype.createMarker=function(){var e=t.prototype.createMarker.call(this);e.intersects=mx.mxUtils.bind(this,(function(t,e){if(this.connectImage!=null||this.isConnecting()){return true}return false}));return e};e.prototype.isCreateTarget=function(t){return this.createTarget};e.prototype.createEdgeState=function(){console.log("createedgestate called");var t=this.graph.newCellInstance({type:CellTypes.CONNECTOR});var e=new mx.mxGeometry;e.relative=false;t.setGeometry(e);return new mx.mxCellState(this.graph.view,t,this.graph.getCellStyle(t))};e.prototype.createTargetVertex=function(t,e){if(!this.currentVertexType)return null;var i=this.graph.newCellInstance({type:this.currentVertexType,assignName:true});var n=this.graph.getModel().getGeometry(i);if(n!=null){var r=this.graph.view.translate;var s=this.graph.view.scale;var l=new mx.mxPoint(this.currentPoint.x/s-r.x,this.currentPoint.y/s-r.y);n.x=Math.round(l.x-n.width/2);n.y=Math.round(l.y-n.height/2)}this.currentVertexType=null;return i};e.prototype.mouseDown=function(e,i){this._firstMouseUp=false;return t.prototype.mouseDown.call(this,e,i)};e.prototype.mouseUp=function(e,i){var n=this;if(this.previous){var r=null;if(this.constraintHandler.currentConstraint!=null&&this.constraintHandler.currentFocus!=null){r=this.constraintHandler.currentFocus.cell}if(r==null&&n.currentState!=null){r=n.currentState.cell}if(!this._firstMouseUp&&!r){this._firstMouseUp=true;this.graph.isMouseDown=true;i.consume(null);return}}this.graph.isMouseDown=false;return t.prototype.mouseUp.call(this,e,i)};e.prototype.reset=function(){this._firstMouseUp=false;this.graph.isMouseDown=false;t.prototype.reset.call(this)};e.prototype.connect=function(t,e,i,n){if(e!=null||this.isCreateTarget(i)||this.graph.allowDanglingEdges){var r=this.graph.getModel();var s=false;var l=null;r.beginUpdate();try{if(t!=null&&e==null&&!this.graph.isIgnoreTerminalEvent(i)&&this.isCreateTarget(i)){e=this.createTargetVertex(i,t);if(e!=null){n=this.graph.getDropTarget([e],i,n);s=true;if(n==null||!this.graph.getModel().isEdge(n)){var a=this.graph.getView().getState(n);if(a!=null){var o=r.getGeometry(e);o.x-=a.origin.x;o.y-=a.origin.y}}else{n=this.graph.getDefaultParent()}this.graph.addCell(e,n)}else if(!this.graph.allowDanglingEdges){return}}var h=this.graph.getDefaultParent();if(t!=null&&e!=null&&r.getParent(t)==r.getParent(e)&&r.getParent(r.getParent(t))!=r.getRoot()){h=r.getParent(t);if(t.geometry!=null&&t.geometry.relative&&(e.geometry!=null&&e.geometry.relative)){h=r.getParent(h)}}var u=null;var d=null;if(this.edgeState!=null){u=this.edgeState.cell.value;d=this.edgeState.cell.style}console.log("edgeState before insert: ",this.edgeState);l=this.insertEdge(h,null,u,t,e,d);console.log("edge inserted: ",l);if(l!=null){this.graph.setConnectionConstraint(l,t,true,this.sourceConstraint);this.graph.setConnectionConstraint(l,e,false,this.constraintHandler.currentConstraint);if(this.edgeState!=null){r.setGeometry(l,this.edgeState.cell.geometry)}var h=r.getParent(t);if(this.isInsertBefore(l,t,e,i,n)){var o=t;while(o.parent!=null&&o.geometry!=null&&o.geometry.relative&&o.parent!=l.parent){o=this.graph.model.getParent(o)}if(o!=null&&o.parent!=null&&o.parent==l.parent){r.add(h,l,o.parent.getIndex(o))}}var p=r.getGeometry(l);if(p==null){p=new mx.mxGeometry;p.relative=true;r.setGeometry(l,p)}if(this.waypoints!=null&&this.waypoints.length>0){var m=this.graph.view.scale;var c=this.graph.view.translate;p.points=[];for(var x=0;x<this.waypoints.length;x++){var f=this.waypoints[x];p.points.push(new mx.mxPoint(f.x/m-c.x,f.y/m-c.y))}}if(e==null){var g=this.graph.view.translate;var m=this.graph.view.scale;var f=this.originalPoint!=null?new mx.mxPoint(this.originalPoint.x/m-g.x,this.originalPoint.y/m-g.y):new mx.mxPoint(this.currentPoint.x/m-g.x,this.currentPoint.y/m-g.y);f.x-=this.graph.panDx/this.graph.view.scale;f.y-=this.graph.panDy/this.graph.view.scale;p.setTerminalPoint(f,false)}this.fireEvent(new mx.mxEventObject(mx.mxEvent.CONNECT,"cell",l,"terminal",e,"event",i,"target",n,"terminalInserted",s))}}catch(v){mx.mxLog.show()}finally{r.endUpdate()}if(this.select){this.selectCells(l,s?e:null)}}};return e}(mx.mxConnectionHandler);var Utils=function(){function t(){}t.convertToBoolean=function(t){return t&&t.toLowerCase()==="true"};t.convertToAbsolutePosition=function(e,i){return t.convertPosition(e,i,false)};t.convertToRelativePosition=function(e,i){return t.convertPosition(e,i,true)};t.convertPosition=function(t,e,i){var n=e.x;var r=e.y;var s=t;while(s){var l=s.getGeometry();if(l){if(i){n-=l.x;r-=l.y}else{n+=l.x;r+=l.y}}s=s.getParent()}return{x:n,y:r}};t.getObjectProperties=function(t){return Object.keys(t).map((function(e){return{name:e,value:t[e]}}))};t.setObjectProperties=function(t,e){e.forEach((function(e){return t[e.name]=e.value}));return t};t.getDpi=function(){var t=document.body.appendChild(document.createElement("DIV"));t.style.width="1in";t.style.padding="0";var e=t.offsetWidth;t.parentNode.removeChild(t);return e};t.convertFontSizeToPixels=function(e,i){var n;if(typeof e==="string")n=parseFloat(e);else n=e;switch(i){case"in":return t.getDpi()*n;case"pt":return n/.75}return n};t.cellOfType=function(e,i){if(typeof i==="string")i=[i];if(t.isValidCell(e)){var n=e.descriptor;for(var r=0,s=i;r<s.length;r++){var l=s[r];if(l===n.id)return n.id===l}}return false};t.isValidCell=function(t){return t instanceof Cell};return t}();exports("U",Utils);var GraphHandler=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;i.previewColor=CommonStyleTokens.PREVIEW_COLOR;return i}e.prototype.shouldRemoveCellsFromParent=function(t,e,i){return false};e.prototype.mouseDown=function(e,i){var n=this.graph;if(i.getEvent().button===2){if(!i.isConsumed()&&this.isEnabled()&&this.isEnabled()&&i.getState()!=null&&!mx.mxEvent.isMultiTouchEvent(i.getEvent())){var r=this.getInitialCellForEvent(i);if(this.isSelectEnabled()&&!n.selectionModel.isSelected(r))n.selectCellForEvent(r,i.getEvent())}n.isMouseDown=false;return}return t.prototype.mouseDown.call(this,e,i)};e.prototype.getPointInSegment=function(t,e,i){var n=15;if(e.x<t.x||e.y<t.y){var r=t;t=e;e=r}if(t.y===e.y&&i.x>=t.x&&i.x<=e.x&&Math.abs(t.y-i.y)<n){return{x:i.x,y:t.y}}if(t.x===e.x&&i.y>=t.y&&i.y<=e.y&&Math.abs(t.x-i.x)<n){return{x:t.x,y:i.y}}return null};e.prototype.mouseUp=function(e,i){if(i.getEvent().button===2)return;var n=this;var r=n.cell;if(!r)return t.prototype.mouseUp.call(this,e,i);var s=n.graph;var l=n.target;if(r!=null&&n.first!=null&&(n.shape!=null||n.livePreviewUsed)&&n.currentDx!=null&&n.currentDy!=null&&s.isSplitEnabled()&&s.isSplitTarget(l,n.cells,i.getEvent())){s.view.revalidate();var a=s.view.getState(l,true);var o=l.getParent();var h=a.absolutePoints.slice(0);var u=s.view.getTranslate();var d={x:i.getGraphX()-u.x,y:i.getGraphY()-u.y};d=Utils.convertToRelativePosition(o,d);if(h&&h.length>=2){var p=[];for(var m=0,c=h;m<c.length;m++){var x=c[m];var f={x:x.x-u.x,y:x.y-u.y};f=Utils.convertToRelativePosition(o,f);p.push(f)}var g=this.getPointInSegment(p[0],p[1],d);if(!g)g=this.getPointInSegment(p[p.length-2],p[p.length-1],d);if(g){s.model.beginUpdate();try{t.prototype.mouseUp.call(this,e,i);var v=r.getGeometry().clone();v.x=g.x-v.width/2;v.y=g.y-v.height/2;s.model.setGeometry(r,v)}finally{s.model.endUpdate()}return}}}t.prototype.mouseUp.call(this,e,i)};e.prototype.mouseMove=function(t,e){var i=this;var n=i.graph;if(!e.isConsumed()&&n.isMouseDown&&i.cell!=null&&i.first!=null&&i.bounds!=null&&!i.suspended){if(mx.mxEvent.isMultiTouchEvent(e.getEvent())){this.reset();return}var r=this.getDelta(e);var s=n.tolerance;if(i.shape!=null||i.livePreviewActive||Math.abs(r.x)>s||Math.abs(r.y)>s){if(i.highlight==null){i.highlight=new mx.mxCellHighlight(n,mx.mxConstants.DROP_TARGET_COLOR,3,undefined)}var l=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled();var a=n.isGridEnabledEvent(e.getEvent());var o=e.getCell();var h=true;var u=null;i.cloning=l;if(n.isDropEnabled()&&i.highlightEnabled&&i.cells.indexOf(o)<0){u=n.getDropTarget(i.cells,e.getEvent(),o,l)}var d=n.getView().getState(u);var p=false;if(d!=null&&(n.model.getParent(i.cell)!=u||l)){if(i.target!=u){i.target=u;this.setHighlightColor(mx.mxConstants.DROP_TARGET_COLOR)}p=true}else{i.target=null;if(i.connectOnDrop&&o!=null&&i.cells.length==1&&n.getModel().isVertex(o)&&n.isCellConnectable(o)){d=n.getView().getState(o);if(d!=null){var m=n.getEdgeValidationError(null,i.cell,o);var c=m==null?mx.mxConstants.VALID_COLOR:mx.mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(c);p=true}}}if(d!=null&&p){i.highlight.highlight(d)}else{i.highlight.hide()}if(i.livePreviewActive&&l){i.resetLivePreview();i.livePreviewActive=false}else if(i.maxLivePreview>=i.cellCount&&!i.livePreviewActive&&i.allowLivePreview){if(!l||!i.livePreviewActive){i.setHandlesVisibleForCells(n.getSelectionCells(),false);i.livePreviewActive=true;i.livePreviewUsed=true}}else if(!i.livePreviewUsed&&i.shape==null){i.shape=this.createPreviewShape(i.bounds)}if(i.guide!=null&&this.useGuidesForEvent(e)){r=i.guide.move(i.bounds,r,a,l);h=false}else{r=n.snapDelta(r,i.bounds,!a,false,false)}if(i.guide!=null&&h){i.guide.hide()}if(n.isConstrainedEvent(e.getEvent())){if(Math.abs(r.x)>Math.abs(r.y)){r.y=0}else{r.x=0}}if(i.currentDx!=r.x||i.currentDy!=r.y){i.currentDx=r.x;i.currentDy=r.y;i.updatePreview()}}this.updateHint(e);this.consumeMouseEvent(mx.mxEvent.MOUSE_MOVE,e);mx.mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&i.updateCursor&&!e.isConsumed()&&(e.getState()!=null||e.sourceState!=null)&&!n.isMouseDown){var x=n.getCursorForMouseEvent(e);if(x==null&&n.isEnabled()&&n.isCellMovable(e.getCell())){if(n.getModel().isEdge(e.getCell())){x=mx.mxConstants.CURSOR_MOVABLE_EDGE}else{x=mx.mxConstants.CURSOR_MOVABLE_VERTEX}}if(x!=null&&e.sourceState!=null){e.sourceState.setCursor(x)}}};return e}(mx.mxGraphHandler);var PanningHandler=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.isPanningTrigger=function(t){var e=t.getEvent();var i=navigator.platform==="MacIntel"?mx.mxEvent.isMetaDown(e):mx.mxEvent.isControlDown(e);return this.useLeftButtonForPanning&&t.getState()==null&&mx.mxEvent.isLeftMouseButton(e)||i&&!mx.mxEvent.isShiftDown(e)};return e}(mx.mxPanningHandler);var _HANDLER_PADDING=10;var VertexToolHandler=function(t){__extends(e,t);function e(e){var i=this;console.log("mxVertexHandler creation");i=t.call(this,e)||this;return i}e.prototype.init=function(){var e=this;var i,n,r,s,l,a,o;t.prototype.init.call(this);var h=this.graph;var u=this.state;if(h.getSelectionCount()>1)return;this._createPanel();var d=u.cell;var p=d.descriptor;this._mouseListener=function(){return e._onShapeClick()};(n=(i=u.shape)===null||i===void 0?void 0:i.node)===null||n===void 0?void 0:n.addEventListener("click",this._mouseListener);this._keyListener=function(t){return e._onKeyDown(t)};document.addEventListener("keydown",this._keyListener);if(p){var m=p.getRadialMenu(h,d);if(m){var c=this._createGroup();for(var x=0,f=m.newVertexTypes||[];x<f.length;x++){var g=f[x];this._createNewVertexTool(c,h.getCellDescriptor(g))}if((r=m.customTools)===null||r===void 0?void 0:r.mainMenu){var v=this._createGroup();for(var y=0,C=(s=m.customTools)===null||s===void 0?void 0:s.mainMenu;y<C.length;y++){var E=C[y];var S=this._createMenuItem(v,E.icon);this._setCustomToolCallback(S,E)}}if(((l=m.customTools)===null||l===void 0?void 0:l.subMenuMain)||((a=m.customTools)===null||a===void 0?void 0:a.subMenuTop)||m.newEdge||m.delete){var b=this._createGroup();if(m.newEdge===undefined||m.newEdge)this._createNewEdgeTool(b);if(m.delete===undefined||m.delete)this._createDeleteTool(b);if((o=m.customTools)===null||o===void 0?void 0:o.subMenuMain)this._createCustomToolsPad(b,m)}}}this.graph.container.appendChild(this.domNode);this._redrawTools()};e.prototype.redraw=function(){t.prototype.redraw.call(this);this._redrawTools()};e.prototype._redrawTools=function(){var t=this.state;if(t!=null&&this.domNode!=null){var e=4;this.domNode.style.left=t.x+t.width+e+"px";this.domNode.style.top=t.y+"px"}};e.prototype.createSelectionShape=function(e){var i=t.prototype.createSelectionShape.call(this,e);i.style={dashPattern:"2 2"};return i};e.prototype.getSelectionBounds=function(t){return new mx.mxRectangle(Math.round(t.x-_HANDLER_PADDING/2),Math.round(t.y-_HANDLER_PADDING/2),Math.round(t.width+_HANDLER_PADDING),Math.round(t.height+_HANDLER_PADDING))};e.prototype.getHandlePadding=function(){return new mx.mxPoint(_HANDLER_PADDING,_HANDLER_PADDING)};e.prototype.destroy=function(){var e,i;var n=this.state;(i=(e=n.shape)===null||e===void 0?void 0:e.node)===null||i===void 0?void 0:i.removeEventListener("click",this);document.removeEventListener("keydown",this._keyListener);t.prototype.destroy.call(this);this._destroyPanel()};e.prototype._destroyPanel=function(){var t;if(this.domNode!=null){(t=this.domNode.parentNode)===null||t===void 0?void 0:t.removeChild(this.domNode);this.domNode=null}};e.prototype._createPanel=function(){this.domNode=document.createElement("div");this.domNode.classList.add("radial-menu-pad");return this.domNode};e.prototype._createGroup=function(){var t=document.createElement("div");t.classList.add("group");this.domNode.appendChild(t);return t};e.prototype._createNewVertexTool=function(t,e){var i=this.graph;var n=this.state;var r=this._createMenuItem(t,e.icon);mx.mxEvent.addGestureListeners(r,(function(t){var r=mx.mxUtils.convertPoint(i.container,mx.mxEvent.getClientX(t),mx.mxEvent.getClientY(t));i.connectionHandler.currentVertexType=e.id;i.connectionHandler.start(n,r.x,r.y);i.isMouseDown=true;i.isMouseTrigger=mx.mxEvent.isMouseEvent(t);mx.mxEvent.consume(t)}),null,null)};e.prototype._createNewEdgeTool=function(t){var e=this.graph;var i=this.state;var n=this._createMenuItem(t,"bpmn-icon-connection");mx.mxEvent.addGestureListeners(n,(function(t){var n=mx.mxUtils.convertPoint(e.container,mx.mxEvent.getClientX(t),mx.mxEvent.getClientY(t));e.connectionHandler.currentVertexType=null;e.connectionHandler.start(i,n.x,n.y);e.isMouseDown=true;e.isMouseTrigger=mx.mxEvent.isMouseEvent(t);mx.mxEvent.consume(t)}),null,null)};e.prototype._createDeleteTool=function(t){var e=this.graph;var i=this.state;var n=this._createMenuItem(t,"bpmn-icon-trash");mx.mxEvent.addGestureListeners(n,(function(t){e.getModel().remove(i.cell)}),null,null)};e.prototype._createCustomToolsPad=function(t,e){var i,n,r;var s=document.createElement("div");s.style.display="none";s.classList.add("custom-tools-pad");t.appendChild(s);var l=document.createElement("div");l.classList.add("secondary-tools");s.appendChild(l);for(var a=0,o=((i=e.customTools)===null||i===void 0?void 0:i.subMenuTop)||[];a<o.length;a++){var h=o[a];var u=document.createElement("span");u.classList.add("secondary-tool");u.classList.add(""+h.icon);this._setCustomToolCallback(u,h);l.appendChild(u)}var d=document.createElement("div");d.classList.add("main-tools");s.appendChild(d);var p=function(t){var e=document.createElement("div");e.classList.add("main-tool");d.appendChild(e);var i=document.createElement("span");i.classList.add("icon");var n=(r=t.icon)===null||r===void 0?void 0:r.split(" ");if(n)n.forEach((function(t){return i.classList.add(t)}));e.appendChild(i);var s=document.createElement("span");s.classList.add("text");s.innerHTML=""+t.label;e.appendChild(s);m._setCustomToolCallback(e,t)};var m=this;for(var c=0,x=((n=e.customTools)===null||n===void 0?void 0:n.subMenuMain)||[];c<x.length;c++){var h=x[c];p(h)}var f=this._createMenuItem(t,"bpmn-icon-screw-wrench");mx.mxEvent.addGestureListeners(f,(function(t){if(s.style.display==="none")s.style.display="block";else s.style.display="none"}),null,null)};e.prototype._setCustomToolCallback=function(t,e){var i=this;mx.mxEvent.addGestureListeners(t,(function(){var t=i.graph;var n=i.state.cell;if(e.value){t.getModel().setValue(n,Object.assign({},n.getValue(),e.value));t.refresh(n)}i._toglePanel();if(e.execute)e.execute(t,n)}),null,null)};e.prototype._createMenuItem=function(t,e,i){var n=document.createElement("div");n.classList.add("item");n.classList.add(e);t.appendChild(n);return n};e.prototype._toglePanel=function(){if(this.domNode){if(this.domNode.style.display==="none")this._showPanel();else this._hidePanel()}};e.prototype._showPanel=function(){if(this.domNode)this.domNode.style.display="block"};e.prototype._hidePanel=function(){if(this.domNode)this.domNode.style.display="none"};e.prototype._createImage=function(t){return mx.mxUtils.createImage(t)};e.prototype._onShapeClick=function(){if(!this._firstClick){this._firstClick=true;return}this._toglePanel()};e.prototype._onKeyDown=function(t){if(t.keyCode===27)this._hidePanel()};return e}(mx.mxVertexHandler);var _NAME_REGEX=/([^\d]*)([\d]*)/g;var Graph=function(t){__extends(e,t);function e(e){var i=t.call(this,e.container)||this;i.resetEdgesOnMove=true;i._editorHelper=e.editorHelper;i.dropEnabled=true;i.installCellDescriptors(e.cellDescriptors);if(e.defaultEdgeDescriptorId){var n=i.getCellDescriptor(e.defaultEdgeDescriptorId);if(n.isEdge)i._defaultEdgeDescriptor=n;else throw Error("Default edge descriptor is not an edge")}i.installGlobalStyles(e.globalStyles);if(e.bottomPad)i.createBottomPad(e.bottomPad);return i}e.prototype.installCellDescriptors=function(t){this._cellDescriptors=new Map;if(!t)return;for(var e=0,i=t;e<i.length;e++){var n=i[e];this._cellDescriptors.set(n.id.toString(),n);if(n.shape)mx.mxCellRenderer.registerShape(n.id.toString(),n.shape)}};e.prototype.installGlobalStyles=function(t){if(!t)return;for(var e=0,i=t;e<i.length;e++){var n=i[e];this.getStylesheet().putCellStyle(n.name,n.value)}};e.prototype.createBottomPad=function(t){};e.prototype.createGraphHandler=function(){return new GraphHandler(this)};e.prototype.createConnectionHandler=function(){var t=this;return new ConnectionHandler(this,(function(){var e=new mx.mxGeometry;e.relative=false;var i;if(t._defaultEdgeDescriptor){i=new Cell(t._defaultEdgeDescriptor,{},e)}else{console.log("No style found");i=new mx.mxCell("",e,"defaultEdge")}i.setEdge(true);return i}))};e.prototype.createPanningHandler=function(){return new PanningHandler(this)};e.prototype.createPanningManager=function(){var t=new mx.mxPanningManager(this);t.border=50;return t};e.prototype.createHandler=function(e){if(e!=null&&this.model.isVertex(e.cell)){return new VertexToolHandler(e)}return t.prototype.createHandler.call(this,e)};e.prototype.createCellEditor=function(){return new CellEditor(this)};Object.defineProperty(e.prototype,"editorHelper",{get:function(){return this._editorHelper},enumerable:false,configurable:true});e.prototype.transaction=function(t){this.getModel().beginUpdate();try{t()}finally{this.getModel().endUpdate()}};e.prototype.getCellIndexInParent=function(t){var e=t.parent;if(e){for(var i=0;i<e.children.length;i++){if(e.getChildAt(i)===t)return i}}return-1};e.prototype.getCellDescriptor=function(t){return this._cellDescriptors.get(t)};e.prototype.newCellInstance=function(t){var e,i;var n;if(typeof t.type==="string")n=this.getCellDescriptor(t.type);else n=t.type;if(!n)throw Error("Unknown cell descriptor: '"+t.type.toString()+"'");var r=(e=t.geometry)!==null&&e!==void 0?e:new mx.mxGeometry;if(n.size){r.width=r.width||n.size.width;r.height=r.height||n.size.height}var s=n.labelOffset;if(s)r.offset=new mx.mxPoint(s.width,s.height);var l=n.newInstance({graph:this,value:{},geometry:r});l.setVertex(n.isVertex);l.setEdge(n.isEdge);l.setStyle(n.getDefaultStyle());this.setCellValue(l,(i=t.value)!==null&&i!==void 0?i:{});if(t.assignName&&n.nameAttribute&&n.baseName&&!l.getValue()[n.nameAttribute]){var a=this.getNewCellName(n.baseName+"1");l.setAttribute(n.nameAttribute,a)}return l};e.prototype.setCellValue=function(t,e){this.getModel().setValue(t,e)};e.prototype.setCellGraphicalProperties=function(t,e,i){var n=this;if(i===void 0){i=true}var r;if(t.isEdge()&&(!t.source||!t.target))return;var s=this.convertLogicalPointToPixels(t,{x:e.x,y:e.y});var l=t.isEdge()?new mx.mxGeometry:new mx.mxGeometry(s.x,s.y,this.convertLogicalToPixels(t,e.width),this.convertLogicalToPixels(t,e.height));var a=t.getStyle();if(e.fromPoint){var o=t.source.geometry;var h=this.convertPixelsPointToLogical(t.source,{x:o.x,y:o.y});a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_EXIT_X,(e.fromPoint.x-h.x)/o.width);a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_EXIT_Y,(e.fromPoint.y-h.y)/o.height)}if(e.toPoint){var u=t.target.geometry;var d=this.convertPixelsPointToLogical(t.source,{x:u.x,y:u.y});a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_ENTRY_X,(e.toPoint.x-d.x)/u.width);a=mx.mxUtils.setStyle(a,mx.mxConstants.STYLE_ENTRY_Y,(e.toPoint.y-d.y)/u.height)}t.setStyle(a);l.relative=false;if(e.points&&e.points.length>0){l.points=e.points.map((function(e){var i=n.convertLogicalPointToPixels(t,e);return new mx.mxPoint(i.x,i.y)}))}if(e.labelPosition){var p=void 0;if(t.isEdge()&&t.source&&t.target){if(((r=e.points)===null||r===void 0?void 0:r.length)>0)p=this._getPointListCenter(e.points);else{var m=this._getTerminalLogicalPointFromStyle(t,true);var c=this._getTerminalLogicalPointFromStyle(t,false);p=this._getPointListCenter([m,c])}}else p={x:e.x+e.width/2,y:e.y+e.height/2};l.offset=new mx.mxPoint(e.labelPosition.x-p.x,e.labelPosition.y-p.y)}this.model.setGeometry(t,l);if(i){var x=this.view.getState(t);if(x&&x.shape)x.shape.redraw()}};e.prototype.getCellGraphicalProperties=function(t){var e=this;var i=t.getGeometry();var n=i.x!==undefined&&i.y!==undefined?this.convertPixelsPointToLogical(t,{x:i.x,y:i.y}):undefined;var r=i.width!==undefined&&i.height!==undefined?{width:this.convertPixelsToLogical(t,i.width),height:this.convertPixelsToLogical(t,i.height)}:undefined;var s=i.offset&&!isNaN(i.offset.x)&&!isNaN(i.offset.y)?{x:i.offset.x,y:i.offset.y}:undefined;var l=n&&r&&s?{x:n.x+r.width/2+s.x,y:n.y+r.height/2+s.y}:undefined;var a=i.points?i.points.map((function(i){return e.convertPixelsPointToLogical(t,i)})):null;var o,h;var u=t.source;var d=t.target;if(t.isEdge()&&u&&d){var p=void 0;if((a===null||a===void 0?void 0:a.length)>0){var m=this._getTerminalLogicalPoint(u,a[0],true,true);if(m&&(m.x!==a[0].x||m.y!==a[0].y)){a.unshift(m)}var c=this._getTerminalLogicalPoint(d,a[a.length-1],true,false);if(c&&(c.x!==a[a.length-1].x||c.y!==a[a.length-1].y)){a.push(c)}this._insertExtraPointsInEdgeForCompatibiityWithGXWin(a);p=this._getPointListCenter(a)}else{o=this._getTerminalLogicalPointFromStyle(t,true);h=this._getTerminalLogicalPointFromStyle(t,false);p=this._getPointListCenter([o,h])}if(s&&p)l={x:p.x+s.x,y:p.y+s.y}}return{x:n===null||n===void 0?void 0:n.x,y:n===null||n===void 0?void 0:n.y,width:r===null||r===void 0?void 0:r.width,height:r===null||r===void 0?void 0:r.height,points:a,labelPosition:l,fromPoint:o,toPoint:h}};e.prototype._insertExtraPointsInEdgeForCompatibiityWithGXWin=function(t){if(t.length>=2){if(Math.abs(t[0].x-t[1].x)>10){if(t[0].x<t[1].x)t.splice(1,0,{x:t[0].x+10,y:t[0].y});else t.splice(1,0,{x:t[0].x-10,y:t[0].y})}if(Math.abs(t[0].y-t[1].y)>10){if(t[0].y<t[1].y)t.splice(1,0,{x:t[0].x,y:t[0].y+10});else t.splice(1,0,{x:t[0].x,y:t[0].y-10})}var e=t[t.length-2];var i=t[t.length-1];if(Math.abs(e.x-i.x)>10){if(e.x<i.x)t.splice(t.length-1,0,{x:i.x-10,y:e.y});else t.splice(t.length-1,0,{x:i.x+10,y:e.y})}if(Math.abs(e.y-i.y)>10){if(e.y<i.y)t.splice(t.length-1,0,{x:e.x,y:i.y-10});else t.splice(t.length-1,0,{x:e.x,y:i.y+10})}}};e.prototype._getTerminalLogicalPointFromStyle=function(t,e){var i=this.getCellStyle(t);var n;if(e&&i[mx.mxConstants.STYLE_EXIT_X]&&i[mx.mxConstants.STYLE_EXIT_Y]){n={x:Number.parseFloat(i[mx.mxConstants.STYLE_EXIT_X]),y:Number.parseFloat(i[mx.mxConstants.STYLE_EXIT_Y])}}else if(!e&&i[mx.mxConstants.STYLE_ENTRY_X]&&i[mx.mxConstants.STYLE_ENTRY_Y]){n={x:Number.parseFloat(i[mx.mxConstants.STYLE_ENTRY_X]),y:Number.parseFloat(i[mx.mxConstants.STYLE_ENTRY_Y])}}var r=t.source.getGeometry();var s={position:this.convertPixelsPointToLogical(t.source,{x:r.x,y:r.y}),size:{width:this.convertPixelsToLogical(t.source,r.width),height:this.convertPixelsToLogical(t,r.height)}};var l=t.target.getGeometry();var a={position:this.convertPixelsPointToLogical(t.target,{x:l.x,y:l.y}),size:{width:this.convertPixelsToLogical(t.target,l.width),height:this.convertPixelsToLogical(t,l.height)}};if(n){var o=e?s:a;return{x:o.position.x+n.x*o.size.width,y:o.position.y+n.y*o.size.height}}if(e)return this._getAutoTerminalPoint(s,a,e);return this._getAutoTerminalPoint(a,s,e)};e.prototype._getPointListCenter=function(t){var e={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY};var i={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY};for(var n=0,r=t;n<r.length;n++){var s=r[n];if(e.x>s.x)e.x=s.x;if(e.y>s.y)e.y=s.y;if(i.x<s.x)i.x=s.x;if(i.y<s.y)i.y=s.y}return{x:e.x+(i.x-e.x)/2,y:e.y+(i.y-e.y)/2}};e.prototype._getAutoTerminalPoint=function(t,e,i){if(i){if(t.position.y>e.position.y+e.size.height){if(t.position.x+t.size.width<e.position.x)return this._getMiddlePoint(t,"middleRight");if(t.position.x>e.position.x+e.size.width)return this._getMiddlePoint(t,"middleLeft");return this._getMiddlePoint(t,"middleTop")}if(t.position.x+t.size.width<e.position.x)return this._getMiddlePoint(t,"middleRight");if(t.position.x>e.position.x+e.size.width)return this._getMiddlePoint(t,"middleLeft");return this._getMiddlePoint(t,"middleBottom")}if(t.position.y>e.position.y+e.size.height)return this._getMiddlePoint(t,"middleTop");if(t.position.y+t.size.height<e.position.y)return this._getMiddlePoint(t,"middleBottom");if(t.position.x>e.position.x+e.size.width)return this._getMiddlePoint(t,"middleLeft");return this._getMiddlePoint(t,"middleRight")};e.prototype._getMiddlePoint=function(t,e){switch(e){case"middleTop":return{x:t.position.x+t.size.width/2,y:t.position.y};case"middleBottom":return{x:t.position.x+t.size.width/2,y:t.position.y+t.size.height};case"middleLeft":return{x:t.position.x,y:t.position.y+t.size.height/2};case"middleRight":return{x:t.position.x+t.size.width,y:t.position.y+t.size.height/2}}};e.prototype._getTerminalLogicalPoint=function(t,e,i,n){var r=this._getPerimeter(t);var s=t.getGeometry();if(r&&s){var l=new mx.mxPoint(e.x,e.y);var a=this.convertPixelsPointToLogical(t,{x:s.x,y:s.y});var o=new mx.mxRectangle(a.x,a.y,s.width,s.height);var h=r(o,{style:this.getCellStyle(t)},l,i);if(i){var u=3;if(Math.abs(e.x-h.x)<u&&Math.abs(e.y-h.y)<u)return e}return h}};e.prototype._getPerimeter=function(t){var e=this.getCellStyle(t);var i=e[mx.mxConstants.STYLE_PERIMETER];if(typeof i==="function")return i;if(typeof i==="string")return mx.mxStyleRegistry.getValue(i)};e.prototype.convertLogicalPointToPixels=function(t,e){return{x:this.convertLogicalToPixels(t,e.x),y:this.convertLogicalToPixels(t,e.y)}};e.prototype.convertPixelsPointToLogical=function(t,e){return{x:this.convertPixelsToLogical(t,e.x),y:this.convertPixelsToLogical(t,e.y)}};e.prototype.convertLogicalOffsetToPixels=function(t,e){return e};e.prototype.convertPixelsOffsetToLogical=function(t,e){return e};e.prototype.convertLogicalToPixels=function(t,e){return e};e.prototype.convertPixelsToLogical=function(t,e){return e};e.prototype.getNewCellName=function(t){var e;var i=false;var n;var r=t.match(_NAME_REGEX);if(r&&r.length==3){t=r[1];e=parseInt(r[2]);n=""+t+e}else{e=1;n=t}do{i=true;for(var s=0,l=this.getAllCells();s<l.length;s++){var a=l[s];if(a instanceof Cell&&a.descriptor.baseName&&a.descriptor.nameAttribute){var o=a.getValue()[a.descriptor.nameAttribute];if(o&&o.toLowerCase()===n.toLowerCase()){i=false;n=""+t+ ++e;break}}}}while(!i);return n};e.prototype.getCellsOfType=function(t){return this.getAllCells((function(e){return Utils.cellOfType(e,t)}))};e.prototype.getAllCells=function(t){var e=[];var i=[this.model.getRoot()];while(i.length>0){var n=i.shift();if(!t||t(n))e.push(n);if(n.children){for(var r=0,s=n.children;r<s.length;r++){var l=s[r];i.push(l)}}}return e};e.prototype.selectCellForEvent=function(e,i){if(e instanceof Cell&&!e.descriptor.isDiagramElement)e=e.getParentDiagramElement();return t.prototype.selectCellForEvent.call(this,e,i)};e.prototype.getDropTarget=function(e,i,n,r){var s=t.prototype.getDropTarget.call(this,e,i,n,r);if(!s)s=this.getDefaultParent();return s};e.prototype.isExtendParentsOnAdd=function(t){return false};e.prototype.isExtendParent=function(t){return true};e.prototype.isConstrainChild=function(t){return true};e.prototype.isCellLocked=function(t){return false};e.prototype.isCellDisconnectable=function(t,e,i){return true};e.prototype.isCellResizable=function(e){if(e instanceof Cell){var i=e.descriptor;return i.isResizable(this,e)}return t.prototype.isCellResizable.call(this,e)};e.prototype.isGridEnabledEvent=function(t){if(this.gridEnabled)return true;return false};e.prototype.convertValueToString=function(e){if(e instanceof Cell){var i=e.getValue();if(i&&typeof i==="object"){var n=e.descriptor;var r=n.labelAttribute;return i[r]}}return t.prototype.convertValueToString.call(this,e)};e.prototype.cellLabelChanged=function(e,i,n){if(e instanceof Cell&&e.value&&typeof e.value==="object"){var r=e.cloneValue();r[e.descriptor.labelAttribute]=i;i=r}t.prototype.cellLabelChanged.call(this,e,i,n)};e.prototype.getAllConnectionConstraints=function(t){if(t!=null&&t.shape!=null){if(t.shape.stencil!=null){if(t.shape.stencil!=null){return t.shape.stencil.constraints}}else if(t.shape.constraints!=null){return t.shape.constraints}}return null};e.prototype.isValidConnection=function(e,i){console.log("valid connection called");if(!t.prototype.isValidConnection.call(this,e,i)){return false}else{if(e instanceof Cell&&i instanceof Cell){if(e.descriptor.cellConectionRestrictions){var n=e.descriptor.cellConectionRestrictions;if(n.has(i.descriptor.id)){var r=n.get(i.descriptor.id);if(r.isValidConnection)r.isValidConnection(e,i);else this.validationAlert("A cell restriction definition must have an isValidConnection memeber implementation")}else{return false}}}}return true};e.prototype.validationAlert=function(t){console.log(t)};e.prototype.getState=function(){return{elements:this.getElementsState(this.getDefaultParent().children)}};e.prototype.getElementsState=function(t){var e=[];for(var i=0,n=t;i<n.length;i++){var r=n[i];if(r instanceof Cell)e.push(this.getElementState(r))}return e};e.prototype.getElementState=function(t){var e=t.getTerminal(true);var i=t.getTerminal(false);return{guid:t.id,type:t.descriptor.id,properties:t.cloneValue(),graphicalProperties:this.getCellGraphicalProperties(t),fromGuid:t.isEdge()&&e instanceof Cell?e.id:null,toGuid:t.isEdge()&&i instanceof Cell?i.id:null,slots:this.getSlotsState(t)}};e.prototype.getSlotsState=function(t){var e=[];if(t.descriptor.isSlot)e.push(this.getSlotState(t));if(t.children){for(var i=0,n=t.children;i<n.length;i++){var r=n[i];if(r instanceof Cell&&r.descriptor.isSlot&&!r.descriptor.isDiagramElement){e.push(this.getSlotState(r))}}}return e};e.prototype.getSlotState=function(t){var e=this;return{id:t.descriptor.slotId,elements:t.getDiagramElements().map((function(t){return e.getElementState(t)}))}};e.prototype.setState=function(t){var e=this;this.settingState=true;try{this.transaction((function(){e.model.clear();if(t!=null)e.addElementsFromState(t.elements)}))}finally{this.settingState=false}};e.prototype.addElementsFromState=function(t,e,i,n){var r=this;this.prepareElementsState(t,i,n);this.transaction((function(){var i=[];for(var n=0,s=t;n<s.length;n++){var l=s[n];r.addElementFromState(l,e);i.push(l)}while(i.length>0){var a=i.shift();var o=r.model.getCell(a.guid);r.setElementDelayedState(o,a);if(a.slots){for(var h=0,u=a.slots;h<u.length;h++){var d=u[h];for(var p=0,m=d.elements;p<m.length;p++){var l=m[p];i.push(l)}}}}}))};e.prototype.addElementFromState=function(t,e){var i;var n=this.newCellInstance({type:t.type});n.setId(t.guid.toString());this.addCell(n,e);this.setCellValue(n,(i=t.properties)!==null&&i!==void 0?i:{});this.setCellGraphicalProperties(n,t.graphicalProperties);if(t.slots){for(var r=0,s=t.slots;r<s.length;r++){var l=s[r];this.setSlotState(n,l)}}};e.prototype.prepareElementsState=function(t,e,i){var n=new Map;var r=[];var s=t.slice(0);while(s.length>0){var l=s.shift();if(e||this.model.getCell(l.guid))this.reassignElementStateGuids(l,n);if(i){var a=l.graphicalProperties;if(a.x!==undefined)a.x+=i.width;if(a.y!==undefined)a.y+=i.height;if(a.points){for(var o=0,h=a.points;o<h.length;o++){var u=h[o];u.x+=i.width;u.y+=i.height}}}if(l.fromGuid&&l.toGuid)r.push(l);if(l.slots){for(var d=0,p=l.slots;d<p.length;d++){var m=p[d];if(m.elements)m.elements.forEach((function(t){return s.push(t)}))}}}for(var c=0,x=r;c<x.length;c++){var f=x[c];f.fromGuid=n.get(f.fromGuid)||f.fromGuid;f.toGuid=n.get(f.toGuid)||f.toGuid}return t};e.prototype.reassignElementStateGuids=function(t,e){var i=Guid.newInstance().toString();e.set(t.guid,i);t.guid=i};e.prototype.setElementDelayedState=function(t,e){if(t.isEdge()){var i=this.model.getCell(e.fromGuid.toString());this.model.setTerminal(t,i,true);var n=this.model.getCell(e.toGuid.toString());this.model.setTerminal(t,n,false);this.setCellGraphicalProperties(t,e.graphicalProperties)}};e.prototype.setSlotState=function(t,e){var i=t.getSlot(e.id);if(i){for(var n=0,r=e.elements;n<r.length;n++){var s=r[n];this.addElementFromState(s,i)}}};return e}(mx.mxGraph);exports("G",Graph);var KeyCodes;(function(t){t[t["UP"]=38]="UP";t[t["DOWN"]=40]="DOWN";t[t["LEFT"]=37]="LEFT";t[t["RIGHT"]=39]="RIGHT";t[t["TAB"]=9]="TAB";t[t["ENTER"]=13]="ENTER";t[t["ESC"]=27]="ESC";t[t["DELETE"]=46]="DELETE";t[t["BACKSPACE"]=8]="BACKSPACE";t[t["SHIFT"]=16]="SHIFT";t[t["CONTROL"]=17]="CONTROL";t[t["ALT"]=18]="ALT";t[t["META"]=91]="META";t[t["CAPS_LOCK"]=20]="CAPS_LOCK";t[t["SPACE"]=32]="SPACE";t[t["F1"]=112]="F1";t[t["F2"]=113]="F2";t[t["F3"]=114]="F3";t[t["F4"]=115]="F4";t[t["F5"]=116]="F5";t[t["F6"]=117]="F6";t[t["F7"]=118]="F7";t[t["F8"]=119]="F8";t[t["F9"]=120]="F9";t[t["F10"]=121]="F10";t[t["F11"]=122]="F11";t[t["F12"]=123]="F12"})(KeyCodes||(KeyCodes={}));var UndoManager=function(t){__extends(e,t);function e(){var e=t.apply(this,arguments)||this;e.enabled=true;return e}e.prototype.undoableEditHappened=function(e){if(this.enabled)t.prototype.undoableEditHappened.call(this,e)};return e}(mx.mxUndoManager);var DEFAULT_CLIPBOARD_FORMAT="DiagramEditor";var MAX_UNDO_LENGTH=1e3;var MOVE_SELECTION_DELTA=10;var MOVE_SELECTION_SHORT_DELTA=1;var COPY_OFFSET={width:20,height:20};var Editor=function(t){__extends(e,t);function e(e){var i=t.call(this)||this;i._guid=Guid.newInstance();i.container=e.container;i.clipboardFormat=e.clipboardFormat||DEFAULT_CLIPBOARD_FORMAT;i.graph=i.createGraph(e);mx.mxConstants.LABEL_HANDLE_SIZE=8;mx.mxEvent.disableContextMenu(i.container);i.initialize(e);return i}e.prototype.createGraph=function(t){return new Graph(t)};e.prototype.initialize=function(t){var e=this;this.graph.setAllowDanglingEdges(false);this.graph.vertexLabelsMovable=true;this.graph.resizeContainer=false;if(t.guides)this.installGuides();if(t.undoManager)this.installUndoManager();if(t.keyManager)this.installKeyHandler();if(t.externalDrop){mx.mxEvent.addListener(this.container,"dragover",(function(t){return e.onDragOver(t)}));mx.mxEvent.addListener(this.container,"drop",(function(t){return e.onDropOver(t)}))}this.graph.graphHandler.scrollOnMove=!!t.scrollOnMove;this.graph.setResizeContainer(!!t.resizeContainer);this.graph.setGridEnabled(!!t.grid);if(t.gridSize!==undefined)this.graph.gridSize=t.gridSize;this.graph.setConnectable(!!t.connectable);this.graph.setPanning(!!t.panning);this.graph.allowAutoPanning=!!t.autoPanning;this.graph.panningHandler.useLeftButtonForPanning=false;if(t.rubberBand)this.installRubberBand();this.graph.getSelectionModel().addListener(mx.mxEvent.CHANGE,(function(){return e.onGraphSelectionChange()}));this.graph.getModel().addListener(mx.mxEvent.CHANGE,(function(t,i){return e.onGraphChange(i)}))};e.prototype.installGuides=function(){var t=mx.mxGraphHandler;t.prototype.guidesEnabled=true;t.prototype.useGuidesForEvent=function(t){return!mx.mxEvent.isAltDown(t.getEvent())}};e.prototype.installUndoManager=function(){var t=this;this.undoManager=new UndoManager(MAX_UNDO_LENGTH);var e=function(e,i){return t.undoManager.undoableEditHappened(i.getProperty("edit"))};this.graph.getModel().addListener(mx.mxEvent.UNDO,e);this.graph.getView().addListener(mx.mxEvent.UNDO,e);var i=function(e,i){var n=i.getProperty("edit").changes;t.graph.setSelectionCells(t.graph.getSelectionCellsForChanges(n))};this.undoManager.addListener(mx.mxEvent.UNDO,i);this.undoManager.addListener(mx.mxEvent.REDO,i)};e.prototype.installKeyHandler=function(){var t=this;this.keyHandler=new mx.mxKeyHandler(this.graph);this.keyHandler.getFunction=function(e){if(e!=null){return mx.mxEvent.isControlDown(e)||mx.mxClient.IS_MAC&&e.metaKey?t.keyHandler.controlKeys[e.keyCode]:t.keyHandler.normalKeys[e.keyCode]}return null};this.keyHandler.bindKey(KeyCodes.LEFT,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindKey(KeyCodes.RIGHT,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindKey(KeyCodes.UP,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindKey(KeyCodes.DOWN,(function(e){return t.onMoveSelection(e)}));this.keyHandler.bindControlKey("Z".charCodeAt(0),(function(e){return t.onUndoRedo(e)}));this.keyHandler.bindControlKey("C".charCodeAt(0),(function(e){return t.copyToClipboard()}));this.keyHandler.bindControlKey("V".charCodeAt(0),(function(e){return t.pasteFromClipboard()}));this.keyHandler.bindKey(KeyCodes.BACKSPACE,(function(){return t.deleteSelection()}));this.keyHandler.bindKey(KeyCodes.DELETE,(function(){return t.deleteSelection()}))};e.prototype.installRubberBand=function(){var t=this;this.rubberBand=new mx.mxRubberband(this.graph);var e=this.rubberBand.mouseDown;this.rubberBand.mouseDown=function(i,n){if(n.getEvent().button===2){t.rubberBand.reset();mx.mxEvent.consume(n.getEvent(),true,true);return}e.call(t.rubberBand,i,n)}};e.prototype.setProperties=function(t,e,i){this._pauseGraphChangeEvents=true;this.undoManager.enabled=false;try{var n=this.graph.getModel().getCell(t);if(n){if(e)this.graph.setCellValue(n,e);if(i)this.graph.setCellGraphicalProperties(n,i,false);var r=this.graph.view.getState(n);if(r)r.shape.redraw()}}finally{this.undoManager.enabled=true;this._pauseGraphChangeEvents=false}};Object.defineProperty(e.prototype,"clipboard",{get:function(){var t=this.graph.editorHelper;if(t)return t.clipboard},enumerable:false,configurable:true});e.prototype.copyToClipboard=function(t){var e=this.clipboard;if(e){t=t||this.graph.getSelectionCells();var i=this.graph.getExportableCells(this.graph.model.getTopmostCells(t));var n=this.graph.getElementsState(i);e.write(JSON.stringify({format:this.clipboardFormat,editorGuid:this._guid.toString(),content:n}))}};e.prototype.pasteFromClipboard=function(){var t=this.clipboard;if(t){var e=t.read();if(e){var i=JSON.parse(e);if(i.format===this.clipboardFormat){var n=new Guid(i.editorGuid);if(Guid.equals(n,this._guid)){this.graph.addElementsFromState(i.content,this.getParentForPaste(),false,COPY_OFFSET)}else this.graph.addElementsFromState(i.content,this.getParentForPaste(),true)}}}};e.prototype.undo=function(){if(this.undoManager.canUndo())this.undoManager.undo()};e.prototype.redo=function(){if(this.undoManager.canRedo())this.undoManager.redo()};e.prototype.getParentForPaste=function(){return null};e.prototype.moveSelection=function(t,e){var i=this;this.graph.transaction((function(){if(!i.graph.isSelectionEmpty())i.graph.moveCells(i.graph.getSelectionCells(),t,e)}))};e.prototype.deleteSelection=function(){var t=this;this.graph.transaction((function(){if(!t.graph.isSelectionEmpty()){t.graph.removeCells(t.graph.getSelectionCells())}}))};e.prototype.onGraphChange=function(t){var i=this;if(this._pauseGraphChangeEvents)return;setTimeout((function(){var n=EventConverter.convert(t,i.graph);if(n.length>0)i.fireEvent(new mx.mxEventObject(e.EVENT_MODEL_CHANGED,"data",n),i)}),100)};e.prototype.onGraphSelectionChange=function(){var t=this.graph.getSelectionCells();var i=[];for(var n=0,r=t;n<r.length;n++){var s=r[n];if(s instanceof Cell)i.push(s.id)}this.fireEvent(new mx.mxEventObject(e.EVENT_SELECTION_CHANGED,"data",i)),this};e.prototype.onUndoRedo=function(t){if(t.shiftKey)this.redo();else this.undo()};e.prototype.onMoveSelection=function(t){var e=0;var i=0;switch(t.keyCode){case KeyCodes.LEFT:e=-1;break;case KeyCodes.RIGHT:e=1;break;case KeyCodes.UP:i=-1;break;case KeyCodes.DOWN:i=1;break}var n=this.graph.gridEnabled?this.graph.gridSize:1;var r=t.shiftKey?n*MOVE_SELECTION_SHORT_DELTA:n*MOVE_SELECTION_DELTA;e=e*r;i=i*r;this.moveSelection(e,i)};e.prototype.onDragOver=function(t){if(this.graph.isEnabled()){t.stopPropagation();t.preventDefault()}};e.prototype.onDropOver=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,n,r;var s=this;return __generator(this,(function(l){switch(l.label){case 0:e=t.dataTransfer.getData("text");i={};if(!this.graph.editorHelper)return[3,2];return[4,this.graph.editorHelper.getNewElementProperties(e)];case 1:i=l.sent();if(!i)return[2];l.label=2;case 2:this.graph.transaction((function(){var r=s.graph.getCellDescriptor(e);t.stopPropagation();t.preventDefault();var l=r.size;var a=mx.mxUtils.convertPoint(s.graph.container,mx.mxEvent.getClientX(t),mx.mxEvent.getClientY(t));var o=s.graph.view.translate;var h=s.graph.view.scale;var u,d;if(s.centerExternalDropOnMousePointer){u=s.graph.snap(a.x/h-o.x-l.width/2);d=s.graph.snap(a.y/h-o.y-l.height/2)}else{u=s.graph.snap(a.x/h-o.x);d=s.graph.snap(a.y/h-o.y)}var p=s.getDropTarget(u,d);if(p){u-=p.geometry.x;d-=p.geometry.y}n=s.graph.newCellInstance({type:e,value:i,geometry:new mx.mxGeometry(u,d,l.width,l.height),assignName:true});s.graph.addCell(n,p)}));r=this.graph.view.getState(n);if(r&&r.shape)r.shape.redraw();return[2]}}))}))};Object.defineProperty(e.prototype,"centerExternalDropOnMousePointer",{get:function(){return true},enumerable:false,configurable:true});e.prototype.getDropTarget=function(t,e){return null};e.prototype.setState=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this._pauseGraphChangeEvents=true;this.undoManager.enabled=false;e.label=1;case 1:e.trys.push([1,,3,4]);return[4,this.graph.setState(t)];case 2:e.sent();this.onAfterSetState();return[3,4];case 3:this._pauseGraphChangeEvents=false;this.undoManager.enabled=true;return[7];case 4:return[2]}}))}))};e.prototype.getState=function(){return this.graph.getState()};e.prototype.onAfterSetState=function(){};return e}(mx.mxEventSource);exports("E",Editor);Editor.EVENT_MODEL_CHANGED="modelChanged";Editor.EVENT_SELECTION_CHANGED="selectionChanged"}}}));