From 685cbf25d07ceecc7d61e36d374cc5cedda2d28a Mon Sep 17 00:00:00 2001
From: process-analytics-bot
 <62586190+process-analytics-bot@users.noreply.github.com>
Date: Mon, 13 Nov 2023 13:27:38 +0000
Subject: [PATCH] chore(deps): bump bpmn-visualization from 0.23.0 to 0.42.0

---
 inst/htmlwidgets/bpmnVisualizationR.yaml                        | 2 +-
 .../lib/bpmn-visualization/bpmn-visualization.min.js            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/inst/htmlwidgets/bpmnVisualizationR.yaml b/inst/htmlwidgets/bpmnVisualizationR.yaml
index c7b8656..04819df 100644
--- a/inst/htmlwidgets/bpmnVisualizationR.yaml
+++ b/inst/htmlwidgets/bpmnVisualizationR.yaml
@@ -14,6 +14,6 @@
 
 dependencies:
   - name: "bpmn-visualization"
-    version: "0.23.0"
+    version: "0.42.0"
     src: htmlwidgets/lib/bpmn-visualization/
     script: bpmn-visualization.min.js
diff --git a/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js b/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js
index 57c013e..9ed1440 100644
--- a/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js
+++ b/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js
@@ -1 +1 @@
-var bpmnvisu=function(exports){"use strict";var FitType,ShapeBpmnElementKind,ShapeBpmnCallActivityKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventDefinitionKind,ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind;function convertEmptyStringAndObject(t,e){return""===t?e?{}:void 0:t}function ensureIsArray(t,e=!1){if(null==t)return[];let n;return n=Array.isArray(t)?t.map((t=>convertEmptyStringAndObject(t,e))):[convertEmptyStringAndObject(t,e)],n.filter(Boolean)}function filter(t,e,n){let i="";return(null==n?void 0:n.startingWith)?i=i.concat(`^(${n.startingWith}).*`):(null==n?void 0:n.notStartingWith)&&(i=i.concat(`^(?!(${n.notStartingWith})).*`)),i=i.concat(`${e}$`),t.filter((t=>(null==n?void 0:n.ignoreCase)?new RegExp(i,"i").test(t):new RegExp(i).test(t)))}exports.FitType=void 0,FitType=exports.FitType||(exports.FitType={}),FitType.None="None",FitType.HorizontalVertical="HorizontalVertical",FitType.Horizontal="Horizontal",FitType.Vertical="Vertical",FitType.Center="Center",exports.ShapeBpmnElementKind=void 0,ShapeBpmnElementKind=exports.ShapeBpmnElementKind||(exports.ShapeBpmnElementKind={}),ShapeBpmnElementKind.LANE="lane",ShapeBpmnElementKind.POOL="pool",ShapeBpmnElementKind.CALL_ACTIVITY="callActivity",ShapeBpmnElementKind.SUB_PROCESS="subProcess",ShapeBpmnElementKind.TASK="task",ShapeBpmnElementKind.TASK_USER="userTask",ShapeBpmnElementKind.TASK_SERVICE="serviceTask",ShapeBpmnElementKind.TASK_RECEIVE="receiveTask",ShapeBpmnElementKind.TASK_SEND="sendTask",ShapeBpmnElementKind.TASK_MANUAL="manualTask",ShapeBpmnElementKind.TASK_SCRIPT="scriptTask",ShapeBpmnElementKind.TASK_BUSINESS_RULE="businessRuleTask",ShapeBpmnElementKind.GLOBAL_TASK="globalTask",ShapeBpmnElementKind.GLOBAL_TASK_USER="globalUserTask",ShapeBpmnElementKind.GLOBAL_TASK_MANUAL="globalManualTask",ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT="globalScriptTask",ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",ShapeBpmnElementKind.GROUP="group",ShapeBpmnElementKind.TEXT_ANNOTATION="textAnnotation",ShapeBpmnElementKind.GATEWAY_PARALLEL="parallelGateway",ShapeBpmnElementKind.GATEWAY_EXCLUSIVE="exclusiveGateway",ShapeBpmnElementKind.GATEWAY_INCLUSIVE="inclusiveGateway",ShapeBpmnElementKind.GATEWAY_EVENT_BASED="eventBasedGateway",ShapeBpmnElementKind.EVENT_START="startEvent",ShapeBpmnElementKind.EVENT_END="endEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",ShapeBpmnElementKind.EVENT_BOUNDARY="boundaryEvent",exports.ShapeBpmnCallActivityKind=void 0,ShapeBpmnCallActivityKind=exports.ShapeBpmnCallActivityKind||(exports.ShapeBpmnCallActivityKind={}),ShapeBpmnCallActivityKind.CALLING_PROCESS="process",ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK="global task",exports.ShapeBpmnEventBasedGatewayKind=void 0,ShapeBpmnEventBasedGatewayKind=exports.ShapeBpmnEventBasedGatewayKind||(exports.ShapeBpmnEventBasedGatewayKind={}),ShapeBpmnEventBasedGatewayKind.Exclusive="Exclusive",ShapeBpmnEventBasedGatewayKind.None="None",ShapeBpmnEventBasedGatewayKind.Parallel="Parallel",exports.ShapeBpmnEventDefinitionKind=void 0,ShapeBpmnEventDefinitionKind=exports.ShapeBpmnEventDefinitionKind||(exports.ShapeBpmnEventDefinitionKind={}),ShapeBpmnEventDefinitionKind.NONE="none",ShapeBpmnEventDefinitionKind.TERMINATE="terminate",ShapeBpmnEventDefinitionKind.CANCEL="cancel",ShapeBpmnEventDefinitionKind.COMPENSATION="compensate",ShapeBpmnEventDefinitionKind.CONDITIONAL="conditional",ShapeBpmnEventDefinitionKind.ERROR="error",ShapeBpmnEventDefinitionKind.ESCALATION="escalation",ShapeBpmnEventDefinitionKind.LINK="link",ShapeBpmnEventDefinitionKind.MESSAGE="message",ShapeBpmnEventDefinitionKind.SIGNAL="signal",ShapeBpmnEventDefinitionKind.TIMER="timer",exports.ShapeBpmnMarkerKind=void 0,ShapeBpmnMarkerKind=exports.ShapeBpmnMarkerKind||(exports.ShapeBpmnMarkerKind={}),ShapeBpmnMarkerKind.ADHOC="adhoc",ShapeBpmnMarkerKind.COMPENSATION="compensation",ShapeBpmnMarkerKind.EXPAND="expand",ShapeBpmnMarkerKind.LOOP="loop",ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL="parallel multi instance",ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",exports.ShapeBpmnSubProcessKind=void 0,ShapeBpmnSubProcessKind=exports.ShapeBpmnSubProcessKind||(exports.ShapeBpmnSubProcessKind={}),ShapeBpmnSubProcessKind.EMBEDDED="embedded",ShapeBpmnSubProcessKind.EVENT="event";class ShapeUtil{static isEvent(t){return isKindOf(EVENT_KINDS,t)}static eventKinds(){return[...EVENT_KINDS]}static isBoundaryEvent(t){return exports.ShapeBpmnElementKind.EVENT_BOUNDARY===t}static isStartEvent(t){return exports.ShapeBpmnElementKind.EVENT_START===t}static isCallActivity(t){return exports.ShapeBpmnElementKind.CALL_ACTIVITY===t}static isSubProcess(t){return exports.ShapeBpmnElementKind.SUB_PROCESS===t}static canHaveNoneEvent(t){return exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW===t||exports.ShapeBpmnElementKind.EVENT_END===t||exports.ShapeBpmnElementKind.EVENT_START===t}static isActivity(t){return isKindOf(ACTIVITY_KINDS,t)}static activityKinds(){return[...ACTIVITY_KINDS]}static isWithDefaultSequenceFlow(t){return FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS.includes(t)}static isTask(t){return isKindOf(TASK_KINDS,t)}static taskKinds(){return[...TASK_KINDS]}static gatewayKinds(){return[...GATEWAY_KINDS]}static isGateway(t){return isKindOf(GATEWAY_KINDS,t)}static flowNodeKinds(){return Object.values(exports.ShapeBpmnElementKind).filter((t=>!ShapeUtil.isPoolOrLane(t)))}static isPoolOrLane(t){return t==exports.ShapeBpmnElementKind.POOL||t==exports.ShapeBpmnElementKind.LANE}}function filterKind(t,e){return filter(Object.values(exports.ShapeBpmnElementKind),t,e)}function isKindOf(t,e){return Object.values(t).map((t=>t)).includes(e)}const EVENT_KINDS=filterKind("Event"),GATEWAY_KINDS=filterKind("Gateway"),TASK_KINDS=filterKind("Task",{ignoreCase:!0,notStartingWith:"global"}),ACTIVITY_KINDS=[...TASK_KINDS,exports.ShapeBpmnElementKind.CALL_ACTIVITY,exports.ShapeBpmnElementKind.SUB_PROCESS],FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS=[...ACTIVITY_KINDS,exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE],eventDefinitionKinds=Object.values(exports.ShapeBpmnEventDefinitionKind).filter((t=>t!=exports.ShapeBpmnEventDefinitionKind.NONE));var AssociationDirectionKind,FlowKind,MessageVisibleKind,SequenceFlowKind;exports.AssociationDirectionKind=void 0,AssociationDirectionKind=exports.AssociationDirectionKind||(exports.AssociationDirectionKind={}),AssociationDirectionKind.NONE="None",AssociationDirectionKind.ONE="One",AssociationDirectionKind.BOTH="Both",exports.FlowKind=void 0,FlowKind=exports.FlowKind||(exports.FlowKind={}),FlowKind.SEQUENCE_FLOW="sequenceFlow",FlowKind.MESSAGE_FLOW="messageFlow",FlowKind.ASSOCIATION_FLOW="association",exports.MessageVisibleKind=void 0,MessageVisibleKind=exports.MessageVisibleKind||(exports.MessageVisibleKind={}),MessageVisibleKind.NONE="none",MessageVisibleKind.INITIATING="initiating",MessageVisibleKind.NON_INITIATING="non_initiating",exports.SequenceFlowKind=void 0,SequenceFlowKind=exports.SequenceFlowKind||(exports.SequenceFlowKind={}),SequenceFlowKind.NORMAL="normal",SequenceFlowKind.DEFAULT="default",SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",SequenceFlowKind.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}var build=createCommonjsModule((function(module){!function(t,e){module.exports?module.exports=e():t.mxgraph=e()}(commonjsGlobal,(function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.1.0",IS_IE:navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:navigator.userAgent.indexOf("MSIE")>=0&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0,IS_OT: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:navigator.userAgent.indexOf("AppleWebKit/")>=0&&navigator.userAgent.indexOf("Chrome/")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_ANDROID:navigator.userAgent.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IOS_VERSION:function(){if(/iP(hone|od|ad)/.test(navigator.platform)){var t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);if(null!=t&&t.length>0)return parseInt(t[1])}return 0}(),IS_GC:navigator.userAgent.indexOf("Chrome/")>=0&&navigator.userAgent.indexOf("Edge/")<0,IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:navigator.userAgent.indexOf("Firefox/")>=0,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:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||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.userAgent),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(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,n,i){if(n=n||document,mxClient.IS_IE6)n.write('<link rel="'+t+'" href="'+e+'" charset="UTF-8" type="text/css"/>');else{var s=n.createElement("link");s.setAttribute("rel",t),s.setAttribute("href",e),s.setAttribute("charset","UTF-8"),s.setAttribute("type","text/css"),i&&s.setAttribute("id",i),n.getElementsByTagName("head")[0].appendChild(s)}},loadResources:function(t,e){var n=mxClient.defaultBundles.length;function i(){0==--n&&t()}for(var s=0;s<mxClient.defaultBundles.length;s++)mxResources.add(mxClient.defaultBundles[s],e,i)},include:function(t){document.write('<script src="'+t+'"><\/script>')}},node;mxClient.IS_SF&&mxClient.IS_TOUCH&&!mxClient.IS_IOS&&(mxClient.IOS_VERSION=13,mxClient.IOS=!0),"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&mxBasePath.length>0?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&mxImageBasePath.length>0?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(null!=document.namespaces&&(8==document.documentMode?(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")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?(node=document.createElement("style"),node.type="text/css",node.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(node)):document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||null==module.exports)&&(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=void 0!==mxClient?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var n=document.createElement("tbody"),i=document.createElement("tr"),s=document.createElement("td");s.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",s.appendChild(mxLog.textarea),i.appendChild(s),n.appendChild(i),i=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),i.appendChild(mxLog.td),n.appendChild(i),e.appendChild(n),mxLog.addButton("Info",(function(t){mxLog.info()})),mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)})),mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")})),mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var r=0,o=0;if("number"==typeof window.innerWidth?(r=window.innerHeight,o=window.innerWidth):(r=document.documentElement.clientHeight||document.body.clientHeight,o=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,o-320),Math.max(0,r-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var l=mxLog.window.getElement(),a=function(t,e){mxLog.textarea.style.height=Math.max(0,l.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a),mxLog.window.addListener(mxEvent.MAXIMIZE,a),mxLog.window.addListener(mxEvent.NORMALIZE,a),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var n=document.createElement("button");mxUtils.write(n,t),mxEvent.addListener(n,"click",e),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var n=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");null!=mxLog.textarea?(mxLog.textarea.value=mxLog.textarea.value+t,navigator.userAgent.indexOf("Presto/2.5")>=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");mxLog.write(t+"\n")}};__mxOutput.mxLog=void 0!==mxLog?mxLog:void 0;var mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(t){if(null!=t){if(null==t[mxObjectIdentity.FIELD_NAME])if("object"==typeof t){var e=mxUtils.getFunctionName(t.constructor);t[mxObjectIdentity.FIELD_NAME]=e+"#"+mxObjectIdentity.counter++}else"function"==typeof t&&(t[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return t[mxObjectIdentity.FIELD_NAME]}return null},clear:function(t){"object"!=typeof t&&"function"!=typeof t||delete t[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}__mxOutput.mxObjectIdentity=void 0!==mxObjectIdentity?mxObjectIdentity:void 0,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 n=mxObjectIdentity.get(t),i=this.map[n];return this.map[n]=e,i},mxDictionary.prototype.remove=function(t){var e=mxObjectIdentity.get(t),n=this.map[e];return delete this.map[e],n},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=void 0!==mxDictionary?mxDictionary:void 0;var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(t){return null==mxClient.languages||mxUtils.indexOf(mxClient.languages,t)>=0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var n=e.indexOf("-");n>0&&(e=e.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,n){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){var i=mxResources.getDefaultBundle(t,e),s=mxResources.getSpecialBundle(t,e),r=function(){if(null!=s)if(n)mxUtils.get(s,(function(t){mxResources.parse(t.getText()),n()}),(function(){n()}));else try{var t=mxUtils.load(s);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=n&&n()};if(null!=i)if(n)mxUtils.get(i,(function(t){mxResources.parse(t.getText()),r()}),(function(){r()}));else try{var o=mxUtils.load(i);o.isReady()&&mxResources.parse(o.getText()),r()}catch(t){}else r()}},parse:function(t){if(null!=t)for(var e=t.split("\n"),n=0;n<e.length;n++)if("#"!=e[n].charAt(0)){var i=e[n].indexOf("=");if(i>0){var s=e[n].substring(0,i),r=e[n].length;13==e[n].charCodeAt(r-1)&&r--;var o=e[n].substring(i+1,r);this.resourcesEncoded?(o=o.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[s]=unescape(o)):mxResources.resources[s]=o}}},get:function(t,e,n){var i=mxResources.resources[t];return null==i&&(i=n),null!=i&&null!=e&&(i=mxResources.replacePlaceholders(i,e)),i},replacePlaceholders:function(t,e){for(var n=[],i=null,s=0;s<t.length;s++){var r=t.charAt(s);"{"==r?i="":null!=i&&"}"==r?((i=parseInt(i)-1)>=0&&i<e.length&&n.push(e[i]),i=null):null!=i?i+=r:n.push(r)}return n.join("")},loadResources:function(t){mxResources.add(mxClient.basePath+"/resources/editor",null,(function(){mxResources.add(mxClient.basePath+"/resources/graph",null,t)}))}};function mxPoint(t,e){this.x=null!=t?t:0,this.y=null!=e?e:0}function mxRectangle(t,e,n,i){mxPoint.call(this,t,e),this.width=null!=n?n:0,this.height=null!=i?i:0}__mxOutput.mxResources=void 0!==mxResources?mxResources:void 0,mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},__mxOutput.mxPoint=void 0!==mxPoint?mxPoint:void 0,mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(t){if(null!=t){var e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width),s=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.y=n,this.width=i-e,this.height=s-n}},mxRectangle.prototype.intersect=function(t){if(null!=t){var e=this.x+this.width,n=t.x+t.width,i=this.y+this.height,s=t.y+t.height;this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.width=Math.min(e,n)-this.x,this.height=Math.min(i,s)-this.y}},mxRectangle.prototype.grow=function(t){this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t},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 null!=t&&t.x==this.x&&t.y==this.y&&t.width==this.width&&t.height==this.height},mxRectangle.fromRectangle=function(t){return new mxRectangle(t.x,t.y,t.width,t.height)},__mxOutput.mxRectangle=void 0!==mxRectangle?mxRectangle:void 0;var mxEffects={animateChanges:function(t,e,n){var i=10,s=0,r=function(){for(var l=!1,a=0;a<e.length;a++){var h=e[a];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,!1);if(null!=u)if(l=!0,h.constructor!=mxGeometryChange||t.model.isEdge(h.cell))mxUtils.setOpacity(u.shape.node,100*s/i);else{var d=t.getView().scale,p=(h.geometry.x-h.previous.x)*d,m=(h.geometry.y-h.previous.y)*d,c=(h.geometry.width-h.previous.width)*d,x=(h.geometry.height-h.previous.height)*d;0==s?(u.x-=p,u.y-=m,u.width-=c,u.height-=x):(u.x+=p/i,u.y+=m/i,u.width+=c/i,u.height+=x/i),t.cellRenderer.redraw(u),mxEffects.cascadeOpacity(t,h.cell,100*s/i)}}}s<i&&l?(s++,window.setTimeout(r,o)):null!=n&&n()},o=30;r()},cascadeOpacity:function(t,e,n){for(var i=t.model.getChildCount(e),s=0;s<i;s++){var r=t.model.getChildAt(e,s),o=t.getView().getState(r);null!=o&&(mxUtils.setOpacity(o.shape.node,n),mxEffects.cascadeOpacity(t,r,n))}var l=t.model.getEdges(e);if(null!=l)for(s=0;s<l.length;s++){var a=t.getView().getState(l[s]);null!=a&&mxUtils.setOpacity(a.shape.node,n)}},fadeOut:function(t,e,n,i,s,r){i=i||40,s=s||30;var o=e||100;if(mxUtils.setOpacity(t,o),r||null==r){var l=function(){o=Math.max(o-i,0),mxUtils.setOpacity(t,o),o>0?window.setTimeout(l,s):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(l,s)}else t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=void 0!==mxEffects?mxEffects:void 0;var mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxUtils.removeCursors(e[i])},getCurrentStyle:mxClient.IS_IE&&(null==document.documentMode||document.documentMode<9)?function(t){return null!=t?t.currentStyle:null}:function(t){return null!=t?window.getComputedStyle(t,""):null},parseCssNumber:function(t){return"thin"==t?t="2":"medium"==t?t="4":"thick"==t&&(t="6"),t=parseFloat(t),isNaN(t)&&(t=0),t},setPrefixedStyle:(prefix=null,mxClient.IS_OT?prefix="O":mxClient.IS_SF||mxClient.IS_GC?prefix="Webkit":mxClient.IS_MT?prefix="Moz":mxClient.IS_IE&&document.documentMode>=9&&document.documentMode<10&&(prefix="ms"),function(t,e,n){t[e]=n,null!=prefix&&e.length>0&&(t[e=prefix+e.substring(0,1).toUpperCase()+e.substring(1)]=n)}),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return null!=e&&("scroll"==e.overflow||"auto"==e.overflow)},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(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,n){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=t.getAttribute(e);if(null!=i&&i==n)return t}for(t=t.firstChild;null!=t;){var s=mxUtils.findNode(t,e,n);if(null!=s)return s;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(null!=t)if(null!=t.name)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){var n=(e=mxUtils.ltrim(e.substring(9))).indexOf("(");n>0&&(e=e.substring(0,n))}return e},indexOf:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(t[n]==e)return n;return-1},forEach:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)e(t[n]);return t},remove:function(t,e){var n=null;if("object"==typeof e)for(var i=mxUtils.indexOf(e,t);i>=0;)e.splice(i,1),n=t,i=mxUtils.indexOf(e,t);for(var s in e)e[s]==t&&(delete e[s],n=t);return n},isNode:function(t,e,n,i){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==n||t.getAttribute(n)==i)},isAncestorNode:function(t,e){for(var n=e;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var n=[],i=t.firstChild;null!=i;)i.nodeType==e&&n.push(i),i=i.nextSibling;return n},importNode:function(t,e,n){return mxClient.IS_IE&&(null==document.documentMode||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,n):t.importNode(e,n)},importNodeImplementation:function(t,e,n){switch(e.nodeType){case 1:var i=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var s=0;s<e.attributes.length;s++)i.setAttribute(e.attributes[s].nodeName,e.getAttribute(e.attributes[s].nodeName));if(n&&e.childNodes&&e.childNodes.length>0)for(s=0;s<e.childNodes.length;s++)i.appendChild(mxUtils.importNodeImplementation(t,e.childNodes[s],n));return i;case 3:case 4:case 8:return t.createTextNode(null!=e.nodeValue?e.nodeValue:e.value)}},createXmlDocument:function(){var t=null;return document.implementation&&document.implementation.createDocument?t=document.implementation.createDocument("","",null):"ActiveXObject"in window&&(t=mxUtils.createMsXmlDocument()),t},createMsXmlDocument:function(){var t=new ActiveXObject("Microsoft.XMLDOM");return t.async=!1,t.validateOnParse=!1,t.resolveExternals=!1,t},parseXml:window.DOMParser?function(t){return(new DOMParser).parseFromString(t,"text/xml")}:function(t){var e=mxUtils.createMsXmlDocument();return e.loadXML(t),e},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){},removeWhitespace:function(t,e){for(var n=e?t.previousSibling:t.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var i=e?n.previousSibling:n.nextSibling,s=mxUtils.getTextContent(n);0==mxUtils.trim(s).length&&n.parentNode.removeChild(n),n=i}},htmlEntities:function(t,e){return t=(t=(t=(t=(t=(t=String(t||"")).replace(/&/g,"&amp;")).replace(/"/g,"&quot;")).replace(/\'/g,"&#39;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),(null==e||e)&&(t=t.replace(/\n/g,"&#xa;")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var n="";if(mxClient.IS_IE||mxClient.IS_IE11)n=mxUtils.getPrettyXml(t,"","","");else if(null!=window.XMLSerializer){n=(new XMLSerializer).serializeToString(t)}else null!=t.xml&&(n=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return e=e||"&#xa;",n=n.replace(/\n/g,e)},getPrettyXml:function(t,e,n,i,s){var r=[];if(null!=t)if(e=null!=e?e:"  ",n=null!=n?n:"",i=null!=i?i:"\n",null!=t.namespaceURI&&t.namespaceURI!=s&&(s=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_TEXT){var o=mxUtils.getTextContent(t);o.length>0&&r.push(n+mxUtils.htmlEntities(mxUtils.trim(o),!1))}else{r.push(n+"<"+t.nodeName);var l=t.attributes;if(null!=l)for(var a=0;a<l.length;a++){var h=mxUtils.htmlEntities(l[a].value);r.push(" "+l[a].nodeName+'="'+h+'"')}var u=t.firstChild;if(null!=u){for(r.push(">"+i);null!=u;)r.push(mxUtils.getPrettyXml(u,e,n+e,i,s)),u=u.nextSibling;r.push(n+"</"+t.nodeName+">"+i)}else r.push("/>"+i)}return r.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],n=[];return function t(i){if(1!=i.length||"BR"!=i[0].nodeName&&"\n"!=i[0].innerHTML)for(var s=0;s<i.length;s++){var r=i[s];"BR"==r.nodeName||"\n"==r.innerHTML||(1==i.length||0==s)&&"DIV"==r.nodeName&&"<br>"==r.innerHTML.toLowerCase()?n.push("\n"):(3===r.nodeType||4===r.nodeType?r.nodeValue.length>0&&n.push(r.nodeValue):8!==r.nodeType&&r.childNodes.length>0&&t(r.childNodes),s<i.length-1&&mxUtils.indexOf(e,i[s+1].nodeName)>=0&&n.push("\n"))}}(t),n.join("")},replaceTrailingNewlines:function(t,e){for(var n="";t.length>0&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),n+=e;return t+n},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},getOuterHtml:mxClient.IS_IE?function(t){if(null!=t){if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var n=t.attributes;if(null!=n)for(var i=0;i<n.length;i++){var s=n[i].value;null!=s&&s.length>0&&(e.push(" "),e.push(n[i].nodeName),e.push('="'),e.push(s),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("</"+t.nodeName+">")),e.join("")}return""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},write:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(n),n},writeln:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var n=null,i=0;i<e;i++)null!=t&&(n=t.ownerDocument.createElement("br"),t.appendChild(n));return n},button:function(t,e,n){var i=(n=null!=n?n:document).createElement("button");return mxUtils.write(i,t),mxEvent.addListener(i,"click",(function(t){e(t)})),i},para:function(t,e){var n=document.createElement("p");return mxUtils.write(n,e),null!=t&&t.appendChild(n),n},addTransparentBackgroundFilter:function(t){t.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(t,e,n,i,s){return mxUtils.link(t,e,(function(){n.execute(i)}),s)},linkInvoke:function(t,e,n,i,s,r){return mxUtils.link(t,e,(function(){n[i](s)}),r)},link:function(t,e,n,i){var s=document.createElement("span");return s.style.color="blue",s.style.textDecoration="underline",s.style.cursor="pointer",null!=i&&(s.style.paddingLeft=i+"px"),mxEvent.addListener(s,"click",n),mxUtils.write(s,e),null!=t&&t.appendChild(s),s},getDocumentSize:function(){var t=document.body,e=document.documentElement;try{return new mxRectangle(0,0,t.clientWidth||e.clientWidth,Math.max(t.clientHeight||0,e.clientHeight))}catch(t){return new mxRectangle}},fit:function(t){var e=mxUtils.getDocumentSize(),n=parseInt(t.offsetLeft),i=parseInt(t.offsetWidth),s=mxUtils.getDocumentScrollOrigin(t.ownerDocument),r=s.x,o=s.y,l=r+e.width;n+i>l&&(t.style.left=Math.max(r,l-i)+"px");var a=parseInt(t.offsetTop),h=parseInt(t.offsetHeight),u=o+e.height;a+h>u&&(t.style.top=Math.max(o,u-h)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,n,i,s,r){var o=new mxXmlRequest(t,null,"GET");return null!=i&&o.setBinary(i),o.send(e,n,s,r),o},getAll:function(t,e,n){for(var i=t.length,s=[],r=0,o=function(){0==r&&null!=n&&n(),r++},l=0;l<t.length;l++)!function(t,n){mxUtils.get(t,(function(t){var r=t.getStatus();r<200||r>299?o():(s[n]=t,0==--i&&e(s))}),o)}(t[l],l);0==i&&e(s)},post:function(t,e,n,i){return new mxXmlRequest(t,e).send(n,i)},submit:function(t,e,n,i){return new mxXmlRequest(t,e).simulate(n,i)},loadInto:function(t,e,n){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&n()}:e.addEventListener("load",n,!1),e.load(t)},getValue:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n),i},getNumber:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n||0),Number(i)},getColor:function(t,e,n){var i=null!=t?t[e]:null;return null==i?i=n:i==mxConstants.NONE&&(i=null),i},clone:function(t,e,n){n=null!=n&&n;var i=null;if(null!=t&&"function"==typeof t.constructor)for(var s in i=new t.constructor,t)s!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,s)<0)&&(n||"object"!=typeof t[s]?i[s]=t[s]:i[s]=mxUtils.clone(t[s]));return i},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(null!=t[n]&&null==e[n]||null==t[n]&&null!=e[n]||null!=t[n]&&null!=e[n]&&(t[n].x!=e[n].x||t[n].y!=e[n].y))return!1;return!0},equalEntries:function(t,e){var n=0;if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e){for(var i in e)n++;for(var i in t)if(n--,!(mxUtils.isNaN(t[i])&&mxUtils.isNaN(e[i])||t[i]==e[i]))return!1}return 0==n},removeDuplicates:function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.get(t[i])||(n.push(t[i]),e.put(t[i],!0));return n},isNaN:function(t){return"number"==typeof t&&isNaN(t)},extend:function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},toString:function(t){var e="";for(var n in t)try{if(null==t[n])e+=n+" = [null]\n";else if("function"==typeof t[n])e+=n+" => [Function]\n";else if("object"==typeof t[n]){e+=n+" => ["+mxUtils.getFunctionName(t[n].constructor)+"]\n"}else e+=n+" = "+t[n]+"\n"}catch(t){e+=n+"="+t.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,n,i,s,r,o,l,a){if(l-=t,a-=e,0===n||0===i)return j;var h=o,u=s;n=Math.abs(n),i=Math.abs(i);var d,p=-l/2,m=-a/2,c=Math.cos(u*Math.PI/180),x=Math.sin(u*Math.PI/180),g=c*p+x*m,y=-1*x*p+c*m,f=g*g,v=y*y,C=n*n,E=i*i,S=f/C+v/E;if(S>1)n=Math.sqrt(S)*n,i=Math.sqrt(S)*i,d=0;else{var T=1;r===h&&(T=-1),d=T*Math.sqrt((C*E-C*v-E*f)/(C*v+E*f))}var b=d*n*y/i,w=-1*d*i*g/n,L=c*b-x*w+l/2,I=x*b+c*w+a/2,A=Math.atan2((y-w)/i,(g-b)/n)-Math.atan2(0,1),O=A>=0?A:2*Math.PI+A,_=(A=Math.atan2((-y-w)/i,(-g-b)/n)-Math.atan2((y-w)/i,(g-b)/n))>=0?A:2*Math.PI+A;0==h&&_>0?_-=2*Math.PI:0!=h&&_<0&&(_+=2*Math.PI);for(var M=2*_/Math.PI,R=Math.ceil(M<0?-1*M:M),P=_/R,N=8/3*Math.sin(P/4)*Math.sin(P/4)/Math.sin(P/2),D=c*n,H=c*i,G=x*n,U=x*i,V=Math.cos(O),B=Math.sin(O),F=-N*(D*B+U*V),k=-N*(G*B-H*V),Y=0,z=0,j=[],K=0;K<R;++K){O+=P,Y=D*(V=Math.cos(O))-U*(B=Math.sin(O))+L,z=G*V+H*B+I;var W=-N*(D*B+U*V),X=-N*(G*B-H*V),q=6*K;j[q]=Number(F+t),j[q+1]=Number(k+e),j[q+2]=Number(Y-W+t),j[q+3]=Number(z-X+e),j[q+4]=Number(Y+t),j[q+5]=Number(z+e),F=Y+W,k=z+X}return j},getBoundingBox:function(t,e,n){var i=null;if(null!=t&&null!=e&&0!=e){var s=mxUtils.toRadians(e),r=Math.cos(s),o=Math.sin(s);n=null!=n?n:new mxPoint(t.x+t.width/2,t.y+t.height/2);var l=new mxPoint(t.x,t.y),a=new mxPoint(t.x+t.width,t.y),h=new mxPoint(a.x,t.y+t.height),u=new mxPoint(t.x,h.y);l=mxUtils.getRotatedPoint(l,r,o,n),a=mxUtils.getRotatedPoint(a,r,o,n),h=mxUtils.getRotatedPoint(h,r,o,n),u=mxUtils.getRotatedPoint(u,r,o,n),(i=new mxRectangle(l.x,l.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),i.add(new mxRectangle(h.x,h.y,0,0)),i.add(new mxRectangle(u.x,u.y,0,0))}return i},getRotatedPoint:function(t,e,n,i){i=null!=i?i:new mxPoint;var s=t.x-i.x,r=t.y-i.y,o=r*e+s*n;return new mxPoint(s*e-r*n+i.x,o+i.y)},getPortConstraints:function(t,e,n,i){var s=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==s)return i;var r=s.toString(),o=mxConstants.DIRECTION_MASK_NONE,l=0;1==mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0));var a=0;if(l>45?(a=1,l>=135&&(a=2)):l<-45&&(a=3,l<=-135&&(a=2)),r.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:o|=mxConstants.DIRECTION_MASK_EAST;break;case 2:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:o|=mxConstants.DIRECTION_MASK_WEST}if(r.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_WEST;break;case 1:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:o|=mxConstants.DIRECTION_MASK_EAST;break;case 3:o|=mxConstants.DIRECTION_MASK_SOUTH}if(r.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:o|=mxConstants.DIRECTION_MASK_WEST;break;case 2:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:o|=mxConstants.DIRECTION_MASK_EAST}if(r.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_EAST;break;case 1:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:o|=mxConstants.DIRECTION_MASK_WEST;break;case 3:o|=mxConstants.DIRECTION_MASK_NORTH}return o},reversePortConstraints:function(t){var e=0;return 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},findNearestSegment:function(t,e,n){var i=-1;if(t.absolutePoints.length>0)for(var s=t.absolutePoints[0],r=null,o=1;o<t.absolutePoints.length;o++){var l=t.absolutePoints[o],a=mxUtils.ptSegDistSq(s.x,s.y,l.x,l.y,e,n);(null==r||a<r)&&(r=a,i=o-1),s=l}return i},getDirectedBounds:function(t,e,n,i,s){var r=mxUtils.getValue(n,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);if(i=null!=i?i:mxUtils.getValue(n,mxConstants.STYLE_FLIPH,!1),s=null!=s?s:mxUtils.getValue(n,mxConstants.STYLE_FLIPV,!1),e.x=Math.round(Math.max(0,Math.min(t.width,e.x))),e.y=Math.round(Math.max(0,Math.min(t.height,e.y))),e.width=Math.round(Math.max(0,Math.min(t.width,e.width))),e.height=Math.round(Math.max(0,Math.min(t.height,e.height))),s&&(r==mxConstants.DIRECTION_SOUTH||r==mxConstants.DIRECTION_NORTH)||i&&(r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST)){var o=e.x;e.x=e.width,e.width=o}if(i&&(r==mxConstants.DIRECTION_SOUTH||r==mxConstants.DIRECTION_NORTH)||s&&(r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST)){o=e.y;e.y=e.height,e.height=o}var l=mxRectangle.fromRectangle(e);return r==mxConstants.DIRECTION_SOUTH?(l.y=e.x,l.x=e.height,l.width=e.y,l.height=e.width):r==mxConstants.DIRECTION_WEST?(l.y=e.height,l.x=e.width,l.width=e.x,l.height=e.y):r==mxConstants.DIRECTION_NORTH&&(l.y=e.width,l.x=e.y,l.width=e.height,l.height=e.x),new mxRectangle(t.x+l.x,t.y+l.y,t.width-l.width-l.x,t.height-l.height-l.y)},getPerimeterPoint:function(t,e,n){for(var i=null,s=0;s<t.length-1;s++){var r=mxUtils.intersection(t[s].x,t[s].y,t[s+1].x,t[s+1].y,e.x,e.y,n.x,n.y);if(null!=r){var o=n.x-r.x,l=n.y-r.y,a={p:r,distSq:l*l+o*o};null!=a&&(null==i||i.distSq>a.distSq)&&(i=a)}}return null!=i?i.p:null},rectangleIntersectsSegment:function(t,e,n){var i=t.y,s=t.x,r=i+t.height,o=s+t.width,l=e.x,a=n.x;if(e.x>n.x&&(l=n.x,a=e.x),a>o&&(a=o),l<s&&(l=s),l>a)return!1;var h=e.y,u=n.y,d=n.x-e.x;if(Math.abs(d)>1e-7){var p=(n.y-e.y)/d,m=e.y-p*e.x;h=p*l+m,u=p*a+m}if(h>u){var c=u;u=h,h=c}return u>r&&(u=r),h<i&&(h=i),!(h>u)},contains:function(t,e,n){return t.x<=e&&t.x+t.width>=e&&t.y<=n&&t.y+t.height>=n},intersects:function(t,e){var n=t.width,i=t.height,s=e.width,r=e.height;if(s<=0||r<=0||n<=0||i<=0)return!1;var o=t.x,l=t.y,a=e.x,h=e.y;return r+=h,n+=o,i+=l,((s+=a)<a||s>o)&&(r<h||r>l)&&(n<o||n>a)&&(i<l||i>h)},intersectsHotspot:function(t,e,n,i,s,r){if(s=null!=s?s:0,r=null!=r?r:0,(i=null!=i?i:1)>0){var o=t.getCenterX(),l=t.getCenterY(),a=t.width,h=t.height,u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;u>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(l=t.y+u/2,h=u):(o=t.x+u/2,a=u)),a=Math.max(s,a*i),h=Math.max(s,h*i),r>0&&(a=Math.min(a,r),h=Math.min(h,r));var d=new mxRectangle(o-a/2,l-h/2,a,h),p=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=p){var m=Math.cos(-p),c=Math.sin(-p),x=(o=new mxPoint(t.getCenterX(),t.getCenterY()),mxUtils.getRotatedPoint(new mxPoint(e,n),m,c,o));e=x.x,n=x.y}return mxUtils.contains(d,e,n)}return!0},getOffset:function(t,e){for(var n=0,i=0,s=!1,r=t,o=document.body,l=document.documentElement;null!=r&&r!=o&&r!=l&&!s;){var a=mxUtils.getCurrentStyle(r);null!=a&&(s=s||"fixed"==a.position),r=r.parentNode}if(!e&&!s){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);n+=h.x,i+=h.y}var u=t.getBoundingClientRect();return null!=u&&(n+=u.left,i+=u.top),new mxPoint(n,i)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow;return new mxPoint(null!=e&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=e&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,n){e=null!=e&&e,n=null==n||n;for(var i=null!=t?t.ownerDocument:document,s=i.body,r=i.documentElement,o=new mxPoint,l=!1;null!=t&&t!=s&&t!=r;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(o.x+=t.scrollLeft,o.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(l=l||"fixed"==a.position),t=e?t.parentNode:null}if(!l&&n){var h=mxUtils.getDocumentScrollOrigin(i);o.x+=h.x,o.y+=h.y}return o},convertPoint:function(t,e,n){var i=mxUtils.getScrollOrigin(t,!1),s=mxUtils.getOffset(t);return s.x-=i.x,s.y-=i.y,new mxPoint(e-s.x,n-s.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?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)&&("string"!=typeof t||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,n,i,s,r,o,l){var a=(l-r)*(n-t)-(o-s)*(i-e),h=((o-s)*(e-r)-(l-r)*(t-s))/a,u=((n-t)*(e-r)-(i-e)*(t-s))/a;return h>=0&&h<=1&&u>=0&&u<=1?new mxPoint(t+h*(n-t),e+h*(i-e)):null},ptSegDistSq:function(t,e,n,i,s,r){var o,l=(s-=t)*(n-=t)+(r-=e)*(i-=e);o=l<=0||(l=(s=n-s)*n+(r=i-r)*i)<=0?0:l*l/(n*n+i*i);var a=s*s+r*r-o;return a<0&&(a=0),a},ptLineDist:function(t,e,n,i,s,r){return Math.abs((i-e)*s-(n-t)*r+n*e-i*t)/Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))},relativeCcw:function(t,e,n,i,s,r){var o=(s-=t)*(i-=e)-(r-=e)*(n-=t);return 0==o&&(o=s*n+r*i)>0&&(o=(s-=n)*n+(r-=i)*i)<0&&(o=0),o<0?-1:o>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,n,i,s,r){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=e>=100?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=e>=100?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=null==e||e;var n=new mxDictionary;return t.sort((function(t,i){var s=n.get(t);null==s&&(s=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),n.put(t,s));var r=n.get(i);null==r&&(r=mxCellPath.create(i).split(mxCellPath.PATH_SEPARATOR),n.put(i,r));var o=mxCellPath.compare(s,r);return 0==o?0:o>0==e?1:-1})),t},getStylename:function(t){if(null!=t){var e=t.split(";")[0];if(e.indexOf("=")<0)return e}return""},getStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)n[i].indexOf("=")<0&&e.push(n[i]);return e},indexOfStylename:function(t,e){if(null!=t&&null!=e)for(var n=t.split(";"),i=0,s=0;s<n.length;s++){if(n[s]==e)return i;i+=n[s].length+1}return-1},addStylename:function(t,e){return mxUtils.indexOfStylename(t,e)<0&&(null==t?t="":t.length>0&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var n=[];if(null!=t)for(var i=t.split(";"),s=0;s<i.length;s++)i[s]!=e&&n.push(i[s]);return n.join(";")},removeAllStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)n[i].indexOf("=")>=0&&e.push(n[i]);return e.join(";")},setCellStyles:function(t,e,n,i){if(null!=e&&e.length>0){t.beginUpdate();try{for(var s=0;s<e.length;s++)if(null!=e[s]){var r=mxUtils.setStyle(t.getStyle(e[s]),n,i);t.setStyle(e[s],r)}}finally{t.endUpdate()}}},setStyle:function(t,e,n){var i=null!=n&&(void 0===n.length||n.length>0);if(null==t||0==t.length)i&&(t=e+"="+n+";");else if(t.substring(0,e.length+1)==e+"="){var s=t.indexOf(";");t=i?e+"="+n+(s<0?";":t.substring(s)):s<0||s==t.length-1?"":t.substring(s+1)}else{var r=t.indexOf(";"+e+"=");if(r<0){if(i){var o=";"==t.charAt(t.length-1)?"":";";t=t+o+e+"="+n+";"}}else{s=t.indexOf(";",r+1);t=i?t.substring(0,r+1)+e+"="+n+(s<0?";":t.substring(s)):t.substring(0,r)+(s<0?";":t.substring(s))}}return t},setCellStyleFlags:function(t,e,n,i,s){if(null!=e&&e.length>0){t.beginUpdate();try{for(var r=0;r<e.length;r++)if(null!=e[r]){var o=mxUtils.setStyleFlag(t.getStyle(e[r]),n,i,s);t.setStyle(e[r],o)}}finally{t.endUpdate()}}},setStyleFlag:function(t,e,n,i){if(null==t||0==t.length)t=i||null==i?e+"="+n:e+"=0";else{var s=t.indexOf(e+"=");if(s<0){var r=";"==t.charAt(t.length-1)?"":";";t=i||null==i?t+r+e+"="+n:t+r+e+"=0"}else{var o=t.indexOf(";",s),l="";l=o<0?t.substring(s+e.length+1):t.substring(s+e.length+1,o),l=null==i?parseInt(l)^n:i?parseInt(l)|n:parseInt(l)&~n,t=t.substring(0,s)+e+"="+l+(o>=0?t.substring(o):"")}}return t},getAlignmentAsPoint:function(t,e){var n=-.5,i=-.5;return t==mxConstants.ALIGN_LEFT?n=0:t==mxConstants.ALIGN_RIGHT&&(n=-1),e==mxConstants.ALIGN_TOP?i=0:e==mxConstants.ALIGN_BOTTOM&&(i=-1),new mxPoint(n,i)},getSizeForString:function(t,e,n,i,s){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var r=document.createElement("div");if(r.style.fontFamily=n,r.style.fontSize=Math.round(e)+"px",r.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=s){(s&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(r.style.fontWeight="bold"),(s&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(r.style.fontStyle="italic");var o=[];(s&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&o.push("underline"),(s&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&o.push("line-through"),o.length>0&&(r.style.textDecoration=o.join(" "))}r.style.position="absolute",r.style.visibility="hidden",r.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",r.style.zoom="1",null!=i?(r.style.width=i+"px",r.style.whiteSpace="normal"):r.style.whiteSpace="nowrap",r.innerHTML=t,document.body.appendChild(r);var l=new mxRectangle(0,0,r.offsetWidth,r.offsetHeight);return document.body.removeChild(r),l},getViewXml:function(t,e,n,i,s){(i=null!=i?i:0,s=null!=s?s:0,e=null!=e?e:1,null==n)&&(n=[t.getModel().getRoot()]);var r=t.getView(),o=null,l=r.isEventsEnabled();r.setEventsEnabled(!1);var a=r.drawPane,h=r.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(r.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.drawPane),r.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.overlayPane)):(r.drawPane=r.drawPane.cloneNode(!1),r.canvas.appendChild(r.drawPane),r.overlayPane=r.overlayPane.cloneNode(!1),r.canvas.appendChild(r.overlayPane));var u=r.getTranslate();r.translate=new mxPoint(i,s);var d=new mxTemporaryCellStates(t.getView(),e,n);try{o=(new mxCodec).encode(t.getView())}finally{d.destroy(),r.translate=u,r.canvas.removeChild(r.drawPane),r.canvas.removeChild(r.overlayPane),r.drawPane=a,r.overlayPane=h,r.setEventsEnabled(l)}return o},getScaleForPageCount:function(t,e,n,i){if(t<1)return 1;i=null!=i?i:0;var s=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*i,r=n.height-2*i,o=e.getGraphBounds().clone(),l=e.getView().getScale();o.width/=l,o.height/=l;var a=o.width,h=a/o.height/(s/r),u=Math.sqrt(t),d=Math.sqrt(h),p=u*d,m=u/d;if(p<1&&m>t){var c=m/t;m=t,p/=c}if(m<1&&p>t){c=p/t;p=t,m/=c}for(var x=Math.ceil(p)*Math.ceil(m),g=0;x>t;){var y=Math.floor(p)/p,f=Math.floor(m)/m;1==y&&(y=Math.floor(p-1)/p),1==f&&(f=Math.floor(m-1)/m);c=1;if(p*=c=y>f?y:f,m*=c,x=Math.ceil(p)*Math.ceil(m),++g>10)break}return.99999*(s*p/a)},show:function(t,e,n,i,s,r){(n=null!=n?n:0,i=null!=i?i:0,null==e)?e=window.open().document:e.open();9==document.documentMode&&e.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var o=t.getGraphBounds(),l=Math.ceil(n-o.x),a=Math.ceil(i-o.y);if(null==s&&(s=Math.ceil(o.width+n)+Math.ceil(Math.ceil(o.x)-o.x)),null==r&&(r=Math.ceil(o.height+i)+Math.ceil(Math.ceil(o.y)-o.y)),mxClient.IS_IE||11==document.documentMode){for(var h="<html><head>",u=document.getElementsByTagName("base"),d=0;d<u.length;d++)h+=u[d].outerHTML;h+="<style>";for(d=0;d<document.styleSheets.length;d++)try{h+=document.styleSheets[d].cssText}catch(t){}h+='</style></head><body style="margin:0px;">',h+='<div style="position:absolute;overflow:hidden;width:'+s+"px;height:"+r+'px;"><div style="position:relative;left:'+l+"px;top:"+a+'px;">',h+=t.container.innerHTML,h+="</div></div></body><html>",e.writeln(h),e.close()}else{e.writeln("<html><head>");for(u=document.getElementsByTagName("base"),d=0;d<u.length;d++)e.writeln(mxUtils.getOuterHtml(u[d]));var p=document.getElementsByTagName("link");for(d=0;d<p.length;d++)e.writeln(mxUtils.getOuterHtml(p[d]));var m=document.getElementsByTagName("style");for(d=0;d<m.length;d++)e.writeln(mxUtils.getOuterHtml(m[d]));e.writeln('</head><body style="margin:0px;"></body></html>'),e.close();var c=e.createElement("div");c.position="absolute",c.overflow="hidden",c.style.width=s+"px",c.style.height=r+"px";var x=e.createElement("div");x.style.position="absolute",x.style.left=l+"px",x.style.top=a+"px";for(var g=t.container.firstChild,y=null;null!=g;){var f=g.cloneNode(!0);g==t.view.drawPane.ownerSVGElement?(c.appendChild(f),y=f):x.appendChild(f),g=g.nextSibling}e.body.appendChild(c),null!=x.firstChild&&e.body.appendChild(x),null!=y&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+l+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var n=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(n,500):n()},popup:function(t,e){if(e){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px",(s=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),n.appendChild(s),(i=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),i.setVisible(!0)}else{var i,s;if(mxClient.IS_NS)(i=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(t)+"</pre"),i.document.close();else(s=(i=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),i.document.body.appendChild(s)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,n,i){var s=document.createElement("div");s.style.padding="20px";var r=document.createElement("img");r.setAttribute("src",i||mxUtils.errorImage),r.setAttribute("valign","bottom"),r.style.verticalAlign="middle",s.appendChild(r),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),mxUtils.write(s,t);var o=document.body.clientWidth,l=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,s,(o-e)/2,l/4,e,null,!1,!0);if(n){mxUtils.br(s);var h=document.createElement("p"),u=document.createElement("button");mxClient.IS_IE?u.style.cssText="float:right":u.setAttribute("style","float:right"),mxEvent.addListener(u,"click",(function(t){a.destroy()})),mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),h.appendChild(u),s.appendChild(h),mxUtils.br(s),a.setClosable(!0)}return a.setVisible(!0),a},makeDraggable:function(t,e,n,i,s,r,o,l,a,h){var u=new mxDragSource(t,n);return u.dragOffset=new mxPoint(null!=s?s:0,null!=r?r:mxConstants.TOOLTIP_VERTICAL_OFFSET),u.autoscroll=o,u.setGuidesEnabled(!1),null!=a&&(u.highlightDropTargets=a),null!=h&&(u.getDropTarget=h),u.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=i&&(u.createDragElement=function(){return i.cloneNode(!0)},l&&(u.createPreviewElement=function(t){var e=i.cloneNode(!0),n=parseInt(e.style.width),s=parseInt(e.style.height);return e.style.width=Math.round(n*t.view.scale)+"px",e.style.height=Math.round(s*t.view.scale)+"px",e})),u}},prefix;__mxOutput.mxUtils=void 0!==mxUtils?mxUtils:void 0;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:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_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"};function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e<arguments.length;e+=2)null!=arguments[e+1]&&(this.properties[arguments[e]]=arguments[e+1])}function mxMouseEvent(t,e){this.evt=t,this.state=e,this.sourceState=e}function mxEventSource(t){this.setEventSource(t)}__mxOutput.mxConstants=void 0!==mxConstants?mxConstants:void 0,mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,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=!0},__mxOutput.mxEventObject=void 0!==mxEventObject?mxEventObject:void 0,mxMouseEvent.prototype.consumed=!1,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){return null!=t&&mxUtils.isAncestorNode(t.node,this.getSource())},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();return null!=t?t.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(t){(t=null!=t?t:null!=this.evt.touches||mxEvent.isMouseEvent(this.evt))&&this.evt.preventDefault&&this.evt.preventDefault(),mxClient.IS_IE&&(this.evt.returnValue=!0),this.consumed=!0},__mxOutput.mxMouseEvent=void 0!==mxMouseEvent?mxMouseEvent:void 0,mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,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){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(t),this.eventListeners.push(e)},mxEventSource.prototype.removeListener=function(t){if(null!=this.eventListeners)for(var e=0;e<this.eventListeners.length;)this.eventListeners[e+1]==t?this.eventListeners.splice(e,2):e+=2},mxEventSource.prototype.fireEvent=function(t,e){if(null!=this.eventListeners&&this.isEventsEnabled()){null==t&&(t=new mxEventObject),null==e&&(e=this.getEventSource()),null==e&&(e=this);for(var n=[e,t],i=0;i<this.eventListeners.length;i+=2){var s=this.eventListeners[i];null!=s&&s!=t.getName()||this.eventListeners[i+1].apply(this,n)}}},__mxOutput.mxEventSource=void 0!==mxEventSource?mxEventSource:void 0;var mxEvent={addListener:(updateListenerList=function(t,e,n){null==t.mxListenerList&&(t.mxListenerList=[]);var i={name:e,f:n};t.mxListenerList.push(i)},window.addEventListener?function(t,e,n){t.addEventListener(e,n,!1),updateListenerList(t,e,n)}:function(t,e,n){t.attachEvent("on"+e,n),updateListenerList(t,e,n)}),removeListener:(updateListener=function(t,e,n){if(null!=t.mxListenerList){for(var i=t.mxListenerList.length,s=0;s<i;s++)if(t.mxListenerList[s].f==n){t.mxListenerList.splice(s,1);break}0==t.mxListenerList.length&&(t.mxListenerList=null)}},window.removeEventListener?function(t,e,n){t.removeEventListener(e,n,!1),updateListener(t,0,n)}:function(t,e,n){t.detachEvent("on"+e,n),updateListener(t,0,n)}),removeAllListeners:function(t){var e=t.mxListenerList;if(null!=e)for(;e.length>0;){var n=e[0];mxEvent.removeListener(t,n.name,n.f)}},addGestureListeners:function(t,e,n,i){null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=n&&mxEvent.addListener(t,"touchmove",n),null!=i&&mxEvent.addListener(t,"touchend",i))},removeGestureListeners:function(t,e,n,i){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=n&&mxEvent.removeListener(t,"touchmove",n),null!=i&&mxEvent.removeListener(t,"touchend",i))},redirectMouseEvents:function(t,e,n,i,s,r,o){var l=function(t){return"function"==typeof n?n(t):n};mxEvent.addGestureListeners(t,(function(t){null!=i?i(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,l(t)))}),(function(t){null!=s?s(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,l(t)))}),(function(t){null!=r?r(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,l(t)))})),mxEvent.addListener(t,"dblclick",(function(t){if(null!=o)o(t);else if(!mxEvent.isConsumed(t)){var n=l(t);e.dblClick(t,null!=n?n.cell:null)}}))},release:function(t){try{if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxEvent.release(e[i])}}catch(t){}},addMouseWheelListener:function(t,e){if(null!=t){if(e=null!=e?e:window,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;Math.abs(i)>.2&&(t(e,i<0,!0),n=e.scale)})),mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}mxEvent.addListener(e,"wheel",(function(e){null==e&&(e=window.event),e.ctrlKey&&e.preventDefault(),e.deltaY,(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5)&&t(e,0==e.deltaY?-e.deltaX>0:-e.deltaY>0)}))}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){return t.preventDefault&&t.preventDefault(),!1}))},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&t.touches.length>1},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return!("buttons"in t)||"mousedown"!=t.type&&"mousemove"!=t.type?"which"in t?1===t.which:1===t.button:1==t.buttons},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},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 null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,n){n=null==n||n,(e=null==e||e)&&(t.preventDefault?(n&&t.stopPropagation(),t.preventDefault()):n&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},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"},updateListener,updateListenerList;function mxXmlRequest(t,e,n,i,s,r){this.url=t,this.params=e,this.method=n||"POST",this.async=null==i||i,this.username=s,this.password=r}__mxOutput.mxEvent=void 0!==mxEvent?mxEvent:void 0,mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,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 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,n,i){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,(function(){this.isReady()&&(t(this),this.request.onreadystatechaange=null)}))),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(null==document.documentMode||document.documentMode>9)&&window.XMLHttpRequest&&null!=n&&null!=i&&(this.request.timeout=n,this.request.ontimeout=i),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){var n=null;(t=t||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var i=t.createElement("form");i.setAttribute("method",this.method),i.setAttribute("action",this.url),null!=e&&i.setAttribute("target",e),i.style.display="none",i.style.visibility="hidden";for(var s=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),r=0;r<s.length;r++){var o=s[r].indexOf("=");if(o>0){var l=s[r].substring(0,o),a=s[r].substring(o+1);this.decodeSimulateValues&&(a=decodeURIComponent(a));var h=t.createElement("textarea");h.setAttribute("wrap","off"),h.setAttribute("name",l),mxUtils.write(h,a),i.appendChild(h)}}t.body.appendChild(i),i.submit(),null!=i.parentNode&&i.parentNode.removeChild(i),null!=n&&(window.onbeforeunload=n)},__mxOutput.mxXmlRequest=void 0!==mxXmlRequest?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var n=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(n)),n},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var n=mxClipboard.insertCount*mxClipboard.STEPSIZE,i=t.getDefaultParent();e=t.importCells(e,n,n,i),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};function mxWindow(t,e,n,i,s,r,o,l,a,h){null!=e&&(o=null==o||o,this.content=e,this.init(n,i,s,r,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(t),(null==l||l)&&this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,n){this.src=t,this.width=e,this.height=n}function mxDivResizer(t,e){if("div"==t.nodeName.toLowerCase()){null==e&&(e=window),this.div=t;var n=mxUtils.getCurrentStyle(t);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)}))),this.resize()}}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 n=e.getProperty("eventName"),i=e.getProperty("event");n!=mxEvent.MOUSE_DOWN&&i.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}__mxOutput.mxClipboard=void 0!==mxClipboard?mxClipboard:void 0,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=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,n,i,s){s=null!=s?s:"mxWindow",this.div=document.createElement("div"),this.div.className=s,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=s,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.height=i+"px"),this.table.style.height=i+"px");var r=document.createElement("tbody"),o=document.createElement("tr");this.title=document.createElement("td"),this.title.className=s+"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),o.appendChild(this.title),r.appendChild(o),o=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=s+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=s+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),o.appendChild(this.td),r.appendChild(o),this.table.appendChild(r),this.div.appendChild(this.table);var l=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,l),mxEvent.addGestureListeners(this.table,l),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var n=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=n}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=null!=t?t.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}var i=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",i))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){if(t)if(null==this.resize){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,n=null,i=null,s=null,r=mxUtils.bind(this,(function(t){this.activate(),e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.div.offsetWidth,s=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){if(null!=e&&null!=n){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setSize(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t)}})),l=mxUtils.bind(this,(function(t){null!=e&&null!=n&&(e=null,n=null,mxEvent.removeGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))}));mxEvent.addGestureListeners(this.resize,r,o,l),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(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),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",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=!1,e=null,n=null,i=mxUtils.bind(this,(function(i){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=n),this.table.style.height=n,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",i));else{t=!0,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",n=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",i))}mxEvent.consume(i)}));mxEvent.addGestureListeners(this.minimize,i)},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=!1,e=null,n=null,i=null,s=null,r=null,o=mxUtils.bind(this,(function(o){if(this.activate(),"none"!=this.maximize.style.display){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=r,this.div.style.left=e+"px",this.div.style.top=n+"px",!mxClient.IS_QUIRKS)this.div.style.height=i,this.div.style.width=s,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.table.style.height=i,this.table.style.width=s,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",o))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",r=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),n=parseInt(this.div.style.top),i=this.table.style.height,s=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var l=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=l-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=l-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS)"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",o))}mxEvent.consume(o)}}));mxEvent.addGestureListeners(this.maximize,o),mxEvent.addListener(this.title,"dblclick",o)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.getX(),s=this.getY(),r=mxUtils.bind(this,(function(t){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setLocation(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)}))),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)),this.destroyOnClose?this.destroy():this.setVisible(!1),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(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(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)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=void 0!==mxWindow?mxWindow:void 0,mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");n.appendChild(i),i=document.createElement("td");var s=document.createElement("button");mxUtils.write(s,mxResources.get("ok")||"OK"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){t()})),s=document.createElement("button"),mxUtils.write(s,mxResources.get("cancel")||"Cancel"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){e()})),n.appendChild(i),this.body.appendChild(n)},mxForm.prototype.addText=function(t,e,n){var i=document.createElement("input");return i.setAttribute("type",n||"text"),i.value=e,this.addField(t,i)},mxForm.prototype.addCheckbox=function(t,e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(t,n),e&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(t,e,n){var i=document.createElement("textarea");return mxClient.IS_NS&&n--,i.setAttribute("rows",n||2),i.value=e,this.addField(t,i)},mxForm.prototype.addCombo=function(t,e,n){var i=document.createElement("select");return null!=n&&i.setAttribute("size",n),e&&i.setAttribute("multiple","true"),this.addField(t,i)},mxForm.prototype.addOption=function(t,e,n,i){var s=document.createElement("option");mxUtils.writeln(s,e),s.setAttribute("value",n),i&&s.setAttribute("selected",i),t.appendChild(s)},mxForm.prototype.addField=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");return mxUtils.write(i,t),n.appendChild(i),(i=document.createElement("td")).appendChild(e),n.appendChild(i),this.body.appendChild(n),e},__mxOutput.mxForm=void 0!==mxForm?mxForm:void 0,mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=void 0!==mxImage?mxImage:void 0,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),n=parseInt(this.div.style.left),i=parseInt(this.div.style.right),s=parseInt(this.div.style.top),r=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(i)&&n>=0&&i>=0&&t-i-n>0&&(this.div.style.width=t-i-n+"px"),this.resizeHeight&&!isNaN(s)&&!isNaN(r)&&s>=0&&r>=0&&e-s-r>0&&(this.div.style.height=e-s-r+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=void 0!==mxDivResizer?mxDivResizer:void 0,mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,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,n,i){return t.getCellAt(e,n)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(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),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),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&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 n=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=mxUtils.getOffset(t.container),r=mxUtils.getScrollOrigin(),o=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=o&&o!=t.container;)o=o.parentNode;return null!=o&&n>=s.x-r.x&&i>=s.y-r.y&&n<=s.x-r.x+t.container.offsetWidth&&i<=s.y-r.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(null==e||this.graphContainsEvent(e,t)||(e=null),e!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=e,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,i+=this.dragOffset.y);var s=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=n+s.x+"px",this.dragElement.style.top=i+s.y+"px"}mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var e=this.currentGraph.view.scale,n=this.currentGraph.view.translate,i=this.currentPoint.x/e-n.x,s=this.currentPoint.y/e-n.y;this.drop(this.currentGraph,t,this.currentDropTarget,i,s)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(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=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),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=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var n=mxUtils.getOffset(t.container),i=mxUtils.getScrollOrigin(t.container),s=mxEvent.getClientX(e)-n.x+i.x-t.panDx,r=mxEvent.getClientY(e)-n.y+i.y-t.panDy;if(t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(s,r,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,s,r,e);var o=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(o)}if(null!=this.previewElement){null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var l=this.isGridEnabled()&&t.isGridEnabledEvent(e),a=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)){var h=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),u=new mxPoint(s,r);a=!1,s=(u=this.currentGuide.move(h,u,l,!0)).x,r=u.y}else if(l){var d=t.view.scale,p=t.view.translate,m=t.gridSize/2;s=(t.snap(s/d-p.x-m)+p.x)*d,r=(t.snap(r/d-p.y-m)+p.y)*d}null!=this.currentGuide&&a&&this.currentGuide.hide(),null!=this.previewOffset&&(s+=this.previewOffset.x,r+=this.previewOffset.y),this.previewElement.style.left=Math.round(s)+"px",this.previewElement.style.top=Math.round(r)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(s,r)},mxDragSource.prototype.drop=function(t,e,n,i,s){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},__mxOutput.mxDragSource=void 0!==mxDragSource?mxDragSource:void 0,mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,n,i,s,r){var o=document.createElement(null!=e?"img":"button"),l=s||(null!=r?"mxToolbarMode":"mxToolbarItem");o.className=l,o.setAttribute("src",e),null!=t&&(null!=e?o.setAttribute("title",t):mxUtils.write(o,t)),this.container.appendChild(o),null!=n&&(mxEvent.addListener(o,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",n));var a=mxUtils.bind(this,(function(t){null!=i?o.setAttribute("src",e):o.style.backgroundColor=""}));return mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){if(null!=i?o.setAttribute("src",i):o.style.backgroundColor="gray",null!=r){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var e=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=o){this.currentImg=o,this.menu.factoryMethod=r;var n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight);this.menu.popup(n.x,n.y,null,t),this.menu.isMenuShowing()&&(o.className=l+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=l,this.currentImg=null})}}})),null,a),mxEvent.addListener(o,"mouseout",a),o},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=t||"mxToolbarCombo",e.appendChild(n),this.container.appendChild(e),n},mxToolbar.prototype.addActionCombo=function(t,e){var n=document.createElement("select");return n.className=e||"mxToolbarCombo",this.addOption(n,t,null),mxEvent.addListener(n,"change",(function(t){var e=n.options[n.selectedIndex];n.selectedIndex=0,null!=e.funct&&e.funct(t)})),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(t,e,n){var i=document.createElement("option");return mxUtils.writeln(i,e),"function"==typeof n?i.funct=n:i.setAttribute("value",n),t.appendChild(i),i},mxToolbar.prototype.addSwitchMode=function(t,e,n,i,s){var r=document.createElement("img");return r.initialClassName=s||"mxToolbarMode",r.className=r.initialClassName,r.setAttribute("src",e),r.altIcon=i,null!=t&&r.setAttribute("title",t),mxEvent.addListener(r,"click",mxUtils.bind(this,(function(t){var e;null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=r),this.selectedMode=r,null!=(e=r.altIcon)?(r.altIcon=r.getAttribute("src"),r.setAttribute("src",e)):r.className=r.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()}))),this.container.appendChild(r),null==this.defaultMode&&(this.defaultMode=r,this.selectMode(r),n()),r},mxToolbar.prototype.addMode=function(t,e,n,i,s,r){r=null==r||r;var o=document.createElement(null!=e?"img":"button");return o.initialClassName=s||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",e),o.altIcon=i,null!=t&&o.setAttribute("title",t),this.enabled&&r&&(mxEvent.addListener(o,"click",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!1}))),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!0}))),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=n,this.selectMode(o,n))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){var n;if(null!=this.selectedMode)null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName;this.selectedMode=t,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){!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,null!=this.menu&&this.menu.destroy()},__mxOutput.mxToolbar=void 0!==mxToolbar?mxToolbar:void 0,mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},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));for(var t=this.changes.length-1;t>=0;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}this.undone=!0,this.redone=!1,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));for(var t=this.changes.length,e=0;e<t;e++){var n=this.changes[e];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},__mxOutput.mxUndoableEdit=void 0!==mxUndoableEdit?mxUndoableEdit:void 0,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 0==this.history.length},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(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),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(){for(var t=this.history.length;this.indexOfNextAdd<t;){var e=this.history[this.indexOfNextAdd++];if(e.redo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",e));break}}},mxUndoManager.prototype.undoableEditHappened=function(t){this.trim(),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)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e<t.length;e++)t[e].die()},__mxOutput.mxUndoManager=void 0!==mxUndoManager?mxUndoManager:void 0;var mxUrlConverter=function(){};function mxPanningManager(t){this.thread=null,this.active=!1,this.tdx=0,this.tdy=0,this.t0x=0,this.t0y=0,this.dx=0,this.dy=0,this.scrollbars=!1,this.scrollLeft=0,this.scrollTop=0,this.mouseListener={mouseDown:function(t,e){},mouseMove:function(t,e){},mouseUp:mxUtils.bind(this,(function(t,e){this.active&&this.stop()}))},t.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,(function(){this.active&&this.stop()})),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,(function(){return this.scrollbars=mxUtils.hasScrollbars(t.container),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,window.setInterval(mxUtils.bind(this,(function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-t.container.scrollLeft-Math.ceil(this.dx),n=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(e,n),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=!0},this.panTo=function(n,i,s,r){this.active||this.start(),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,s=null!=s?s:0,r=null!=r?r:0;var o=t.container;this.dx=n+s-o.scrollLeft-o.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.handleMouseOut?this.dx=Math.max(this.dx,0):this.dx=0,0==this.dx&&(this.dx=n-o.scrollLeft,this.dx>0&&this.dx<this.border?this.dx=this.dx-this.border:this.handleMouseOut?this.dx=Math.min(0,this.dx):this.dx=0),this.dy=i+r-o.scrollTop-o.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.handleMouseOut?this.dy=Math.max(this.dy,0):this.dy=0,0==this.dy&&(this.dy=i-o.scrollTop,this.dy>0&&this.dy<this.border?this.dy=this.dy-this.border:this.handleMouseOut?this.dy=Math.min(0,this.dy):this.dy=0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=e())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdx=0,this.tdy=0,this.scrollbars)t.panDx=0,t.panDy=0,t.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=t.panDx,n=t.panDy;0==e&&0==n||(t.panGraph(0,0),t.view.setTranslate(this.t0x+e/t.view.scale,this.t0y+n/t.view.scale))}},this.destroy=function(){t.removeMouseListener(this.mouseListener),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}function mxPopupMenu(t){this.factoryMethod=t,null!=t&&this.init()}function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.graphModelChanged(e.getProperty("edit").changes)})),this.setGraph(t)}function mxAnimation(t){this.delay=null!=t?t:20}function mxMorphing(t,e,n,i){mxAnimation.call(this,i),this.graph=t,this.steps=null!=e?e:6,this.ease=null!=n?n:1.5}function mxImageBundle(t){this.images=[],this.alt=null!=t&&t}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(t){mxAbstractCanvas2D.call(this),this.root=t,this.writeDefaults()}function mxSvgCanvas2D(t,e){mxAbstractCanvas2D.call(this),this.root=t,this.gradients=[],this.defs=null,this.styleEnabled=null!=e&&e;var n=null;if(t.ownerDocument!=document){for(var i=t;null!=i&&"svg"!=i.nodeName;)i=i.parentNode;n=i}null!=n&&(n.getElementsByTagName("defs").length>0&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUrlConverter.prototype.enabled=!0,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("/");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 null!=t&&"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=void 0!==mxUrlConverter?mxUrlConverter:void 0,mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,__mxOutput.mxPanningManager=void 0!==mxPanningManager?mxPanningManager:void 0,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=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,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,n,i,s,r,o){i=i||this,this.itemCount++,i.willAddSeparator&&(i.containsItems&&this.addSeparator(i,!0),i.willAddSeparator=!1),i.containsItems=!0;var l=document.createElement("tr");l.className="mxPopupMenuItem";var a=document.createElement("td");if(a.className="mxPopupMenuIcon",null!=e){var h=document.createElement("img");h.src=e,a.appendChild(h)}else if(null!=s){var u=document.createElement("div");u.className=s,a.appendChild(u)}if(l.appendChild(a),this.labels){var d=document.createElement("td");d.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),mxUtils.write(d,t),d.align="left",l.appendChild(d);var p=document.createElement("td");p.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),p.style.paddingRight="6px",p.style.textAlign="right",l.appendChild(p),null==i.div&&this.createSubmenu(i)}if(i.tbody.appendChild(l),0!=o&&0!=r){var m=null;mxEvent.addGestureListeners(l,mxUtils.bind(this,(function(t){this.eventReceiver=l,i.activeRow!=l&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),null!=l.div&&(this.showSubmenu(i,l),i.activeRow=l)),null==document.selection||!mxClient.IS_QUIRKS&&8!=document.documentMode||(m=document.selection.createRange()),mxEvent.consume(t)})),mxUtils.bind(this,(function(t){i.activeRow!=l&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),this.autoExpand&&null!=l.div&&(this.showSubmenu(i,l),i.activeRow=l)),l.className="mxPopupMenuItemHover"})),mxUtils.bind(this,(function(t){if(this.eventReceiver==l){if(i.activeRow!=l&&this.hideMenu(),null!=m){try{m.select()}catch(t){}m=null}null!=n&&n(t)}this.eventReceiver=null,mxEvent.consume(t)}))),mxEvent.addListener(l,"mouseout",mxUtils.bind(this,(function(t){l.className="mxPopupMenuItem"})))}return l},mxPopupMenu.prototype.addCheckmark=function(t,e){var n=t.firstChild.nextSibling;n.style.backgroundImage="url('"+e+"')",n.style.backgroundRepeat="no-repeat",n.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(null!=e.div){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 n=parseInt(e.div.offsetLeft),i=parseInt(e.div.offsetWidth),s=mxUtils.getDocumentScrollOrigin(document),r=document.body,o=document.documentElement;n+i>s.x+(r.clientWidth||o.clientWidth)&&(e.div.style.left=Math.max(0,t.div.offsetLeft-i+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(null!=t.tbody){t.willAddSeparator=!1;var n=document.createElement("tr"),i=document.createElement("td");i.className="mxPopupMenuIcon",i.style.padding="0 0 0 0px",n.appendChild(i);var s=document.createElement("td");s.style.padding="0 0 0 0px",s.setAttribute("colSpan","2");var r=document.createElement("hr");r.setAttribute("size","1"),s.appendChild(r),n.appendChild(s),t.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(t,e,n,i){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,i),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=void 0!==mxPopupMenu?mxPopupMenu:void 0,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=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=void 0!==mxAutoSaveManager?mxAutoSaveManager:void 0,mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(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(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=void 0!==mxAnimation?mxAnimation:void 0,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(null!=this.cells)for(var e=0;e<this.cells.length;e++)this.animateCell(this.cells[e],t,!1);else this.animateCell(this.graph.getModel().getRoot(),t,!0);this.show(t),(t.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,n){var i=this.graph.getView().getState(t),s=null;if(null!=i&&(s=this.getDelta(i),this.graph.getModel().isVertex(t)&&(0!=s.x||0!=s.y))){var r=this.graph.view.getTranslate(),o=this.graph.view.getScale();s.x+=r.x*o,s.y+=r.y*o,e.moveState(i,-s.x/this.ease,-s.y/this.ease)}if(n&&!this.stopRecursion(i,s))for(var l=this.graph.getModel().getChildCount(t),a=0;a<l;a++)this.animateCell(this.graph.getModel().getChildAt(t,a),e,n)},mxMorphing.prototype.stopRecursion=function(t,e){return null!=e&&(0!=e.x||0!=e.y)},mxMorphing.prototype.getDelta=function(t){var e=this.getOriginForCell(t.cell),n=this.graph.getView().getTranslate(),i=this.graph.getView().getScale(),s=t.x/i-n.x,r=t.y/i-n.y;return new mxPoint((e.x-s)*i,(e.y-r)*i)},mxMorphing.prototype.getOriginForCell=function(t){var e=null;if(null!=t){var n=this.graph.getModel().getParent(t),i=this.graph.getCellGeometry(t);if(e=this.getOriginForCell(n),null!=i)if(i.relative){var s=this.graph.getCellGeometry(n);null!=s&&(e.x+=i.x*s.width,e.y+=i.y*s.height)}else e.x+=i.x,e.y+=i.y}if(null==e){var r=this.graph.view.getTranslate();e=new mxPoint(-r.x,-r.y)}return e},__mxOutput.mxMorphing=void 0!==mxMorphing?mxMorphing:void 0,mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(t,e,n){this.images[t]={value:e,fallback:n}},mxImageBundle.prototype.getImage=function(t){var e=null;if(null!=t){var n=this.images[t];null!=n&&(e=this.alt?n.fallback:n.value)}return e},__mxOutput.mxImageBundle=void 0!==mxImageBundle?mxImageBundle:void 0,mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(t,e){null!=t&&(this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawCellState.apply(this,arguments)}))),this.includeOverlays&&this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawOverlays.apply(this,arguments)}))))},mxImageExport.prototype.visitStatesRecursive=function(t,e,n){if(null!=t){n(t,e);for(var i=t.view.graph,s=i.model.getChildCount(t.cell),r=0;r<s;r++){var o=i.view.getState(i.model.getChildAt(t.cell,r));this.visitStatesRecursive(o,e,n)}}},mxImageExport.prototype.getLinkForCellState=function(t,e){return null},mxImageExport.prototype.drawCellState=function(t,e){var n=this.getLinkForCellState(t,e);null!=n&&e.setLink(n),this.drawShape(t,e),this.drawText(t,e),null!=n&&e.setLink(null)},mxImageExport.prototype.drawShape=function(t,e){t.shape instanceof mxShape&&t.shape.checkBounds()&&(e.save(),t.shape.paint(e),e.restore())},mxImageExport.prototype.drawText=function(t,e){null!=t.text&&t.text.checkBounds()&&(e.save(),t.text.paint(e),e.restore())},mxImageExport.prototype.drawOverlays=function(t,e){null!=t.overlays&&t.overlays.visit((function(t,n){n instanceof mxShape&&n.paint(e)}))},__mxOutput.mxImageExport=void 0!==mxImageExport?mxImageExport:void 0,mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,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=!1,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:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,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(null!=this.path&&(this.path.push(arguments[0]),arguments.length>2))for(var t=this.state,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,n,i,s){var r=n*(Math.PI/180);return mxUtils.getRotatedPoint(new mxPoint(t,e),Math.cos(r),Math.sin(r),new mxPoint(i,s))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){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,n,i,s){},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){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,n,i,s,r,o,l,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=l?l:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){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){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){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){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){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,n,i){this.addOp(this.quadOp,t,e,n,i)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,n,i,s,r){this.addOp(this.curveOp,t,e,n,i,s,r)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,n,i,s,r,o){var l=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,n,i,s,r,o);if(null!=l)for(var a=0;a<l.length;a+=6)this.curveTo(l[a],l[a+1],l[a+2],l[a+3],l[a+4],l[a+5])},mxAbstractCanvas2D.prototype.close=function(t,e,n,i,s,r){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},__mxOutput.mxAbstractCanvas2D=void 0!==mxAbstractCanvas2D?mxAbstractCanvas2D:void 0,mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var t;(t=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(t),(t=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(t),(t=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(t),(t=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(t),(t=this.createElement("shadowoffset")).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(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){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 n=this.createElement("translate");n.setAttribute("dx",this.format(t)),n.setAttribute("dy",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(t,e,n,i,s){var r=this.createElement("rotate");(0!=t||e||n)&&(r.setAttribute("theta",this.format(t)),r.setAttribute("flipH",e?"1":"0"),r.setAttribute("flipV",n?"1":"0"),r.setAttribute("cx",this.format(i)),r.setAttribute("cy",this.format(s)),this.root.appendChild(r))},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),this.compressed){if(this.state.fillColor==t)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var e=this.createElement("fillcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setGradient=function(t,e,n,i,s,r,o,l,a){if(null!=t&&null!=e){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var h=this.createElement("gradient");h.setAttribute("c1",t),h.setAttribute("c2",e),h.setAttribute("x",this.format(n)),h.setAttribute("y",this.format(i)),h.setAttribute("w",this.format(s)),h.setAttribute("h",this.format(r)),null!=o&&h.setAttribute("direction",o),null!=l&&h.setAttribute("alpha1",l),null!=a&&h.setAttribute("alpha2",a),this.root.appendChild(h)}},mxXmlCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.strokeColor==t)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var e=this.createElement("strokecolor");e.setAttribute("color",null!=t?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 n=this.createElement("dashed");n.setAttribute("dashed",t?"1":"0"),null!=e&&n.setAttribute("fixDash",e?"1":"0"),this.root.appendChild(n)},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),this.compressed){if(this.state.fontColor==t)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var e=this.createElement("fontcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBackgroundColor==t)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var e=this.createElement("fontbackgroundcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBorderColor==t)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var e=this.createElement("fontbordercolor");e.setAttribute("color",null!=t?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(null==t&&(t=0),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),this.state.shadowColor==t)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var e=this.createElement("shadowcolor");e.setAttribute("color",null!=t?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 n=this.createElement("shadowoffset");n.setAttribute("dx",t),n.setAttribute("dy",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(t,e,n,i){var s=this.createElement("rect");s.setAttribute("x",this.format(t)),s.setAttribute("y",this.format(e)),s.setAttribute("w",this.format(n)),s.setAttribute("h",this.format(i)),this.root.appendChild(s)},mxXmlCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){var o=this.createElement("roundrect");o.setAttribute("x",this.format(t)),o.setAttribute("y",this.format(e)),o.setAttribute("w",this.format(n)),o.setAttribute("h",this.format(i)),o.setAttribute("dx",this.format(s)),o.setAttribute("dy",this.format(r)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(t,e,n,i){var s=this.createElement("ellipse");s.setAttribute("x",this.format(t)),s.setAttribute("y",this.format(e)),s.setAttribute("w",this.format(n)),s.setAttribute("h",this.format(i)),this.root.appendChild(s)},mxXmlCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){s=this.converter.convert(s);var a=this.createElement("image");a.setAttribute("x",this.format(t)),a.setAttribute("y",this.format(e)),a.setAttribute("w",this.format(n)),a.setAttribute("h",this.format(i)),a.setAttribute("src",s),a.setAttribute("aspect",r?"1":"0"),a.setAttribute("flipH",o?"1":"0"),a.setAttribute("flipV",l?"1":"0"),this.root.appendChild(a)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastX=0,this.lastY=0},mxXmlCanvas2D.prototype.moveTo=function(t,e){var n=this.createElement("move");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.lineTo=function(t,e){var n=this.createElement("line");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.quadTo=function(t,e,n,i){var s=this.createElement("quad");s.setAttribute("x1",this.format(t)),s.setAttribute("y1",this.format(e)),s.setAttribute("x2",this.format(n)),s.setAttribute("y2",this.format(i)),this.root.appendChild(s),this.lastX=n,this.lastY=i},mxXmlCanvas2D.prototype.curveTo=function(t,e,n,i,s,r){var o=this.createElement("curve");o.setAttribute("x1",this.format(t)),o.setAttribute("y1",this.format(e)),o.setAttribute("x2",this.format(n)),o.setAttribute("y2",this.format(i)),o.setAttribute("x3",this.format(s)),o.setAttribute("y3",this.format(r)),this.root.appendChild(o),this.lastX=s,this.lastY=r},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s){mxUtils.isNode(s)&&(s=mxUtils.getOuterHtml(s));var m=this.createElement("text");m.setAttribute("x",this.format(t)),m.setAttribute("y",this.format(e)),m.setAttribute("w",this.format(n)),m.setAttribute("h",this.format(i)),m.setAttribute("str",s),null!=r&&m.setAttribute("align",r),null!=o&&m.setAttribute("valign",o),m.setAttribute("wrap",l?"1":"0"),null==a&&(a=""),m.setAttribute("format",a),null!=h&&m.setAttribute("overflow",h),null!=u&&m.setAttribute("clip",u?"1":"0"),null!=d&&m.setAttribute("rotation",d),null!=p&&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=void 0!==mxXmlCanvas2D?mxXmlCanvas2D:void 0,mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"==typeof DOMParser&&"function"==typeof XMLSerializer,mxSvgCanvas2D.prototype.useDomParser)try{var t=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=t}catch(t){mxSvgCanvas2D.prototype.useDomParser=!1}}(),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,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.blockImagePointerEvents=!1,mxSvgCanvas2D.prototype.lineHeightCorrection=1,mxSvgCanvas2D.prototype.pointerEventsValue="all",mxSvgCanvas2D.prototype.fontMetricsPadding=10,mxSvgCanvas2D.prototype.cacheOffsetSize=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return e>0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var n=this.root.ownerDocument.createElement(t);return null!=e&&n.setAttribute("xmlns",e),n},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,n,i,s,r,o,l,a,h,u,d,p){return null!=r?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m=this.getAlternateText(t,e,n,i,s,r,o,l,a,h,u,d,p),c=this.state;if(null!=m&&c.fontSize>0){var x=l==mxConstants.ALIGN_TOP?1:l==mxConstants.ALIGN_BOTTOM?0:.3,g=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_LEFT?"start":"middle",y=this.createElement("text");y.setAttribute("x",Math.round(e+c.dx)),y.setAttribute("y",Math.round(n+c.dy+x*c.fontSize)),y.setAttribute("fill",c.fontColor||"black"),y.setAttribute("font-family",c.fontFamily),y.setAttribute("font-size",Math.round(c.fontSize)+"px"),"start"!=g&&y.setAttribute("text-anchor",g),(c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold"),(c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");var f=[];return(c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&f.push("underline"),(c.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&f.push("line-through"),f.length>0&&y.setAttribute("text-decoration",f.join(" ")),mxUtils.write(y,m),y}return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,n,i,s){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+n,e=e.toLowerCase()+"-"+i;var r=null;if(null==s||s==mxConstants.DIRECTION_SOUTH)r="s";else if(s==mxConstants.DIRECTION_EAST)r="e";else{var o=t;t=e,e=o,s==mxConstants.DIRECTION_NORTH?r="s":s==mxConstants.DIRECTION_WEST&&(r="e")}return"mx-gradient-"+t+"-"+e+"-"+r},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,n,i,s){var r=this.createGradientId(t,e,n,i,s),o=this.gradients[r];if(null==o){var l=this.root.ownerSVGElement,a=0,h=r+"-"+a;if(null!=l)for(o=l.ownerDocument.getElementById(h);null!=o&&o.ownerSVGElement!=l;)h=r+"-"+a++,o=l.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(t,e,n,i,s)).setAttribute("id",h),null!=this.defs?this.defs.appendChild(o):l.appendChild(o)),this.gradients[r]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,n,i,s){var r=this.createElement("linearGradient");r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2","0%"),r.setAttribute("y2","0%"),null==s||s==mxConstants.DIRECTION_SOUTH?r.setAttribute("y2","100%"):s==mxConstants.DIRECTION_EAST?r.setAttribute("x2","100%"):s==mxConstants.DIRECTION_NORTH?r.setAttribute("y1","100%"):s==mxConstants.DIRECTION_WEST&&r.setAttribute("x1","100%");var o=n<1?";stop-opacity:"+n:"",l=this.createElement("stop");return l.setAttribute("offset","0%"),l.setAttribute("style","stop-color:"+t+o),r.appendChild(l),o=i<1?";stop-opacity:"+i:"",(l=this.createElement("stop")).setAttribute("offset","100%"),l.setAttribute("style","stop-color:"+e+o),r.appendChild(l),r},mxSvgCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.setAttribute("d",this.path.join(" "))}t&&null!=i.fillColor?this.updateFill():this.styleEnabled||("ellipse"==n.nodeName&&mxClient.IS_FF?n.setAttribute("fill","transparent"):n.setAttribute("fill","none"),t=!1),e&&null!=i.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=i.transform&&i.transform.length>0&&n.setAttribute("transform",i.transform),i.shadow&&this.root.appendChild(this.createShadow(n)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents?n.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||n.setAttribute("pointer-events","none"),("rect"!=n.nodeName&&"path"!=n.nodeName&&"ellipse"!=n.nodeName||"none"!=n.getAttribute("fill")&&"transparent"!=n.getAttribute("fill")||"none"!=n.getAttribute("stroke")||"none"!=n.getAttribute("pointer-events"))&&this.root.appendChild(n),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),null!=t.fillColor)if(null!=t.gradientColor){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)this.node.setAttribute("fill","url(#"+e+")");else{var n=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+n+"#"+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()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),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(null!=t.lineJoin&&"miter"!=t.lineJoin&&this.node.setAttribute("stroke-linejoin",t.lineJoin),null!=t.lineCap){var e=t.lineCap;"flat"==e&&(e="butt"),"butt"!=e&&this.node.setAttribute("stroke-linecap",e)}null==t.miterLimit||this.styleEnabled&&10==t.miterLimit||this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var n=this.state.dashPattern.split(" ");if(n.length>0)for(var i=0;i<n.length;i++)e[i]=Number(n[i])*t}return e.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(t){var e=t.cloneNode(!0),n=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OT?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(t){var e=t.cloneNode(!0),n=this.state;return"none"==e.getAttribute("fill")||mxClient.IS_FF&&"transparent"==e.getAttribute("fill")||e.setAttribute("fill",n.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",n.shadowColor),e.setAttribute("transform","translate("+this.format(n.shadowDx*n.scale)+","+this.format(n.shadowDy*n.scale)+")"+(n.transform||"")),e.setAttribute("opacity",n.shadowAlpha),e},mxSvgCanvas2D.prototype.setLink=function(t){if(null==t)this.root=this.originalRoot;else{this.originalRoot=this.root;var e=this.createElement("a");null==e.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?e.setAttribute("xlink:href",t):e.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",t),this.root.appendChild(e),this.root=e}},mxSvgCanvas2D.prototype.rotate=function(t,e,n,i,s){if(0!=t||e||n){var r=this.state;if(i+=r.dx,s+=r.dy,i*=r.scale,s*=r.scale,r.transform=r.transform||"",e&&n)t+=180;else if(e!=n){var o=e?i:0,l=e?-1:1,a=n?s:0,h=n?-1:1;r.transform+="translate("+this.format(o)+","+this.format(a)+")scale("+this.format(l)+","+this.format(h)+")translate("+this.format(-o)+","+this.format(-a)+")"}(e?!n:n)&&(t*=-1),0!=t&&(r.transform+="rotate("+this.format(t)+","+this.format(i)+","+this.format(s)+")"),r.rotation=r.rotation+t,r.rotationCx=i,r.rotationCy=s}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(t,e,n,i){var s=this.state,r=this.createElement("rect");r.setAttribute("x",this.format((t+s.dx)*s.scale)),r.setAttribute("y",this.format((e+s.dy)*s.scale)),r.setAttribute("width",this.format(n*s.scale)),r.setAttribute("height",this.format(i*s.scale)),this.node=r},mxSvgCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){this.rect(t,e,n,i),s>0&&this.node.setAttribute("rx",this.format(s*this.state.scale)),r>0&&this.node.setAttribute("ry",this.format(r*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,n,i){var s=this.state,r=this.createElement("ellipse");r.setAttribute("cx",this.format((t+n/2+s.dx)*s.scale)),r.setAttribute("cy",this.format((e+i/2+s.dy)*s.scale)),r.setAttribute("rx",n/2*s.scale),r.setAttribute("ry",i/2*s.scale),this.node=r},mxSvgCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){s=this.converter.convert(s),r=null==r||r,o=null!=o&&o,l=null!=l&&l;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",s):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",s),r||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var u=this.state.transform||"";if(o||l){var d=1,p=1,m=0,c=0;o&&(d=-1,m=-n-2*t),l&&(p=-1,c=-i-2*e),u+="scale("+d+","+p+")translate("+m*a.scale+","+c*a.scale+")"}u.length>0&&h.setAttribute("transform",u),this.pointerEvents||h.setAttribute("pointer-events","none"),this.root.appendChild(h),this.blockImagePointerEvents&&(h.setAttribute("style","pointer-events:none"),(h=this.createElement("rect")).setAttribute("visibility","hidden"),h.setAttribute("pointer-events","fill"),h.setAttribute("x",this.format(t*a.scale)),h.setAttribute("y",this.format(e*a.scale)),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),this.root.appendChild(h))},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");null!=e&&("<body"==(t=(new XMLSerializer).serializeToString(e.body)).substring(0,5)&&(t=t.substring(t.indexOf(">",5)+1)),"</body>"==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var n=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),i=n.createElement("body");n.documentElement.appendChild(i);var s=document.createElement("div");s.innerHTML=t;for(var r=s.firstChild;null!=r;){var o=r.nextSibling;i.appendChild(n.adoptNode(r)),r=o}return i.innerHTML}var l=document.createElement("textarea");l.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=l.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>"),mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(e)&&(e="<div><div>"+mxUtils.getXml(e)+"</div></div>"),e='<div xmlns="http://www.w3.org/1999/xhtml">'+e+"</div>",mxUtils.parseXml(e).documentElement;var n=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var i=document.createElement("div"),s=i.cloneNode(!1);this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e),s.appendChild(i),n.appendChild(s)}else n.innerHTML=e;return n},mxSvgCanvas2D.prototype.updateText=function(t,e,n,i,s,r,o,l,a,h,u){null!=u&&null!=u.firstChild&&null!=u.firstChild.firstChild&&this.updateTextNodes(t,e,n,i,s,r,o,l,a,h,u.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c){var x=this.createElement("g"),g=this.createElement("foreignObject");if(g.setAttribute("style","overflow: visible; text-align: left;"),g.setAttribute("pointer-events","none"),m.ownerDocument!=document&&(m=mxUtils.importNodeImplementation(g.ownerDocument,m,!0)),g.appendChild(m),x.appendChild(g),this.updateTextNodes(t,e,n,i,r,o,l,h,u,d,x),this.root.ownerDocument!=document){var y=this.createAlternateContent(g,t,e,n,i,s,r,o,l,a,h,u,d);if(null!=y){g.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var f=this.createElement("switch");f.appendChild(g),f.appendChild(y),x.appendChild(f)}}c.appendChild(x)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,n,i,s,r,o,l,a,h,u){var d=this.state.scale;mxSvgCanvas2D.createCss(n,i,s,r,o,l,a,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(r==mxConstants.ALIGN_TOP?"flex-start":r==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(s==mxConstants.ALIGN_LEFT?"flex-start":s==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),d,mxUtils.bind(this,(function(n,i,s,r,o){t+=this.state.dx,e+=this.state.dy;var l=u.firstChild,a=l.firstChild,p=a.firstChild,m=p.firstChild,c=(this.rotateHtml?this.state.rotation:0)+(null!=h?h:0),x=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=d?"scale("+d+")":"");m.setAttribute("style",o),p.setAttribute("style",r),l.setAttribute("width",Math.ceil(1/Math.min(1,d)*100)+"%"),l.setAttribute("height",Math.ceil(1/Math.min(1,d)*100)+"%");var g=Math.round(e+i);g<0?l.setAttribute("y",g):(l.removeAttribute("y"),s+="padding-top: "+g+"px; "),a.setAttribute("style",s+"margin-left: "+Math.round(t+n)+"px;"),""!=(x+=0!=c?"rotate("+c+" "+t+" "+e+")":"")?u.setAttribute("transform",x):u.removeAttribute("transform"),1!=this.state.alpha?u.setAttribute("opacity",this.state.alpha):u.removeAttribute("opacity")})))},mxSvgCanvas2D.createCss=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m="box-sizing: border-box; font-size: 0; text-align: "+(n==mxConstants.ALIGN_LEFT?"left":n==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",c=mxUtils.getAlignmentAsPoint(n,i),x="overflow: hidden; ",g="width: 1px; ",y="height: 1px; ",f=c.x*t,v=c.y*e;o?(g="width: "+Math.round(t)+"px; ",m+="max-height: "+Math.round(e)+"px; ",v=0):"fill"==r?(u+="width: 100%; height: 100%; ",m+=(g="width: "+Math.round(t)+"px; ")+(y="height: "+Math.round(e)+"px; ")):"width"==r?(u+="width: 100%; ",m+=g="width: "+Math.round(t)+"px; ",v=0,e>0&&(m+="max-height: "+Math.round(e)+"px; ")):(x="",v=0);var C="";null!=l&&(C+="background-color: "+l+"; "),null!=a&&(C+="border: 1px solid "+a+"; "),""==x||o?u+=C:m+=C,s&&t>0?(u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",g="width: "+Math.round(t+2)+"px; ",""!=x&&"fill"!=r&&(v=0)):(u+="white-space: nowrap; ",""==x&&(f=0)),p(f,v,h+g+y,m+x,u,x)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,n="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")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(n+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(n+="font-style: italic; ");var i=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(n+="text-decoration: "+i.join(" ")+"; "),n},mxSvgCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s)if(d=null!=d?d:0,this.foEnabled&&"html"==a){var m=this.createDiv(s);null!=m&&(null!=p&&m.setAttribute("dir",p),this.addForeignObject(t,e,n,i,s,r,o,l,a,h,u,d,p,m,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,n,i,s,r,o,l,h,u,d,p)},mxSvgCanvas2D.prototype.createClip=function(t,e,n,i){for(var s="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(i=Math.round(i)),r=0,o=s+"-"+r;null!=document.getElementById(o);)o=s+"-"+ ++r;clip=this.createElement("clipPath"),clip.setAttribute("id",o);var l=this.createElement("rect");return l.setAttribute("x",t),l.setAttribute("y",e),l.setAttribute("width",n),l.setAttribute("height",i),clip.appendChild(l),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,h,u,d){u=null!=u?u:0;var p=this.state,m=p.fontSize,c=this.createElement("g"),x=p.transform||"";if(this.updateFont(c),0!=u&&(x+="rotate("+u+","+this.format(t*p.scale)+","+this.format(e*p.scale)+")"),null!=d&&c.setAttribute("direction",d),h&&n>0&&i>0){var g=t,y=e;r==mxConstants.ALIGN_CENTER?g-=n/2:r==mxConstants.ALIGN_RIGHT&&(g-=n),"fill"!=a&&(o==mxConstants.ALIGN_MIDDLE?y-=i/2:o==mxConstants.ALIGN_BOTTOM&&(y-=i));var f=this.createClip(g*p.scale-2,y*p.scale-2,n*p.scale+4,i*p.scale+4);if(null!=this.defs?this.defs.appendChild(f):this.root.appendChild(f),mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)c.setAttribute("clip-path","url(#"+f.getAttribute("id")+")");else{var v=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c.setAttribute("clip-path","url("+v+"#"+f.getAttribute("id")+")")}}var C=r==mxConstants.ALIGN_RIGHT?"end":r==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=C&&c.setAttribute("text-anchor",C),this.styleEnabled&&m==mxConstants.DEFAULT_FONTSIZE||c.setAttribute("font-size",m*p.scale+"px"),x.length>0&&c.setAttribute("transform",x),p.alpha<1&&c.setAttribute("opacity",p.alpha);var E=s.split("\n"),S=Math.round(m*mxConstants.LINE_HEIGHT),T=m+(E.length-1)*S;y=e+m-1;if(o==mxConstants.ALIGN_MIDDLE)y-="fill"==a?i/2:(this.matchHtmlAlignment&&h&&i>0?Math.min(T,i):T)/2;else if(o==mxConstants.ALIGN_BOTTOM){if("fill"==a)y-=i;else y-=(this.matchHtmlAlignment&&h&&i>0?Math.min(T,i):T)+1}for(var b=0;b<E.length;b++){if(E[b].length>0&&mxUtils.trim(E[b]).length>0){var w=this.createElement("text");w.setAttribute("x",this.format(t*p.scale)+this.textOffset),w.setAttribute("y",this.format(y*p.scale)+this.textOffset),mxUtils.write(w,E[b]),c.appendChild(w)}y+=S}this.root.appendChild(c),this.addTextBackground(c,s,t,e,n,"fill"==a?i:T,r,o,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&e.fontFamily==mxConstants.DEFAULT_FONTFAMILY||t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var n=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&t.setAttribute("text-decoration",n.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,n,i,s,r,o,l,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var u=null;if("fill"==a||"width"==a)o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,i*h.scale,(s-2)*h.scale,(r+2)*h.scale);else if(null!=t.getBBox&&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(t){}else{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",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(p.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(p.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),p.innerHTML=e.replace(/\n/g,"<br/>"),document.body.appendChild(p);s=p.offsetWidth,r=p.offsetHeight;p.parentNode.removeChild(p),o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,(i+2)*h.scale,s*h.scale,(r+1)*h.scale)}if(null!=u){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=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0;m.setAttribute("stroke-width",c),this.root.ownerDocument==document&&1==mxUtils.mod(c,2)&&m.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(m,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=void 0!==mxSvgCanvas2D?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxShape(t){this.stencil=t,this.initStyles()}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,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 n=this.node,i=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,i.strokeWidth*i.scale/this.vmlScale))+"px",i.shadow&&this.root.appendChild(this.createShadow(n,t&&null!=i.fillColor,e&&null!=i.strokeColor)),e&&null!=i.strokeColor?(n.stroked="true",n.strokecolor=i.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),t&&null!=i.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,null!=t.gradientColor){e.type="gradient",e.method="none",e.color2=t.gradientColor;var n=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?n-=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?n+=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?n-=180+("y"==this.root.style.flip?-180:0):n+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),e.angle=mxUtils.mod(n,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if("string"==typeof this.state.dashPattern){var e=this.state.dashPattern.split(" ");e.length>0&&1==e[0]&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,n){var i=this.state,s=-i.rotation*(Math.PI/180),r=Math.cos(s),o=Math.sin(s),l=i.shadowDx*i.scale,a=i.shadowDy*i.scale;"x"==this.root.style.flip?l*=-1:"y"==this.root.style.flip&&(a*=-1);var h=t.cloneNode(!0);return h.style.marginLeft=Math.round(l*r-a*o)+"px",h.style.marginTop=Math.round(l*o+a*r)+"px",8==document.documentMode&&(h.strokeweight=t.strokeweight,"shape"==t.nodeName&&(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))),n?(h.strokecolor=i.shadowColor,h.appendChild(this.createShadowStroke())):h.stroked="false",e?h.appendChild(this.createShadowFill()):h.filled="false",h},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,n,i,s){e&&n?t+=180:e?this.root.style.flip="x":n&&(this.root.style.flip="y"),(e?!n:n)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=i,this.state.rotationCy=s},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,n,i){var s=this.state,r=(this.lastX+s.dx)*s.scale,o=(this.lastY+s.dy)*s.scale,l=(t+s.dx)*s.scale,a=(e+s.dy)*s.scale,h=(n+s.dx)*s.scale,u=(i+s.dy)*s.scale,d=r+2/3*(l-r),p=o+2/3*(a-o),m=h+2/3*(l-h),c=u+2/3*(a-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/s.scale-s.dx,this.lastY=u/s.scale-s.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,n,i,s){var r=this.state,o=this.createVmlElement(t);return o.style.position="absolute",o.style.left=this.format((e+r.dx)*r.scale)+"px",o.style.top=this.format((n+r.dy)*r.scale)+"px",o.style.width=this.format(i*r.scale)+"px",o.style.height=this.format(s*r.scale)+"px",o},mxVmlCanvas2D.prototype.rect=function(t,e,n,i){this.node=this.createRect("rect",t,e,n,i)},mxVmlCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){this.node=this.createRect("roundrect",t,e,n,i),this.node.setAttribute("arcsize",Math.max(100*s/n,100*r/i)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,n,i){this.node=this.createRect("oval",t,e,n,i)},mxVmlCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){var a=null;if(r){(a=this.createRect("rect",t,e,n,i)).stroked="false";var h=this.createVmlElement("fill");h.aspect=r?"atmost":"ignore",h.rotate="true",h.type="frame",h.src=s,a.appendChild(h)}else(a=this.createRect("image",t,e,n,i)).src=s;o&&l?a.style.rotation="180":o?a.style.flip="x":l&&(a.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(a.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(a)},mxVmlCanvas2D.prototype.createDiv=function(t,e,n,i){var s=this.createElement("div"),r=this.state,o="";if(null!=r.fontBackgroundColor&&(o+="background-color:"+mxUtils.htmlEntities(r.fontBackgroundColor)+";"),null!=r.fontBorderColor&&(o+="border:1px solid "+mxUtils.htmlEntities(r.fontBorderColor)+";"),mxUtils.isNode(t))s.appendChild(t);else if("fill"!=i&&"width"!=i){var l=this.createElement("div");l.style.cssText=o,l.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",l.style.zoom="1",l.style.textDecoration="inherit",l.innerHTML=t,s.appendChild(l)}else s.style.cssText=o,s.innerHTML=t;var a=s.style;return a.fontSize=r.fontSize/this.vmlScale+"px",a.fontFamily=r.fontFamily,a.color=r.fontColor,a.verticalAlign="top",a.textAlign=e||"left",a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?r.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(r.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold"),(r.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic"),(r.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a.textDecoration="underline"),s},mxVmlCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s){var m=this.state;if("html"==a){if(null!=m.rotation){var c=this.rotatePoint(t,e,m.rotation,m.rotationCx,m.rotationCy);t=c.x,e=c.y}8!=document.documentMode||mxClient.IS_EM?(t*=m.scale,e*=m.scale):(t+=m.dx,e+=m.dy,"fill"!=h&&o==mxConstants.ALIGN_TOP&&(e-=1));var x=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group");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 g=this.createElement("div");g.style.position="relative",g.style.display="inline";var y=mxUtils.getAlignmentAsPoint(r,o),f=y.x,v=y.y,C=this.createDiv(s,r,o,h),E=this.createElement("div");if(null!=p&&C.setAttribute("dir",p),l&&n>0){if(u||(C.style.width=Math.round(n)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal","break-word"==C.style.wordWrap)null!=(_=C).firstChild&&"DIV"==_.firstChild.nodeName&&(_.firstChild.style.width="100%")}else C.style.whiteSpace="nowrap";var S=m.rotation+(d||0);if(this.rotateHtml&&0!=S?(E.style.display="inline",E.style.zoom="1",E.appendChild(C),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?x.appendChild(E):(g.appendChild(E),x.appendChild(g))):8!=document.documentMode||mxClient.IS_EM?(C.style.display="inline",x.appendChild(C)):(g.appendChild(C),x.appendChild(g)),"DIV"!=this.root.nodeName){var T=this.createVmlElement("rect");T.stroked="false",T.filled="false",T.appendChild(x),this.root.appendChild(T)}else this.root.appendChild(x);if(u?(C.style.overflow="hidden",C.style.width=Math.round(n)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(i)+"px")):"fill"==h?(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.height=Math.max(0,i)+1+"px"):"width"==h&&(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.maxHeight=Math.max(0,i)+1+"px"),this.rotateHtml&&0!=S){var b=S*(Math.PI/180),w=parseFloat(parseFloat(Math.cos(b)).toFixed(8)),L=parseFloat(parseFloat(Math.sin(-b)).toFixed(8));(b%=2*Math.PI)<0&&(b+=2*Math.PI),(b%=Math.PI)>Math.PI/2&&(b=Math.PI-b);var I=Math.cos(b),A=Math.sin(b);8!=document.documentMode||mxClient.IS_EM||(C.style.display="inline-block",E.style.display="inline-block",g.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var O=C;null!=O.firstChild&&"DIV"==O.firstChild.nodeName&&(O=O.firstChild);var _=O.offsetWidth+3,M=O.offsetHeight;u?(n=Math.min(n,_),M=Math.min(M,i)):n=_,l&&(C.style.width=n+"px"),mxClient.IS_QUIRKS&&(u||"width"==h)&&M>i&&(M=i,C.style.height=M+"px");var R=((i=M)-i*I+n*-A)/2-L*n*(f+.5)+w*i*(v+.5),P=(n-n*I+i*-A)/2+w*n*(f+.5)+L*i*(v+.5);if("group"==x.nodeName&&"DIV"==this.root.nodeName){var N=this.createElement("div");N.style.display="inline-block",N.style.position="absolute",N.style.left=this.format(t+(P-n/2)*m.scale)+"px",N.style.top=this.format(e+(R-i/2)*m.scale)+"px",x.parentNode.appendChild(N),N.appendChild(x)}else{var D=8!=document.documentMode||mxClient.IS_EM?m.scale:1;x.style.left=this.format(t+(P-n/2)*D)+"px",x.style.top=this.format(e+(R-i/2)*D)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+w+", M12="+L+", M21="+-L+", M22="+w+", sizingMethod='auto expand')",E.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(E.style.filter+="alpha(opacity="+100*this.state.alpha+")"),E.appendChild(C),C.style.position="",C.style.visibility=""}else if(8!=document.documentMode||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(x.style.filter="alpha(opacity="+100*this.state.alpha+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),n=C.offsetWidth;M=C.offsetHeight;mxClient.IS_QUIRKS&&u&&M>i&&(M=i,C.style.height=M+"px"),i=M,C.style.visibility="",H.appendChild(C),x.style.left=this.format(t+n*f*this.state.scale)+"px",x.style.top=this.format(e+i*v*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+100*this.state.alpha+")"),g.style.left=100*f+"%",g.style.top=100*v+"%"}else this.plainText(t,e,n,i,mxUtils.htmlEntities(s,!1),r,o,l,a,h,u,d,p)}},mxVmlCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,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=100*m.alpha+"%",c.appendChild(x);var g=this.createVmlElement("path");g.textpathok="true",g.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),c.appendChild(g);var y=this.createVmlElement("textpath");y.style.cssText="v-text-align:"+r,y.style.align=r,y.style.fontFamily=m.fontFamily,y.string=s,y.on="true";var f=m.fontSize*m.scale/this.vmlScale;y.style.fontSize=f+"px",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(y.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(y.style.fontStyle="italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(y.style.textDecoration="underline");var v=f+(s.split("\n").length-1)*f*mxConstants.LINE_HEIGHT,C=0,E=0;if(o==mxConstants.ALIGN_BOTTOM?E=-v/2:o!=mxConstants.ALIGN_MIDDLE&&(E=v/2),null!=d){c.style.rotation=d;var S=d*(Math.PI/180);C=Math.sin(S)*E,E=Math.cos(S)*E}c.appendChild(y),c.style.left=this.format(t-C)+"px",c.style.top=this.format(e+E)+"px",this.root.appendChild(c)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=void 0!==mxVmlCanvas2D?mxVmlCanvas2D:void 0,mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},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);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,n,i){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=t&&null!=e){this.graph.getView().translate;var s=this.graph.getView().scale,r=this.getGuideTolerance(n)*s,o=t.clone();o.x+=e.x,o.y+=e.y;var l=!1,a=null,h=null,u=!1,d=null,p=null,m=r,c=r,x=o.x,g=o.x+o.width,y=o.getCenterX(),f=o.y,v=o.y+o.height,C=o.getCenterY();function i(n,i,s){n+=this.graph.panDx;var r=!1;s&&Math.abs(n-y)<=m?(e.x=n-t.getCenterX(),m=Math.abs(n-y),r=!0):s||(Math.abs(n-x)<=m?(e.x=n-t.x,m=Math.abs(n-x),r=!0):Math.abs(n-g)<=m&&(e.x=n-t.x-t.width,m=Math.abs(n-g),r=!0)),r&&(a=i,h=Math.round(n-this.graph.panDx),null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()))),l=l||r}function A(n,i,s){n+=this.graph.panDy;var r=!1;s&&Math.abs(n-C)<=c?(e.y=n-t.getCenterY(),c=Math.abs(n-C),r=!0):s||(Math.abs(n-f)<=c?(e.y=n-t.y,c=Math.abs(n-f),r=!0):Math.abs(n-v)<=c&&(e.y=n-t.y-t.height,c=Math.abs(n-v),r=!0)),r&&(d=i,p=Math.round(n-this.graph.panDy),null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))),u=u||r}for(var E=0;E<this.states.length;E++){var S=this.states[E];null==S||this.isStateIgnored(S)||(this.horizontal&&(i.call(this,S.x+S.width,S,!1),i.call(this,S.x,S,!1),i.call(this,S.getCenterX(),S,!0)),this.vertical&&(A.call(this,S.y+S.height,S,!1),A.call(this,S.y,S,!1),A.call(this,S.getCenterY(),S,!0)))}this.graph.snapDelta(e,t,!n,l,u);var T=this.graph.container;if(l||null==this.guideX){if(null!=this.guideX){var b=null,w=null;null!=a&&null!=t&&(b=Math.min(t.y+e.y-this.graph.panDy,a.y),w=Math.max(t.y+t.height+e.y-this.graph.panDy,a.y+a.height)),this.guideX.points=null!=b&&null!=w?[new mxPoint(h,b),new mxPoint(h,w)]:[new mxPoint(h,-this.graph.panDy),new mxPoint(h,T.scrollHeight-3-this.graph.panDy)],this.guideX.stroke=this.getGuideColor(a,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw()}}else this.guideX.node.style.visibility="hidden";if(u||null==this.guideY){if(null!=this.guideY){var L=null,I=null;null!=d&&null!=t&&(L=Math.min(t.x+e.x-this.graph.panDx,d.x),I=Math.max(t.x+t.width+e.x-this.graph.panDx,d.x+d.width)),this.guideY.points=null!=L&&null!=I?[new mxPoint(L,p),new mxPoint(I,p)]:[new mxPoint(-this.graph.panDx,p),new mxPoint(T.scrollWidth-3-this.graph.panDx,p)],this.guideY.stroke=this.getGuideColor(d,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()}}else this.guideY.node.style.visibility="hidden";e=this.getDelta(t,a,e.x,d,e.y)}return e},mxGuide.prototype.getDelta=function(t,e,n,i,s){return(this.rounded||null!=e&&null==e.cell)&&(n=Math.floor(t.x+n)-t.x),(this.rounded||null!=i&&null==i.cell)&&(s=Math.floor(t.y+s)-t.y),new mxPoint(n,s)},mxGuide.prototype.getGuideColor=function(t,e){return mxConstants.GUIDE_COLOR},mxGuide.prototype.hide=function(){this.setVisible(!1)},mxGuide.prototype.setVisible=function(t){null!=this.guideX&&(this.guideX.node.style.visibility=t?"visible":"hidden"),null!=this.guideY&&(this.guideY.node.style.visibility=t?"visible":"hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},__mxOutput.mxGuide=void 0!==mxGuide?mxGuide:void 0,mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.antiAlias=!0,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=!0,mxShape.prototype.svgPointerEvents="all",mxShape.prototype.shapePointerEvents=!1,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.outline=!1,mxShape.prototype.visible=!0,mxShape.prototype.useSvgBoundingBox=!1,mxShape.prototype.init=function(t){null==this.node&&(this.node=this.create(t),null!=t&&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=!1,this.flipV=!1},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){var t=this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth;return 1==mxUtils.mod(Math.max(1,Math.round(t*this.scale)),2)?.5:0},mxShape.prototype.create=function(t){return null!=t&&null!=t.ownerSVGElement?this.createSvg(t):8==document.documentMode||!mxClient.IS_VML||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(t):this.createVml(t)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t},mxShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML?this.redrawShape():this.redrawHtmlShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerHTML=""},mxShape.prototype.updateBoundsFromPoints=function(){var t=this.points;if(null!=t&&t.length>0&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e<this.points.length;e++)null!=t[e]&&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),n=t;if(e!=mxConstants.DIRECTION_SOUTH&&e!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()){var i=(n=n.clone()).width;n.width=n.height,n.height=i}var s=this.getLabelMargins(n);if(null!=s){var r="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),o="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);if(null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()){i=s.x;s.x=s.height,s.height=s.width,s.width=s.y,s.y=i,i=r,r=o,o=i}return mxUtils.getDirectedBounds(t,s,this.style,r,o)}return t},mxShape.prototype.getLabelMargins=function(t){return null},mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!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");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.paint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents,t.blockImagePointerEvents=mxClient.IS_FF;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);if(""!=t.tagUrn){var n=Math.max(1,Math.round(this.bounds.width)),i=Math.max(1,Math.round(this.bounds.height));t.coordsize=n*this.vmlScale+","+i*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var s=this.scale;return e.translate(-Math.round(this.bounds.x/s),-Math.round(this.bounds.y/s)),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)),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+")"),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+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var n=this.fill,i=this.gradient,s="0",r={east:0,south:1,west:2,north:3},o=null!=this.direction?r[this.direction]:0;if(null!=this.gradientDirection&&(o=mxUtils.mod(o+r[this.gradientDirection]-1,4)),1==o){s="1";var l=n;n=i,i=l}else if(2==o){l=n;n=i,i=l}else 3==o&&(s="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+i+"', gradientType='"+s+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):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","CSS1Compat"==document.compatMode&&(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 n=t.gradients[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.paint=function(t){var e=!1;if(null!=t&&this.outline){var n=t.stroke;t.stroke=function(){e=!0,n.apply(this,arguments)};var i=t.fillAndStroke;t.fillAndStroke=function(){e=!0,i.apply(this,arguments)}}var s=this.scale,r=this.bounds.x/s,o=this.bounds.y/s,l=this.bounds.width/s,a=this.bounds.height/s;if(this.isPaintBoundsInverted()){var h=(l-a)/2;r+=h,o-=h;var u=l;l=a,a=u}this.updateTransform(t,r,o,l,a),this.configureCanvas(t,r,o,l,a);var d=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&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/s,p.y/s,p.width/s,p.height/s);m.appendChild(t.createTransparentFill()),m.stroked="false",t.root.appendChild(m)}}if(null!=this.stencil)this.stencil.drawShape(t,this,r,o,l,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var c=[],x=0;x<this.points.length;x++)null!=this.points[x]&&c.push(new mxPoint(this.points[x].x/s,this.points[x].y/s));this.paintEdgeShape(t,c)}else this.paintVertexShape(t,r,o,l,a);null!=d&&null!=t.state&&null!=t.state.transform&&d.setAttribute("transform",t.state.transform),null!=t&&this.outline&&!e&&(t.rect(r,o,l,a),t.stroke())},mxShape.prototype.configureCanvas=function(t,e,n,i,s){var r=null;if(null!=this.style&&(r=this.style.dashPattern),t.setAlpha(this.opacity/100),t.setFillAlpha(this.fillOpacity/100),t.setStrokeAlpha(this.strokeOpacity/100),null!=this.isShadow&&t.setShadow(this.isShadow),null!=this.isDashed&&t.setDashed(this.isDashed,null!=this.style&&1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1)),null!=r&&t.setDashPattern(r),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var o=this.getGradientBounds(t,e,n,i,s);t.setGradient(this.fill,this.gradient,o.x,o.y,o.width,o.height,this.gradientDirection)}else t.setFillColor(this.fill);t.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(t,e,n,i,s){return new mxRectangle(e,n,i,s)},mxShape.prototype.updateTransform=function(t,e,n,i,s){t.scale(this.scale),t.rotate(this.getShapeRotation(),this.flipH,this.flipV,e+i/2,n+s/2)},mxShape.prototype.paintVertexShape=function(t,e,n,i,s){this.paintBackground(t,e,n,i,s),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),this.paintForeground(t,e,n,i,s))},mxShape.prototype.paintBackground=function(t,e,n,i,s){},mxShape.prototype.paintForeground=function(t,e,n,i,s){},mxShape.prototype.paintEdgeShape=function(t,e){},mxShape.prototype.getArcSize=function(t,e){var n=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))n=Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;n=Math.min(t*i,e*i)}return n},mxShape.prototype.paintGlassEffect=function(t,e,n,i,s,r){var o=Math.ceil(this.strokewidth/2),l=.4;t.setGradient("#ffffff","#ffffff",e,n,i,.6*s,"south",.9,.1),t.begin(),r+=2*o,this.isRounded?(t.moveTo(e-o+r,n-o),t.quadTo(e-o,n-o,e-o,n-o+r),t.lineTo(e-o,n+s*l),t.quadTo(e+.5*i,n+.7*s,e+i+o,n+s*l),t.lineTo(e+i+o,n-o+r),t.quadTo(e+i+o,n-o,e+i+o-r,n-o)):(t.moveTo(e-o,n-o),t.lineTo(e-o,n+s*l),t.quadTo(e+.5*i,n+.7*s,e+i+o,n+s*l),t.lineTo(e+i+o,n-o)),t.close(),t.fill()},mxShape.prototype.addPoints=function(t,e,n,i,s,r,o){if(null!=e&&e.length>0){o=null==o||o;var l=e[e.length-1];if(s&&n){var a=(e=e.slice())[0],h=new mxPoint(l.x+(a.x-l.x)/2,l.y+(a.y-l.y)/2);e.splice(0,0,h)}var u=e[0],d=1;for(o?t.moveTo(u.x,u.y):t.lineTo(u.x,u.y);d<(s?e.length:e.length-1);){var p=e[mxUtils.mod(d,e.length)],m=u.x-p.x,c=u.y-p.y;if(n&&(0!=m||0!=c)&&(null==r||mxUtils.indexOf(r,d-1)<0)){var x=Math.sqrt(m*m+c*c),g=m*Math.min(i,x/2)/x,y=c*Math.min(i,x/2)/x,f=p.x+g,v=p.y+y;t.lineTo(f,v);for(var C=e[mxUtils.mod(d+1,e.length)];d<e.length-2&&0==Math.round(C.x-p.x)&&0==Math.round(C.y-p.y);)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(i,x/2)/x,S=c*Math.min(i,x/2)/x,T=p.x+E,b=p.y+S;t.quadTo(p.x,p.y,T,b),p=new mxPoint(T,b)}else t.lineTo(p.x,p.y);u=p,d++}s?t.close():t.lineTo(l.x,l.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){if(this.state=t,this.style=t.style,null!=this.style){if(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=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var e=this.flipH;this.flipH=this.flipV,this.flipV=e}this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),this.fill==mxConstants.NONE&&(this.fill=null),this.gradient==mxConstants.NONE&&(this.gradient=null),this.stroke==mxConstants.NONE&&(this.stroke=null)}},mxShape.prototype.setCursor=function(t){null==t&&(t=""),this.cursor=t,null!=this.node&&(this.node.style.cursor=t)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.isRoundable=function(){return!1},mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&null!=this.node&&null!=this.node.ownerSVGElement)try{var t=this.node.getBBox();if(t.width>0&&t.height>0)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){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 null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,n,i){var s=document.createElementNS(mxConstants.NS_SVG,"rect");return s.setAttribute("x",t),s.setAttribute("y",e),s.setAttribute("width",n),s.setAttribute("height",i),s.setAttribute("fill","none"),s.setAttribute("stroke","none"),s.setAttribute("pointer-events","all"),s},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var n=t[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n))}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=void 0!==mxShape?mxShape:void 0,mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,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=null!=t?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&e.length>0){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}}},mxStencil.prototype.parseConstraint=function(t){var e=Number(t.getAttribute("x")),n=Number(t.getAttribute("y")),i="1"==t.getAttribute("perimeter"),s=t.getAttribute("name");return new mxConnectionConstraint(new mxPoint(e,n),i,s)},mxStencil.prototype.evaluateTextAttribute=function(t,e,n){var i=this.evaluateAttribute(t,e,n),s=t.getAttribute("localized");return(mxStencil.defaultLocalized&&null==s||"1"==s)&&(i=mxResources.get(i)),i},mxStencil.prototype.evaluateAttribute=function(t,e,n){var i=t.getAttribute(e);if(null==i){var s=mxUtils.getTextContent(t);if(null!=s&&mxStencil.allowEval){var r=mxUtils.eval(s);"function"==typeof r&&(i=r(n))}}return i},mxStencil.prototype.drawShape=function(t,e,n,i,s,r){var o=t.states.slice(),l=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,null),a=this.computeAspect(e.style,n,i,s,r,l),h=Math.min(a.width,a.height),u="inherit"==this.strokewidth?Number(mxUtils.getNumber(e.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*h;t.setStrokeWidth(u),null!=e.style&&"1"==mxUtils.getValue(e.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(t.setStrokeColor(mxConstants.NONE),t.rect(n,i,s,r),t.stroke(),t.setStrokeColor(e.stroke)),this.drawChildren(t,e,n,i,s,r,this.bgNode,a,!1,!0),this.drawChildren(t,e,n,i,s,r,this.fgNode,a,!0,!e.outline||null==e.style||0==mxUtils.getValue(e.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)),t.states.length!=o.length&&(t.states=o)},mxStencil.prototype.drawChildren=function(t,e,n,i,s,r,o,l,a,h){if(null!=o&&s>0&&r>0)for(var u=o.firstChild;null!=u;)u.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,u,l,a,h),u=u.nextSibling},mxStencil.prototype.computeAspect=function(t,e,n,i,s,r){var o=e,l=n,a=i/this.w0,h=s/this.h0,u=r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH;if(u){h=i/this.h0,a=s/this.w0;var d=(i-s)/2;o+=d,l-=d}return"fixed"==this.aspect&&(a=h=Math.min(a,h),u?(o+=(s-this.w0*a)/2,l+=(i-this.h0*h)/2):(o+=(i-this.w0*a)/2,l+=(s-this.h0*h)/2)),new mxRectangle(o,l,a,h)},mxStencil.prototype.drawNode=function(t,e,n,i,s,r){var o=n.nodeName,l=i.x,a=i.y,h=i.width,u=i.height,d=Math.min(h,u);if("save"==o)t.save();else if("restore"==o)t.restore();else if(r){if("path"==o){t.begin();var p=!0;if("1"==n.getAttribute("rounded")){p=!1;for(var m=Number(n.getAttribute("arcSize")),c=0,x=[],g=n.firstChild;null!=g;){if(g.nodeType==mxConstants.NODETYPE_ELEMENT){var y=g.nodeName;if("move"!=y&&"line"!=y){p=!0;break}"move"!=y&&0!=x.length||x.push([]),x[x.length-1].push(new mxPoint(l+Number(g.getAttribute("x"))*h,a+Number(g.getAttribute("y"))*u)),c++}g=g.nextSibling}if(!p&&c>0)for(var f=0;f<x.length;f++){var v=!1,C=x[f][0],E=x[f][x[f].length-1];C.x==E.x&&C.y==E.y&&(x[f].pop(),v=!0),this.addPoints(t,x[f],!0,m,v)}else p=!0}if(p)for(g=n.firstChild;null!=g;)g.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,g,i,s,r),g=g.nextSibling}else if("close"==o)t.close();else if("move"==o)t.moveTo(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u);else if("line"==o)t.lineTo(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u);else if("quad"==o)t.quadTo(l+Number(n.getAttribute("x1"))*h,a+Number(n.getAttribute("y1"))*u,l+Number(n.getAttribute("x2"))*h,a+Number(n.getAttribute("y2"))*u);else if("curve"==o)t.curveTo(l+Number(n.getAttribute("x1"))*h,a+Number(n.getAttribute("y1"))*u,l+Number(n.getAttribute("x2"))*h,a+Number(n.getAttribute("y2"))*u,l+Number(n.getAttribute("x3"))*h,a+Number(n.getAttribute("y3"))*u);else if("arc"==o)t.arcTo(Number(n.getAttribute("rx"))*h,Number(n.getAttribute("ry"))*u,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u);else if("rect"==o)t.rect(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*u);else if("roundrect"==o){var S=Number(n.getAttribute("arcsize"));0==S&&(S=100*mxConstants.RECTANGLE_ROUNDING_FACTOR);var T=Number(n.getAttribute("w"))*h,b=Number(n.getAttribute("h"))*u,w=Number(S)/100,L=Math.min(T*w,b*w);t.roundrect(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,T,b,L,L)}else if("ellipse"==o)t.ellipse(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*u);else if("image"==o){if(!e.outline){var I=this.evaluateAttribute(n,"src",e);t.image(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*u,I,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV"))}}else if("text"==o){if(!e.outline){var A=this.evaluateTextAttribute(n,"str",e),O="1"==n.getAttribute("vertical")?-90:0;if("0"==n.getAttribute("align-shape")){var _=e.rotation,M=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPH,0),R=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPV,0);M&&R?O-=_:M||R?O+=_:O-=_}O-=n.getAttribute("rotation"),t.text(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,0,0,A,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",null,!1,O)}}else if("include-shape"==o){var P=mxStencilRegistry.getStencil(n.getAttribute("name"));if(null!=P){var N=l+Number(n.getAttribute("x"))*h,D=a+Number(n.getAttribute("y"))*u;T=Number(n.getAttribute("w"))*h,b=Number(n.getAttribute("h"))*u;P.drawShape(t,e,N,D,T,b)}}else if("fillstroke"==o)t.fillAndStroke();else if("fill"==o)t.fill();else if("stroke"==o)t.stroke();else if("strokewidth"==o){var H="1"==n.getAttribute("fixed")?1:d;t.setStrokeWidth(Number(n.getAttribute("width"))*H)}else if("dashed"==o)t.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==o){var G=n.getAttribute("pattern");if(null!=G){var U=G.split(" "),V=[];for(f=0;f<U.length;f++)U[f].length>0&&V.push(Number(U[f])*d);G=V.join(" "),t.setDashPattern(G)}}else"strokecolor"==o?t.setStrokeColor(n.getAttribute("color")):"linecap"==o?t.setLineCap(n.getAttribute("cap")):"linejoin"==o?t.setLineJoin(n.getAttribute("join")):"miterlimit"==o?t.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==o?t.setFillColor(n.getAttribute("color")):"alpha"==o||"fillalpha"==o||"strokealpha"==o?t.setAlpha(n.getAttribute("alpha")):"fontcolor"==o?t.setFontColor(n.getAttribute("color")):"fontstyle"==o?t.setFontStyle(n.getAttribute("style")):"fontfamily"==o?t.setFontFamily(n.getAttribute("family")):"fontsize"==o&&t.setFontSize(Number(n.getAttribute("size"))*d);!s||"fillstroke"!=o&&"fill"!=o&&"stroke"!=o||(s=!1,t.setShadow(!1))}},__mxOutput.mxStencil=void 0!==mxStencil?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=void 0!==mxStencilRegistry?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,n,i,s,r,o,l,a,h){var u=mxMarker.markers[n];return null!=u?u(t,e,n,i,s,r,o,l,a,h):null}};function mxActor(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxCloud(t,e,n,i){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRectangleShape(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxDoubleEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRhombus(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxPolyline(t,e,n){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxArrow(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.spacing=null!=r?r:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=r?r:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c,x,g,y,f,v,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=s?s:"black",this.align=null!=n?n:mxConstants.ALIGN_CENTER,this.valign=null!=i?i:mxConstants.ALIGN_MIDDLE,this.family=null!=r?r:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=l?l:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||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=null==m||m,this.background=c,this.border=x,this.wrap=null!=g&&g,this.clipped=null!=y&&y,this.overflow=null!=f?f:"visible",this.labelPadding=null!=v?v:0,this.textDirection=C,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,n){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxImageShape(t,e,n,i,s){mxShape.call(this),this.bounds=t,this.image=e,this.fill=n,this.stroke=i,this.strokewidth=null!=s?s:1,this.shadow=!1}function mxLabel(t,e,n,i){mxRectangleShape.call(this,t,e,n,i)}function mxCylinder(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxConnector(t,e,n){mxPolyline.call(this,t,e,n)}function mxSwimlane(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,n,i,s,r){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=n?n:0,this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.border=null!=r?r:0}function mxPartitionLayout(t,e,n,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=n||0,this.border=i||0}function mxCompactTreeLayout(t,e,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=n&&n}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,n){mxGraphLayout.call(this,t),this.layouts=e,this.master=n}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}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]))}function mxGraphHierarchyModel(t,e,n,i,s){t.getGraph(),this.tightenToSource=s,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var r=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,r);for(var o=0;o<e.length;o++){for(var l=r[o].connectsAsSource,a=0;a<l.length;a++){var h=l[a],u=h.edges;if(null!=u&&u.length>0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxSwimlaneModel(t,e,n,i,s){t.getGraph(),this.tightenToSource=s,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var r=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,r);for(var o=0;o<e.length;o++){for(var l=r[o].connectsAsSource,a=0;a<l.length;a++){var h=l[a],u=h.edges;if(null!=u&&u.length>0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,n,i,s,r){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=n,this.orientation=i,this.initialX=s,this.parallelEdgeSpacing=r}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}!function(){function t(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();m.x-=d,m.y-=p;var c=i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return s.x+=-r*c-d,s.y+=-o*c-p,function(){e.begin(),e.moveTo(m.x,m.y),e.lineTo(m.x-r-o/t,m.y-o+r/t),i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(m.x-3*r/4,m.y-3*o/4),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.close(),u?e.fillAndStroke():e.stroke()}}}function e(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();return m.x-=d,m.y-=p,s.x+=2*-d,s.y+=2*-p,function(){e.begin(),e.moveTo(m.x-r-o/t,m.y-o+r/t),e.lineTo(m.x,m.y),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.stroke()}}}function n(t,e,n,i,s,r,o,l,a,h){var u=n==mxConstants.ARROW_DIAMOND?.7071:.9862,d=s*a*u,p=r*a*u;s*=o+a,r*=o+a;var m=i.clone();m.x-=d,m.y-=p,i.x+=-s-d,i.y+=-r-p;var c=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(m.x,m.y),t.lineTo(m.x-s/2-r/c,m.y+s/c-r/2),t.lineTo(m.x-s,m.y-r),t.lineTo(m.x-s/2+r/c,m.y-r/2-s/c),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",(function(t,e,n,i,s,r,o,l,a,h){var u=o/2,d=i.clone();return i.x-=s*u,i.y-=r*u,function(){t.ellipse(d.x-u,d.y-u,o,o),h?t.fillAndStroke():t.stroke()}})),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),__mxOutput.mxMarker=void 0!==mxMarker?mxMarker:void 0,mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,n,i,s){var r=i/3;t.moveTo(0,s),t.curveTo(0,3*s/5,0,2*s/5,i/2,2*s/5),t.curveTo(i/2-r,2*s/5,i/2-r,0,i/2,0),t.curveTo(i/2+r,0,i/2+r,2*s/5,i/2,2*s/5),t.curveTo(i,2*s/5,i,3*s/5,i,s),t.close()},__mxOutput.mxActor=void 0!==mxActor?mxActor:void 0,mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,n,i,s){t.moveTo(.25*i,.25*s),t.curveTo(.05*i,.25*s,0,.5*s,.16*i,.55*s),t.curveTo(0,.66*s,.18*i,.9*s,.31*i,.8*s),t.curveTo(.4*i,s,.7*i,s,.8*i,.8*s),t.curveTo(i,.8*s,i,.6*s,.875*i,.5*s),t.curveTo(i,.3*s,.8*i,.1*s,.625*i,.2*s),t.curveTo(.5*i,.05*s,.3*i,.05*s,.25*i,.25*s),t.close()},__mxOutput.mxCloud=void 0!==mxCloud?mxCloud:void 0,mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,n,i,s){var r=!0;if(null!=this.style&&(r="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),r||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(r||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded){var o=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))o=Math.min(i/2,Math.min(s/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(i*l,s*l)}t.roundrect(e,n,i,s,o,o)}else t.rect(e,n,i,s);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,n,i,s){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,n,i,s){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,n,i,s,this.getArcSize(i+this.strokewidth,s+this.strokewidth))},__mxOutput.mxRectangleShape=void 0!==mxRectangleShape?mxRectangleShape:void 0,mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},__mxOutput.mxEllipse=void 0!==mxEllipse?mxEllipse:void 0,mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,n,i,s){if(!this.outline){var r=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(i/5,s/5)));e+=r,n+=r,s-=2*r,(i-=2*r)>0&&s>0&&t.ellipse(e,n,i,s),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=void 0!==mxDoubleEllipse?mxDoubleEllipse:void 0,mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,n,i,s){var r=i/2,o=s/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+r,n),new mxPoint(e+i,n+o),new mxPoint(e+r,n+s),new mxPoint(e,n+o)],this.isRounded,l,!0),t.fillAndStroke()},__mxOutput.mxRhombus=void 0!==mxRhombus?mxRhombus:void 0,mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var n=t.pointerEventsValue;t.pointerEventsValue="stroke",null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=n},mxPolyline.prototype.paintLine=function(t,e,n){var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,n,i,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var n=e[0],i=e.length;t.moveTo(n.x,n.y);for(var s=1;s<i-2;s++){var r=e[s],o=e[s+1],l=(r.x+o.x)/2,a=(r.y+o.y)/2;t.quadTo(r.x,r.y,l,a)}r=e[i-2],o=e[i-1];t.quadTo(r.x,r.y,o.x,o.y),t.stroke()},__mxOutput.mxPolyline=void 0!==mxPolyline?mxPolyline:void 0,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 n=mxConstants.ARROW_SPACING,i=mxConstants.ARROW_WIDTH,s=mxConstants.ARROW_SIZE,r=e[0],o=e[e.length-1],l=o.x-r.x,a=o.y-r.y,h=Math.sqrt(l*l+a*a),u=h-2*n-s,d=l/h,p=a/h,m=u*d,c=u*p,x=i*p/3,g=-i*d/3,y=r.x-x/2+n*d,f=r.y-g/2+n*p,v=y+x,C=f+g,E=v+m,S=C+c,T=E+x,b=S+g,w=T-3*x,L=b-3*g;t.begin(),t.moveTo(y,f),t.lineTo(v,C),t.lineTo(E,S),t.lineTo(T,b),t.lineTo(o.x-n*d,o.y-n*p),t.lineTo(w,L),t.lineTo(w+x,L+g),t.close(),t.fillAndStroke()},__mxOutput.mxArrow=void 0!==mxArrow?mxArrow:void 0,mxUtils.extend(mxArrowConnector,mxShape),mxArrowConnector.prototype.useSvgBoundingBox=!0,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),null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))},mxArrowConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=this.getEdgeWidth();this.isMarkerStart()&&(e=Math.max(e,this.getStartArrowWidth())),this.isMarkerEnd()&&(e=Math.max(e,this.getEndArrowWidth())),t.grow((e/2+this.strokewidth)*this.scale)},mxArrowConnector.prototype.paintEdgeShape=function(t,e){var n=this.strokewidth;this.outline&&(n=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));for(var i=this.getStartArrowWidth()+n,s=this.getEndArrowWidth()+n,r=this.outline?this.getEdgeWidth()+n:this.getEdgeWidth(),o=this.isOpenEnded(),l=this.isMarkerStart(),a=this.isMarkerEnd(),h=o?0:this.arrowSpacing+n/2,u=this.startSize+n,d=this.endSize+n,p=this.isArrowRounded(),m=e[e.length-1],c=1;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,g=e[c].y-e[0].y,y=Math.sqrt(x*x+g*g);if(0!=y){var f,v,C=x/y,E=C,S=g/y,T=S,b=r*S,w=-r*C,L=[];p?t.setLineJoin("round"):e.length>2&&t.setMiterLimit(1.42),t.begin();var I=C,A=S;if(l&&!o)this.paintMarker(t,e[0].x,e[0].y,C,S,u,i,r,h,!0);else{var O=e[0].x+b/2+h*C,_=e[0].y+w/2+h*S,M=e[0].x-b/2+h*C,R=e[0].y-w/2+h*S;o?(t.moveTo(O,_),L.push((function(){t.lineTo(M,R)}))):(t.moveTo(M,R),t.lineTo(O,_))}for(var P=0,N=0,D=0,H=0;H<e.length-2;H++){var G=mxUtils.relativeCcw(e[H].x,e[H].y,e[H+1].x,e[H+1].y,e[H+2].x,e[H+2].y);if(P=e[H+2].x-e[H+1].x,N=e[H+2].y-e[H+1].y,0!=(D=Math.sqrt(P*P+N*N))){var U=C*(E=P/D)+S*(T=N/D),V=Math.max(Math.sqrt((U+1)/2),.04);f=C+E,v=S+T;var B=Math.sqrt(f*f+v*v);if(0!=B){f/=B,v/=B;var F=Math.max(V,Math.min(this.strokewidth/200+.04,.35)),k=0!=G&&p?Math.max(.1,F):Math.max(V,.06),Y=e[H+1].x+v*r/2/k,z=e[H+1].y-f*r/2/k,j=e[H+1].x-v*r/2/k,K=e[H+1].y+f*r/2/k;if(0!=G&&p)if(-1==G){var W=j+S*r,X=K-C*r,q=j+T*r,Z=K-E*r;t.lineTo(W,X),t.quadTo(Y,z,q,Z),function(e,n){L.push((function(){t.lineTo(e,n)}))}(j,K)}else t.lineTo(Y,z),function(e,n){var i=Y-S*r,s=z+C*r,o=Y-T*r,l=z+E*r;L.push((function(){t.quadTo(e,n,i,s)})),L.push((function(){t.lineTo(o,l)}))}(j,K);else t.lineTo(Y,z),function(e,n){L.push((function(){t.lineTo(e,n)}))}(j,K);C=E,S=T}}}if(b=r*T,w=-r*E,a&&!o)this.paintMarker(t,m.x,m.y,-C,-S,d,s,r,h,!1);else{t.lineTo(m.x-h*E+b/2,m.y-h*T+w/2);var $=m.x-h*E-b/2,Q=m.y-h*T-w/2;o?(t.moveTo($,Q),L.splice(0,0,(function(){t.moveTo($,Q)}))):t.lineTo($,Q)}for(H=L.length-1;H>=0;H--)L[H]();o?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),p&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),l&&!o&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,I,A,u,i,r,h,!0),t.stroke(),t.end()),a&&!o&&(t.begin(),this.paintMarker(t,m.x,m.y,-C,-S,d,s,r,h,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,n,i,s,r,o,l,a,h){var u=l/o,d=l*s/2,p=-l*i/2,m=(a+r)*i,c=(a+r)*s;h?t.moveTo(e-d+m,n-p+c):t.lineTo(e-d+m,n-p+c),t.lineTo(e-d/u+m,n-p/u+c),t.lineTo(e+a*i,n+a*s),t.lineTo(e+d/u+m,n+p/u+c),t.lineTo(e+d+m,n+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!1},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=void 0!==mxArrowConnector?mxArrowConnector:void 0,mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var n=this.scale,i=this.bounds.x/n,s=this.bounds.y/n,r=this.bounds.width/n,o=this.bounds.height/n;if(this.updateTransform(t,i,s,r,o),this.configureCanvas(t,i,s,r,o),e)t.updateText(i,s,r,o,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var l=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,a=l||t instanceof mxVmlCanvas2D?"html":"",h=this.value;l||"html"!=a||(h=mxUtils.htmlEntities(h,!1)),"html"!=a||mxUtils.isNode(this.value)||(h=mxUtils.replaceTrailingNewlines(h,"<div><br></div>")),h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==a?h.replace(/\n/g,"<br/>"):h;var u=this.textDirection;u!=mxConstants.TEXT_DIRECTION_AUTO||l||(u=this.getAutoDirection()),u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL&&(u=null),t.text(i,s,r,o,h,this.align,this.valign,this.wrap,a,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("DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML){var t=this.createCanvas();null!=t&&null!=t.updateText?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value: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=!0,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),null!=this.style&&(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 null!=t&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return null!=t&&(t=null==t.ownerSVGElement?this.node.firstChild.firstChild:t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&n==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_MIDDLE)){var s=null,r=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)r=(t=t.firstChild.firstChild.firstChild.firstChild).offsetHeight*this.scale,s="width"==this.overflow?this.boundingBox.width:t.offsetWidth*this.scale;else try{var o=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)||0==o.width&&0==o.height?this.boundingBox=null:this.boundingBox=new mxRectangle(o.x,o.y,o.width,o.height))}catch(t){}else{var l=null!=this.state?this.state.view.textDiv:null;if(null!=this.offsetWidth&&null!=this.offsetHeight)s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale;else{null!=l&&(this.updateFont(l),this.updateSize(l,!1),this.updateInnerHtml(l),t=l);var a=t;if(8!=document.documentMode||mxClient.IS_EM)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild);else{var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap){var u=a.getElementsByTagName("div");u.length>0&&(a=u[u.length-1]),s=a.offsetWidth+2,u=this.node.getElementsByTagName("div"),this.clipped&&(s=Math.min(h,s)),u.length>1&&(u[u.length-2].style.width=s+"px")}}else t.style.whiteSpace="nowrap"}this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight,s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale}}null!=s&&null!=r&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,s,r))}if(null!=this.boundingBox)if(0!=e){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 null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,n,i,s){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;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>"),t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,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")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var n=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(e+="text-decoration: "+n.join(" ")+"; "),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,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),n="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",i=this.getTextCss()+(this.pointerEvents?"pointer-events: all; ":"");mxSvgCanvas2D.createCss(t,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):null,n,i,this.scale,mxUtils.bind(this,(function(t,e,n,i,s,r){var o=this.getTextRotation(),l=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=o?"rotate("+o+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=l&&(l="transform-origin: 0 0; transform: "+l+"; "),""==r?(n+=i,i="display:inline-block; min-width: 100%; "+l):i+=l,this.opacity<100&&(s+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",n);var a=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="<div><div>"+a+"</div></div>"),this.node.firstChild.firstChild.setAttribute("style",s),this.node.firstChild.setAttribute("style",i)})))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,n=this.margin.x,i=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-n+"% "+100*-i+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*n+"%,"+100*i+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+100*n+"%,"+100*i+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(n*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-i*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"<div>&nbsp;</div>"),e='<div style="display:inline-block;_display:inline;">'+(e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e)+"</div>",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,n=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var s=0,r=0,o=null!=this.state?this.state.view.textDiv:null,l=this.node;if(null!=o){o.style.overflow="",o.style.height="",o.style.width="",this.updateFont(o),this.updateSize(o,!1),this.updateInnerHtml(o);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(o.style.whiteSpace="normal",o.style.wordWrap=mxConstants.WORD_WRAP,s=a,this.clipped&&(s=Math.min(s,this.bounds.width)),o.style.width=s+"px"):o.style.whiteSpace="nowrap",null!=(l=o).firstChild&&"DIV"==l.firstChild.nodeName&&(l=l.firstChild,this.wrap&&"break-word"==o.style.wordWrap&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(s=l.offsetWidth+this.textWidthPadding,o.style.width=s+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(r+=3)}else null!=l.firstChild&&"DIV"==l.firstChild.nodeName&&(r=(l=l.firstChild).offsetHeight);s=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));a=this.bounds.width/i;var h=this.bounds.height/i;"fill"==this.overflow?(r=h,s=a):"width"==this.overflow&&(r=l.scrollHeight,s=a),this.offsetWidth=s,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&h>0)?(h=Math.min(h,r),t.height=Math.round(h)+"px"):h=r,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(s=Math.min(a,s)),a=s,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),d=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),p=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));(u%=2*Math.PI)<0&&(u+=2*Math.PI),(u%=Math.PI)>Math.PI/2&&(u=Math.PI-u);var m=Math.cos(u),c=Math.sin(-u),x=a*-(e+.5),g=h*-(n+.5),y=(h-h*m+a*c)/2+p*x-d*g,f=(a-a*m+h*c)/2-d*x-p*g;if(0!=u){var v="progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12="+p+", M21="+-p+", M22="+d+", sizingMethod='auto expand')";null!=t.filter&&t.filter.length>0?t.filter+=" "+v:t.filter=v}n=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?n-=1:this.valign==mxConstants.ALIGN_BOTTOM?n+=2:n+=1),t.zoom=i,t.left=Math.round(this.bounds.x+f-a/2)+"px",t.top=Math.round(this.bounds.y+y-h/2+n)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>"),t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t;var e=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||"width"==this.overflow)null!=e&&(this.node.style.backgroundColor=e),null!=n&&(this.node.style.border="1px solid "+n);else{var i="";null!=e&&(i+="background-color:"+mxUtils.htmlEntities(e)+";"),null!=n&&(i+="border:1px solid "+mxUtils.htmlEntities(n)+";"),t='<div style="zoom:1;'+i+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'">'+t+"</div>"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var r=this.textDirection;r==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(r=this.getAutoDirection()),r==mxConstants.TEXT_DIRECTION_LTR||r==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",r):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,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var n=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),e.textDecoration=n.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var n=Math.max(0,Math.round(this.bounds.width/this.scale)),i=Math.max(0,Math.round(this.bounds.height/this.scale)),s=t.style;if(this.clipped?(s.overflow="hidden",mxClient.IS_QUIRKS?s.width=n+"px":(s.maxHeight=i+"px",s.maxWidth=n+"px")):"fill"==this.overflow?(s.width=n+1+"px",s.height=i+1+"px",s.overflow="hidden"):"width"==this.overflow&&(s.width=n+1+"px",s.maxHeight=i+1+"px",s.overflow="hidden"),this.wrap&&n>0){if(s.wordWrap=mxConstants.WORD_WRAP,s.whiteSpace="normal",s.width=n+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow){var r=t;null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild,"break-word"==t.style.wordWrap&&(r.style.width="100%"));var o=r.offsetWidth;if(0==o){var l=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),o=r.offsetWidth,t.style.visibility="",l.appendChild(t)}o+=3,this.clipped&&(o=Math.min(o,n)),s.width=o+"px"}}else s.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},__mxOutput.mxText=void 0!==mxText?mxText:void 0,mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,.5*s),new mxPoint(0,s)],this.isRounded,r,!0)},__mxOutput.mxTriangle=void 0!==mxTriangle?mxTriangle:void 0,mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*i,0),new mxPoint(.75*i,0),new mxPoint(i,.5*s),new mxPoint(.75*i,s),new mxPoint(.25*i,s),new mxPoint(0,.5*s)],this.isRounded,r,!0)},__mxOutput.mxHexagon=void 0!==mxHexagon?mxHexagon:void 0,mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(t,e,n,i,s){var r=n+s/2;t.begin(),t.moveTo(e,r),t.lineTo(e+i,r),t.stroke()},__mxOutput.mxLine=void 0!==mxLine?mxLine:void 0,mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,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,null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,n,i,s){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,n,i,s){if(null!=this.image){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=r&&(t.setFillColor(r),t.setStrokeColor(o),t.rect(e,n,i,s),t.fillAndStroke()),t.image(e,n,i,s,this.image,this.preserveImageAspect,!1,!1),null!=(o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(o),t.rect(e,n,i,s),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(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="",null!=this.image){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var n=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,i=document.createElement(n?mxClient.VML_PREFIX+":image":"img");i.setAttribute("border","0"),i.style.position="absolute",i.src=this.image;var s=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=s,this.flipH&&this.flipV?s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?s+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),i.style.filter!=s&&(i.style.filter=s),"image"==i.nodeName?i.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(i.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(i.style,"transform",""),i.style.width=this.node.style.width,i.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(i)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=void 0!==mxImageShape?mxImageShape:void 0,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),null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(t,e,n,i,s){this.paintImage(t,e,n,i,s),this.paintIndicator(t,e,n,i,s),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,n,i,s){if(null!=this.image){var r=this.getImageBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:s==mxConstants.ALIGN_RIGHT?t+=n-o-a:t+=a,r==mxConstants.ALIGN_TOP?e+=a:r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.paintIndicator=function(t,e,n,i,s){if(null!=this.indicator)this.indicator.bounds=this.getIndicatorBounds(e,n,i,s),this.indicator.paint(t);else if(null!=this.indicatorImage){var r=this.getIndicatorBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return s==mxConstants.ALIGN_RIGHT?t+=n-o-a:s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:t+=a,r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:r==mxConstants.ALIGN_TOP?e+=a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){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=void 0!==mxLabel?mxLabel:void 0,mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,n,i,s,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,n,i){return Math.min(this.maxHeight,Math.round(i/5))},mxCylinder.prototype.redrawPath=function(t,e,n,i,s,r){var o=this.getCylinderSize(e,n,i,s);(r&&null!=this.fill||!r&&null==this.fill)&&(t.moveTo(0,o),t.curveTo(0,2*o,i,2*o,i,o),r||(t.stroke(),t.begin())),r||(t.moveTo(0,o),t.curveTo(0,-o/3,i,-o/3,i,o),t.lineTo(i,s-o),t.curveTo(i,s+o/3,0,s+o/3,0,s-o),t.close())},__mxOutput.mxCylinder=void 0!==mxCylinder?mxCylinder:void 0,mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED],mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=n&&n(),null!=i&&i()},mxConnector.prototype.createMarker=function(t,e,n){var i=null,s=e.length,r=mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),o=n?e[1]:e[s-2],l=n?e[0]:e[s-1];if(null!=r&&null!=o&&null!=l){for(var a=1;a<s-1&&0==Math.round(o.x-l.x)&&0==Math.round(o.y-l.y);)o=n?e[1+a]:e[s-2-a],a++;var h=l.x-o.x,u=l.y-o.y,d=Math.max(1,Math.sqrt(h*h+u*u)),p=h/d,m=u/d,c=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),x=0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL];i=mxMarker.createMarker(t,this,r,l,p,m,c,n,this.strokewidth,x)}return i},mxConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(e=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),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=void 0!==mxConnector?mxConnector:void 0,mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.isRoundable=function(t,e,n,i,s){return!0},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(),n=new mxRectangle(t.x,t.y,t.width,t.height),i=this.isHorizontal(),s=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),o=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH,l=i==!o,a=!l&&s!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST),h=l&&r!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(o){u=Math.min(n.width,e*this.scale);(a||h)&&(n.x+=n.width-u),n.width=u}else{var u=Math.min(n.height,e*this.scale);(a||h)&&(n.y+=n.height-u),n.height=u}return n},mxSwimlane.prototype.getGradientBounds=function(t,e,n,i,s){var r=this.getTitleSize();return this.isHorizontal()?new mxRectangle(e,n,i,r=Math.min(r,s)):new mxRectangle(e,n,r=Math.min(r,i),s)},mxSwimlane.prototype.getArcSize=function(t,e,n){return n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)*3},mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.paintVertexShape=function(t,e,n,i,s){var r=this.getTitleSize(),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),l=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),a=0;r=this.isHorizontal()?Math.min(r,s):Math.min(r,i),t.translate(e,n),this.isRounded?(a=this.getArcSize(i,s,r),a=Math.min((this.isHorizontal()?s:i)-r,Math.min(r,a)),this.paintRoundedSwimlane(t,e,n,i,s,r,a,o,l)):this.paintSwimlane(t,e,n,i,s,r,o,l);var h=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);if(this.paintSeparator(t,e,n,i,s,r,h),null!=this.image){var u=this.getImageBounds(e,n,i,s);t.image(u.x-e,u.y-n,u.width,u.height,this.image,!1,!1,!1)}this.glass&&(t.setShadow(!1),this.paintGlassEffect(t,0,0,i,r,a))},mxSwimlane.prototype.paintSwimlane=function(t,e,n,i,s,r,o,l){t.begin(),this.isHorizontal()?(t.moveTo(0,r),t.lineTo(0,0),t.lineTo(i,0),t.lineTo(i,r),t.fillAndStroke(),r<s&&(o==mxConstants.NONE?t.pointerEvents=!1:t.setFillColor(o),t.begin(),t.moveTo(0,r),t.lineTo(0,s),t.lineTo(i,s),t.lineTo(i,r),o==mxConstants.NONE?t.stroke():t.fillAndStroke())):(t.moveTo(r,0),t.lineTo(0,0),t.lineTo(0,s),t.lineTo(r,s),t.fillAndStroke(),r<i&&(o==mxConstants.NONE?t.pointerEvents=!1:t.setFillColor(o),t.begin(),t.moveTo(r,0),t.lineTo(i,0),t.lineTo(i,s),t.lineTo(r,s),o==mxConstants.NONE?t.stroke():t.fillAndStroke())),l&&this.paintDivider(t,e,n,i,s,r,o==mxConstants.NONE)},mxSwimlane.prototype.paintRoundedSwimlane=function(t,e,n,i,s,r,o,l,a){t.begin(),this.isHorizontal()?(t.moveTo(i,r),t.lineTo(i,o),t.quadTo(i,0,i-Math.min(i/2,o),0),t.lineTo(Math.min(i/2,o),0),t.quadTo(0,0,0,o),t.lineTo(0,r),t.fillAndStroke(),r<s&&(l==mxConstants.NONE?t.pointerEvents=!1:t.setFillColor(l),t.begin(),t.moveTo(0,r),t.lineTo(0,s-o),t.quadTo(0,s,Math.min(i/2,o),s),t.lineTo(i-Math.min(i/2,o),s),t.quadTo(i,s,i,s-o),t.lineTo(i,r),l==mxConstants.NONE?t.stroke():t.fillAndStroke())):(t.moveTo(r,0),t.lineTo(o,0),t.quadTo(0,0,0,Math.min(s/2,o)),t.lineTo(0,s-Math.min(s/2,o)),t.quadTo(0,s,o,s),t.lineTo(r,s),t.fillAndStroke(),r<i&&(l==mxConstants.NONE?t.pointerEvents=!1:t.setFillColor(l),t.begin(),t.moveTo(r,s),t.lineTo(i-o,s),t.quadTo(i,s,i,s-Math.min(s/2,o)),t.lineTo(i,Math.min(s/2,o)),t.quadTo(i,0,i-o,0),t.lineTo(r,0),l==mxConstants.NONE?t.stroke():t.fillAndStroke())),a&&this.paintDivider(t,e,n,i,s,r,l==mxConstants.NONE)},mxSwimlane.prototype.paintDivider=function(t,e,n,i,s,r,o){o||t.setShadow(!1),t.begin(),this.isHorizontal()?(t.moveTo(0,r),t.lineTo(i,r)):(t.moveTo(r,0),t.lineTo(r,s)),t.stroke()},mxSwimlane.prototype.paintSeparator=function(t,e,n,i,s,r,o){o!=mxConstants.NONE&&(t.setStrokeColor(o),t.setDashed(!0),t.begin(),this.isHorizontal()?(t.moveTo(i,r),t.lineTo(i,s)):(t.moveTo(r,0),t.lineTo(i,0)),t.stroke(),t.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(t,e,n,i){return this.isHorizontal()?new mxRectangle(t+n-this.imageSize,e,this.imageSize,this.imageSize):new mxRectangle(t,e,this.imageSize,this.imageSize)},__mxOutput.mxSwimlane=void 0!==mxSwimlane?mxSwimlane:void 0,mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(t,e,n){},mxGraphLayout.prototype.execute=function(t){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(t,e,n,i){var s=this.graph.view.getState(e),r=null!=s?s.style:this.graph.getCellStyle(e);return null!=r?r[t]:null},mxGraphLayout.traverse=function(t,e,n,i,s){if(null!=n&&null!=t&&(e=null==e||e,!(s=s||new mxDictionary).get(t))){s.put(t,!0);var r=n(t,i);if(null==r||r){var o=this.graph.model.getEdgeCount(t);if(o>0)for(var l=0;l<o;l++){var a=this.graph.model.getEdgeAt(t,l),h=this.graph.model.getTerminal(a,!0)==t;if(!e||h){var u=this.graph.view.getVisibleTerminal(a,!h);this.traverse(u,e,n,a,s)}}}}},mxGraphLayout.prototype.isAncestor=function(t,e,n){if(!n)return this.graph.model.getParent(e)==t;if(e==t)return!1;for(;null!=e&&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)||null==e.getTerminal(t,!0)||null==e.getTerminal(t,!1)},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(null!=t&&t!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,t))for(var i=n.getGeometry(t);t!=this.parent;)e.x=e.x+i.x,e.y=e.y+i.y,t=n.getParent(t),i=n.getGeometry(t)}return e},mxGraphLayout.prototype.setEdgePoints=function(t,e){if(null!=t){var n=this.graph.model,i=n.getGeometry(t);if(null==i?(i=new mxGeometry).setRelative(!0):i=i.clone(),null!=this.parent&&null!=e)for(var s=n.getParent(t),r=this.getParentOffset(s),o=0;o<e.length;o++)e[o].x=e[o].x-r.x,e[o].y=e[o].y-r.y;i.points=e,n.setGeometry(t,i)}},mxGraphLayout.prototype.setVertexLocation=function(t,e,n){var i=this.graph.getModel(),s=i.getGeometry(t),r=null;if(null!=s){if(r=new mxRectangle(e,n,s.width,s.height),this.useBoundingBox){var o=this.graph.getView().getState(t);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var l=this.graph.getView().scale,a=o.text.boundingBox;o.text.boundingBox.x<o.x&&(e+=(o.x-a.x)/l,r.width=a.width),o.text.boundingBox.y<o.y&&(n+=(o.y-a.y)/l,r.height=a.height)}}if(null!=this.parent){var h=i.getParent(t);if(null!=h&&h!=this.parent){var u=this.getParentOffset(h);e-=u.x,n-=u.y}}s.x==e&&s.y==n||((s=s.clone()).x=e,s.y=n,i.setGeometry(t,s))}return r},mxGraphLayout.prototype.getVertexBounds=function(t){var e=this.graph.getModel().getGeometry(t);if(this.useBoundingBox){var n=this.graph.getView().getState(t);if(null!=n&&null!=n.text&&null!=n.text.boundingBox){var i=this.graph.getView().scale,s=n.text.boundingBox,r=Math.max(n.x-s.x,0)/i,o=Math.max(n.y-s.y,0)/i,l=Math.max(s.x+s.width-(n.x+n.width),0)/i,a=Math.max(s.y+s.height-(n.y+n.height),0)/i;e=new mxRectangle(e.x-r,e.y-o,e.width+r+l,e.height+o+a)}}if(null!=this.parent){var h=this.graph.getModel().getParent(t);if(e=e.clone(),null!=h&&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,n,i,s,r){return this.graph.updateGroupBounds(t,e,!0,n,i,s,r)},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.weightedValue>t.weightedValue?-1:e.weightedValue<t.weightedValue?1:e.nudge?-1:1:0},__mxOutput.mxGraphLayout=void 0!==mxGraphLayout?mxGraphLayout:void 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=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeParentMax=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.borderCollapse=!0,mxStackLayout.prototype.allowGaps=!1,mxStackLayout.prototype.gridSize=0,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),s=i.getParent(t),r=this.isHorizontal();if(null!=t&&null!=s){var o=0,l=0,a=i.getChildCount(s),h=r?e:n,u=this.graph.getView().getState(s);for(null!=u&&(h-=r?u.x:u.y),h/=this.graph.view.scale,o=0;o<a;o++){var d=i.getChildAt(s,o);if(d!=t){var p=i.getGeometry(d);if(null!=p){var m=r?p.x+p.width/2:p.y+p.height/2;if(l<=h&&m>h)break;l=m}}}var c=s.getIndex(t);c=Math.max(0,o-(o>c?1:0)),i.add(s,t,c)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),n=e.getGeometry(t);null!=this.graph.container&&(null==n&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return n},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),n=e.getChildCount(t),i=[],s=0;s<n;s++){var r=e.getChildAt(t,s);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}return this.allowGaps&&i.sort(mxUtils.bind(this,(function(t,e){var n=this.graph.getCellGeometry(t),i=this.graph.getCellGeometry(e);return n.y==i.y?0:n.y>i.y>0?1:-1}))),i},mxStackLayout.prototype.snap=function(t){if(null!=this.gridSize&&this.gridSize>0&&(t=Math.max(t,this.gridSize))/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(null!=t){var e=this.getParentSize(t),n=this.isHorizontal(),i=this.graph.getModel(),s=null;null!=e&&(s=n?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),s-=2*this.border;var r=this.x0+this.border+this.marginLeft,o=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var l=this.graph.getCellStyle(t),a=mxUtils.getNumber(l,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(l,mxConstants.STYLE_HORIZONTAL,!0);null!=e&&(a=h?Math.min(a,e.height):Math.min(a,e.width)),n==h&&(s-=a),h?o+=a:r+=a}i.beginUpdate();try{for(var u=0,d=null,p=0,m=null,c=this.getLayoutCells(t),x=0;x<c.length;x++){var g=c[x],y=i.getGeometry(g);if(null!=y){y=y.clone(),null!=this.wrap&&null!=d&&(n&&d.x+d.width+y.width+2*this.spacing>this.wrap||!n&&d.y+d.height+y.height+2*this.spacing>this.wrap)&&(d=null,n?o+=u+this.spacing:r+=u+this.spacing,u=0),u=Math.max(u,n?y.height:y.width);var f=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(g);f=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=d){var C=p+this.spacing+Math.floor(f/2);n?y.x=this.snap((this.allowGaps?Math.max(C,y.x):C)-this.marginLeft)+this.marginLeft:y.y=this.snap((this.allowGaps?Math.max(C,y.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(n?y.x=this.allowGaps&&y.x>r?Math.max(this.snap(y.x-this.marginLeft)+this.marginLeft,r):r:y.y=this.allowGaps&&y.y>o?Math.max(this.snap(y.y-this.marginTop)+this.marginTop,o):o);n?y.y=o:y.x=r,this.fill&&null!=s&&(n?y.height=s:y.width=s),n?y.width=this.snap(y.width):y.height=this.snap(y.height),this.setChildGeometry(g,y),m=g,d=y,p=n?d.x+d.width+Math.floor(f/2):d.y+d.height+Math.floor(f/2)}}this.resizeParent&&null!=e&&null!=d&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,d):this.resizeLast&&null!=e&&null!=d&&null!=m&&(n?d.width=e.width-d.x-this.spacing-this.marginRight-this.marginLeft:d.height=e.height-d.y-this.spacing-this.marginBottom,this.setChildGeometry(m,d))}finally{i.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var n=this.graph.getCellGeometry(t);null!=n&&e.x==n.x&&e.y==n.y&&e.width==n.width&&e.height==n.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,n){var i=this.isHorizontal(),s=this.graph.getModel(),r=e.clone();if(i){var o=n.x+n.width+this.marginRight+this.border;this.resizeParentMax?r.width=Math.max(r.width,o):r.width=o}else{o=n.y+n.height+this.marginBottom+this.border;this.resizeParentMax?r.height=Math.max(r.height,o):r.height=o}e.x==r.x&&e.y==r.y&&e.width==r.width&&e.height==r.height||s.setGeometry(t,r)},__mxOutput.mxStackLayout=void 0!==mxStackLayout?mxStackLayout:void 0,mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),s=i.getParent(t);if(null!=t&&null!=s){var r=0,o=0,l=i.getChildCount(s);for(r=0;r<l;r++){var a=i.getChildAt(s,r),h=this.getVertexBounds(a);if(null!=h){var u=h.x+h.width/2;if(o<e&&u>e)break;o=u}}var d=s.getIndex(t);d=Math.max(0,r-(r>d?1:0)),i.add(s,t,d)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),n=this.graph.getModel(),i=n.getGeometry(t);null!=this.graph.container&&(null==i&&n.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=i){for(var s=[],r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o);!this.isVertexIgnored(l)&&this.isVertexMovable(l)&&s.push(l)}var a=s.length;if(a>0){var h=this.border,u=this.border,d=e?i.height:i.width;d-=2*this.border;var p=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;d-=e?p.height:p.width,h+=p.width,u+=p.height;var m=this.border+(a-1)*this.spacing,c=e?(i.width-h-m)/a:(i.height-u-m)/a;if(c>0){n.beginUpdate();try{for(o=0;o<a;o++){l=s[o];var x=n.getGeometry(l);null!=x&&((x=x.clone()).x=h,x.y=u,e?(this.resizeVertices&&(x.width=c,x.height=d),h+=c+this.spacing):(this.resizeVertices&&(x.height=c,x.width=d),u+=c+this.spacing),n.setGeometry(l,x))}}finally{n.endUpdate()}}}}},__mxOutput.mxPartitionLayout=void 0!==mxPartitionLayout?mxPartitionLayout:void 0,mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.maintainParentLocation=!1,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=!1,mxCompactTreeLayout.prototype.visited=null,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.sortEdges=!1,mxCompactTreeLayout.prototype.alignRanks=!1,mxCompactTreeLayout.prototype.maxRankHeight=null,mxCompactTreeLayout.prototype.root=null,mxCompactTreeLayout.prototype.node=null,mxCompactTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(t,e){this.parent=t;var n=this.graph.getModel();if(null==e)if(this.graph.getEdges(t,n.getParent(t),this.invert,!this.invert,!1).length>0)this.root=t;else{var i=this.graph.findTreeRoots(t,!0,this.invert);if(i.length>0)for(var s=0;s<i.length;s++)if(!this.isVertexIgnored(i[s])&&this.graph.getEdges(i[s],null,this.invert,!this.invert,!1).length>0){this.root=i[s];break}}else this.root=e;if(null!=this.root){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(a=this.graph.getCellGeometry(t))&&(this.parentX=a.x,this.parentY=a.y);n.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var r=this.graph.gridSize,o=r;if(!this.moveTree){var l=this.getVertexBounds(this.root);null!=l&&(r=l.x,o=l.y)}var a,h=null;if(null!=(h=this.isHorizontal()?this.horizontalLayout(this.node,r,o):this.verticalLayout(this.node,null,r,o))){var u=0,d=0;h.x<0&&(u=Math.abs(r-h.x)),h.y<0&&(d=Math.abs(o-h.y)),0==u&&0==d||this.moveNode(this.node,u,d),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(null!=this.parentX&&null!=this.parentY)null!=(a=this.graph.getCellGeometry(t))&&((a=a.clone()).x=this.parentX,a.y=this.parentY,n.setGeometry(t,a))}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,n){t.x+=e,t.y+=n,this.apply(t);for(var i=t.child;null!=i;)this.moveNode(i,e,n),i=i.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var n=new mxDictionary;e.sort((function(e,i){var s=e.getTerminal(e.getTerminal(!1)==t),r=n.get(s);null==r&&(r=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),n.put(s,r));var o=i.getTerminal(i.getTerminal(!1)==t),l=n.get(o);return null==l&&(l=mxCellPath.create(o).split(mxCellPath.PATH_SEPARATOR),n.put(o,l)),mxCellPath.compare(r,l)}))},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]<t.height)&&(this.maxRankHeight[e]=t.height);for(var n=t.child;null!=n;)this.findRankHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.setCellHeights=function(t,e){null!=this.maxRankHeight[e]&&this.maxRankHeight[e]>t.height&&(t.height=this.maxRankHeight[e]);for(var n=t.child;null!=n;)this.setCellHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var n=mxCellPath.create(t),i=null;if(null!=t&&null==this.visited[n]&&!this.isVertexIgnored(t)){this.visited[n]=t,i=this.createNode(t);var s=this.graph.getModel(),r=null,o=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),l=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,o);for(var a=0;a<o.length;a++){var h=o[a];if(!this.isEdgeIgnored(h)){this.resetEdges&&this.setEdgePoints(h,null),this.edgeRouting&&(this.setEdgeStyleEnabled(h,!1),this.setEdgePoints(h,null));var u=l.getState(h),d=null!=u?u.getVisibleTerminal(this.invert):l.getVisibleTerminal(h,this.invert),p=this.dfs(d,e);null!=p&&null!=s.getGeometry(d)&&(null==r?i.child=p:r.next=p,r=p)}}}return i},mxCompactTreeLayout.prototype.layout=function(t){if(null!=t){for(var e=t.child;null!=e;)this.layout(e),e=e.next;null!=t.child?this.attachParent(t,this.join(t)):this.layoutLeaf(t)}},mxCompactTreeLayout.prototype.horizontalLayout=function(t,e,n,i){t.x+=e+t.offsetX,t.y+=n+t.offsetY,i=this.apply(t,i);var s=t.child;if(null!=s){i=this.horizontalLayout(s,t.x,t.y,i);for(var r=t.y+s.offsetY,o=s.next;null!=o;)i=this.horizontalLayout(o,t.x+s.offsetX,r,i),r+=o.offsetY,o=o.next}return i},mxCompactTreeLayout.prototype.verticalLayout=function(t,e,n,i,s){t.x+=n+t.offsetY,t.y+=i+t.offsetX,s=this.apply(t,s);var r=t.child;if(null!=r){s=this.verticalLayout(r,t,t.x,t.y,s);for(var o=t.x+r.offsetY,l=r.next;null!=l;)s=this.verticalLayout(l,t,o,t.y+r.offsetX,s),o+=l.offsetY,l=l.next}return s},mxCompactTreeLayout.prototype.attachParent=function(t,e){var n=this.nodeDistance+this.levelDistance,i=(e-t.width)/2-this.nodeDistance,s=i+t.width+2*this.nodeDistance-e;t.child.offsetX=n+t.height,t.child.offsetY=s,t.contour.upperHead=this.createLine(t.height,0,this.createLine(n,s,t.contour.upperHead)),t.contour.lowerHead=this.createLine(t.height,0,this.createLine(n,i,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,n=t.child;t.contour=n.contour;var i=n.width+e,s=i;for(n=n.next;null!=n;){var r=this.merge(t.contour,n.contour);n.offsetY=r+i,n.offsetX=0,s+=r+(i=n.width+e),n=n.next}return s},mxCompactTreeLayout.prototype.merge=function(t,e){for(var n=0,i=0,s=0,r=t.lowerHead,o=e.upperHead;null!=o&&null!=r;){var l=this.offset(n,i,o.dx,o.dy,r.dx,r.dy);i+=l,s+=l,n+o.dx<=r.dx?(n+=o.dx,i+=o.dy,o=o.next):(n-=r.dx,i-=r.dy,r=r.next)}if(null!=o){var a=this.bridge(t.upperTail,0,0,o,n,i);t.upperTail=null!=a.next?e.upperTail:a,t.lowerTail=e.lowerTail}else{null==(a=this.bridge(e.lowerTail,n,i,r,0,0)).next&&(t.lowerTail=a)}return t.lowerHead=e.lowerHead,s},mxCompactTreeLayout.prototype.offset=function(t,e,n,i,s,r){var o=0;if(s<=t||t+n<=0)return 0;if(s*i-n*r>0)if(t<0)o=t*i/n-e;else if(t>0){o=t*r/s-e}else o=-e;else if(s<t+n){o=r-(e+(s-t)*i/n)}else if(s>t+n){o=(n+t)*r/s-(e+i)}else o=r-(e+i);return o>0?o:0},mxCompactTreeLayout.prototype.bridge=function(t,e,n,i,s,r){var o=s+i.dx-e,l=0;l=0==i.dx?i.dy:o*i.dy/i.dx;var a=this.createLine(o,l,i.next);return t.next=this.createLine(0,r+i.dy-l-n,a),a},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 n=this.getVertexBounds(t);return null!=n&&(this.isHorizontal()?(e.width=n.height,e.height=n.width):(e.width=n.width,e.height=n.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var n=this.graph.getModel(),i=t.cell,s=n.getGeometry(i);if(null!=i&&null!=s){if(this.isVertexMovable(i)&&(s=this.setVertexLocation(i,t.x,t.y),this.resizeParent)){var r=n.getParent(i),o=mxCellPath.create(r);null==this.parentsChanged[o]&&(this.parentsChanged[o]=r)}e=null==e?new mxRectangle(s.x,s.y,s.width,s.height):new mxRectangle(Math.min(e.x,s.x),Math.min(e.y,s.y),Math.max(e.x+e.width,s.x+s.width),Math.max(e.y+e.height,s.y+s.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,n){var i=new Object;return i.dx=t,i.dy=e,i.next=n,i},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,n=t.cell,i=0,s=[];null!=e;){i++;var r=e.x;this.horizontal&&(r=e.y),s.push(new WeightedCellSorter(e,r)),e=e.next}s.sort(WeightedCellSorter.prototype.compare);var o=t.width,l=(i+1)*this.prefHozEdgeSep;o>l+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep);var a=o/i,h=a/2;o>l+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);var u=this.minEdgeJetty-this.prefVertEdgeOff,d=this.getVertexBounds(n);e=t.child;for(var p=0;p<s.length;p++){for(var m=s[p].cell.cell,c=this.getVertexBounds(m),x=this.graph.getEdgesBetween(n,m,!1),g=[],y=0,f=0,v=0;v<x.length;v++)this.horizontal?(y=d.x+d.width,f=d.y+h,g.push(new mxPoint(y,f)),y=d.x+d.width+u,g.push(new mxPoint(y,f)),f=c.y+c.height/2,g.push(new mxPoint(y,f)),this.setEdgePoints(x[v],g)):(y=d.x+h,f=d.y+d.height,g.push(new mxPoint(y,f)),f=d.y+d.height+u,g.push(new mxPoint(y,f)),y=c.x+c.width/2,g.push(new mxPoint(y,f)),this.setEdgePoints(x[v],g));p<i/2?u+=this.prefVertEdgeOff:p>i/2&&(u-=this.prefVertEdgeOff),h+=a}},__mxOutput.mxCompactTreeLayout=void 0!==mxCompactTreeLayout?mxCompactTreeLayout:void 0,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=!1,mxRadialTreeLayout.prototype.sortEdges=!1,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)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var n=null,i=this.getVertexBounds(this.root);for(var s in this.centerX=i.x+i.width/2,this.centerY=i.y+i.height/2,this.visited){var r=this.getVertexBounds(this.visited[s]);(n=null!=n?n:r.clone()).add(r)}this.calcRowDims([this.node],0);for(var o=0,l=0,a=0;a<this.row.length;a++){var h=(this.centerX-this.rowMinX[a]-this.nodeDistance)/this.rowRadi[a],u=(this.rowMaxX[a]-this.centerX-this.nodeDistance)/this.rowRadi[a];o=Math.max(o,h),l=Math.max(l,u)}for(a=0;a<this.row.length;a++)for(var d=this.centerX-this.nodeDistance-o*this.rowRadi[a],p=this.centerX+this.nodeDistance+l*this.rowRadi[a],m=p-d,c=0;c<this.row[a].length;c++){var x=(f=this.row[a])[c],g=((r=this.getVertexBounds(x.cell)).x+r.width/2-d)/m,y=2*Math.PI*g;x.theta=y}for(a=this.row.length-2;a>=0;a--){var f=this.row[a];for(c=0;c<f.length;c++){for(var v=(x=f[c]).child,C=0,E=0;null!=v;)E+=v.theta,C++,v=v.next;if(C>0){var S=E/C;if(S>x.theta&&c<f.length-1){var T=f[c+1].theta;x.theta=Math.min(S,T-Math.PI/10)}else if(S<x.theta&&c>0){var b=f[c-1].theta;x.theta=Math.max(S,b+Math.PI/10)}}}}for(a=0;a<this.row.length;a++)for(c=0;c<this.row[a].length;c++){x=(f=this.row[a])[c],r=this.getVertexBounds(x.cell);this.setVertexLocation(x.cell,this.centerX-r.width/2+this.rowRadi[a]*Math.cos(x.theta),this.centerY-r.height/2+this.rowRadi[a]*Math.sin(x.theta))}},mxRadialTreeLayout.prototype.calcRowDims=function(t,e){if(null!=t&&0!=t.length){this.rowMinX[e]=this.centerX,this.rowMaxX[e]=this.centerX,this.rowMinCenX[e]=this.centerX,this.rowMaxCenX[e]=this.centerX,this.row[e]=[];for(var n=!1,i=0;i<t.length;i++)for(var s=null!=t[i]?t[i].child:null;null!=s;){var r=s.cell,o=this.getVertexBounds(r);this.rowMinX[e]=Math.min(o.x,this.rowMinX[e]),this.rowMaxX[e]=Math.max(o.x+o.width,this.rowMaxX[e]),this.rowMinCenX[e]=Math.min(o.x+o.width/2,this.rowMinCenX[e]),this.rowMaxCenX[e]=Math.max(o.x+o.width/2,this.rowMaxCenX[e]),this.rowRadi[e]=o.y-this.getVertexBounds(this.root).y,null!=s.child&&(n=!0),this.row[e].push(s),s=s.next}n&&this.calcRowDims(this.row[e],e+1)}},__mxOutput.mxRadialTreeLayout=void 0!==mxRadialTreeLayout?mxRadialTreeLayout:void 0,mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,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.vertexArray,mxFastOrganicLayout.prototype.dispX,mxFastOrganicLayout.prototype.dispY,mxFastOrganicLayout.prototype.cellLocation,mxFastOrganicLayout.prototype.radius,mxFastOrganicLayout.prototype.radiusSquared,mxFastOrganicLayout.prototype.isMoveable,mxFastOrganicLayout.prototype.neighbours,mxFastOrganicLayout.prototype.indices,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxFastOrganicLayout.prototype.execute=function(t){var e=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(t),i=0;i<n.length;i++)this.isVertexIgnored(n[i])||this.vertexArray.push(n[i]);var s=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,r=this.vertexArray.length;this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant;for(i=0;i<this.vertexArray.length;i++){var o=this.vertexArray[i];this.cellLocation[i]=[];var l=mxObjectIdentity.get(o);this.indices[l]=i;var a=(y=this.getVertexBounds(o)).width,h=y.height,u=y.x,d=y.y;this.cellLocation[i][0]=u+a/2,this.cellLocation[i][1]=d+h/2,this.radius[i]=Math.min(a,h),this.radiusSquared[i]=this.radius[i]*this.radius[i]}e.beginUpdate();try{for(i=0;i<r;i++){this.dispX[i]=0,this.dispY[i]=0,this.isMoveable[i]=this.isVertexMovable(this.vertexArray[i]);var p=this.graph.getConnections(this.vertexArray[i],t);n=this.graph.getOpposites(p,this.vertexArray[i]);this.neighbours[i]=[];for(var m=0;m<n.length;m++){this.resetEdges&&this.graph.resetEdge(p[m]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[m],!1);l=mxObjectIdentity.get(n[m]);var c=this.indices[l];this.neighbours[i][m]=null!=c?c:i}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(r)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}var x=null,g=null;for(i=0;i<this.vertexArray.length;i++){var y;o=this.vertexArray[i];if(this.isVertexMovable(o))if(null!=(y=this.getVertexBounds(o))){this.cellLocation[i][0]-=y.width/2,this.cellLocation[i][1]-=y.height/2;u=this.graph.snap(Math.round(this.cellLocation[i][0])),d=this.graph.snap(Math.round(this.cellLocation[i][1]));this.setVertexLocation(o,u,d),x=null==x?u:Math.min(x,u),g=null==g?d:Math.min(g,d)}}var f=1-(x||0),v=1-(g||0);null!=s&&(f+=s.x,v+=s.y),this.graph.moveCells(this.vertexArray,f,v)}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]);e<.001&&(e=.001);var n=this.dispX[t]/e*Math.min(e,this.temperature),i=this.dispY[t]/e*Math.min(e,this.temperature);this.dispX[t]=0,this.dispY[t]=0,this.cellLocation[t][0]+=n,this.cellLocation[t][1]+=i}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var t=0;t<this.vertexArray.length;t++)for(var e=0;e<this.neighbours[t].length;e++){var n=this.neighbours[t][e];if(t!=n&&this.isMoveable[t]&&this.isMoveable[n]){var i=this.cellLocation[t][0]-this.cellLocation[n][0],s=this.cellLocation[t][1]-this.cellLocation[n][1],r=i*i+s*s-this.radiusSquared[t]-this.radiusSquared[n];r<this.minDistanceLimitSquared&&(r=this.minDistanceLimitSquared);var o=Math.sqrt(r),l=r/this.forceConstant,a=i/o*l,h=s/o*l;this.dispX[t]-=a,this.dispY[t]-=h,this.dispX[n]+=a,this.dispY[n]+=h}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var t=this.vertexArray.length,e=0;e<t;e++)for(var n=e;n<t;n++){if(!this.allowedToRun)return;if(n!=e&&this.isMoveable[e]&&this.isMoveable[n]){var i=this.cellLocation[e][0]-this.cellLocation[n][0],s=this.cellLocation[e][1]-this.cellLocation[n][1];0==i&&(i=.01+Math.random()),0==s&&(s=.01+Math.random());var r=Math.sqrt(i*i+s*s),o=r-this.radius[e]-this.radius[n];if(o>this.maxDistanceLimit)continue;o<this.minDistanceLimit&&(o=this.minDistanceLimit);var l=this.forceConstantSquared/o,a=i/r*l,h=s/r*l;this.dispX[e]+=a,this.dispY[e]+=h,this.dispX[n]-=a,this.dispY[n]-=h}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},__mxOutput.mxFastOrganicLayout=void 0!==mxFastOrganicLayout?mxFastOrganicLayout:void 0,mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0,i=null,s=null,r=[],o=e.getChildCount(t),l=0;l<o;l++){var a=e.getChildAt(t,l);if(this.isVertexIgnored(a))this.isEdgeIgnored(a)||(this.resetEdges&&this.graph.resetEdge(a),this.disableEdgeStyle&&this.setEdgeStyleEnabled(a,!1));else{r.push(a);var h=this.getVertexBounds(a);i=null==i?h.y:Math.min(i,h.y),s=null==s?h.x:Math.min(s,h.x),n=Math.max(n,Math.max(h.width,h.height))}}var u=this.getRadius(r.length,n);this.moveCircle&&(s=this.x0,i=this.y0),this.circle(r,u,s,i)}finally{e.endUpdate()}},mxCircleLayout.prototype.getRadius=function(t,e){return Math.max(t*e/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(t,e,n,i){for(var s=t.length,r=2*Math.PI/s,o=0;o<s;o++)this.isVertexMovable(t[o])&&this.setVertexLocation(t[o],Math.round(n+e+e*Math.sin(o*r)),Math.round(i+e+e*Math.cos(o*r)))},__mxOutput.mxCircleLayout=void 0!==mxCircleLayout?mxCircleLayout:void 0,mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(t){var e=this.findParallels(t);this.graph.model.beginUpdate();try{for(var n in e){var i=e[n];i.length>1&&this.layout(i)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t){for(var e=this.graph.getModel(),n=[],i=e.getChildCount(t),s=0;s<i;s++){var r=e.getChildAt(t,s);if(!this.isEdgeIgnored(r)){var o=this.getEdgeId(r);null!=o&&(null==n[o]&&(n[o]=[]),n[o].push(r))}}return n},mxParallelEdgeLayout.prototype.getEdgeId=function(t){var e=this.graph.getView(),n=e.getVisibleTerminal(t,!0),i=e.getVisibleTerminal(t,!1);return null!=n&&null!=i?(n=mxObjectIdentity.get(n))>(i=mxObjectIdentity.get(i))?i+"-"+n:n+"-"+i:null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],n=this.graph.getView(),i=this.graph.getModel(),s=i.getGeometry(n.getVisibleTerminal(e,!0)),r=i.getGeometry(n.getVisibleTerminal(e,!1));if(s==r)for(var o=s.x+s.width+this.spacing,l=s.y+s.height/2,a=0;a<t.length;a++)this.route(t[a],o,l),o+=this.spacing;else if(null!=s&&null!=r){var h=s.x+s.width/2,u=s.y+s.height/2,d=r.x+r.width/2-h,p=r.y+r.height/2-u,m=Math.sqrt(d*d+p*p);if(m>0){o=h+d/2,l=u+p/2;var c=p*this.spacing/m,x=d*this.spacing/m;o+=c*(t.length-1)/2,l-=x*(t.length-1)/2;for(a=0;a<t.length;a++)this.route(t[a],o,l),o-=c,l+=x}}},mxParallelEdgeLayout.prototype.route=function(t,e,n){this.graph.isCellMovable(t)&&this.setEdgePoints(t,[new mxPoint(e,n)])},__mxOutput.mxParallelEdgeLayout=void 0!==mxParallelEdgeLayout?mxParallelEdgeLayout:void 0,mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(t,e,n){null!=this.master?this.master.moveCell.apply(this.master,arguments):this.layouts[0].moveCell.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{e.endUpdate()}},__mxOutput.mxCompositeLayout=void 0!==mxCompositeLayout?mxCompositeLayout:void 0,mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(t){for(var e=this.graph.view,n=this.graph.getModel(),i=[],s=[],r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o),a=e.getState(l);null!=a&&(this.isVertexIgnored(l)?this.isEdgeIgnored(l)||i.push(a):s.push(a))}this.placeLabels(s,i)},mxEdgeLabelLayout.prototype.placeLabels=function(t,e){var n=this.graph.getModel();n.beginUpdate();try{for(var i=0;i<e.length;i++){var s=e[i];if(null!=s&&null!=s.text&&null!=s.text.boundingBox)for(var r=0;r<t.length;r++){var o=t[r];null!=o&&this.avoid(s,o)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(t,e){var n=this.graph.getModel(),i=t.text.boundingBox;if(mxUtils.intersects(i,e)){var s=-i.y-i.height+e.y,r=-i.y+e.y+e.height,o=Math.abs(s)<Math.abs(r)?s:r,l=-i.x-i.width+e.x,a=-i.x+e.x+e.width,h=Math.abs(l)<Math.abs(a)?l:a;Math.abs(h)<Math.abs(o)?o=0:h=0;var u=n.getGeometry(t.cell);null!=u&&(null!=(u=u.clone()).offset?(u.offset.x+=h,u.offset.y+=o):u.offset=new mxPoint(h,o),n.setGeometry(t.cell,u))}},__mxOutput.mxEdgeLabelLayout=void 0!==mxEdgeLabelLayout?mxEdgeLabelLayout:void 0,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!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(t){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(t,e){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(t,e){this.isVertex()?this.x[0]=e:this.isEdge()&&(this.x[t-this.minRank-1]=e)},mxGraphAbstractHierarchyCell.prototype.getX=function(t){return this.isVertex()?this.x[0]:this.isEdge()?this.x[t-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(t,e){this.isVertex()?this.y[0]=e:this.isEdge()&&(this.y[t-this.minRank-1]=e)},__mxOutput.mxGraphAbstractHierarchyCell=void 0!==mxGraphAbstractHierarchyCell?mxGraphAbstractHierarchyCell:void 0,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=!1,mxGraphHierarchyNode.prototype.getRankValue=function(t){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(t){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsTarget.length;e++){var n=this.connectsAsTarget[e];-1==n.maxRank||n.maxRank==t+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsSource.length;e++){var n=this.connectsAsSource[e];-1==n.minRank||n.minRank==t-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},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(null!=t&&null!=this.hashCode&&null!=t.hashCode&&this.hashCode.length<t.hashCode.length){if(this.hashCode==t.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var e=0;e<this.hashCode.length;e++)if(this.hashCode[e]!=t.hashCode[e])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},__mxOutput.mxGraphHierarchyNode=void 0!==mxGraphHierarchyNode?mxGraphHierarchyNode:void 0,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=!1,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(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.nextLayerConnectedCells[e]=[],e==this.temp.length-1?this.nextLayerConnectedCells[e].push(this.source):this.nextLayerConnectedCells[e].push(this)}return this.nextLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.previousLayerConnectedCells[e]=[],0==e?this.previousLayerConnectedCells[e].push(this.target):this.previousLayerConnectedCells[e].push(this)}return this.previousLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},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(){return null!=this.edges&&this.edges.length>0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=void 0!==mxGraphHierarchyEdge?mxGraphHierarchyEdge:void 0,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=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),s=0;s<e.length;s++){n[s]=new mxGraphHierarchyNode(e[s]),this.vertexMapper.put(e[s],n[s]);var r=t.getEdges(e[s]);n[s].connectsAsSource=[];for(var o=0;o<r.length;o++){var l=t.getVisibleTerminal(r[o],!1);if(l!=e[s]&&t.graph.model.isVertex(l)&&!t.isVertexIgnored(l)){var a=t.getEdgesBetween(e[s],l,!1),h=t.getEdgesBetween(e[s],l,!0);if(null!=a&&a.length>0&&null==this.edgeMapper.get(a[0])&&2*h.length>=a.length){for(var u=new mxGraphHierarchyEdge(a),d=0;d<a.length;d++){var p=a[d];this.edgeMapper.put(p,u),i.resetEdge(p),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(p,!1),t.setOrthogonalEdge(p,!0))}u.source=n[s],mxUtils.indexOf(n[s].connectsAsSource,u)<0&&n[s].connectsAsSource.push(u)}}}n[s].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var t=[];if(null!=this.roots)for(var e=0;e<this.roots.length;e++){null!=(h=this.vertexMapper.get(this.roots[e]))&&t.push(h)}var n=this.vertexMapper.getValues();for(e=0;e<n.length;e++)n[e].temp[0]=-1;for(var i=t.slice();t.length>0;){var s;d=(h=t[0]).connectsAsTarget,s=h.connectsAsSource;var r=!0,o=this.SOURCESCANSTARTRANK;for(e=0;e<d.length;e++){if(5270620!=(m=d[e]).temp[0]){r=!1;break}var l=m.source;o=Math.min(o,l.temp[0]-1)}if(r){if(h.temp[0]=o,this.maxRank=Math.min(this.maxRank,o),null!=s)for(e=0;e<s.length;e++){(m=s[e]).temp[0]=5270620,-1==(l=m.target).temp[0]&&(t.push(l),l.temp[0]=-2)}t.shift()}else{var a=t.shift();if(t.push(h),a==h&&1==t.length)break}}for(e=0;e<n.length;e++)n[e].temp[0]-=this.maxRank;for(e=0;e<i.length;e++)for(var h,u=0,d=(h=i[e]).connectsAsSource,p=0;p<d.length;p++){var m;l=(m=d[p]).target;h.temp[0]=Math.max(u,l.temp[0]+1),u=h.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 n=null;if(null!=this.roots){var i=this.roots;n=[];for(e=0;e<i.length;e++){var s=i[e],r=this.vertexMapper.get(s);n[e]=r}}this.visit((function(e,n,i,s,r){if((0==r&&n.maxRank<0&&n.minRank<0&&(t[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=t[n.maxRank].length-1),null!=e&&null!=i)&&e.maxRank-n.maxRank>1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o<i.maxRank;o++)t[o].push(i),i.setGeneralPurposeVariable(o,t[o].length-1)}}),n,!1,null)},mxGraphHierarchyModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var s=0;s<e.length;s++){var r=e[s];null!=r&&(null==i&&(i=new Object),n?(r.hashCode=[],r.hashCode[0]=this.dfsCount,r.hashCode[1]=s,this.extendedDfs(null,r,null,t,i,r.hashCode,s,0)):this.dfs(null,r,null,t,i,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(t,e,n,i,s,r){if(null!=e){var o=e.id;if(null==s[o]){s[o]=e,i(t,e,n,r,0);for(var l=e.connectsAsSource.slice(),a=0;a<l.length;a++){var h=l[a],u=h.target;this.dfs(e,u,h,i,s,r+1)}}else i(t,e,n,r,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(t,e,n,i,s,r,o,l){if(null!=e){if(null!=t&&(null==e.hashCode||e.hashCode[0]!=t.hashCode[0])){var a=t.hashCode.length+1;e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=o}var h=e.id;if(null==s[h]){s[h]=e,i(t,e,n,l,0);for(var u=e.connectsAsSource.slice(),d=0;d<u.length;d++){var p=u[d],m=p.target;this.extendedDfs(e,m,p,i,s,e.hashCode,d,l+1)}}else i(t,e,n,l,1)}},__mxOutput.mxGraphHierarchyModel=void 0!==mxGraphHierarchyModel?mxGraphHierarchyModel:void 0,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=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),s=t.swimlanes,r=0;r<e.length;r++){n[r]=new mxGraphHierarchyNode(e[r]),this.vertexMapper.put(e[r],n[r]),n[r].swimlaneIndex=-1;for(var o=0;o<s.length;o++)if(i.model.getParent(e[r])==s[o]){n[r].swimlaneIndex=o;break}var l=t.getEdges(e[r]);n[r].connectsAsSource=[];for(var a=0;a<l.length;a++){var h=t.getVisibleTerminal(l[a],!1);if(h!=e[r]&&t.graph.model.isVertex(h)&&!t.isVertexIgnored(h)){var u=t.getEdgesBetween(e[r],h,!1),d=t.getEdgesBetween(e[r],h,!0);if(null!=u&&u.length>0&&null==this.edgeMapper.get(u[0])&&2*d.length>=u.length){for(var p=new mxGraphHierarchyEdge(u),m=0;m<u.length;m++){var c=u[m];this.edgeMapper.put(c,p),i.resetEdge(c),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(c,!1),t.setOrthogonalEdge(c,!0))}p.source=n[r],mxUtils.indexOf(n[r].connectsAsSource,p)<0&&n[r].connectsAsSource.push(p)}}}n[r].temp[0]=0}},mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var t=[],e=new Object;if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var i=this.vertexMapper.get(this.roots[n]);this.maxChainDfs(null,i,null,e,0),null!=i&&t.push(i)}var s=[],r=[];for(n=this.ranksPerGroup.length-1;n>=0;n--)n==this.ranksPerGroup.length-1?s[n]=0:s[n]=r[n+1]+1,r[n]=s[n]+this.ranksPerGroup[n];this.maxRank=r[0];var o=this.vertexMapper.getValues();for(n=0;n<o.length;n++)o[n].temp[0]=-1;for(;t.length>0;){var l,a;l=(i=t[0]).connectsAsTarget,a=i.connectsAsSource;var h=!0,u=r[0];for(n=0;n<l.length;n++){if(5270620!=(p=l[n]).temp[0]){h=!1;break}var d=p.source;u=Math.min(u,d.temp[0]-1)}if(h){if(u>r[i.swimlaneIndex]&&(u=r[i.swimlaneIndex]),i.temp[0]=u,null!=a)for(n=0;n<a.length;n++){var p;(p=a[n]).temp[0]=5270620,-1==(d=p.target).temp[0]&&(t.push(d),d.temp[0]=-2)}t.shift()}else{var m=t.shift();if(t.push(i),m==i&&1==t.length)break}}},mxSwimlaneModel.prototype.maxChainDfs=function(t,e,n,i,s){if(null!=e){var r=mxCellPath.create(e.cell);if(null==i[r]){i[r]=e;var o=e.swimlaneIndex;(null==this.ranksPerGroup[o]||this.ranksPerGroup[o]<s)&&(this.ranksPerGroup[o]=s);for(var l=e.connectsAsSource.slice(),a=0;a<l.length;a++){var h=l[a],u=h.target;e.swimlaneIndex<u.swimlaneIndex?this.maxChainDfs(e,u,h,mxUtils.clone(i,null,!0),0):e.swimlaneIndex==u.swimlaneIndex&&this.maxChainDfs(e,u,h,mxUtils.clone(i,null,!0),s+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 n=null;if(null!=this.roots){var i=this.roots;n=[];for(e=0;e<i.length;e++){var s=i[e],r=this.vertexMapper.get(s);n[e]=r}}this.visit((function(e,n,i,s,r){if((0==r&&n.maxRank<0&&n.minRank<0&&(t[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=t[n.maxRank].length-1),null!=e&&null!=i)&&e.maxRank-n.maxRank>1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o<i.maxRank;o++)t[o].push(i),i.setGeneralPurposeVariable(o,t[o].length-1)}}),n,!1,null)},mxSwimlaneModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var s=0;s<e.length;s++){var r=e[s];null!=r&&(null==i&&(i=new Object),n?(r.hashCode=[],r.hashCode[0]=this.dfsCount,r.hashCode[1]=s,this.extendedDfs(null,r,null,t,i,r.hashCode,s,0)):this.dfs(null,r,null,t,i,0))}this.dfsCount++}},mxSwimlaneModel.prototype.dfs=function(t,e,n,i,s,r){if(null!=e){var o=e.id;if(null==s[o]){s[o]=e,i(t,e,n,r,0);for(var l=e.connectsAsSource.slice(),a=0;a<l.length;a++){var h=l[a],u=h.target;this.dfs(e,u,h,i,s,r+1)}}else i(t,e,n,r,1)}},mxSwimlaneModel.prototype.extendedDfs=function(t,e,n,i,s,r,o,l){if(null!=e){if(null!=t&&(null==e.hashCode||e.hashCode[0]!=t.hashCode[0])){var a=t.hashCode.length+1;e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=o}var h=e.id;if(null==s[h]){s[h]=e,i(t,e,n,l,0);for(var u=e.connectsAsSource.slice(),d=e.connectsAsTarget.slice(),p=0;p<u.length;p++){var m=(c=u[p]).target;e.swimlaneIndex<=m.swimlaneIndex&&this.extendedDfs(e,m,c,i,s,e.hashCode,p,l+1)}for(p=0;p<d.length;p++){var c;m=(c=d[p]).source;e.swimlaneIndex<m.swimlaneIndex&&this.extendedDfs(e,m,c,i,s,e.hashCode,p,l+1)}}else i(t,e,n,l,1)}},__mxOutput.mxSwimlaneModel=void 0!==mxSwimlaneModel?mxSwimlaneModel:void 0,mxHierarchicalLayoutStage.prototype.execute=function(t){},__mxOutput.mxHierarchicalLayoutStage=void 0!==mxHierarchicalLayoutStage?mxHierarchicalLayoutStage:void 0,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 n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();var i=0,s=this.calculateCrossings(e);for(n=0;n<this.maxIterations&&i<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var r=this.calculateCrossings(e);if(r<s){s=r,i=0;for(var o=0;o<this.nestedBestRanks.length;o++)for(var l=e.ranks[o],a=0;a<l.length;a++){var h=l[a];this.nestedBestRanks[o][h.getGeneralPurposeVariable(o)]=h}}else{i++;for(o=0;o<this.nestedBestRanks.length;o++)for(l=e.ranks[o],a=0;a<l.length;a++){(h=l[a]).setGeneralPurposeVariable(o,a)}}if(0==s)break}var u=[],d=[];for(n=0;n<e.maxRank+1;n++)d[n]=[],u[n]=d[n];for(n=0;n<this.nestedBestRanks.length;n++)for(o=0;o<this.nestedBestRanks[n].length;o++)d[n].push(this.nestedBestRanks[n][o]);e.ranks=u},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(t){for(var e=t.ranks.length,n=0,i=1;i<e;i++)n+=this.calculateRankCrossing(i,t);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(t,e){for(var n=0,i=e.ranks[t],s=e.ranks[t-1],r=[],o=0;o<i.length;o++){for(var l=i[o],a=l.getGeneralPurposeVariable(t),h=l.getPreviousLayerConnectedCells(t),u=[],d=0;d<h.length;d++){var p=h[d].getGeneralPurposeVariable(t-1);u.push(p)}u.sort((function(t,e){return t-e})),r[a]=u}var m=[];for(o=0;o<r.length;o++)m=m.concat(r[o]);for(var c=1;c<s.length;)c<<=1;var x=2*c-1;c-=1;var g=[];for(o=0;o<x;++o)g[o]=0;for(o=0;o<m.length;o++){var y=m[o]+c;for(++g[y];y>0;)y%2&&(n+=g[y+1]),++g[y=y-1>>1]}return n},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var n=!0,i=0;n&&i++<10;){var s=t%2==1&&i%2==1;n=!1;for(var r=0;r<e.ranks.length;r++){for(var o=e.ranks[r],l=[],a=0;a<o.length;a++){var h=o[a],u=h.getGeneralPurposeVariable(r);u<0&&(u=a),l[u]=h}var d=null,p=null,m=null,c=null,x=null,g=null,y=null,f=null,v=null,C=null;for(a=0;a<o.length-1;a++){if(0==a){d=(v=l[a]).getNextLayerConnectedCells(r),p=v.getPreviousLayerConnectedCells(r),x=[],g=[];for(var E=0;E<d.length;E++)x[E]=d[E].getGeneralPurposeVariable(r+1);for(E=0;E<p.length;E++)g[E]=p[E].getGeneralPurposeVariable(r-1)}else d=m,p=c,x=y,g=f,v=C;m=(C=l[a+1]).getNextLayerConnectedCells(r),c=C.getPreviousLayerConnectedCells(r),y=[],f=[];for(E=0;E<m.length;E++)y[E]=m[E].getGeneralPurposeVariable(r+1);for(E=0;E<c.length;E++)f[E]=c[E].getGeneralPurposeVariable(r-1);var S=0,T=0;for(E=0;E<x.length;E++)for(var b=0;b<y.length;b++)x[E]>y[b]&&S++,x[E]<y[b]&&T++;for(E=0;E<g.length;E++)for(b=0;b<f.length;b++)g[E]>f[b]&&S++,g[E]<f[b]&&T++;if(T<S||T==S&&s){var w=v.getGeneralPurposeVariable(r);v.setGeneralPurposeVariable(r,C.getGeneralPurposeVariable(r)),C.setGeneralPurposeVariable(r,w),m=d,c=p,y=x,f=g,C=v,s||(n=!0)}}}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(t,e){var n=t%2==0;if(n)for(var i=e.maxRank-1;i>=0;i--)this.medianRank(i,n);else for(i=1;i<e.maxRank;i++)this.medianRank(i,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(t,e){for(var n=this.nestedBestRanks[t].length,i=[],s=[],r=0;r<n;r++){var o,l,a=this.nestedBestRanks[t][r],h=new MedianCellSorter;h.cell=a,l=e?t+1:t-1,null!=(o=e?a.getNextLayerConnectedCells(t):a.getPreviousLayerConnectedCells(t))&&0!=o.length?(h.medianValue=this.medianValue(o,l),i.push(h)):s[a.getGeneralPurposeVariable(t)]=!0}i.sort(MedianCellSorter.prototype.compare);for(r=0;r<n;r++){if(null==s[r])(a=i.shift().cell).setGeneralPurposeVariable(t,r)}},mxMedianHybridCrossingReduction.prototype.medianValue=function(t,e){for(var n=[],i=0,s=0;s<t.length;s++){var r=t[s];n[i++]=r.getGeneralPurposeVariable(e)}if(n.sort((function(t,e){return t-e})),i%2==1)return n[Math.floor(i/2)];if(2==i)return(n[0]+n[1])/2;var o=i/2,l=n[o-1]-n[0],a=n[i-1]-n[o];return(n[o-1]*a+n[o]*l)/(l+a)},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.medianValue>t.medianValue?-1:e.medianValue<t.medianValue?1:0:0},__mxOutput.mxMedianHybridCrossingReduction=void 0!==mxMedianHybridCrossingReduction?mxMedianHybridCrossingReduction:void 0,mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(t){for(var e=this.layout.getModel(),n=new Object,i=e.vertexMapper.getValues(),s=new Object,r=0;r<i.length;r++)s[i[r].id]=i[r];var o=null;if(null!=e.roots){var l=e.roots;o=[];for(r=0;r<l.length;r++)o[r]=e.vertexMapper.get(l[r])}e.visit((function(t,e,i,r,o){e.isAncestor(t)&&(i.invert(),mxUtils.remove(i,t.connectsAsSource),t.connectsAsTarget.push(i),mxUtils.remove(i,e.connectsAsTarget),e.connectsAsSource.push(i)),n[e.id]=e,delete s[e.id]}),o,!0,null);var a=mxUtils.clone(n,null,!0);e.visit((function(t,e,i,r,o){e.isAncestor(t)&&(i.invert(),mxUtils.remove(i,t.connectsAsSource),e.connectsAsSource.push(i),t.connectsAsTarget.push(i),mxUtils.remove(i,e.connectsAsTarget)),n[e.id]=e,delete s[e.id]}),s,!0,a)},__mxOutput.mxMinimumCycleRemover=void 0!==mxMinimumCycleRemover?mxMinimumCycleRemover:void 0,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=!0,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," : ");for(var n=t.ranks[e],i=0;i<n.length;i++){var s=n[i];mxLog.write(s.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),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var i=0;i<this.maxIterations;i++){if(0!=i&&(this.medianPos(i,e),this.minNode(e)),this.currentXDelta<n){for(var s=0;s<e.ranks.length;s++)for(var r=e.ranks[s],o=0;o<r.length;o++){(l=r[o]).setX(s,l.getGeneralPurposeVariable(s))}n=this.currentXDelta}else for(s=0;s<e.ranks.length;s++)for(r=e.ranks[s],o=0;o<r.length;o++){var l;(l=r[o]).setGeneralPurposeVariable(s,l.getX(s))}this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(t){for(var e=[],n=new mxDictionary,i=[],s=0;s<=t.maxRank;s++){i[s]=t.ranks[s];for(var r=0;r<i[s].length;r++){var o=i[s][r],l=new WeightedCellSorter(o,s);l.rankIndex=r,l.visited=!0,e.push(l),n.put(o,l)}}for(var a=10*e.length,h=0;e.length>0&&h<=a;){var u=e.shift(),d=u.cell,p=u.weightedValue,m=parseInt(u.rankIndex),c=d.getNextLayerConnectedCells(p),x=d.getPreviousLayerConnectedCells(p),g=c.length,y=x.length,f=this.medianXValue(c,p+1),v=this.medianXValue(x,p-1),C=g+y,E=d.getGeneralPurposeVariable(p),S=E;C>0&&(S=(f*g+v*y)/C);var T=!1;if(S<E-1)if(0==m)d.setGeneralPurposeVariable(p,S),T=!0;else{var b=i[p][m-1],w=b.getGeneralPurposeVariable(p);(w=w+b.width/2+this.intraCellSpacing+d.width/2)<S?(d.setGeneralPurposeVariable(p,S),T=!0):w<d.getGeneralPurposeVariable(p)-1&&(d.setGeneralPurposeVariable(p,w),T=!0)}else if(S>E+1){if(m==i[p].length-1)d.setGeneralPurposeVariable(p,S),T=!0;else{var L=i[p][m+1],I=L.getGeneralPurposeVariable(p);(I=I-L.width/2-this.intraCellSpacing-d.width/2)>S?(d.setGeneralPurposeVariable(p,S),T=!0):I>d.getGeneralPurposeVariable(p)+1&&(d.setGeneralPurposeVariable(p,I),T=!0)}}if(T){for(s=0;s<c.length;s++){var A=c[s];null!=(O=n.get(A))&&0==O.visited&&(O.visited=!0,e.push(O))}for(s=0;s<x.length;s++){var O;A=x[s];null!=(O=n.get(A))&&0==O.visited&&(O.visited=!0,e.push(O))}}u.visited=!1,h++}},mxCoordinateAssignment.prototype.medianPos=function(t,e){if(t%2==0)for(var n=e.maxRank;n>0;n--)this.rankMedianPosition(n-1,e,n);else for(n=0;n<e.maxRank-1;n++)this.rankMedianPosition(n+1,e,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(t,e,n){for(var i=e.ranks[t],s=[],r=new Object,o=0;o<i.length;o++){var l=i[o];s[o]=new WeightedCellSorter,s[o].cell=l,s[o].rankIndex=o,r[l.id]=s[o];var a=null;a=n<t?l.getPreviousLayerConnectedCells(t):l.getNextLayerConnectedCells(t),s[o].weightedValue=this.calculatedWeightedValue(l,a)}s.sort(WeightedCellSorter.prototype.compare);for(o=0;o<s.length;o++){var h=s[o].cell,u=(a=null,0);null!=(a=n<t?h.getPreviousLayerConnectedCells(t).slice():h.getNextLayerConnectedCells(t).slice())&&(u=a.length>0?this.medianXValue(a,n):h.getGeneralPurposeVariable(t));for(var d=0,p=-1e8,m=s[o].rankIndex-1;m>=0;){if(null!=(y=r[i[m].id])){var c=y.cell;y.visited?(p=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+h.width/2,m=-1):(d+=c.width+this.intraCellSpacing,m--)}}var x=0,g=1e8;for(m=s[o].rankIndex+1;m<s.length;){var y;if(null!=(y=r[i[m].id])){var f=y.cell;y.visited?(g=f.getGeneralPurposeVariable(t)-f.width/2-this.intraCellSpacing-x-h.width/2,m=s.length):(x+=f.width+this.intraCellSpacing,m++)}}u>=p&&u<=g?h.setGeneralPurposeVariable(t,u):u<p?(h.setGeneralPurposeVariable(t,p),this.currentXDelta+=p-u):u>g&&(h.setGeneralPurposeVariable(t,g),this.currentXDelta+=u-g),s[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var n=0,i=0;i<e.length;i++){var s=e[i];t.isVertex()&&s.isVertex()?n++:t.isEdge()&&s.isEdge()?n+=8:n+=2}return n},mxCoordinateAssignment.prototype.medianXValue=function(t,e){if(0==t.length)return 0;for(var n=[],i=0;i<t.length;i++)n[i]=t[i].getGeneralPurposeVariable(e);if(n.sort((function(t,e){return t-e})),t.length%2==1)return n[Math.floor(t.length/2)];var s=t.length/2;return(n[s-1]+n[s])/2},mxCoordinateAssignment.prototype.initialCoords=function(t,e){this.calculateWidestRank(t,e);for(var n=this.widestRank;n>=0;n--)n<e.maxRank&&this.rankCoordinates(n,t,e);for(n=this.widestRank+1;n<=e.maxRank;n++)n>0&&this.rankCoordinates(n,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,n){for(var i=n.ranks[t],s=0,r=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,o=!1,l=0;l<i.length;l++){var a=i[l];if(a.isVertex()){var h=this.layout.getVertexBounds(a.cell);null!=h?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(a.width=h.width,a.height=h.height):(a.width=h.height,a.height=h.width):o=!0,s=Math.max(s,a.height)}else if(a.isEdge()){var u=1;null!=a.edges?u=a.edges.length:mxLog.warn("edge.edges is null"),a.width=(u-1)*this.parallelEdgeSpacing}r+=a.width/2,a.setX(t,r),a.setGeneralPurposeVariable(t,r),r+=a.width/2,r+=this.intraCellSpacing}1==o&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(t,e){var n=-this.interRankCellSpacing,i=0;this.rankWidths=[],this.rankY=[];for(var s=e.maxRank;s>=0;s--){for(var r=0,o=e.ranks[s],l=this.initialX,a=!1,h=0;h<o.length;h++){var u=o[h];if(u.isVertex()){var d=this.layout.getVertexBounds(u.cell);null!=d?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.width=d.width,u.height=d.height):(u.width=d.height,u.height=d.width):a=!0,r=Math.max(r,u.height)}else if(u.isEdge()){var p=1;null!=u.edges?p=u.edges.length:mxLog.warn("edge.edges is null"),u.width=(p-1)*this.parallelEdgeSpacing}l+=u.width/2,u.setX(s,l),u.setGeneralPurposeVariable(s,l),l+=u.width/2,(l+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=l,this.widestRank=s),this.rankWidths[s]=l}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[s]=n;var m=r/2+i/2+this.interRankCellSpacing;i=r,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+=m:n-=m;for(h=0;h<o.length;h++){o[h].setY(s,n)}}},mxCoordinateAssignment.prototype.minPath=function(t,e){for(var n=e.edgeMapper.getValues(),i=0;i<n.length;i++){var s=n[i];if(!(s.maxRank-s.minRank-1<1)){for(var r=s.getGeneralPurposeVariable(s.minRank+1),o=!0,l=0,a=s.minRank+2;a<s.maxRank;a++){var h=s.getGeneralPurposeVariable(a);r!=h?(o=!1,r=h):l++}if(!o){var u=0,d=0,p=[],m=[],c=s.getGeneralPurposeVariable(s.minRank+1);for(a=s.minRank+1;a<s.maxRank-1;a++){c==(x=s.getX(a+1))||this.repositionValid(e,s,a+1,c)?(p[a-s.minRank-1]=c,u++):(p[a-s.minRank-1]=x,c=x)}c=s.getX(a);for(a=s.maxRank-1;a>s.minRank+1;a--){var x;c==(x=s.getX(a-1))||this.repositionValid(e,s,a-1,c)?(m[a-s.minRank-2]=c,d++):(m[a-s.minRank-2]=s.getX(a-1),c=x)}if(d>l||u>l)if(d>=u)for(a=s.maxRank-2;a>s.minRank;a--)s.setX(a,m[a-s.minRank-1]);else if(u>d)for(a=s.minRank+2;a<s.maxRank;a++)s.setX(a,p[a-s.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(t,e,n,i){for(var s=t.ranks[n],r=-1,o=0;o<s.length;o++)if(e==s[o]){r=o;break}if(r<0)return!1;var l=e.getGeneralPurposeVariable(n);if(i<l){if(0==r)return!0;var a=s[r-1],h=a.getGeneralPurposeVariable(n);return(h=h+a.width/2+this.intraCellSpacing+e.width/2)<=i}if(i>l){if(r==s.length-1)return!0;var u=s[r+1],d=u.getGeneralPurposeVariable(n);return(d=d-u.width/2-this.intraCellSpacing-e.width/2)>=i}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<e.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=-Number.MAX_VALUE;var i=e.vertexMapper.getValues();for(n=0;n<i.length;n++)this.setVertexLocation(i[n]);this.layout.edgeStyle!=mxHierarchicalEdgeStyle.ORTHOGONAL&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.POLYLINE&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.CURVE||this.localEdgeProcessing(e);var s=e.edgeMapper.getValues();for(n=0;n<s.length;n++)this.setEdgePosition(s[n])},mxCoordinateAssignment.prototype.localEdgeProcessing=function(t){for(var e=0;e<t.ranks.length;e++)for(var n=t.ranks[e],i=0;i<n.length;i++){var s=n[i];if(s.isVertex())for(var r=s.getPreviousLayerConnectedCells(e),o=e-1,l=0;l<2;l++){if(o>-1&&o<t.ranks.length&&null!=r&&r.length>0){for(var a=[],h=0;h<r.length;h++){var u=new WeightedCellSorter(r[h],r[h].getX(o));a.push(u)}a.sort(WeightedCellSorter.prototype.compare);var d=s.x[0]-s.width/2,p=d+s.width,m=0,c=[];for(h=0;h<a.length;h++){var x,g=a[h].cell;if(g.isVertex()){x=0==l?s.connectsAsSource:s.connectsAsTarget;for(var y=0;y<x.length;y++)x[y].source!=g&&x[y].target!=g||(m+=x[y].edges.length,c.push(x[y]))}else m+=g.edges.length,c.push(g)}var f=(m+1)*this.prefHozEdgeSep;s.width>f+2*this.prefHozEdgeSep&&(d+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);var v=(p-d)/m,C=d+v/2,E=this.minEdgeJetty-this.prefVertEdgeOff;for(h=0;h<c.length;h++){var S=c[h].edges.length,T=this.jettyPositions[c[h].ids[0]];null==T&&(T=[],this.jettyPositions[c[h].ids[0]]=T),h<m/2?E+=this.prefVertEdgeOff:h>m/2&&(E-=this.prefVertEdgeOff);for(var b=0;b<S;b++)T[4*b+2*l]=C,C+=v,T[4*b+2*l+1]=E}}r=s.getNextLayerConnectedCells(e),o=e+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(t){var e=0;if(101207!=t.temp[0]){var n=t.maxRank,i=t.minRank;n==i&&(n=t.source.maxRank,i=t.target.minRank);for(var s=0,r=this.jettyPositions[t.ids[0]],o=t.isReversed?t.target.cell:t.source.cell,l=this.layout.graph,a=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,h=0;h<t.edges.length;h++){var u=t.edges[h],d=this.layout.getVisibleTerminal(u,!0),p=[],m=t.isReversed;if(d!=o&&(m=!m),null!=r){var c=m?2:0,x=m?a?this.rankBottomY[i]:this.rankTopY[i]:a?this.rankTopY[n]:this.rankBottomY[n],g=r[4*s+1+c];m!=a&&(g=-g),x+=g;var y=r[4*s+c],f=l.model.getTerminal(u,!0);if(this.layout.isPort(f)&&l.model.getParent(f)==d)y=null!=(O=l.view.getState(f))?O.x:d.geometry.x+t.source.width*f.geometry.x;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(y,x)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(y,x+g))):(p.push(new mxPoint(x,y)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(x+g,y)))}var v=t.x.length-1,C=-1,E=-1,S=t.maxRank-1;m&&(v=0,C=t.x.length,E=1,S=t.minRank+1);for(var T=v;t.maxRank!=t.minRank&&T!=C;T+=E){var b=t.x[T]+e,w=(this.rankTopY[S]+this.rankBottomY[S+1])/2,L=(this.rankTopY[S-1]+this.rankBottomY[S])/2;if(m){var I=w;w=L,L=I}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(b,w)),p.push(new mxPoint(b,L))):(p.push(new mxPoint(w,b)),p.push(new mxPoint(L,b))),this.limitX=Math.max(this.limitX,b),S+=E}if(null!=r){c=m?2:0;var A=m?a?this.rankTopY[n]:this.rankBottomY[n]:a?this.rankBottomY[i]:this.rankTopY[i];g=r[4*s+3-c];m!=a&&(g=-g);x=A-g,y=r[4*s+2-c];var O,_=l.model.getTerminal(u,!1),M=this.layout.getVisibleTerminal(u,!1);if(this.layout.isPort(_)&&l.model.getParent(_)==M)y=null!=(O=l.view.getState(_))?O.x:M.geometry.x+t.target.width*_.geometry.x;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(y,x-g)),p.push(new mxPoint(y,x))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(x-g,y)),p.push(new mxPoint(x,y)))}t.isReversed&&this.processReversedEdge(t,u),this.layout.setEdgePoints(u,p),e=0==e?this.parallelEdgeSpacing:e>0?-e:-e+this.parallelEdgeSpacing,s++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,n=t.x[0]-t.width/2,i=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],i),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],i+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,n,i):this.layout.setVertexLocation(e,i,n),this.limitX=Math.max(this.limitX,n+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=void 0!==mxCoordinateAssignment?mxCoordinateAssignment:void 0,mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),n=new Object,i=mxUtils.clone(e.vertexMapper,null,!0),s=null;if(null!=e.roots){var r=e.roots;s=[];for(var o=0;o<r.length;o++)mxCellPath.create(r[o]),s[o]=e.vertexMapper.get(r[o])}e.visit((function(t,e,s,r,o){var l=null!=t&&t.swimlaneIndex==e.swimlaneIndex&&e.isAncestor(t),a=null!=t&&null!=s&&t.swimlaneIndex<e.swimlaneIndex&&s.source==e;l?(s.invert(),mxUtils.remove(s,t.connectsAsSource),e.connectsAsSource.push(s),t.connectsAsTarget.push(s),mxUtils.remove(s,e.connectsAsTarget)):a&&(s.invert(),mxUtils.remove(s,t.connectsAsTarget),e.connectsAsTarget.push(s),t.connectsAsSource.push(s),mxUtils.remove(s,e.connectsAsSource));var h=mxCellPath.create(e.cell);n[h]=e,delete i[h]}),s,!0,null)},__mxOutput.mxSwimlaneOrdering=void 0!==mxSwimlaneOrdering?mxSwimlaneOrdering:void 0;var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function mxSwimlaneLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(t){this.currentEdit=this.createUndoableEdit(),null!=t?this.setRoot(t):this.clear()}function mxRootChange(t,e){this.model=t,this.root=e,this.previous=e}function mxChildChange(t,e,n,i){this.model=t,this.parent=e,this.previous=e,this.child=n,this.index=i,this.previousIndex=i}function mxTerminalChange(t,e,n,i){this.model=t,this.cell=e,this.terminal=n,this.previous=n,this.source=i}function mxValueChange(t,e,n){this.model=t,this.cell=e,this.value=n,this.previous=n}function mxStyleChange(t,e,n){this.model=t,this.cell=e,this.style=n,this.previous=n}function mxGeometryChange(t,e,n){this.model=t,this.cell=e,this.geometry=n,this.previous=n}function mxCollapseChange(t,e,n){this.model=t,this.cell=e,this.collapsed=n,this.previous=n}function mxVisibleChange(t,e,n){this.model=t,this.cell=e,this.visible=n,this.previous=n}function mxCellAttributeChange(t,e,n){this.cell=t,this.attribute=e,this.value=n,this.previous=n}function mxCell(t,e,n){this.value=t,this.setGeometry(e),this.setStyle(n),null!=this.onInit&&this.onInit()}function mxGeometry(t,e,n,i){mxRectangle.call(this,t,e,n,i)}mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.maintainParentLocation=!1,mxHierarchicalLayout.prototype.moveParent=!1,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=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,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 n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,null==e||e instanceof Array||(e=[e]),null!=e||null!=t){if(this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(r=this.graph.getCellGeometry(t))&&(this.parentX=r.x,this.parentY=r.y);if(null!=e){for(var i=[],s=0;s<e.length;s++){(null==t||n.isAncestor(t,e[s]))&&n.isVertex(e[s])&&i.push(e[s])}this.roots=i}n.beginUpdate();try{var r;if(this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY)null!=(r=this.graph.getCellGeometry(t))&&((r=r.clone()).x=this.parentX,r.y=this.parentY,n.setGeometry(t,r))}finally{n.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i=this.graph.model,s=null,r=-1e5;for(var o in e){var l=e[o];if(i.isVertex(l)&&this.graph.isCellVisible(l)){for(var a=this.getEdges(l),h=0,u=0,d=0;d<a.length;d++){this.getVisibleTerminal(a[d],!0)==l?h++:u++}0==u&&h>0&&n.push(l);var p=h-u;p>r&&(r=p,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o);this.isPort(l)?i=i.concat(n.getEdges(l,!0,!0)):!s&&this.graph.isCellVisible(l)||(i=i.concat(n.getEdges(l,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));var a=[];for(o=0;o<i.length;o++){var h=this.getVisibleTerminal(i[o],!0),u=this.getVisibleTerminal(i[o],!1);(h==u||h!=u&&(u==t&&(null==this.parent||this.isAncestor(this.parent,h,this.traverseAncestors))||h==t&&(null==this.parent||this.isAncestor(this.parent,u,this.traverseAncestors))))&&a.push(i[o])}return this.edgesCache.put(t,a),a},mxHierarchicalLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var s=this.graph.view.getState(t),r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==r&&(r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=r&&(this.isPort(r)&&(r=this.graph.model.getParent(r)),n.put(t,r)),r},mxHierarchicalLayout.prototype.run=function(t){var e=[],n=[];if(null==this.roots&&null!=t){var i=Object();this.filterDescendants(t,i),this.roots=[];var s=!0;for(var r in i)if(null!=i[r]){s=!1;break}for(;!s;){for(var o=this.findRoots(t,i),l=0;l<o.length;l++){var a=Object();e.push(a),this.traverse(o[l],!0,null,n,a,e,i)}for(l=0;l<o.length;l++)this.roots.push(o[l]);for(var r in s=!0,i)if(null!=i[r]){s=!1;break}}}else for(l=0;l<this.roots.length;l++){a=Object();e.push(a),this.traverse(this.roots[l],!0,null,n,a,e,null)}var h=0;for(l=0;l<e.length;l++){a=e[l];var u=[];for(var r in a)u.push(a[r]);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 n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),s=0;s<i;s++){var r=n.getChildAt(t,s);this.isPort(r)||this.filterDescendants(r,e)}},mxHierarchicalLayout.prototype.isPort=function(t){return null!=t&&null!=t.geometry&&t.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),s=[],r=0;r<i.length;r++){var o=this.getVisibleTerminal(i[r],!0),l=this.getVisibleTerminal(i[r],!1);(o==t&&l==e||!n&&o==e&&l==t)&&s.push(i[r])}return s},mxHierarchicalLayout.prototype.traverse=function(t,e,n,i,s,r,o){if(null!=t&&null!=i){var l=mxObjectIdentity.get(t);if(null!=i[l]||null!=o&&null==o[l]){if(null==s[l])for(p=0;p<r.length;p++){var a=r[p];if(null!=a[l]){for(var h in a)s[h]=a[h];return r.splice(p,1),s}}}else{null==s[l]&&(s[l]=t),null==i[l]&&(i[l]=t),null!==o&&delete o[l];for(var u=this.getEdges(t),d=[],p=0;p<u.length;p++)d[p]=this.getVisibleTerminal(u[p],!0)==t;for(var p=0;p<u.length;p++)if(!e||d[p]){for(var m=this.getVisibleTerminal(u[p],!d[p]),c=1,x=0;x<u.length;x++)if(x!=p){var g=d[x];this.getVisibleTerminal(u[x],!g)==m&&(g?c++:c--)}c>=0&&(s=this.traverse(m,e,u[p],i,s,r,o))}}}return s},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxHierarchicalLayout=void 0!==mxHierarchicalLayout?mxHierarchicalLayout:void 0,mxSwimlaneLayout.prototype=new mxGraphLayout,mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout,mxSwimlaneLayout.prototype.roots=null,mxSwimlaneLayout.prototype.swimlanes=null,mxSwimlaneLayout.prototype.dummyVertexWidth=50,mxSwimlaneLayout.prototype.resizeParent=!1,mxSwimlaneLayout.prototype.maintainParentLocation=!1,mxSwimlaneLayout.prototype.moveParent=!1,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=!0,mxSwimlaneLayout.prototype.tightenToSource=!0,mxSwimlaneLayout.prototype.disableEdgeStyle=!0,mxSwimlaneLayout.prototype.traverseAncestors=!0,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 n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){if(null==t&&(t=n.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(l=this.graph.getCellGeometry(t))&&(this.parentX=l.x,this.parentY=l.y);this.swimlanes=e;for(var i=[],s=0;s<e.length;s++){var r=this.graph.getChildCells(e[s]);if(null==r||0==r.length){var o=this.graph.insertVertex(e[s],null,null,0,0,this.dummyVertexWidth,0);i.push(o)}}n.beginUpdate();try{var l;if(this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY)null!=(l=this.graph.getCellGeometry(t))&&((l=l.clone()).x=this.parentX,l.y=this.parentY,n.setGeometry(t,l));this.graph.removeCells(i)}finally{n.endUpdate()}}},mxSwimlaneLayout.prototype.updateGroupBounds=function(){var t=[],e=this.model;for(var n in e.edgeMapper)for(var i=e.edgeMapper[n],s=0;s<i.edges.length;s++)t.push(i.edges[s]);var r=this.graph.getBoundingBoxFromGeometry(t,!0),o=[];for(s=0;s<this.swimlanes.length;s++){var l=this.swimlanes[s];if(null!=(c=this.graph.getCellGeometry(l))){var a=this.graph.getChildCells(l),h=this.graph.isSwimlane(l)?this.graph.getStartSize(l):new mxRectangle,u=this.graph.getBoundingBoxFromGeometry(a);o[s]=u;var d=u.y+c.y-h.height-this.parentBorder,p=u.y+c.y+u.height;if(null==r)r=new mxRectangle(0,d,0,p-d);else{r.y=Math.min(r.y,d);var m=Math.max(r.y+r.height,p);r.height=m-r.y}}}for(s=0;s<this.swimlanes.length;s++){var c;l=this.swimlanes[s];if(null!=(c=this.graph.getCellGeometry(l))){a=this.graph.getChildCells(l),h=this.graph.isSwimlane(l)?this.graph.getStartSize(l):new mxRectangle;var x=c.clone(),g=0==s?this.parentBorder:this.interRankCellSpacing/2,y=h.width+g,f=o[s].x-y,v=r.y-this.parentBorder;x.x+=f,x.y=v,x.width=o[s].width+y+this.interRankCellSpacing/2,x.height=r.height+h.height+2*this.parentBorder,this.graph.model.setGeometry(l,x),this.graph.moveCells(a,-f,c.y-v)}}},mxSwimlaneLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i=this.graph.model,s=null,r=-1e5;for(var o in e){var l=e[o];if(null!=l&&i.isVertex(l)&&this.graph.isCellVisible(l)&&i.isAncestor(t,l)){for(var a=this.getEdges(l),h=0,u=0,d=0;d<a.length;d++){var p=this.getVisibleTerminal(a[d],!0);if(p==l){var m=this.getVisibleTerminal(a[d],!1);i.isAncestor(t,m)&&h++}else i.isAncestor(t,p)&&u++}0==u&&h>0&&n.push(l);var c=h-u;c>r&&(r=c,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o);this.isPort(l)?i=i.concat(n.getEdges(l,!0,!0)):!s&&this.graph.isCellVisible(l)||(i=i.concat(n.getEdges(l,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));var a=[];for(o=0;o<i.length;o++){var h=this.getVisibleTerminal(i[o],!0),u=this.getVisibleTerminal(i[o],!1);(h==u||h!=u&&(u==t&&(null==this.parent||this.graph.isValidAncestor(h,this.parent,this.traverseAncestors))||h==t&&(null==this.parent||this.graph.isValidAncestor(u,this.parent,this.traverseAncestors))))&&a.push(i[o])}return this.edgesCache.put(t,a),a},mxSwimlaneLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var s=this.graph.view.getState(t),r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==r&&(r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=r&&(this.isPort(r)&&(r=this.graph.model.getParent(r)),n.put(t,r)),r},mxSwimlaneLayout.prototype.run=function(t){var e=[],n=Object();if(null!=this.swimlanes&&this.swimlanes.length>0&&null!=t){for(var i=Object(),s=0;s<this.swimlanes.length;s++)this.filterDescendants(this.swimlanes[s],i);this.roots=[];var r=!0;for(var o in i)if(null!=i[o]){r=!1;break}for(var l=0;!r&&l<this.swimlanes.length;){var a=this.findRoots(this.swimlanes[l],i);if(0!=a.length){for(s=0;s<a.length;s++){var h=Object();e.push(h),this.traverse(a[s],!0,null,n,h,e,i,l)}for(s=0;s<a.length;s++)this.roots.push(a[s]);for(var o in r=!0,i)if(null!=i[o]){r=!1;break}}else l++}}else for(s=0;s<this.roots.length;s++){h=Object();e.push(h),this.traverse(this.roots[s],!0,null,n,h,e,null)}var u=[];for(var o in n)u.push(n[o]);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 n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&n.getParent(t)!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),s=0;s<i;s++){var r=n.getChildAt(t,s);this.isPort(r)||this.filterDescendants(r,e)}},mxSwimlaneLayout.prototype.isPort=function(t){return!!t.geometry.relative},mxSwimlaneLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),s=[],r=0;r<i.length;r++){var o=this.getVisibleTerminal(i[r],!0),l=this.getVisibleTerminal(i[r],!1);(o==t&&l==e||!n&&o==e&&l==t)&&s.push(i[r])}return s},mxSwimlaneLayout.prototype.traverse=function(t,e,n,i,s,r,o,l){if(null!=t&&null!=i){var a=mxObjectIdentity.get(t);if(null!=i[a]||null!=o&&null==o[a]){if(null==s[a])for(m=0;m<r.length;m++){var h=r[m];if(null!=h[a]){for(var u in h)s[u]=h[u];return r.splice(m,1),s}}}else{null==s[a]&&(s[a]=t),null==i[a]&&(i[a]=t),null!==o&&delete o[a];for(var d=this.getEdges(t),p=this.graph.model,m=0;m<d.length;m++){var c=this.getVisibleTerminal(d[m],!0),x=c==t;x&&(c=this.getVisibleTerminal(d[m],!1));var g=0;for(g=0;g<this.swimlanes.length&&!p.isAncestor(this.swimlanes[g],c);g++);g>=this.swimlanes.length||(g>l||(!e||x)&&g==l)&&(s=this.traverse(c,e,d[m],i,s,r,o,g))}}}return s},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxSwimlaneLayout=void 0!==mxSwimlaneLayout?mxSwimlaneLayout:void 0,mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.ignoreRelativeEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,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;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var n=null;if(null!=t){n=[];for(var i=0;i<t.length;i++)e(t[i])&&n.push(t[i])}return n},mxGraphModel.prototype.getDescendants=function(t){return this.filterDescendants(null,t)},mxGraphModel.prototype.filterDescendants=function(t,e){var n=[];e=e||this.getRoot(),(null==t||t(e))&&n.push(e);for(var i=this.getChildCount(e),s=0;s<i;s++){var r=this.getChildAt(e,s);n=n.concat(this.filterDescendants(t,r))}return n},mxGraphModel.prototype.getRoot=function(t){var e=t||this.root;if(null!=t)for(;null!=t;)e=t,t=this.getParent(t);return e},mxGraphModel.prototype.setRoot=function(t){return this.execute(new mxRootChange(this,t)),t},mxGraphModel.prototype.rootChanged=function(t){var e=this.root;return this.root=t,this.nextId=0,this.cells=null,this.cellAdded(t),e},mxGraphModel.prototype.isRoot=function(t){return null!=t&&this.root==t},mxGraphModel.prototype.isLayer=function(t){return this.isRoot(this.getParent(t))},mxGraphModel.prototype.isAncestor=function(t,e){for(;null!=e&&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 null!=t?t.getParent():null},mxGraphModel.prototype.add=function(t,e,n){if(e!=t&&null!=t&&null!=e){null==n&&(n=this.getChildCount(t));var i=t!=this.getParent(e);this.execute(new mxChildChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParents(e)}return e},mxGraphModel.prototype.cellAdded=function(t){if(null!=t){if(null==t.getId()&&this.createIds&&t.setId(this.createId(t)),null!=t.getId()){var e=this.getCell(t.getId());if(e!=t){for(;null!=e;)t.setId(this.createId(t)),e=this.getCell(t.getId());null==this.cells&&(this.cells=new Object),this.cells[t.getId()]=t}}mxUtils.isNumeric(t.getId())&&(this.nextId=Math.max(this.nextId,t.getId()));for(var n=this.getChildCount(t),i=0;i<n;i++)this.cellAdded(this.getChildAt(t,i))}},mxGraphModel.prototype.createId=function(t){var e=this.nextId;return this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(t,e){e=e||this.getRoot(t);for(var n=this.getChildCount(t),i=0;i<n;i++){var s=this.getChildAt(t,i);this.updateEdgeParents(s,e)}var r=this.getEdgeCount(t),o=[];for(i=0;i<r;i++)o.push(this.getEdgeAt(t,i));for(i=0;i<o.length;i++){var l=o[i];this.isAncestor(e,l)&&this.updateEdgeParent(l,e)}},mxGraphModel.prototype.updateEdgeParent=function(t,e){for(var n=this.getTerminal(t,!0),i=this.getTerminal(t,!1),s=null;null!=n&&!this.isEdge(n)&&null!=n.geometry&&n.geometry.relative;)n=this.getParent(n);for(;null!=i&&this.ignoreRelativeEdgeParent&&!this.isEdge(i)&&null!=i.geometry&&i.geometry.relative;)i=this.getParent(i);if(this.isAncestor(e,n)&&this.isAncestor(e,i)&&null!=(s=n==i?this.getParent(n):this.getNearestCommonAncestor(n,i))&&(this.getParent(s)!=this.root||this.isAncestor(s,t))&&this.getParent(t)!=s){var r=this.getGeometry(t);if(null!=r){var o=this.getOrigin(this.getParent(t)),l=this.getOrigin(s),a=l.x-o.x,h=l.y-o.y;(r=r.clone()).translate(-a,-h),this.setGeometry(t,r)}this.add(s,t,this.getChildCount(s))}},mxGraphModel.prototype.getOrigin=function(t){var e=null;if(null!=t){if(e=this.getOrigin(this.getParent(t)),!this.isEdge(t)){var n=this.getGeometry(t);null!=n&&(e.x+=n.x,e.y+=n.y)}}else e=new mxPoint;return e},mxGraphModel.prototype.getNearestCommonAncestor=function(t,e){if(null!=t&&null!=e){var n=mxCellPath.create(e);if(null!=n&&n.length>0){var i=t,s=mxCellPath.create(i);if(n.length<s.length){i=e;var r=s;s=n,n=r}for(;null!=i;){var o=this.getParent(i);if(0==n.indexOf(s+mxCellPath.PATH_SEPARATOR)&&null!=o)return i;s=mxCellPath.getParentPath(s),i=o}}}return null},mxGraphModel.prototype.remove=function(t){return t==this.root?this.setRoot(null):null!=this.getParent(t)&&this.execute(new mxChildChange(this,null,t)),t},mxGraphModel.prototype.cellRemoved=function(t){if(null!=t&&null!=this.cells){for(var e=this.getChildCount(t)-1;e>=0;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,n){var i=this.getParent(t);if(null!=e)e==i&&i.getIndex(t)==n||e.insert(t,n);else if(null!=i){var s=i.getIndex(t);i.remove(s)}var r=this.contains(e),o=this.contains(i);return r&&!o?this.cellAdded(t):o&&!r&&this.cellRemoved(t),i},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,n){e=null!=e&&e,n=null!=n&&n;for(var i=this.getChildCount(t),s=[],r=0;r<i;r++){var o=this.getChildAt(t,r);(!n&&!e||n&&this.isEdge(o)||e&&this.isVertex(o))&&s.push(o)}return s},mxGraphModel.prototype.getTerminal=function(t,e){return null!=t?t.getTerminal(e):null},mxGraphModel.prototype.setTerminal=function(t,e,n){var i=e!=this.getTerminal(t,n);return this.execute(new mxTerminalChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParent(t,this.getRoot()),e},mxGraphModel.prototype.setTerminals=function(t,e,n){this.beginUpdate();try{this.setTerminal(t,e,!0),this.setTerminal(t,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(t,e,n){var i=this.getTerminal(t,n);return null!=e?e.insertEdge(t,n):null!=i&&i.removeEdge(t,n),i},mxGraphModel.prototype.getEdgeCount=function(t){return null!=t?t.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(t,e){return null!=t?t.getEdgeAt(e):null},mxGraphModel.prototype.getDirectedEdgeCount=function(t,e,n){for(var i=0,s=this.getEdgeCount(t),r=0;r<s;r++){var o=this.getEdgeAt(t,r);o!=n&&this.getTerminal(o,e)==t&&i++}return i},mxGraphModel.prototype.getConnections=function(t){return this.getEdges(t,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(t){return this.getEdges(t,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(t){return this.getEdges(t,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(t,e,n,i){e=null==e||e,n=null==n||n,i=null==i||i;for(var s=this.getEdgeCount(t),r=[],o=0;o<s;o++){var l=this.getEdgeAt(t,o),a=this.getTerminal(l,!0),h=this.getTerminal(l,!1);(i&&a==h||a!=h&&(e&&h==t||n&&a==t))&&r.push(l)}return r},mxGraphModel.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;var i=this.getEdgeCount(t),s=this.getEdgeCount(e),r=t,o=i;s<i&&(o=s,r=e);for(var l=[],a=0;a<o;a++){var h=this.getEdgeAt(r,a),u=this.getTerminal(h,!0),d=this.getTerminal(h,!1);(u==t&&d==e||!n&&(d==t&&u==e))&&l.push(h)}return l},mxGraphModel.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var s=[];if(null!=t)for(var r=0;r<t.length;r++){var o=this.getTerminal(t[r],!0),l=this.getTerminal(t[r],!1);o==e&&null!=l&&l!=e&&i?s.push(l):l==e&&null!=o&&o!=e&&n&&s.push(o)}return s},mxGraphModel.prototype.getTopmostCells=function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.put(t[i],!0);for(i=0;i<t.length;i++){for(var s=t[i],r=!0,o=this.getParent(s);null!=o;){if(e.get(o)){r=!1;break}o=this.getParent(o)}r&&n.push(s)}return n},mxGraphModel.prototype.isVertex=function(t){return null!=t&&t.isVertex()},mxGraphModel.prototype.isEdge=function(t){return null!=t&&t.isEdge()},mxGraphModel.prototype.isConnectable=function(t){return null!=t&&t.isConnectable()},mxGraphModel.prototype.getValue=function(t){return null!=t?t.getValue():null},mxGraphModel.prototype.setValue=function(t,e){return this.execute(new mxValueChange(this,t,e)),e},mxGraphModel.prototype.valueForCellChanged=function(t,e){return t.valueChanged(e)},mxGraphModel.prototype.getGeometry=function(t){return null!=t?t.getGeometry():null},mxGraphModel.prototype.setGeometry=function(t,e){return e!=this.getGeometry(t)&&this.execute(new mxGeometryChange(this,t,e)),e},mxGraphModel.prototype.geometryForCellChanged=function(t,e){var n=this.getGeometry(t);return t.setGeometry(e),n},mxGraphModel.prototype.getStyle=function(t){return null!=t?t.getStyle():null},mxGraphModel.prototype.setStyle=function(t,e){return e!=this.getStyle(t)&&this.execute(new mxStyleChange(this,t,e)),e},mxGraphModel.prototype.styleForCellChanged=function(t,e){var n=this.getStyle(t);return t.setStyle(e),n},mxGraphModel.prototype.isCollapsed=function(t){return null!=t&&t.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(t,e){return e!=this.isCollapsed(t)&&this.execute(new mxCollapseChange(this,t,e)),e},mxGraphModel.prototype.collapsedStateForCellChanged=function(t,e){var n=this.isCollapsed(t);return t.setCollapsed(e),n},mxGraphModel.prototype.isVisible=function(t){return null!=t&&t.isVisible()},mxGraphModel.prototype.setVisible=function(t,e){return e!=this.isVisible(t)&&this.execute(new mxVisibleChange(this,t,e)),e},mxGraphModel.prototype.visibleStateForCellChanged=function(t,e){var n=this.isVisible(t);return t.setVisible(e),n},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)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,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=!1}}},mxGraphModel.prototype.createUndoableEdit=function(t){var e=new mxUndoableEdit(this,null==t||t);return 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))},e},mxGraphModel.prototype.mergeChildren=function(t,e,n){n=null==n||n,this.beginUpdate();try{var i=new Object;for(var s in this.mergeChildrenImpl(t,e,n,i),i){var r=i[s],o=this.getTerminal(r,!0);null!=o&&(o=i[mxCellPath.create(o)],this.setTerminal(r,o,!0)),null!=(o=this.getTerminal(r,!1))&&(o=i[mxCellPath.create(o)],this.setTerminal(r,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(t,e,n,i){this.beginUpdate();try{for(var s=t.getChildCount(),r=0;r<s;r++){var o=t.getChildAt(r);if("function"==typeof o.getId){var l=o.getId(),a=null==l||this.isEdge(o)&&n?null:this.getCell(l);if(null==a){var h=o.clone();h.setId(l),h.setTerminal(o.getTerminal(!0),!0),h.setTerminal(o.getTerminal(!1),!1),a=e.insert(h),this.cellAdded(a)}i[mxCellPath.create(o)]=a,this.mergeChildrenImpl(o,a,n,i)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(t){var e=[];if(null!=t)for(var n=new mxDictionary,i=0;i<t.length;i++){var s=this.getParent(t[i]);null==s||n.get(s)||(n.put(s,!0),e.push(s))}return e},mxGraphModel.prototype.cloneCell=function(t){return null!=t?this.cloneCells([t],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(t,e,n){n=null!=n?n:new Object;for(var i=[],s=0;s<t.length;s++)null!=t[s]?i.push(this.cloneCellImpl(t[s],n,e)):i.push(null);for(s=0;s<i.length;s++)null!=i[s]&&this.restoreClone(i[s],t[s],n);return i},mxGraphModel.prototype.cloneCellImpl=function(t,e,n){var i=mxObjectIdentity.get(t),s=e[i];if(null==s&&(s=this.cellCloned(t),e[i]=s,n))for(var r=this.getChildCount(t),o=0;o<r;o++){var l=this.cloneCellImpl(this.getChildAt(t,o),e,!0);s.insert(l)}return s},mxGraphModel.prototype.cellCloned=function(t){return t.clone()},mxGraphModel.prototype.restoreClone=function(t,e,n){var i=this.getTerminal(e,!0);null!=i&&(null!=(s=n[mxObjectIdentity.get(i)])&&s.insertEdge(t,!0));var s,r=this.getTerminal(e,!1);null!=r&&(null!=(s=n[mxObjectIdentity.get(r)])&&s.insertEdge(t,!1));for(var o=this.getChildCount(t),l=0;l<o;l++)this.restoreClone(this.getChildAt(t,l),this.getChildAt(e,l),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){if(null!=this.child){var t=this.model.getParent(this.child),e=null!=t?t.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),t=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=t,this.index=this.previousIndex,this.previousIndex=e}},mxChildChange.prototype.connect=function(t,e){e=null==e||e;var n=t.getTerminal(!0),i=t.getTerminal(!1);null!=n&&(e?this.model.terminalForCellChanged(t,n,!0):this.model.terminalForCellChanged(t,null,!0)),null!=i&&(e?this.model.terminalForCellChanged(t,i,!1):this.model.terminalForCellChanged(t,null,!1)),t.setTerminal(n,!0),t.setTerminal(i,!1);for(var s=this.model.getChildCount(t),r=0;r<s;r++)this.connect(this.model.getChildAt(t,r),e)},mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))},mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))},mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))},mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))},mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))},mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))},mxCellAttributeChange.prototype.execute=function(){if(null!=this.cell){var t=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=t}},__mxOutput.mxGraphModel=void 0!==mxGraphModel?mxGraphModel:void 0,mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,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();return this.setValue(t),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 0!=this.vertex},mxCell.prototype.setVertex=function(t){this.vertex=t},mxCell.prototype.isEdge=function(){return 0!=this.edge},mxCell.prototype.setEdge=function(t){this.edge=t},mxCell.prototype.isConnectable=function(){return 0!=this.connectable},mxCell.prototype.setConnectable=function(t){this.connectable=t},mxCell.prototype.isVisible=function(){return 0!=this.visible},mxCell.prototype.setVisible=function(t){this.visible=t},mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed},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){return e?this.source=t:this.target=t,t},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(t){return mxUtils.indexOf(this.children,t)},mxCell.prototype.getChildAt=function(t){return null==this.children?null:this.children[t]},mxCell.prototype.insert=function(t,e){return null!=t&&(null==e&&(e=this.getChildCount(),t.getParent()==this&&e--),t.removeFromParent(),t.setParent(this),null==this.children?(this.children=[],this.children.push(t)):this.children.splice(e,0,t)),t},mxCell.prototype.remove=function(t){var e=null;return null!=this.children&&t>=0&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(null!=t){if(t.getTerminal(!e)!=this&&null!=this.edges){var n=this.getEdgeIndex(t);n>=0&&this.edges.splice(n,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var n=this.getValue(),i=null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(t):null;return null!=i?i:e},mxCell.prototype.setAttribute=function(t,e){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=void 0!==mxCell?mxCell:void 0,mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){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){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var n=mxUtils.toRadians(t),i=Math.cos(n),s=Math.sin(n);if(!this.relative){var r=new mxPoint(this.getCenterX(),this.getCenterY()),o=mxUtils.getRotatedPoint(r,i,s,e);this.x=Math.round(o.x-this.width/2),this.y=Math.round(o.y-this.height/2)}if(null!=this.sourcePoint){o=mxUtils.getRotatedPoint(this.sourcePoint,i,s,e);this.sourcePoint.x=Math.round(o.x),this.sourcePoint.y=Math.round(o.y)}if(null!=this.targetPoint){o=mxUtils.getRotatedPoint(this.targetPoint,i,s,e);this.targetPoint.x=Math.round(o.x),this.targetPoint.y=Math.round(o.y)}if(null!=this.points)for(var l=0;l<this.points.length;l++)if(null!=this.points[l]){o=mxUtils.getRotatedPoint(this.points[l],i,s,e);this.points[l].x=Math.round(o.x),this.points[l].y=Math.round(o.y)}},mxGeometry.prototype.translate=function(t,e){if(t=parseFloat(t),e=parseFloat(e),this.relative||(this.x=parseFloat(this.x)+t,this.y=parseFloat(this.y)+e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+t,this.targetPoint.y=parseFloat(this.targetPoint.y)+e),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=0;n<this.points.length;n++)null!=this.points[n]&&(this.points[n].x=parseFloat(this.points[n].x)+t,this.points[n].y=parseFloat(this.points[n].y)+e)},mxGeometry.prototype.scale=function(t,e,n){if(t=parseFloat(t),e=parseFloat(e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*t,this.targetPoint.y=parseFloat(this.targetPoint.y)*e),null!=this.points)for(var i=0;i<this.points.length;i++)null!=this.points[i]&&(this.points[i].x=parseFloat(this.points[i].x)*t,this.points[i].y=parseFloat(this.points[i].y)*e);this.relative||(this.x=parseFloat(this.x)*t,this.y=parseFloat(this.y)*e,n&&(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&&(null==this.sourcePoint&&null==t.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(t.sourcePoint))&&(null==this.targetPoint&&null==t.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(t.targetPoint))&&(null==this.points&&null==t.points||null!=this.points&&mxUtils.equalPoints(this.points,t.points))&&(null==this.alternateBounds&&null==t.alternateBounds||null!=this.alternateBounds&&this.alternateBounds.equals(t.alternateBounds))&&(null==this.offset&&null==t.offset||null!=this.offset&&this.offset.equals(t.offset))},__mxOutput.mxGeometry=void 0!==mxGeometry?mxGeometry:void 0;var mxCellPath={PATH_SEPARATOR:".",create:function(t){var e="";if(null!=t)for(var n=t.getParent();null!=n;){e=n.getIndex(t)+mxCellPath.PATH_SEPARATOR+e,n=(t=n).getParent()}var i=e.length;return i>1&&(e=e.substring(0,i-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var n=t;if(null!=e)for(var i=e.split(mxCellPath.PATH_SEPARATOR),s=0;s<i.length;s++)n=n.getChildAt(parseInt(i[s]));return n},compare:function(t,e){for(var n=Math.min(t.length,e.length),i=0,s=0;s<n;s++)if(t[s]!=e[s]){var r,o;if(0==t[s].length||0==e[s].length)i=t[s]==e[s]?0:t[s]>e[s]?1:-1;else i=(r=parseInt(t[s]))==(o=parseInt(e[s]))?0:r>o?1:-1;break}0==i&&((r=t.length)!=(o=e.length)&&(i=r>o?1:-1));return i}};__mxOutput.mxCellPath=void 0!==mxCellPath?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,n,i){var s=t.getCenterX(),r=t.getCenterY(),o=n.x-s,l=n.y-r,a=Math.atan2(l,o),h=new mxPoint(0,0),u=Math.PI,d=Math.PI/2-a,p=Math.atan2(t.height,t.width);return a<-u+p||a>u-p?(h.x=t.x,h.y=r-t.width*Math.tan(a)/2):a<-p?(h.y=t.y,h.x=s-t.height*Math.tan(d)/2):a<p?(h.x=t.x+t.width,h.y=r+t.width*Math.tan(a)/2):(h.y=t.y+t.height,h.x=s+t.height*Math.tan(d)/2),i&&(n.x>=t.x&&n.x<=t.x+t.width?h.x=n.x:n.y>=t.y&&n.y<=t.y+t.height&&(h.y=n.y),n.x<t.x?h.x=t.x:n.x>t.x+t.width&&(h.x=t.x+t.width),n.y<t.y?h.y=t.y:n.y>t.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width/2,l=t.height/2,a=s+o,h=r+l,u=n.x,d=n.y,p=parseInt(u-a),m=parseInt(d-h);if(0==p&&0!=m)return new mxPoint(a,h+l*m/Math.abs(m));if(0==p&&0==m)return new mxPoint(u,d);if(i){if(d>=r&&d<=r+t.height){var c=d-h,x=Math.sqrt(o*o*(1-c*c/(l*l)))||0;return u<=s&&(x=-x),new mxPoint(a+x,d)}if(u>=s&&u<=s+t.width){x=u-a,c=Math.sqrt(l*l*(1-x*x/(o*o)))||0;return d<=r&&(c=-c),new mxPoint(u,h+c)}}var g=m/p,y=h-g*a,f=o*o*g*g+l*l,v=-2*a*f,C=o*o*g*g*a*a+l*l*a*a-o*o*l*l,E=Math.sqrt(v*v-4*f*C),S=(-v+E)/(2*f),T=(-v-E)/(2*f),b=g*S+y,w=g*T+y,L=0,I=0;return Math.sqrt(Math.pow(S-u,2)+Math.pow(b-d,2))<Math.sqrt(Math.pow(T-u,2)+Math.pow(w-d,2))?(L=S,I=b):(L=T,I=w),new mxPoint(L,I)},RhombusPerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width,l=t.height,a=s+o/2,h=r+l/2,u=n.x,d=n.y;if(a==u)return new mxPoint(a,h>d?r:r+l);if(h==d)return new mxPoint(a>u?s:s+o,h);var p=a,m=h;return i&&(u>=s&&u<=s+o?p=u:d>=r&&d<=r+l&&(m=d)),u<a?d<h?mxUtils.intersection(u,d,p,m,a,r,s,h):mxUtils.intersection(u,d,p,m,a,r+l,s,h):d<h?mxUtils.intersection(u,d,p,m,a,r,s+o,h):mxUtils.intersection(u,d,p,m,a,r+l,s+o,h)},TrianglePerimeter:function(t,e,n,i){var s=null!=e?e.style[mxConstants.STYLE_DIRECTION]:null,r=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH,o=t.x,l=t.y,a=t.width,h=t.height,u=o+a/2,d=l+h/2,p=new mxPoint(o,l),m=new mxPoint(o+a,d),c=new mxPoint(o,l+h);s==mxConstants.DIRECTION_NORTH?(p=c,m=new mxPoint(u,l),c=new mxPoint(o+a,l+h)):s==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(u,l+h),c=new mxPoint(o+a,l)):s==mxConstants.DIRECTION_WEST&&(p=new mxPoint(o+a,l),m=new mxPoint(o,d),c=new mxPoint(o+a,l+h));var x=n.x-u,g=n.y-d,y=r?Math.atan2(x,g):Math.atan2(g,x),f=r?Math.atan2(a,h):Math.atan2(h,a),v=null;if(s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_WEST?y>-f&&y<f:y<-Math.PI+f||y>Math.PI-f)v=i&&(r&&n.x>=p.x&&n.x<=c.x||!r&&n.y>=p.y&&n.y<=c.y)?r?new mxPoint(n.x,p.y):new mxPoint(p.x,n.y):s==mxConstants.DIRECTION_NORTH?new mxPoint(o+a/2+h*Math.tan(y)/2,l+h):s==mxConstants.DIRECTION_SOUTH?new mxPoint(o+a/2-h*Math.tan(y)/2,l):s==mxConstants.DIRECTION_WEST?new mxPoint(o+a,l+h/2+a*Math.tan(y)/2):new mxPoint(o,l+h/2-a*Math.tan(y)/2);else{if(i){var C=new mxPoint(u,d);n.y>=l&&n.y<=l+h?(C.x=r?u:s==mxConstants.DIRECTION_WEST?o+a:o,C.y=n.y):n.x>=o&&n.x<=o+a&&(C.x=n.x,C.y=r?s==mxConstants.DIRECTION_NORTH?l+h:l:d),x=n.x-C.x,g=n.y-C.y,u=C.x,d=C.y}v=r&&n.x<=o+a/2||!r&&n.y<=l+h/2?mxUtils.intersection(n.x,n.y,u,d,p.x,p.y,m.x,m.y):mxUtils.intersection(n.x,n.y,u,d,m.x,m.y,c.x,c.y)}return null==v&&(v=new mxPoint(u,d)),v},HexagonPerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width,l=t.height,a=t.getCenterX(),h=t.getCenterY(),u=n.x,d=n.y,p=u-a,m=d-h,c=-Math.atan2(m,p),x=Math.PI,g=Math.PI/2,y=new mxPoint(a,h),f=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,v=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH,C=new mxPoint,E=new mxPoint;if((u<s&&d<r||u<s&&d>r+l||u>s+o&&d<r||u>s+o&&d>r+l)&&(i=!1),i){if(v){if(u==a){if(d<=r)return new mxPoint(a,r);if(d>=r+l)return new mxPoint(a,r+l)}else if(u<s){if(d==r+l/4)return new mxPoint(s,r+l/4);if(d==r+3*l/4)return new mxPoint(s,r+3*l/4)}else if(u>s+o){if(d==r+l/4)return new mxPoint(s+o,r+l/4);if(d==r+3*l/4)return new mxPoint(s+o,r+3*l/4)}else if(u==s){if(d<h)return new mxPoint(s,r+l/4);if(d>h)return new mxPoint(s,r+3*l/4)}else if(u==s+o){if(d<h)return new mxPoint(s+o,r+l/4);if(d>h)return new mxPoint(s+o,r+3*l/4)}if(d==r)return new mxPoint(a,r);if(d==r+l)return new mxPoint(a,r+l);u<a?d>r+l/4&&d<r+3*l/4?(C=new mxPoint(s,r),E=new mxPoint(s,r+l)):d<r+l/4?(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r-Math.floor(.25*l))):d>r+3*l/4&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l))):u>a&&(d>r+l/4&&d<r+3*l/4?(C=new mxPoint(s+o,r),E=new mxPoint(s+o,r+l)):d<r+l/4?(C=new mxPoint(s,r-Math.floor(.25*l)),E=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l))):d>r+3*l/4&&(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))))}else{if(d==h){if(u<=s)return new mxPoint(s,r+l/2);if(u>=s+o)return new mxPoint(s+o,r+l/2)}else if(d<r){if(u==s+o/4)return new mxPoint(s+o/4,r);if(u==s+3*o/4)return new mxPoint(s+3*o/4,r)}else if(d>r+l){if(u==s+o/4)return new mxPoint(s+o/4,r+l);if(u==s+3*o/4)return new mxPoint(s+3*o/4,r+l)}else if(d==r){if(u<a)return new mxPoint(s+o/4,r);if(u>a)return new mxPoint(s+3*o/4,r)}else if(d==r+l){if(u<a)return new mxPoint(s+o/4,r+l);if(d>h)return new mxPoint(s+3*o/4,r+l)}if(u==s)return new mxPoint(s,h);if(u==s+o)return new mxPoint(s+o,h);d<h?u>s+o/4&&u<s+3*o/4?(C=new mxPoint(s,r),E=new mxPoint(s+o,r)):u<s+o/4?(C=new mxPoint(s-Math.floor(.25*o),r+l),E=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l))):u>s+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r+l)):d>h&&(u>s+o/4&&u<s+3*o/4?(C=new mxPoint(s,r+l),E=new mxPoint(s+o,r+l)):u<s+o/4?(C=new mxPoint(s-Math.floor(.25*o),r),E=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l))):u>s+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)))}var S=a,T=h;u>=s&&u<=s+o?(S=u,T=d<h?r+l:r):d>=r&&d<=r+l&&(T=d,S=u<a?s+o:s),y=mxUtils.intersection(S,T,n.x,n.y,C.x,C.y,E.x,E.y)}else{if(v){if(c==(b=Math.atan2(l/4,o/2)))return new mxPoint(s+o,r+Math.floor(.25*l));if(c==g)return new mxPoint(s+Math.floor(.5*o),r);if(c==x-b)return new mxPoint(s,r+Math.floor(.25*l));if(c==-b)return new mxPoint(s+o,r+Math.floor(.75*l));if(c==-g)return new mxPoint(s+Math.floor(.5*o),r+l);if(c==-x+b)return new mxPoint(s,r+Math.floor(.75*l));c<b&&c>-b?(C=new mxPoint(s+o,r),E=new mxPoint(s+o,r+l)):c>b&&c<g?(C=new mxPoint(s,r-Math.floor(.25*l)),E=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l))):c>g&&c<x-b?(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r-Math.floor(.25*l))):c>x-b&&c<=x||c<-x+b&&c>=-x?(C=new mxPoint(s,r),E=new mxPoint(s,r+l)):c<-b&&c>-g?(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))):c<-g&&c>-x+b&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l)))}else{var b;if(c==(b=Math.atan2(l/2,o/4)))return new mxPoint(s+Math.floor(.75*o),r);if(c==x-b)return new mxPoint(s+Math.floor(.25*o),r);if(c==x||c==-x)return new mxPoint(s,r+Math.floor(.5*l));if(0==c)return new mxPoint(s+o,r+Math.floor(.5*l));if(c==-b)return new mxPoint(s+Math.floor(.75*o),r+l);if(c==-x+b)return new mxPoint(s+Math.floor(.25*o),r+l);c>0&&c<b?(C=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r+l)):c>b&&c<x-b?(C=new mxPoint(s,r),E=new mxPoint(s+o,r)):c>x-b&&c<x?(C=new mxPoint(s-Math.floor(.25*o),r+l),E=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l))):c<0&&c>-b?(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)):c<-b&&c>-x+b?(C=new mxPoint(s,r+l),E=new mxPoint(s+o,r+l)):c<-x+b&&c>-x&&(C=new mxPoint(s-Math.floor(.25*o),r),E=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)))}y=mxUtils.intersection(a,h,n.x,n.y,C.x,C.y,E.x,E.y)}return null==y?new mxPoint(a,h):y}};function mxPrintPreview(t,e,n,i,s,r,o,l,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=i?i:0,this.pageFormat=mxRectangle.fromRectangle(null!=n?n:t.pageFormat),this.title=null!=l?l:"Printer-friendly version",this.x0=null!=s?s:0,this.y0=null!=r?r:0,this.borderColor=o,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,n){this.view=t,this.cell=e,this.style=null!=n?n:{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,n){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(t){this.graph=t,this.zoomHandler=mxUtils.bind(this,(function(){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){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)})),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}__mxOutput.mxPerimeter=void 0!==mxPerimeter?mxPerimeter:void 0,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=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,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=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=5">':8==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=8">':document.documentMode>8&&(t='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e'),t},mxPrintPreview.prototype.appendGraph=function(t,e,n,i,s,r){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.x0=n,this.y0=i,this.open(null,null,s,r)},mxPrintPreview.prototype.open=function(t,e,n,i){var s=this.graph.cellRenderer.initializeOverlay,r=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(t,e){e.init(t.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(t,e,n,i){e.dialect=t.view.graph.dialect,e.init(t.view.getDrawPane())}),this.wnd=null!=e?e:this.wnd;var o=!1;null==this.wnd&&(o=!0,this.wnd=window.open());var l=this.wnd.document;if(o){var a=this.getDoctype();null!=a&&a.length>0&&l.writeln(a),mxClient.IS_VML?l.writeln('<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">'):("CSS1Compat"===document.compatMode&&l.writeln("<!DOCTYPE html>"),l.writeln("<html>")),l.writeln("<head>"),this.writeHead(l,t),l.writeln("</head>"),l.writeln('<body class="mxPage">')}var h=this.graph.getGraphBounds().clone(),u=this.graph.getView().getScale(),d=u/this.scale,p=this.graph.getView().getTranslate();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-2*this.border,c=this.pageFormat.height-2*this.border;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)),g=Math.max(1,Math.ceil((h.height+this.y0)/c));this.pageCount=x*g;var y=mxUtils.bind(this,(function(){if(this.pageSelector&&(g>1||x>1)){var t=this.createPageSelector(g,x);if(l.body.appendChild(t),mxClient.IS_IE&&null==l.documentMode||5==l.documentMode||8==l.documentMode||7==l.documentMode){t.style.position="absolute";var e=function(){t.style.top=(l.body.scrollTop||l.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()})),mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}})),f=mxUtils.bind(this,(function(t,e){if(null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(n||e)&&(t.style.pageBreakAfter="always"),o&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))l.writeln(t.outerHTML),t.parentNode.removeChild(t);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var i=l.createElement("div");i.innerHTML=t.outerHTML,i=i.getElementsByTagName("div")[0],l.body.appendChild(i),t.parentNode.removeChild(t)}else t.parentNode.removeChild(t),l.body.appendChild(t);(n||e)&&this.addPageBreak(l)})),v=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=v)for(var C=0;C<v.length;C++)f(v[C],!0);var E=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(C=0;C<g;C++)for(var S=C*c/this.scale-this.y0/this.scale+(h.y-p.y*u)/u,T=0;T<x;T++){if(null==this.wnd)return null;var b=T*m/this.scale-this.x0/this.scale+(h.x-p.x*u)/u,w=C*x+T+1,L=new mxRectangle(b,S,m,c);(r=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,(function(t){this.addGraphFragment(-b,-S,this.scale,w,t,L),this.printBackgroundImage&&this.insertBackgroundImage(t,-b,-S)})),w)).setAttribute("id","mxPage-"+w),f(r,null!=E||C<g-1||T<x-1)}if(null!=E)for(C=0;C<E.length;C++)f(E[C],C<E.length-1);o&&!i&&(this.closeDocument(),y()),this.wnd.focus()}catch(t){null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r)}finally{this.graph.cellRenderer.initializeOverlay=s}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(null!=this.wnd&&null!=this.wnd.document){var t=this.wnd.document;this.writePostfix(t),t.writeln("</body>"),t.writeln("</html>"),t.close(),mxEvent.release(t.body)}}catch(t){}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln("<title>"+this.title+"</title>"),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("}"),null!=e&&t.writeln(e),t.writeln("</style>")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var n=this.wnd.document,i=n.createElement("table");i.className="mxPageSelector",i.setAttribute("border","0");for(var s=n.createElement("tbody"),r=0;r<t;r++){for(var o=n.createElement("tr"),l=0;l<e;l++){var a=r*e+l+1,h=n.createElement("td"),u=n.createElement("a");if(u.setAttribute("href","#mxPage-"+a),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var d="var page = document.getElementById('mxPage-"+a+"');page.scrollIntoView(true);event.preventDefault();";u.setAttribute("onclick",d)}mxUtils.write(u,a,n),h.appendChild(u),o.appendChild(h)}s.appendChild(o)}return i.appendChild(s),i},mxPrintPreview.prototype.renderPage=function(t,e,n,i,s,r){var o=this.wnd.document,l=document.createElement("div"),a=null;try{if(0!=n||0!=i){l.style.position="relative",l.style.width=t+"px",l.style.height=e+"px",l.style.pageBreakInside="avoid",(u=document.createElement("div")).style.position="relative",u.style.top=this.border+"px",u.style.left=this.border+"px",u.style.width=t-2*this.border+"px",u.style.height=e-2*this.border+"px",u.style.overflow="hidden";var h=document.createElement("div");h.style.position="relative",h.style.marginLeft=n+"px",h.style.marginTop=i+"px",8==o.documentMode&&(u.style.position="absolute",h.style.position="absolute"),10==o.documentMode&&(h.style.width="100%",h.style.height="100%"),u.appendChild(h),l.appendChild(u),document.body.appendChild(l),a=h}else{var u;l.style.width=t+"px",l.style.height=e+"px",l.style.overflow="hidden",l.style.pageBreakInside="avoid",8==o.documentMode&&(l.style.position="relative"),(u=document.createElement("div")).style.width=t-2*this.border+"px",u.style.height=e-2*this.border+"px",u.style.overflow="hidden",!mxClient.IS_IE||null!=o.documentMode&&5!=o.documentMode&&8!=o.documentMode&&7!=o.documentMode?(u.style.top=this.border+"px",u.style.left=this.border+"px"):(u.style.marginTop=this.border+"px",u.style.marginLeft=this.border+"px"),this.graph.dialect==mxConstants.DIALECT_VML&&(u.style.position="absolute"),l.appendChild(u),document.body.appendChild(l),a=u}}catch(t){throw l.parentNode.removeChild(l),l=null,t}return s(a),l},mxPrintPreview.prototype.getRoot=function(){var t=this.graph.view.currentRoot;return null==t&&(t=this.graph.getModel().getRoot()),t},mxPrintPreview.prototype.addGraphFragment=function(t,e,n,i,s,r){var o=this.graph.getView(),l=this.graph.container;this.graph.container=s;var a=o.getCanvas(),h=o.getBackgroundPane(),u=o.getDrawPane(),d=o.getOverlayPane(),p=n;if(this.graph.dialect==mxConstants.DIALECT_SVG){if(o.createSvg(),!mxClient.NO_FO){var m=o.getDrawPane().parentNode;m.getAttribute("transform"),m.setAttribute("transformOrigin","0 0"),m.setAttribute("transform","scale("+n+","+n+")translate("+t+","+e+")"),n=1,t=0,e=0}}else this.graph.dialect==mxConstants.DIALECT_VML?o.createVml():o.createHtml();var c=o.isEventsEnabled();o.setEventsEnabled(!1);var x=this.graph.isEnabled();this.graph.setEnabled(!1);var g=o.getTranslate();o.translate=new mxPoint(t,e);var y=this.graph.cellRenderer.redraw,f=o.states,v=o.scale;if(this.clipping){var C=new mxRectangle((r.x+g.x)*v,(r.y+g.y)*v,r.width*v/p,r.height*v/p);this.graph.cellRenderer.redraw=function(t,e,n){if(null!=t){var i=f.get(t.cell);if(null!=i){var s=o.getBoundingBox(i,!1);if(null!=s&&!mxUtils.intersects(C,s))return}}y.apply(this,arguments)}}var E=null;try{var S=[this.getRoot()];E=new mxTemporaryCellStates(o,n,S,null,mxUtils.bind(this,(function(t){return this.getLinkForCellState(t)})))}finally{if(mxClient.IS_IE)o.overlayPane.innerHTML="",o.canvas.style.overflow="hidden",o.canvas.style.position="relative",o.canvas.style.top=this.marginTop+"px",o.canvas.style.width=r.width+"px",o.canvas.style.height=r.height+"px";else for(var T=s.firstChild;null!=T;){var b=T.nextSibling,w=T.nodeName.toLowerCase();"svg"==w?(T.style.overflow="hidden",T.style.position="relative",T.style.top=this.marginTop+"px",T.setAttribute("width",r.width),T.setAttribute("height",r.height),T.style.width="",T.style.height=""):"default"!=T.style.cursor&&"div"!=w&&T.parentNode.removeChild(T),T=b}if(this.printBackgroundImage){var L=s.getElementsByTagName("svg");L.length>0&&(L[0].style.position="absolute")}o.overlayPane.parentNode.removeChild(o.overlayPane),this.graph.setEnabled(x),this.graph.container=l,this.graph.cellRenderer.redraw=y,o.canvas=a,o.backgroundPane=h,o.drawPane=u,o.overlayPane=d,o.translate=g,E.destroy(),o.setEventsEnabled(c)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,n){var i=this.graph.backgroundImage;if(null!=i){var s=document.createElement("img");s.style.position="absolute",s.style.marginLeft=Math.round(e*this.scale)+"px",s.style.marginTop=Math.round(n*this.scale)+"px",s.setAttribute("width",Math.round(this.scale*i.width)),s.setAttribute("height",Math.round(this.scale*i.height)),s.src=i.src,t.insertBefore(s,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=void 0!==mxPrintPreview?mxPrintPreview:void 0,mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return 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",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return 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",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 n=e;if(null!=t&&t.length>0){var i=t.split(";");n=null!=n&&";"!=t.charAt(0)?mxUtils.clone(n):new Object;for(var s=0;s<i.length;s++){var r=i[s],o=r.indexOf("=");if(o>=0){var l=r.substring(0,o),a=r.substring(o+1);a==mxConstants.NONE?delete n[l]:mxUtils.isNumeric(a)?n[l]=parseFloat(a):n[l]=a}else{var h=this.styles[r];if(null!=h)for(var l in h)n[l]=h[l]}}}return n},__mxOutput.mxStylesheet=void 0!==mxStylesheet?mxStylesheet:void 0,mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,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){if(t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var n=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=n.x,e.y=n.y,e.width=this.shape.stencil.w0*n.width,e.height=this.shape.stencil.h0*n.height}return 0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return null!=e?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t: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,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),null!=this.shape&&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(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e<this.absolutePoints.length;e++)t.absolutePoints[e]=this.absolutePoints[e].clone()}return null!=this.origin&&(t.origin=this.origin.clone()),null!=this.absoluteOffset&&(t.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(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,t},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},__mxOutput.mxCellState=void 0!==mxCellState?mxCellState:void 0,mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(t){this.singleSelection=t},mxGraphSelectionModel.prototype.isSelected=function(t){return null!=t&&mxUtils.indexOf(this.cells,t)>=0},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],n=0;n<t.length;n++)this.graph.isCellSelectable(t[n])&&e.push(t[n]);this.changeSelection(e,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(t){if(null!=t)for(var e=0;e<t.length;e++)if(this.graph.isCellSelectable(t[e]))return t[e];return null},mxGraphSelectionModel.prototype.addCell=function(t){null!=t&&this.addCells([t])},mxGraphSelectionModel.prototype.addCells=function(t){if(null!=t){var e=null;this.singleSelection&&(e=this.cells,t=[this.getFirstSelectableCell(t)]);for(var n=[],i=0;i<t.length;i++)!this.isSelected(t[i])&&this.graph.isCellSelectable(t[i])&&n.push(t[i]);this.changeSelection(n,e)}},mxGraphSelectionModel.prototype.removeCell=function(t){null!=t&&this.removeCells([t])},mxGraphSelectionModel.prototype.removeCells=function(t){if(null!=t){for(var e=[],n=0;n<t.length;n++)this.isSelected(t[n])&&e.push(t[n]);this.changeSelection(null,e)}},mxGraphSelectionModel.prototype.changeSelection=function(t,e){if(null!=t&&t.length>0&&null!=t[0]||null!=e&&e.length>0&&null!=e[0]){var n=new mxSelectionChange(this,t,e);n.execute();var i=new mxUndoableEdit(this,!1);i.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",i))}},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(null!=t){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e<this.removed.length;e++)this.selectionModel.cellRemoved(this.removed[e]);if(null!=this.added)for(e=0;e<this.added.length;e++)this.selectionModel.cellAdded(this.added[e]);var n=this.added;this.added=this.removed,this.removed=n,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=void 0!==mxGraphSelectionModel?mxGraphSelectionModel:void 0,mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.selectText=!0,mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,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=!0,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){null!=this.textarea&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var n=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(n=mxUtils.replaceTrailingNewlines(n,"<div><br></div>")),n.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(!1),mxEvent.consume(t)}))),mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){this.blurEnabled&&this.focusLost(t)}))),mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))})));var e=mxUtils.bind(this,(function(e){null!=this.editingCell&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,t.innerHTML="")}));mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var n=mxUtils.bind(this,(function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)}));mxEvent.addListener(t,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",n),mxEvent.addListener(t,"cut",n),mxEvent.addListener(t,"paste",n);var i=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",s=mxUtils.bind(this,(function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null,this.resize()})),0))}));mxEvent.addListener(t,i,s),mxEvent.addListener(window,"resize",s),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",s),mxEvent.addListener(t,"DOMNodeInserted",s)):(mxEvent.addListener(t,"cut",s),mxEvent.addListener(t,"paste",s))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!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(null==t)this.stopEditing(!0);else if(null!=this.textarea){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=null;if(this.autoSize&&"fill"!=t.style[mxConstants.STYLE_OVERFLOW]){var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(null==(i=null!=t.text&&null==this.align?t.text.margin:null)&&(i=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))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),null!=s){var r=(parseFloat(s)+2)*n;this.bounds.width=r,this.bounds.x+=i.x*r}}else{var o=mxRectangle.fromRectangle(t),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&l==mxConstants.ALIGN_CENTER&&a==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,null!=s&&(o.width=parseFloat(s)*n),!t.view.graph.cellRenderer.legacySpacing||"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*n,u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+h,d=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+h,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+h,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+h;l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);o=new mxRectangle(o.x+m,o.y+u,o.width-(l==mxConstants.ALIGN_CENTER&&null==s?m+d:0),o.height-(a==mxConstants.ALIGN_MIDDLE?u+p:0))}this.bounds=new mxRectangle(o.x+t.absoluteOffset.x,o.y+t.absoluteOffset.y,o.width,o.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";r=Math.round(this.bounds.width/(document.documentMode,n))+this.wordWrapPadding;"relative"!=this.textarea.style.position?(this.textarea.style.width=r+"px",this.textarea.scrollWidth>r&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=r+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var c=this.textarea.scrollWidth,x=this.textarea.scrollHeight;8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5))/n))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-i.y*(this.bounds.height-(x+.5)*n)+x*(n-1)*0+1*Math.abs(i.y+.5))/n))+"px",this.textarea.style.width=Math.round(c*n)+"px",this.textarea.style.height=Math.round(x*n)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-i.y*(this.bounds.height-(x+.5)*n)+x*(n-1)*0+1*Math.abs(i.y+.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-i.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-i.y*(this.bounds.height-4)+(-1==i.y?3:0))+1)+"px")}else this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/n)+"px",this.textarea.style.height=Math.round(this.bounds.height/n)+"px",8==document.documentMode||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(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"),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","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/n)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxClient.IS_VML?this.textarea.style.zoom=n:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+n+","+n+")"+(null==i?"":" translate("+100*i.x+"%,"+100*i.y+"%)")))}},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!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(null!=e){var n=mxUtils.getCurrentStyle(e);null!=n&&(t="absolute"==n.position)}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,null==this.textarea&&this.init(),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var n=this.graph.getView().getState(t);if(null!=n){this.graph.getView().scale;var i=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),s=mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),r=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,a=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,h=[];(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&h.push("underline"),(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&h.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(i*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(n),this.textarea.style.textDecoration=h.join(" "),this.textarea.style.fontWeight=l?"bold":"normal",this.textarea.style.fontStyle=a?"italic":"",this.textarea.style.fontSize=Math.round(i)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=s,this.textarea.style.textAlign=o,this.textarea.style.outline="none",this.textarea.style.color=r;var u=this.textDirection=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);u==mxConstants.TEXT_DIRECTION_AUTO&&(null==n||null==n.text||n.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(n.text.value)||(u=n.text.getAutoDirection())),u==mxConstants.TEXT_DIRECTION_LTR||u==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",u):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(n,e)||"",this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,null!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(n.cell)||"fill"!=n.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(t){}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),n=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&(this.textarea.innerHTML!=n||null!=this.align)){this.prepareTextarea();var i=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{null!=i&&this.applyValue(e,i),null!=this.align&&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(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=this.getMinimumSize(t),s=i.width,r=i.height,o=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW])o=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var l=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*n,a=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+l,h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+l,u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+l,d=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+l;o=new mxRectangle(t.x,t.y,Math.max(s,t.width-d-h),Math.max(r,t.height-a-u));var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),m=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&p==mxConstants.ALIGN_CENTER&&m==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,e?(o.x=t.absoluteOffset.x,o.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(t.text.boundingBox.x>0&&(o.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(o.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(o.x=Math.min(o.x,t.text.boundingBox.x),o.y=Math.min(o.y,t.text.boundingBox.y)),o.x+=d,o.y+=a,null!=t.text&&null!=t.text.boundingBox&&(e?(o.width=Math.max(s,t.text.boundingBox.width),o.height=Math.max(r,t.text.boundingBox.height)):(o.width=Math.max(o.width,t.text.boundingBox.width),o.height=Math.max(o.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var c=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);c==mxConstants.ALIGN_LEFT?o.x-=t.width:c==mxConstants.ALIGN_RIGHT&&(o.x+=t.width);var x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);x==mxConstants.ALIGN_TOP?o.y-=t.height:x==mxConstants.ALIGN_BOTTOM&&(o.y+=t.height)}}return new mxRectangle(Math.round(o.x),Math.round(o.y),Math.round(o.width),Math.round(o.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=void 0!==mxCellEditor?mxCellEditor:void 0,mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,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(null!=t.style){var n=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(null!=n)e=new mxShape(n);else e=new(this.getShapeConstructor(t))}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),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){null!=t.shape&&(this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(null!=t.style)for(var e=["inherit","swimlane","indicated"],n=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR],i=0;i<n.length;i++)if(mxUtils.indexOf(e,t.style[n[i]])>=0)return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,n){var i=t.shape[e],s=t.view.graph,r=null;if("inherit"==i?r=s.model.getParent(t.cell):"swimlane"==i?(t.shape[e]=n==mxConstants.STYLE_STROKECOLOR?"#000000":"#ffffff",r=null!=s.model.getTerminal(t.cell,!1)?s.model.getTerminal(t.cell,!1):t.cell,r=s.getSwimlane(r),n=s.swimlaneIndicatorColorAttribute):"indicated"==i&&(t.shape[e]=t.shape.indicatorColor),null!=r){var o=s.getView().getState(r);t.shape[e]=null,null!=o&&(null!=o.shape&&"indicatorColor"!=e?t.shape[e]=o.shape[e]:t.shape[e]=o.style[n])}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var n=t.view.graph;if(n.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||null==t.style[mxConstants.STYLE_FONTSIZE]){var i=n.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,n.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],n.isWrapping(t.cell)&&n.isHtmlLabel(t.cell),n.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=i?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var s=!1,r=function(e){var i=t;if(mxClient.IS_TOUCH||s){var r=mxEvent.getClientX(e),o=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,o);i=n.view.getState(n.getCellAt(l.x,l.y))}return i};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),s=n.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e))),s=!1)}))),n.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.dblClick(e,t.cell),mxEvent.consume(e))})))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),n=null;if(null!=e){n=new mxDictionary;for(var i=0;i<e.length;i++){var s=null!=t.overlays?t.overlays.remove(e[i]):null;if(null==s){var r=new mxImageShape(new mxRectangle,e[i].image.src);r.dialect=t.view.graph.dialect,r.preserveImageAspect=!1,r.overlay=e[i],this.initializeOverlay(t,r),this.installCellOverlayListeners(t,e[i],r),null!=e[i].cursor&&(r.node.style.cursor=e[i].cursor),n.put(e[i],r)}else n.put(e[i],s)}}null!=t.overlays&&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,n){var i=t.view.graph;mxEvent.addListener(n.node,"click",(function(n){i.isEditing()&&i.stopEditing(!i.isInvokesStopCellEditing()),e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",n,"cell",t.cell))})),mxEvent.addGestureListeners(n.node,(function(t){mxEvent.consume(t)}),(function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))})),mxClient.IS_TOUCH&&mxEvent.addListener(n.node,"touchend",(function(n){e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",n,"cell",t.cell))}))},mxCellRenderer.prototype.createControl=function(t){var e=t.view.graph,n=e.getFoldingImage(t);if(e.foldingEnabled&&null!=n){if(null==t.control){var i=new mxRectangle(0,0,n.width,n.height);t.control=new mxImageShape(i,n.src),t.control.preserveImageAspect=!1,t.control.dialect=e.dialect,this.initControl(t,t.control,!0,this.createControlClickHandler(t))}}else null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.createControlClickHandler=function(t){var e=t.view.graph;return mxUtils.bind(this,(function(n){if(this.forceControlClickHandler||e.isEnabled()){var i=!e.isCellCollapsed(t.cell);e.foldCells(i,!1,[t.cell],null,n),mxEvent.consume(n)}}))},mxCellRenderer.prototype.initControl=function(t,e,n,i){var s=t.view.graph;s.isHtmlLabel(t.cell)&&mxClient.NO_FO&&s.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(s.container),e.node.style.zIndex=1):e.init(t.view.getOverlayPane());var r=e.innerNode||e.node;if(null==i||mxClient.IS_IOS||(s.isEnabled()&&(r.style.cursor="pointer"),mxEvent.addListener(r,"click",i)),n){var o=null;mxEvent.addGestureListeners(r,(function(e){o=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),s.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),mxEvent.consume(e)}),(function(e){s.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),(function(e){s.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,t)),mxEvent.consume(e)})),null!=i&&mxClient.IS_IOS&&r.addEventListener("touchend",(function(t){if(null!=o){var e=s.tolerance;Math.abs(o.x-mxEvent.getClientX(t))<e&&Math.abs(o.y-mxEvent.getClientY(t))<e&&(i.call(i,t),mxEvent.consume(t))}}),!0)}return r},mxCellRenderer.prototype.isShapeEvent=function(t,e){return!0},mxCellRenderer.prototype.isLabelEvent=function(t,e){return!0},mxCellRenderer.prototype.installListeners=function(t){var e=t.view.graph,n=function(n){var i=t;if(e.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(n).nodeName||mxClient.IS_TOUCH){var s=mxEvent.getClientX(n),r=mxEvent.getClientY(n),o=mxUtils.convertPoint(e.container,s,r);i=e.view.getState(e.getCellAt(o.x,o.y))}return i};mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,(function(n){this.isShapeEvent(t,n)&&e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(n,t))})),mxUtils.bind(this,(function(i){this.isShapeEvent(t,i)&&e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(i,n(i)))})),mxUtils.bind(this,(function(i){this.isShapeEvent(t,i)&&e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(i,n(i)))}))),e.nativeDblClickEnabled&&mxEvent.addListener(t.shape.node,"dblclick",mxUtils.bind(this,(function(n){this.isShapeEvent(t,n)&&(e.dblClick(n,t.cell),mxEvent.consume(n))})))},mxCellRenderer.prototype.redrawLabel=function(t,e){var n=t.view.graph,i=this.getLabelValue(t),s=n.isWrapping(t.cell),r=n.isLabelClipped(t.cell),o=t.view.graph.isHtmlLabel(t.cell)||null!=i&&mxUtils.isNode(i)?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,l=t.style[mxConstants.STYLE_OVERFLOW]||"visible";if(null==t.text||t.text.wrap==s&&t.text.clipped==r&&t.text.overflow==l&&t.text.dialect==o||(t.text.destroy(),t.text=null),null==t.text&&null!=i&&(mxUtils.isNode(i)||i.length>0)?this.createLabel(t,i):null==t.text||null!=i&&0!=i.length||(t.text.destroy(),t.text=null),null!=t.text){e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=n.getVerticalAlign(t));var a=this.getLabelBounds(t),h=this.getTextScale(t);if(e||t.text.value!=i||t.text.isWrapping!=s||t.text.overflow!=l||t.text.isClipping!=r||t.text.scale!=h||t.text.dialect!=o||null==t.text.bounds||!t.text.bounds.equals(a)){t.text.dialect=o,t.text.value=i,t.text.bounds=a,t.text.scale=h,t.text.wrap=s,t.text.clipped=r,t.text.overflow=l;var u=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=u}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function n(n,i,s){return"spacingTop"==i||"spacingRight"==i||"spacingBottom"==i||"spacingLeft"==i?parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[i]||s):e[n]!=(t.style[i]||s)}return n("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||n("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||n("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||n("color",mxConstants.STYLE_FONTCOLOR,"black")||n("align",mxConstants.STYLE_ALIGN,"")||n("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||n("spacing",mxConstants.STYLE_SPACING,2)||n("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||n("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||n("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||n("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||n("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||n("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||n("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||n("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||n("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,n=t.view.scale,i=e.getModel().isEdge(t.cell),s=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(i){var r=t.text.getSpacing();s.x+=r.x*n,s.y+=r.y*n;var o=e.getCellGeometry(t.cell);null!=o&&(s.width=Math.max(0,o.width*n),s.height=Math.max(0,o.height*n))}else{if(t.text.isPaintBoundsInverted()){var l=s.x;s.x=s.y,s.y=l}s.x+=t.x,s.y+=t.y,s.width=Math.max(1,t.width),s.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var a=(t.width-t.height)/2;s.x+=a,s.y-=a;l=s.width;s.width=s.height,s.height=l}if(null!=t.shape){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE&&(s=t.shape.getLabelBounds(s))}var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=d&&(s.width=parseFloat(d)*n),i||this.rotateLabelBounds(t,s),s},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||"fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var n=t.view.scale,i=t.text.getSpacing();e.x+=i.x*n,e.y+=i.y*n;var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),r=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(s==mxConstants.ALIGN_CENTER&&null==o?t.text.spacingLeft*n+t.text.spacingRight*n:0)),e.height=Math.max(0,e.height-(r==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*n+t.text.spacingBottom*n:0))}var l=t.text.getTextRotation();if(0!=l&&null!=t&&t.view.graph.model.isVertex(t.cell)){var a=t.getCenterX(),h=t.getCenterY();if(e.x!=a||e.y!=h){var u=l*(Math.PI/180),d=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(a,h));e.x=d.x,e.y=d.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),null!=t.overlays){var n=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),i=mxUtils.toRadians(n),s=Math.cos(i),r=Math.sin(i);t.overlays.visit((function(i,o){var l=o.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&null!=t.shape&&0!=n){var a=l.getCenterX(),h=l.getCenterY(),u=mxUtils.getRotatedPoint(new mxPoint(a,h),s,r,new mxPoint(t.getCenterX(),t.getCenterY()));a=u.x,h=u.y,l.x=Math.round(a-l.width/2),l.y=Math.round(h-l.height/2)}!e&&null!=o.bounds&&o.scale==t.view.scale&&o.bounds.equals(l)||(o.bounds=l,o.scale=t.view.scale,o.redraw())}))}},mxCellRenderer.prototype.redrawControl=function(t,e){var n=t.view.graph.getFoldingImage(t);if(null!=t.control&&null!=n){var i=this.getControlBounds(t,n.width,n.height),s=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),r=t.view.scale;!e&&t.control.scale==r&&t.control.bounds.equals(i)&&t.control.rotation==s||(t.control.rotation=s,t.control.bounds=i,t.control.scale=r,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,n){if(null!=t.control){var i=t.view.scale,s=t.getCenterX(),r=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(s=t.x+e*i,r=t.y+n*i,null!=t.shape)){var o=t.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var l=(t.width-t.height)/2;s+=l,r-=l}if(0!=o){var a=mxUtils.toRadians(o),h=Math.cos(a),u=Math.sin(a),d=mxUtils.getRotatedPoint(new mxPoint(s,r),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));s=d.x,r=d.y}}return t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(s-e/2*i),Math.round(r-n/2*i),Math.round(e*i),Math.round(n*i))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,n){for(var i=this.getShapesForState(t),s=0;s<i.length;s++)if(null!=i[s]&&null!=i[s].node){var r=i[s].node.parentNode!=t.view.getDrawPane()&&i[s].node.parentNode!=t.view.getOverlayPane(),o=r?n:e;if(null!=o&&o.nextSibling!=i[s].node)null==o.nextSibling?o.parentNode.appendChild(i[s].node):o.parentNode.insertBefore(i[s].node,o.nextSibling);else if(null==o)if(i[s].node.parentNode==t.view.graph.container){for(var l=t.view.canvas;null!=l&&l.parentNode!=t.view.graph.container;)l=l.parentNode;null!=l&&null!=l.nextSibling?l.nextSibling!=i[s].node&&i[s].node.parentNode.insertBefore(i[s].node,l.nextSibling):i[s].node.parentNode.appendChild(i[s].node)}else null!=i[s].node.parentNode&&null!=i[s].node.parentNode.firstChild&&i[s].node.parentNode.firstChild!=i[s].node&&i[s].node.parentNode.insertBefore(i[s].node,i[s].node.parentNode.firstChild);r?n=i[s].node:e=i[s].node}return[e,n]},mxCellRenderer.prototype.getShapesForState=function(t){return[t.shape,t.text,t.control]},mxCellRenderer.prototype.redraw=function(t,e,n){var i=this.redrawShape(t,e,n);null==t.shape||null!=n&&!n||(this.redrawLabel(t,i),this.redrawCellOverlays(t,i),this.redrawControl(t,i))},mxCellRenderer.prototype.redrawShape=function(t,e,n){var i=t.view.graph.model,s=!1;return null!=t.shape&&null!=t.shape.style&&null!=t.style&&t.shape.style[mxConstants.STYLE_SHAPE]!=t.style[mxConstants.STYLE_SHAPE]&&(t.shape.destroy(),t.shape=null),null==t.shape&&null!=t.view.graph.container&&t.cell!=t.view.currentRoot&&(i.isVertex(t.cell)||i.isEdge(t.cell))?(t.shape=this.createShape(t),null!=t.shape&&(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))):e||null==t.shape||mxUtils.equalEntries(t.shape.style,t.style)&&!this.checkPlaceholderStyles(t)||(t.shape.resetStyles(),this.configureShape(t),t.view.graph.selectionCellsHandler.updateHandler(t),e=!0),null!=t.shape&&(this.createControl(t),(e||this.isShapeInvalid(t,t.shape))&&(null!=t.absolutePoints?(t.shape.points=t.absolutePoints.slice(),t.shape.bounds=null):(t.shape.points=null,t.shape.bounds=new mxRectangle(t.x,t.y,t.width,t.height)),t.shape.scale=t.view.scale,null==n||n?this.doRedrawShape(t):t.shape.updateBoundingBox(),s=!0)),s},mxCellRenderer.prototype.doRedrawShape=function(t){t.shape.redraw()},mxCellRenderer.prototype.isShapeInvalid=function(t,e){return null==e.bounds||e.scale!=t.view.scale||null==t.absolutePoints&&!e.bounds.equals(t)||null!=t.absolutePoints&&!mxUtils.equalPoints(e.points,t.absolutePoints)},mxCellRenderer.prototype.destroy=function(t){null!=t.shape&&(null!=t.text&&(t.text.destroy(),t.text=null),null!=t.overlays&&(t.overlays.visit((function(t,e){e.destroy()})),t.overlays=null),null!=t.control&&(t.control.destroy(),t.control=null),t.shape.destroy(),t.shape=null)},__mxOutput.mxCellRenderer=void 0!==mxCellRenderer?mxCellRenderer:void 0;var mxEdgeStyle={EntityRelation:function(t,e,n,i,s){var r=t.view,o=r.graph,l=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*r.scale,a=t.absolutePoints,h=a[0],u=a[a.length-1],d=!1;if(null!=h)(e=new mxCellState).x=h.x,e.y=h.y;else{if(null==e)return;if((c=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&c!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST)d=c==mxConstants.DIRECTION_MASK_WEST;else{var p=o.getCellGeometry(e.cell);p.relative?d=p.x<=.5:null!=n&&(d=n.x+n.width<e.x)}}var m=!0;if(null!=u)(n=new mxCellState).x=u.x,n.y=u.y;else if(null!=n){var c;if((c=mxUtils.getPortConstraints(n,t,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&c!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST)m=c==mxConstants.DIRECTION_MASK_WEST;else{var x=o.getCellGeometry(n.cell);x.relative?m=x.x<=.5:null!=e&&(m=e.x+e.width<n.x)}}if(null!=e&&null!=n){var g=d?e.x:e.x+e.width,y=r.getRoutingCenterY(e),f=m?n.x:n.x+n.width,v=r.getRoutingCenterY(n),C=l,E=d?-C:C,S=new mxPoint(g+E,y),T=new mxPoint(f+(E=m?-C:C),v);if(d==m){var b=d?Math.min(g,f)-l:Math.max(g,f)+l;s.push(new mxPoint(b,y)),s.push(new mxPoint(b,v))}else if(S.x<T.x==d){var w=y+(v-y)/2;s.push(S),s.push(new mxPoint(S.x,w)),s.push(new mxPoint(T.x,w)),s.push(T)}else s.push(S),s.push(T)}},Loop:function(t,e,n,i,s){var r=t.absolutePoints,o=r[0],l=r[r.length-1];if(null==o||null==l){if(null!=e){var a=t.view,h=a.graph;null!=(y=null!=i&&i.length>0?i[0]:null)&&(y=a.transformControlPoint(t,y),mxUtils.contains(e,y.x,y.y)&&(y=null));var u=0,d=0,p=0,m=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,h.gridSize)*a.scale,x=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);x==mxConstants.DIRECTION_NORTH||x==mxConstants.DIRECTION_SOUTH?(u=a.getRoutingCenterX(e),d=c):(p=a.getRoutingCenterY(e),m=c),null==y||y.x<e.x||y.x>e.x+e.width?null!=y?(u=y.x,m=Math.max(Math.abs(p-y.y),m)):x==mxConstants.DIRECTION_NORTH?p=e.y-2*d:x==mxConstants.DIRECTION_SOUTH?p=e.y+e.height+2*d:u=x==mxConstants.DIRECTION_EAST?e.x-2*m:e.x+e.width+2*m:null!=y&&(u=a.getRoutingCenterX(e),d=Math.max(Math.abs(u-y.x),m),p=y.y,m=0),s.push(new mxPoint(u-d,p-m)),s.push(new mxPoint(u+d,p+m))}}else if(null!=i&&i.length>0)for(var g=0;g<i.length;g++){var y=i[g];y=t.view.transformControlPoint(t,y),s.push(new mxPoint(y.x,y.y))}},ElbowConnector:function(t,e,n,i,s){var r=null!=i&&i.length>0?i[0]:null,o=!1,l=!1;if(null!=e&&null!=n)if(null!=r){var a=Math.min(e.x,n.x),h=Math.max(e.x+e.width,n.x+n.width),u=Math.min(e.y,n.y),d=Math.max(e.y+e.height,n.y+n.height);o=(r=t.view.transformControlPoint(t,r)).y<u||r.y>d,l=r.x<a||r.x>h}else{if(!(o=(a=Math.max(e.x,n.x))==(h=Math.min(e.x+e.width,n.x+n.width))))l=(u=Math.max(e.y,n.y))==(d=Math.min(e.y+e.height,n.y+n.height))}l||!o&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,n,i,s):mxEdgeStyle.TopToBottom(t,e,n,i,s)},SideToSide:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.x,n.x),d=Math.min(e.x+e.width,n.x+n.width),p=null!=o?o.x:Math.round(d+(u-d)/2),m=r.getRoutingCenterY(e),c=r.getRoutingCenterY(n);if(null!=o&&(o.y>=e.y&&o.y<=e.y+e.height&&(m=o.y),o.y>=n.y&&o.y<=n.y+n.height&&(c=o.y)),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),mxUtils.contains(n,p,c)||mxUtils.contains(e,p,c)||s.push(new mxPoint(p,c)),1==s.length)if(null!=o)mxUtils.contains(n,p,o.y)||mxUtils.contains(e,p,o.y)||s.push(new mxPoint(p,o.y));else{var x=Math.max(e.y,n.y),g=Math.min(e.y+e.height,n.y+n.height);s.push(new mxPoint(p,x+(g-x)/2))}}},TopToBottom:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.y,n.y),d=Math.min(e.y+e.height,n.y+n.height),p=r.getRoutingCenterX(e);null!=o&&o.x>=e.x&&o.x<=e.x+e.width&&(p=o.x);var m=null!=o?o.y:Math.round(d+(u-d)/2);if(mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),p=null!=o&&o.x>=n.x&&o.x<=n.x+n.width?o.x:r.getRoutingCenterX(n),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),1==s.length)if(null!=o&&1==s.length)mxUtils.contains(n,o.x,m)||mxUtils.contains(e,o.x,m)||s.push(new mxPoint(o.x,m));else{var c=Math.max(e.x,n.x),x=Math.min(e.x+e.width,n.x+n.width);s.push(new mxPoint(c+(x-c)/2,m))}}},SegmentConnector:function(t,e,n,i,s){var r=t.absolutePoints,o=Math.max(1,t.view.scale),l=s.length>0?s[0]:null,a=!0,h=null;function u(t){return(null==l||Math.abs(l.x-t.x)>=o||Math.abs(l.y-t.y)>=o)&&(s.push(t),l=t),l}var d=r[0];null==d&&null!=e?d=new mxPoint(t.view.getRoutingCenterX(e),t.view.getRoutingCenterY(e)):null!=d&&(d=d.clone()),d.x=Math.round(d.x),d.y=Math.round(d.y);var p=r.length-1;if(null!=i&&i.length>0){for(var m=[],c=0;c<i.length;c++){var x=t.view.transformControlPoint(t,i[c]);null!=x&&(x.x=Math.round(x.x),x.y=Math.round(x.y),m.push(x))}if(0==m.length)return;i=m,null!=d&&null!=i[0]&&(Math.abs(i[0].x-d.x)<o&&(i[0].x=d.x),Math.abs(i[0].y-d.y)<o&&(i[0].y=d.y));var g=r[p];null!=g&&null!=i[i.length-1]&&(Math.abs(i[i.length-1].x-g.x)<o&&(i[i.length-1].x=g.x),Math.abs(i[i.length-1].y-g.y)<o&&(i[i.length-1].y=g.y)),h=i[0];var y=e,f=r[0],v=!1,C=!1,E=h;null!=f&&(f.x=Math.round(f.x),f.y=Math.round(f.y),y=null);for(c=0;c<2;c++){var S=null!=f&&f.x==E.x,T=null!=f&&f.y==E.y,b=null!=y&&E.y>=y.y&&E.y<=y.y+y.height,w=null!=y&&E.x>=y.x&&E.x<=y.x+y.width;if(v=T||null==f&&b,C=S||null==f&&w,0==c&&(v&&C||S&&T));else{if(null!=f&&!T&&!S&&(b||w)){a=!b;break}if(C||v){a=v,1==c&&(a=i.length%2==0?v:C);break}}y=n,null!=(f=r[p])&&(f.x=Math.round(f.x),f.y=Math.round(f.y),y=null),E=i[i.length-1],S&&T&&(i=i.slice(1))}a&&(null!=r[0]&&r[0].y!=h.y||null==r[0]&&null!=e&&(h.y<e.y||h.y>e.y+e.height))?u(new mxPoint(d.x,h.y)):!a&&(null!=r[0]&&r[0].x!=h.x||null==r[0]&&null!=e&&(h.x<e.x||h.x>e.x+e.width))&&u(new mxPoint(h.x,d.y)),a?d.y=h.y:d.x=h.x;for(c=0;c<i.length;c++)a=!a,h=i[c],a?d.y=h.y:d.x=h.x,u(d.clone())}else h=d,a=!0;if(null==(d=r[p])&&null!=n&&(d=new mxPoint(t.view.getRoutingCenterX(n),t.view.getRoutingCenterY(n))),null!=d&&(d.x=Math.round(d.x),d.y=Math.round(d.y),null!=h&&(a&&(null!=r[p]&&r[p].y!=h.y||null==r[p]&&null!=n&&(h.y<n.y||h.y>n.y+n.height))?u(new mxPoint(d.x,h.y)):!a&&(null!=r[p]&&r[p].x!=h.x||null==r[p]&&null!=n&&(h.x<n.x||h.x>n.x+n.width))&&u(new mxPoint(h.x,d.y)))),null==r[0]&&null!=e)for(;s.length>1&&null!=s[1]&&mxUtils.contains(e,s[1].x,s[1].y);)s.splice(1,1);if(null==r[p]&&null!=n)for(;s.length>1&&null!=s[s.length-1]&&mxUtils.contains(n,s[s.length-1].x,s[s.length-1].y);)s.splice(s.length-1,1);null!=g&&null!=s[s.length-1]&&Math.abs(g.x-s[s.length-1].x)<=o&&Math.abs(g.y-s[s.length-1].y)<=o&&(s.splice(s.length-1,1),null!=s[s.length-1]&&(Math.abs(s[s.length-1].x-g.x)<o&&(s[s.length-1].x=g.x),Math.abs(s[s.length-1].y-g.y)<o&&(s[s.length-1].y=g.y)))},orthBuffer:10,orthPointsFallback:!0,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,n,i,s){var r=mxUtils.getValue(t.style,s?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(t.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));if("auto"==r)if(mxUtils.getValue(t.style,s?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE){var o=mxUtils.getNumber(t.style,s?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);r=Math.max(2,Math.ceil((o+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer}else r=2*mxEdgeStyle.orthBuffer;return r},OrthConnector:function(t,e,n,i,s){var r=t.view.graph,o=null!=e&&r.getModel().isEdge(e.cell),l=null!=n&&r.getModel().isEdge(n.cell),a=t.absolutePoints,h=a[0],u=a[a.length-1],d=null!=e?e.x:h.x,p=null!=e?e.y:h.y,m=null!=e?e.width:0,c=null!=e?e.height:0,x=null!=n?n.x:u.x,g=null!=n?n.y:u.y,y=null!=n?n.width:0,f=null!=n?n.height:0,v=t.view.scale*mxEdgeStyle.getJettySize(t,e,n,i,!0),C=t.view.scale*mxEdgeStyle.getJettySize(t,e,n,i,!1);null!=e&&n==e&&(v=C=Math.max(v,C));var E=C+v,S=!1;null!=h&&null!=u&&(S=(_=u.x-h.x)*_+(N=u.y-h.y)*N<E*E);if(S||mxEdgeStyle.orthPointsFallback&&null!=i&&i.length>0||o||l)mxEdgeStyle.SegmentConnector(t,e,n,i,s);else{var T,b=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],w=0;if(null!=e)if(b[0]=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(w=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0)))d=(T=mxUtils.getBoundingBox(new mxRectangle(d,p,m,c),w)).x,p=T.y,m=T.width,c=T.height;if(null!=n)if(b[1]=mxUtils.getPortConstraints(n,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(w=mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION,0)))x=(T=mxUtils.getBoundingBox(new mxRectangle(x,g,y,f),w)).x,g=T.y,y=T.width,f=T.height;for(var L=[0,0],I=[[d=Math.round(10*d)/10,p=Math.round(10*p)/10,m=Math.round(10*m)/10,c=Math.round(10*c)/10],[x=Math.round(10*x)/10,g=Math.round(10*g)/10,y=Math.round(10*y)/10,f=Math.round(10*f)/10]],A=[v,C],O=0;O<2;O++)mxEdgeStyle.limits[O][1]=I[O][0]-A[O],mxEdgeStyle.limits[O][2]=I[O][1]-A[O],mxEdgeStyle.limits[O][4]=I[O][0]+I[O][2]+A[O],mxEdgeStyle.limits[O][8]=I[O][1]+I[O][3]+A[O];var _,M=I[0][0]+I[0][2]/2,R=I[0][1]+I[0][3]/2,P=I[1][0]+I[1][2]/2,N=R-(I[1][1]+I[1][3]/2),D=0;(_=M-P)<0?D=N<0?2:1:N<=0&&(D=3,0==_&&(D=2));var H=null;null!=e&&(H=h);var G=[[.5,.5],[.5,.5]];for(O=0;O<2;O++)null!=H&&(G[O][0]=(H.x-I[O][0])/I[O][2],Math.abs(H.x-I[O][0])<=1?L[O]=mxConstants.DIRECTION_MASK_WEST:Math.abs(H.x-I[O][0]-I[O][2])<=1&&(L[O]=mxConstants.DIRECTION_MASK_EAST),G[O][1]=(H.y-I[O][1])/I[O][3],Math.abs(H.y-I[O][1])<=1?L[O]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(H.y-I[O][1]-I[O][3])<=1&&(L[O]=mxConstants.DIRECTION_MASK_SOUTH)),H=null,null!=n&&(H=u);var U=I[0][1]-(I[1][1]+I[1][3]),V=I[0][0]-(I[1][0]+I[1][2]),B=I[1][1]-(I[0][1]+I[0][3]),F=I[1][0]-(I[0][0]+I[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(V-E,0),mxEdgeStyle.vertexSeperations[2]=Math.max(U-E,0),mxEdgeStyle.vertexSeperations[4]=Math.max(B-E,0),mxEdgeStyle.vertexSeperations[3]=Math.max(F-E,0);var k=[],Y=[],z=[];Y[0]=V>=F?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,z[0]=U>=B?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,Y[1]=mxUtils.reversePortConstraints(Y[0]),z[1]=mxUtils.reversePortConstraints(z[0]);var j=V>=F?V:F,K=U>=B?U:B,W=[[0,0],[0,0]],X=!1;for(O=0;O<2;O++)0==L[O]&&(0==(Y[O]&b[O])&&(Y[O]=mxUtils.reversePortConstraints(Y[O])),0==(z[O]&b[O])&&(z[O]=mxUtils.reversePortConstraints(z[O])),W[O][0]=z[O],W[O][1]=Y[O]);K>0&&j>0&&((Y[0]&b[0])>0&&(z[1]&b[1])>0?(W[0][0]=Y[0],W[0][1]=z[0],W[1][0]=z[1],W[1][1]=Y[1],X=!0):(z[0]&b[0])>0&&(Y[1]&b[1])>0&&(W[0][0]=z[0],W[0][1]=Y[0],W[1][0]=Y[1],W[1][1]=z[1],X=!0)),K>0&&!X&&(W[0][0]=z[0],W[0][1]=Y[0],W[1][0]=z[1],W[1][1]=Y[1],X=!0),j>0&&!X&&(W[0][0]=Y[0],W[0][1]=z[0],W[1][0]=Y[1],W[1][1]=z[1],X=!0);for(O=0;O<2;O++)0==L[O]&&(0==(W[O][0]&b[O])&&(W[O][0]=W[O][1]),k[O]=W[O][0]&b[O],k[O]|=(W[O][1]&b[O])<<8,k[O]|=(W[1-O][O]&b[O])<<16,k[O]|=(W[1-O][1-O]&b[O])<<24,0==(15&k[O])&&(k[O]=k[O]<<8),0==(3840&k[O])&&(k[O]=15&k[O]|k[O]>>8),0==(983040&k[O])&&(k[O]=65535&k[O]|(251658240&k[O])>>8),L[O]=15&k[O],b[O]!=mxConstants.DIRECTION_MASK_WEST&&b[O]!=mxConstants.DIRECTION_MASK_NORTH&&b[O]!=mxConstants.DIRECTION_MASK_EAST&&b[O]!=mxConstants.DIRECTION_MASK_SOUTH||(L[O]=b[O]));var q=L[0]==mxConstants.DIRECTION_MASK_EAST?3:L[0],Z=L[1]==mxConstants.DIRECTION_MASK_EAST?3:L[1];(q-=D)<1&&(q+=4),(Z-=D)<1&&(Z+=4);var $=mxEdgeStyle.routePatterns[q-1][Z-1];switch(mxEdgeStyle.wayPoints1[0][0]=I[0][0],mxEdgeStyle.wayPoints1[0][1]=I[0][1],L[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=v,mxEdgeStyle.wayPoints1[0][1]+=G[0][1]*I[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=G[0][0]*I[0][2],mxEdgeStyle.wayPoints1[0][1]+=I[0][3]+v;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=I[0][2]+v,mxEdgeStyle.wayPoints1[0][1]+=G[0][1]*I[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=G[0][0]*I[0][2],mxEdgeStyle.wayPoints1[0][1]-=v}var Q=0,J=(L[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,tt=J,et=0;for(O=0;O<$.length;O++){var nt=15&$[O],it=nt==mxConstants.DIRECTION_MASK_EAST?3:nt;(it+=D)>4&&(it-=4);var st=mxEdgeStyle.dirVectors[it-1];(et=it%2>0?0:1)!=J&&(Q++,mxEdgeStyle.wayPoints1[Q][0]=mxEdgeStyle.wayPoints1[Q-1][0],mxEdgeStyle.wayPoints1[Q][1]=mxEdgeStyle.wayPoints1[Q-1][1]);var rt=($[O]&mxEdgeStyle.TARGET_MASK)>0,ot=($[O]&mxEdgeStyle.SOURCE_MASK)>0,lt=($[O]&mxEdgeStyle.SIDE_MASK)>>5;(lt<<=D)>15&&(lt>>=4);var at=($[O]&mxEdgeStyle.CENTER_MASK)>0;if((ot||rt)&&lt<9){var ht=0,ut=ot?0:1;if(ht=at&&0==et?I[ut][0]+G[ut][0]*I[ut][2]:at?I[ut][1]+G[ut][1]*I[ut][3]:mxEdgeStyle.limits[ut][lt],0==et){var dt=(ht-mxEdgeStyle.wayPoints1[Q][0])*st[0];dt>0&&(mxEdgeStyle.wayPoints1[Q][0]+=st[0]*dt)}else{var pt=(ht-mxEdgeStyle.wayPoints1[Q][1])*st[1];pt>0&&(mxEdgeStyle.wayPoints1[Q][1]+=st[1]*pt)}}else at&&(mxEdgeStyle.wayPoints1[Q][0]+=st[0]*Math.abs(mxEdgeStyle.vertexSeperations[it]/2),mxEdgeStyle.wayPoints1[Q][1]+=st[1]*Math.abs(mxEdgeStyle.vertexSeperations[it]/2));Q>0&&mxEdgeStyle.wayPoints1[Q][et]==mxEdgeStyle.wayPoints1[Q-1][et]?Q--:J=et}for(O=0;O<=Q;O++){if(O==Q)if((((L[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1)==tt?0:1)!=(Q+1)%2)break;s.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[O][0]),Math.round(mxEdgeStyle.wayPoints1[O][1])))}for(var mt=1;mt<s.length;)null==s[mt-1]||null==s[mt]||s[mt-1].x!=s[mt].x||s[mt-1].y!=s[mt].y?mt++:s.splice(mt,1)}},getRoutePattern:function(t,e,n,i){var s=t[0]==mxConstants.DIRECTION_MASK_EAST?3:t[0],r=t[1]==mxConstants.DIRECTION_MASK_EAST?3:t[1];(s-=e)<1&&(s+=4),(r-=e)<1&&(r+=4);var o=routePatterns[s-1][r-1];return 0!=n&&0!=i||null!=inlineRoutePatterns[s-1][r-1]&&(o=inlineRoutePatterns[s-1][r-1]),o}};__mxOutput.mxEdgeStyle=void 0!==mxEdgeStyle?mxEdgeStyle:void 0;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}};function mxGraphView(t){this.graph=t,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(t,e){if(this.view=t,this.root=e,this.previous=e,this.isUp=null==e,!this.isUp)for(var n=this.view.currentRoot,i=this.view.graph.getModel();null!=n;){if(n==e){this.isUp=!0;break}n=i.getParent(n)}}function mxGraph(t,e,n,i){this.mouseListeners=null,this.renderHint=n,mxClient.IS_SVG?this.dialect=mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?this.dialect=mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?this.dialect=mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?this.dialect=mxConstants.DIALECT_PREFERHTML:this.dialect=mxConstants.DIALECT_MIXEDHTML,this.model=null!=e?e:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=i?i: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(),null!=t&&this.init(t),this.view.revalidate()}function mxCellOverlay(t,e,n,i,s,r){this.image=t,this.tooltip=e,this.align=null!=n?n:this.align,this.verticalAlign=null!=i?i:this.verticalAlign,this.offset=null!=s?s:new mxPoint,this.cursor=null!=r?r:"help"}function mxOutline(t,e){this.source=t,null!=e&&this.init(e)}function mxMultiplicity(t,e,n,i,s,r,o,l,a,h){this.source=t,this.type=e,this.attr=n,this.value=i,this.min=null!=s?s:0,this.max=null!=r?r:"n",this.validNeighbors=o,this.countError=mxResources.get(l)||l,this.typeError=mxResources.get(a)||a,this.validNeighborsAllowed=null==h||h}function mxLayoutManager(t){this.undoHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.beforeUndo(e.getProperty("edit"))})),this.moveHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.cellsMoved(e.getProperty("cells"),e.getProperty("event"))})),this.setGraph(t)}function mxSwimlaneManager(t,e,n,i){this.horizontal=null==e||e,this.addEnabled=null==n||n,this.resizeEnabled=null==i||i,this.addHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(e.getProperty("cells"))})),this.resizeHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(e.getProperty("cells"))})),this.setGraph(t)}function mxTemporaryCellStates(t,e,n,i,s){e=null!=e?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 r=this;if(null!=s&&(t.graph.cellRenderer.doRedrawShape=function(e){var n=e.shape.paint;e.shape.paint=function(t){var i=s(e);null!=i&&t.setLink(i),n.apply(this,arguments),null!=i&&t.setLink(null)},r.oldDoRedrawShape.apply(t.graph.cellRenderer,arguments),e.shape.paint=n}),t.validateCellState=function(e,n){return null==e||null==i||i(e)?r.oldValidateCellState.apply(t,arguments):null},t.setStates(new mxDictionary),t.setScale(e),null!=n){t.resetValidationState();for(var o=null,l=0;l<n.length;l++){var a=t.getBoundingBox(t.validateCellState(t.validateCell(n[l])));null==o?o=a:o.add(a)}t.setGraphBounds(o||new mxRectangle)}}function mxCellStatePreview(t){this.deltas=new mxDictionary,this.graph=t}function mxConnectionConstraint(t,e,n,i,s){this.point=t,this.perimeter=null==e||e,this.name=n,this.dx=i||0,this.dy=s||0}function mxGraphHandler(t){this.graph=t,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,(function(){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(null!=this.first&&!this.suspended)try{this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.updatePreview(!0),window.setTimeout(mxUtils.bind(this,(function(){this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.graph.getSelectionCells(),!1),this.updatePreview())})),0)}catch(t){this.reset()}})),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler)}function mxPanningHandler(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,(function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");n==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(i)&&(this.start(i),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",i)),i.consume())})),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,(function(t,e){if(this.isPinchEnabled()){var n=e.getProperty("event");mxEvent.isConsumed(n)||"gesturestart"!=n.type?"gestureend"==n.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale&&this.zoomGraph(n)}})),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,(function(){this.active&&this.reset()})),mxEvent.addListener(document,"mouseup",this.mouseUpListener))}function mxPopupMenuHandler(t,e){null!=t&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,(function(t,e){this.inTolerance=!1})),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}function mxCellMarker(t,e,n,i){mxEventSource.call(this),null!=t&&(this.graph=t,this.validColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=n?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=i?i:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}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){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)}function mxConnectionHandler(t,e){mxEventSource.call(this),null!=t&&(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))}function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,(function(t,e){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():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)}function mxRubberband(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,(function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");if(n==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(i)){var s=mxUtils.getOffset(this.graph.container),r=mxUtils.getScrollOrigin(this.graph.container);r.x-=s.x,r.y-=s.y,this.start(i.getX()+r.x,i.getY()+r.y),i.consume(!1)}})),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){null!=this.first&&this.reset()})),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()}))))}function mxHandle(t,e,n){this.graph=t.view.graph,this.state=t,this.cursor=null!=e?e:this.cursor,this.image=null!=n?n:this.image,this.init()}function mxVertexHandler(t){null!=t&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,(function(t,e){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate()),this.reset()})),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxEdgeHandler(t){null!=t&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,(function(e,n){var i=null!=this.index;this.reset(),i&&this.graph.cellRenderer.redraw(this.state,!1,t.view.isRendering())})),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxElbowEdgeHandler(t){mxEdgeHandler.call(this,t)}function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}function mxKeyHandler(t,e){null!=t&&(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),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()}))))}function mxTooltipHandler(t,e){null!=t&&(this.graph=t,this.delay=e||500,this.graph.addMouseListener(this))}function mxCellTracker(t,e,n){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}function mxCellHighlight(t,e,n,i){null!=t&&(this.graph=t,this.highlightColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=i&&i,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,(function(){if(null!=this.state){var t=this.graph.view.getState(this.state.cell);null==t?this.hide():(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))}function mxDefaultKeyHandler(t){if(null!=t){this.editor=t,this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(n){e.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",n))}}}function mxDefaultPopupMenu(t){this.config=t}function mxDefaultToolbar(t,e){this.editor=e,null!=t&&null!=e&&this.init(t)}function mxEditor(t){this.actions=[],this.addActions(),null!=document.body&&(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,null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()}))))}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=void 0!==mxStyleRegistry?mxStyleRegistry:void 0,mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,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=!1,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(null!=t&&t.length>0)for(var n=this.graph.getModel(),i=0;i<t.length;i++)if(n.isVertex(t[i])||n.isEdge(t[i])){var s=this.getState(t[i]);null!=s&&(null==e?e=mxRectangle.fromRectangle(s):e.add(s))}return e},mxGraphView.prototype.setCurrentRoot=function(t){if(this.currentRoot!=t){var e=new mxCurrentRootChange(this,t);e.execute();var n=new mxUndoableEdit(this,!0);n.add(e),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()}return t},mxGraphView.prototype.scaleAndTranslate=function(t,e,n){var i=this.scale,s=new mxPoint(this.translate.x,this.translate.y);this.scale==t&&this.translate.x==e&&this.translate.y==n||(this.scale=t,this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",t,"previousScale",i,"translate",this.translate,"previousTranslate",s))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(t){var e=this.scale;this.scale!=t&&(this.scale=t,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 n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==t&&this.translate.y==e||(this.translate.x=t,this.translate.y=e,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.viewStateChanged=function(){this.revalidate(),this.graph.sizeDidChange()},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(t,e,n){var i=this.graph.getModel();if(t=t||i.getRoot(),e=null!=e&&e,n=null==n||n,this.removeState(t),n&&(e||t!=this.currentRoot))for(var s=i.getChildCount(t),r=0;r<s;r++)this.clear(i.getChildAt(t,r),e);else this.invalidate(t)},mxGraphView.prototype.invalidate=function(t,e,n){var i=this.graph.getModel();t=t||i.getRoot(),e=null==e||e,n=null==n||n;var s=this.getState(t);if(null!=s&&(s.invalid=!0),!t.invalidating){if(t.invalidating=!0,e)for(var r=i.getChildCount(t),o=0;o<r;o++){var l=i.getChildAt(t,o);this.invalidate(l,e,n)}if(n){var a=i.getEdgeCount(t);for(o=0;o<a;o++)this.invalidate(i.getEdgeAt(t,o),e,n)}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 n=null;this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode&&!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),n=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 i=this.getBoundingBox(this.validateCellState(this.validateCell(t||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()))));this.setGraphBounds(null!=i?i:this.getEmptyBounds()),this.validateBackground(),null!=n&&(this.canvas.style.display=n,this.textDiv.parentNode.removeChild(this.textDiv),null!=this.placeholder&&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=null==e||e;var n=null;if(null!=t&&(null!=t.shape&&null!=t.shape.boundingBox&&(n=t.shape.boundingBox.clone()),null!=t.text&&null!=t.text.boundingBox&&(null!=n?n.add(t.text.boundingBox):n=t.text.boundingBox.clone()),e))for(var i=this.graph.getModel(),s=i.getChildCount(t.cell),r=0;r<s;r++){var o=this.getBoundingBox(this.getState(i.getChildAt(t.cell,r)));null!=o&&(null==n?n=o:n.add(o))}return n},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(null!=t){if(null==this.backgroundImage||this.backgroundImage.image!=t.src){null!=this.backgroundImage&&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(),8!=document.documentMode||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 null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null)},mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var t=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),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){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),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))})))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.graph.pageFormat,e=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,t.width*e,t.height*e)},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){if(e=null==e||e,null!=t)if(e=e&&this.graph.isCellVisible(t),null==this.getState(t,e)||e)for(var n=this.graph.getModel(),i=n.getChildCount(t),s=0;s<i;s++)this.validateCell(n.getChildAt(t,s),e&&(!this.isCellCollapsed(t)||t==this.currentRoot));else this.removeState(t);return t},mxGraphView.prototype.validateCellState=function(t,e){e=null==e||e;var n=null;if(null!=t&&null!=(n=this.getState(t))){var i=this.graph.getModel();if(n.invalid&&(n.invalid=!1,(null==n.style||n.invalidStyle)&&(n.style=this.graph.getCellStyle(n.cell),n.invalidStyle=!1),t!=this.currentRoot&&this.validateCellState(i.getParent(t),!1),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!0),!1),!0),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!1),!1),!1),this.updateCellState(n),t==this.currentRoot||n.invalid||(this.graph.cellRenderer.redraw(n,!1,this.isRendering()),n.updateCachedBounds())),e&&!n.invalid){null!=n.shape&&this.stateValidated(n);for(var s=i.getChildCount(t),r=0;r<s;r++)this.validateCellState(i.getChildAt(t,r))}}return n},mxGraphView.prototype.updateCellState=function(t){if(t.absoluteOffset.x=0,t.absoluteOffset.y=0,t.origin.x=0,t.origin.y=0,t.length=0,t.cell!=this.currentRoot){var e=this.graph.getModel(),n=this.getState(e.getParent(t.cell));null!=n&&n.cell!=this.currentRoot&&(t.origin.x+=n.origin.x,t.origin.y+=n.origin.y);var i=this.graph.getChildOffsetForCell(t.cell);null!=i&&(t.origin.x+=i.x,t.origin.y+=i.y);var s=this.graph.getCellGeometry(t.cell);if(null!=s){if(!e.isEdge(t.cell))if(i=null!=s.offset?s.offset:this.EMPTY_POINT,s.relative&&null!=n)if(e.isEdge(n.cell)){var r=this.getPoint(n,s);null!=r&&(t.origin.x+=r.x/this.scale-n.origin.x-this.translate.x,t.origin.y+=r.y/this.scale-n.origin.y-this.translate.y)}else t.origin.x+=s.x*n.unscaledWidth+i.x,t.origin.y+=s.y*n.unscaledHeight+i.y;else t.absoluteOffset.x=this.scale*i.x,t.absoluteOffset.y=this.scale*i.y,t.origin.x+=s.x,t.origin.y+=s.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*s.width,t.unscaledWidth=s.width,t.height=this.scale*s.height,t.unscaledHeight=s.height,e.isVertex(t.cell)&&this.updateVertexState(t,s),e.isEdge(t.cell)&&this.updateEdgeState(t,s)}}t.updateCachedBounds()},mxGraphView.prototype.isCellCollapsed=function(t){return this.graph.isCellCollapsed(t)},mxGraphView.prototype.updateVertexState=function(t,e){var n=this.graph.getModel(),i=this.getState(n.getParent(t.cell));if(e.relative&&null!=i&&!n.isEdge(i.cell)){var s=mxUtils.toRadians(i.style[mxConstants.STYLE_ROTATION]||"0");if(0!=s){var r=Math.cos(s),o=Math.sin(s),l=new mxPoint(t.getCenterX(),t.getCenterY()),a=new mxPoint(i.getCenterX(),i.getCenterY()),h=mxUtils.getRotatedPoint(l,r,o,a);t.x=h.x-t.width/2,t.y=h.y-t.height/2}}this.updateVertexLabelOffset(t)},mxGraphView.prototype.updateEdgeState=function(t,e){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1);if(null!=this.graph.model.getTerminal(t.cell,!0)&&null==n||null==n&&null==e.getTerminalPoint(!0)||null!=this.graph.model.getTerminal(t.cell,!1)&&null==i||null==i&&null==e.getTerminalPoint(!1))this.clear(t.cell,!0);else{this.updateFixedTerminalPoints(t,n,i),this.updatePoints(t,e.points,n,i),this.updateFloatingTerminalPoints(t,n,i);var s=t.absolutePoints;t.cell!=this.currentRoot&&(null==s||s.length<2||null==s[0]||null==s[s.length-1])?this.clear(t.cell,!0):(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)null!=(n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))?n*=this.scale:n=t.width,t.absoluteOffset.x-=n;else if(e==mxConstants.ALIGN_RIGHT)t.absoluteOffset.x+=t.width;else if(e==mxConstants.ALIGN_CENTER){var n;if(null!=(n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))){var i=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),s=0;i==mxConstants.ALIGN_CENTER?s=.5:i==mxConstants.ALIGN_RIGHT&&(s=1),0!=s&&(t.absoluteOffset.x-=(n*this.scale-t.width)*s)}}var r=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);r==mxConstants.ALIGN_TOP?t.absoluteOffset.y-=t.height:r==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,n=e&&this.lastForegroundHtmlNode||this.lastHtmlNode,i=e&&this.lastForegroundNode||this.lastNode,s=this.graph.cellRenderer.insertStateAfter(t,i,n);e?(this.lastForegroundHtmlNode=s[1],this.lastForegroundNode=s[0]):(this.lastHtmlNode=s[1],this.lastNode=s[0])},mxGraphView.prototype.updateFixedTerminalPoints=function(t,e,n){this.updateFixedTerminalPoint(t,e,!0,this.graph.getConnectionConstraint(t,e,!0)),this.updateFixedTerminalPoint(t,n,!1,this.graph.getConnectionConstraint(t,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(t,e,n,i),n)},mxGraphView.prototype.getFixedTerminalPoint=function(t,e,n,i){var s=null;if(null!=i&&(s=this.graph.getConnectionPoint(e,i,!1)),null==s&&null==e){var r=this.scale,o=this.translate,l=t.origin;null!=(s=this.graph.getCellGeometry(t.cell).getTerminalPoint(n))&&(s=new mxPoint(r*(o.x+s.x+l.x),r*(o.y+s.y+l.y)))}return s},mxGraphView.prototype.updateBoundsFromStencil=function(t){var e=null;if(null!=t&&null!=t.shape&&null!=t.shape.stencil&&"fixed"==t.shape.stencil.aspect){e=mxRectangle.fromRectangle(t);var n=t.shape.stencil.computeAspect(t.style,t.x,t.y,t.width,t.height);t.setRect(n.x,n.y,t.shape.stencil.w0*n.width,t.shape.stencil.h0*n.height)}return e},mxGraphView.prototype.updatePoints=function(t,e,n,i){if(null!=t){var s=[];s.push(t.absolutePoints[0]);var r=this.getEdgeStyle(t,e,n,i);if(null!=r){var o=this.getTerminalPort(t,n,!0),l=this.getTerminalPort(t,i,!1),a=this.updateBoundsFromStencil(o),h=this.updateBoundsFromStencil(l);r(t,o,l,e,s),null!=a&&o.setRect(a.x,a.y,a.width,a.height),null!=h&&l.setRect(h.x,h.y,h.width,h.height)}else if(null!=e)for(var u=0;u<e.length;u++)if(null!=e[u]){var d=mxUtils.clone(e[u]);s.push(this.transformControlPoint(t,d))}var p=t.absolutePoints;s.push(p[p.length-1]),t.absolutePoints=s}},mxGraphView.prototype.transformControlPoint=function(t,e){if(null!=t&&null!=e){var n=t.origin;return new mxPoint(this.scale*(e.x+this.translate.x+n.x),this.scale*(e.y+this.translate.y+n.y))}return null},mxGraphView.prototype.isLoopStyleEnabled=function(t,e,n,i){var s=this.graph.getConnectionConstraint(t,n,!0),r=this.graph.getConnectionConstraint(t,i,!1);return!(!(null==e||e.length<2)||mxUtils.getValue(t.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=s&&null!=s.point||null!=r&&null!=r.point))&&(null!=n&&n==i)},mxGraphView.prototype.getEdgeStyle=function(t,e,n,i){var s=this.isLoopStyleEnabled(t,e,n,i)?mxUtils.getValue(t.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(t.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:t.style[mxConstants.STYLE_EDGE];if("string"==typeof s){var r=mxStyleRegistry.getValue(s);null==r&&this.isAllowEval()&&(r=mxUtils.eval(s)),s=r}return"function"==typeof s?s:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(t,e,n){var i=t.absolutePoints,s=i[0];null==i[i.length-1]&&null!=n&&this.updateFloatingTerminalPoint(t,n,e,!1),null==s&&null!=e&&this.updateFloatingTerminalPoint(t,e,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(t,e,n,i),i)},mxGraphView.prototype.getFloatingTerminalPoint=function(t,e,n,i){e=this.getTerminalPort(t,e,i);var s=this.getNextPoint(t,n,i),r=this.graph.isOrthogonal(t),o=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0")),l=new mxPoint(e.getCenterX(),e.getCenterY());if(0!=o){var a=Math.cos(-o),h=Math.sin(-o);s=mxUtils.getRotatedPoint(s,a,h,l)}var u=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(t.style[i?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);var d=this.getPerimeterPoint(e,s,0==o&&r,u);if(0!=o){a=Math.cos(o),h=Math.sin(o);d=mxUtils.getRotatedPoint(d,a,h,l)}return d},mxGraphView.prototype.getTerminalPort=function(t,e,n){var i=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,s=mxUtils.getValue(t.style,i);if(null!=s){var r=this.getState(this.graph.getModel().getCell(s));null!=r&&(e=r)}return e},mxGraphView.prototype.getPerimeterPoint=function(t,e,n,i){var s=null;if(null!=t){var r=this.getPerimeterFunction(t);if(null!=r&&null!=e){var o=this.getPerimeterBounds(t,i);if(o.width>0||o.height>0){s=new mxPoint(e.x,e.y);var l=!1,a=!1;this.graph.model.isVertex(t.cell)&&(l=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),a=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(l=1==mxUtils.getValue(t.style,"stencilFlipH",0)||l,a=1==mxUtils.getValue(t.style,"stencilFlipV",0)||a),l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y)),null!=(s=r(o,t,s,n))&&(l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y))}}null==s&&(s=this.getPoint(t))}return s},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if("string"==typeof e){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,n){var i=t.absolutePoints,s=null;if(null!=i&&i.length>=2){var r=i.length;s=i[n?Math.min(1,r-1):Math.max(0,r-2)]}return null==s&&null!=e&&(s=new mxPoint(e.getCenterX(),e.getCenterY())),s},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var n=this.graph.getModel(),i=n.getTerminal(t,e),s=i;null!=i&&i!=this.currentRoot;)this.graph.isCellVisible(s)&&!this.isCellCollapsed(i)||(s=i),i=n.getParent(i);return null==s||n.contains(s)&&n.getParent(s)!=n.getRoot()&&s!=this.currentRoot||(s=null),s},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,n=e[0],i=e[e.length-1];if(n.x!=i.x||n.y!=i.y){var s=i.x-n.x,r=i.y-n.y;t.terminalDistance=Math.sqrt(s*s+r*r)}else t.terminalDistance=0;var o=0,l=[],a=n;if(null!=a){for(var h=a.x,u=a.y,d=h,p=u,m=1;m<e.length;m++){var c=e[m];if(null!=c){s=a.x-c.x,r=a.y-c.y;var x=Math.sqrt(s*s+r*r);l.push(x),o+=x,a=c,h=Math.min(a.x,h),u=Math.min(a.y,u),d=Math.max(a.x,d),p=Math.max(a.y,p)}}t.length=o,t.segments=l;t.x=h,t.y=u,t.width=Math.max(1,d-h),t.height=Math.max(1,p-u)}},mxGraphView.prototype.getPoint=function(t,e){var n=t.getCenterX(),i=t.getCenterY();if(null==t.segments||null!=e&&!e.relative){if(null!=e){null!=(m=e.offset)&&(n+=m.x,i+=m.y)}}else{for(var s=null!=e?e.x/2:0,r=t.absolutePoints.length,o=Math.round((s+.5)*t.length),l=t.segments[0],a=0,h=1;o>=Math.round(a+l)&&h<r-1;)a+=l,l=t.segments[h++];var u=0==l?0:(o-a)/l,d=t.absolutePoints[h-1],p=t.absolutePoints[h];if(null!=d&&null!=p){var m,c=0,x=0,g=0;if(null!=e)c=e.y,null!=(m=e.offset)&&(x=m.x,g=m.y);var y=p.x-d.x,f=p.y-d.y,v=0==l?0:f/l,C=0==l?0:y/l;n=d.x+y*u+(v*c+x)*this.scale,i=d.y+f*u-(C*c-g)*this.scale}}return new mxPoint(n,i)},mxGraphView.prototype.getRelativePoint=function(t,e,n){var i=this.graph.getModel().getGeometry(t.cell);if(null!=i){var s=t.absolutePoints.length;if(i.relative&&s>1){for(var r=t.length,o=t.segments,l=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n),u=0,d=0,p=0,m=2;m<s;m++){d+=o[m-2],a=t.absolutePoints[m];var c=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n);c<=h&&(h=c,u=m-1,p=d),l=a}var x=o[u];l=t.absolutePoints[u],a=t.absolutePoints[u+1];var g=l.x,y=l.y,f=a.x,v=a.y,C=e,E=n,S=g-f,T=y-v,b=0,w=(C=S-(C-=f))*S+(E=T-(E-=v))*T;b=w<=0?0:w*w/(S*S+T*T);var L=Math.sqrt(b);L>x&&(L=x);var I=Math.sqrt(mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n));return-1==mxUtils.relativeCcw(l.x,l.y,a.x,a.y,e,n)&&(I=-I),new mxPoint((r/2-p-L)/r*-2,I/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=e&&e.length>0&&null!=t.segments){var n=this.graph.getCellGeometry(t.cell);if(n.relative){var i=this.getPoint(t,n);null!=i&&(t.absoluteOffset=i)}else{var s=e[0],r=e[e.length-1];if(null!=s&&null!=r){var o=r.x-s.x,l=r.y-s.y,a=0,h=0,u=n.offset;null!=u&&(a=u.x,h=u.y);var d=s.x+o/2+a*this.scale,p=s.y+l/2+h*this.scale;t.absoluteOffset.x=d,t.absoluteOffset.y=p}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var n=null;return null!=t&&(n=this.states.get(t),e&&(null==n||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==n?(n=this.createState(t),this.states.put(t,n)):n.style=this.graph.getCellStyle(t))),n},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(null==t)return this.states;for(var e=[],n=0;n<t.length;n++){var i=this.getState(t[n]);null!=i&&e.push(i)}return e},mxGraphView.prototype.removeState=function(t){var e=null;return null!=t&&null!=(e=this.states.remove(t))&&(this.graph.cellRenderer.destroy(e),e.invalid=!0,e.destroy()),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||null!=e.parentNode&&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),n=new mxPoint(t.clientX-e.x,t.clientY-e.y),i=this.graph.container.offsetWidth,s=this.graph.container.clientWidth;if(i>s&&n.x>s+2&&n.x<=i)return!0;var r=this.graph.container.offsetHeight,o=this.graph.container.clientHeight;return r>o&&n.y>o+2&&n.y<=r},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(null!=e){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)})))),mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){!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))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))}))),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.dblClick(e)})));t.addMouseListener({mouseDown:function(e,n){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,(function(n){null!=t.tooltipHandler&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(n)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&!mxEvent.isConsumed(n)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(n,function(n){var i=null;if(mxClient.IS_TOUCH){var s=mxEvent.getClientX(n),r=mxEvent.getClientY(n),o=mxUtils.convertPoint(e,s,r);i=t.view.getState(t.getCellAt(o.x,o.y))}return i}(n)))})),this.endHandler=mxUtils.bind(this,(function(e){this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(e)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&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(null!=t&&(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),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds(),n=e.x+e.width+this.graph.border,i=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(n,i)}));mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(null!=this.graph.container){var n=this.graph.container.offsetWidth,i=this.graph.container.offsetHeight;this.canvas.style.width=n<t?t+"px":"100%",this.canvas.style.height=i<e?e+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(t,e){var n=document.createElement("DIV");return null!=t&&null!=e?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t,n.style.height=e):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var t=this.graph.container;if(null!=t){var e=t.offsetWidth,n=t.offsetHeight;this.canvas=this.createVmlPane(e,n),this.canvas.style.overflow="hidden",this.backgroundPane=this.createVmlPane(e,n),this.drawPane=this.createVmlPane(e,n),this.overlayPane=this.createVmlPane(e,n),this.decoratorPane=this.createVmlPane(e,n),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 n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t+"px",n.style.height=e+"px",n.setAttribute("coordsize",t+","+e),n.setAttribute("coordorigin","0,0"),n},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),(mxClient.IS_IE||mxClient.IS_IE11)&&(e.style.overflow="hidden"),null!=t&&(t.appendChild(e),this.updateContainerStyle(t))},mxGraphView.prototype.updateContainerStyle=function(t){var e=mxUtils.getCurrentStyle(t);null!=e&&"static"==e.position&&(t.style.position="relative"),mxClient.IS_POINTER&&(t.style.touchAction="none")},mxGraphView.prototype.destroy=function(){var t=null!=this.canvas?this.canvas.ownerSVGElement:null;null==t&&(t=this.canvas),null!=t&&null!=t.parentNode&&(this.clear(this.currentRoot,!0),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)},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);null!=e&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();var n=this.isUp?mxEvent.UP:mxEvent.DOWN;this.view.fireEvent(new mxEventObject(n,"root",this.view.currentRoot,"previous",this.previous)),this.isUp=!this.isUp},__mxOutput.mxGraphView=void 0!==mxGraphView?mxGraphView:void 0,mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,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=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.nativeDblClickEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=500,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.tapAndHoldEnabled=!0,mxGraph.prototype.tapAndHoldDelay=500,mxGraph.prototype.tapAndHoldInProgress=!1,mxGraph.prototype.tapAndHoldValid=!1,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=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoSizeCellsOnAdd=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.translateToScrollPosition=!1,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!1,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.constrainRelativeChildren=!1,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.extendParentsOnMove=!1,mxGraph.prototype.recursiveResize=!1,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,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="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"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(){null!=this.tooltipHandler&&this.tooltipHandler.hide()}))),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)})))),8==document.documentMode&&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(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,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){for(var e=new mxDictionary,n=[],i=mxUtils.bind(this,(function(t){if(!e.get(t)&&this.model.contains(t))if(this.model.isEdge(t)||this.model.isVertex(t))e.put(t,!0),n.push(t);else for(var s=this.model.getChildCount(t),r=0;r<s;r++)i(this.model.getChildAt(t,r))})),s=0;s<t.length;s++){var r=t[s];if(r.constructor!=mxRootChange){var o=null;r instanceof mxChildChange?o=r.child:null!=r.cell&&r.cell instanceof mxCell&&(o=r.cell),null!=o&&i(o)}}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(){for(var t=this.getSelectionCells(),e=[],n=0;n<t.length;n++)if(this.model.contains(t[n])&&this.isCellVisible(t[n]))for(var i=this.model.getParent(t[n]);null!=i&&i!=this.view.currentRoot;){if(this.isCellCollapsed(i)||!this.isCellVisible(i)){e.push(t[n]);break}i=this.model.getParent(i)}else e.push(t[n]);this.removeSelectionCells(e)},mxGraph.prototype.processChange=function(t){if(t instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(t.previous),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,!0,!0),this.model.contains(e)&&!this.isCellCollapsed(e)||(this.view.invalidate(t.child,!0,!0),this.removeStateForCell(t.child),this.view.currentRoot==t.child&&this.home()),e!=t.previous&&(null!=e&&this.view.invalidate(e,!1,!1),null!=t.previous&&this.view.invalidate(t.previous,!1,!1))}else if(t instanceof mxTerminalChange||t instanceof mxGeometryChange)(t instanceof mxTerminalChange||null==t.previous&&null!=t.geometry||null!=t.previous&&!t.previous.equals(t.geometry))&&this.view.invalidate(t.cell);else if(t instanceof mxValueChange)this.view.invalidate(t.cell,!1,!1);else if(t instanceof mxStyleChange){this.view.invalidate(t.cell,!0,!0);var n=this.view.getState(t.cell);null!=n&&(n.invalidStyle=!0)}else null!=t.cell&&t.cell instanceof mxCell&&this.removeStateForCell(t.cell)},mxGraph.prototype.removeStateForCell=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.removeStateForCell(this.model.getChildAt(t,n));this.view.invalidate(t,!1,!0),this.view.removeState(t)},mxGraph.prototype.addCellOverlay=function(t,e){null==t.overlays&&(t.overlays=[]),t.overlays.push(e);var n=this.view.getState(t);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",t,"overlay",e)),e},mxGraph.prototype.getCellOverlays=function(t){return t.overlays},mxGraph.prototype.removeCellOverlay=function(t,e){if(null==e)this.removeCellOverlays(t);else{var n=mxUtils.indexOf(t.overlays,e);if(n>=0){t.overlays.splice(n,1),0==t.overlays.length&&(t.overlays=null);var i=this.view.getState(t);null!=i&&this.cellRenderer.redraw(i),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(null!=e){t.overlays=null;var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n);for(var i=0;i<e.length;i++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e[i]))}return e},mxGraph.prototype.clearCellOverlays=function(t){t=null!=t?t:this.model.getRoot(),this.removeCellOverlays(t);for(var e=this.model.getChildCount(t),n=0;n<e;n++){var i=this.model.getChildAt(t,n);this.clearCellOverlays(i)}},mxGraph.prototype.setCellWarning=function(t,e,n,i){if(null!=e&&e.length>0){var s=new mxCellOverlay(n=null!=n?n:this.warningImage,"<font color=red>"+e+"</font>");return i&&s.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,n){this.isEnabled()&&this.setSelectionCell(t)}))),this.addCellOverlay(t,s)}return this.removeCellOverlays(t),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(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,n){this.model.beginUpdate();try{var i=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",i,"event",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,n){this.model.beginUpdate();try{this.model.setValue(t,e),n&&this.cellSizeUpdated(t,!1)}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(),n=t.getCell(),i=new mxEventObject(mxEvent.CLICK,"event",e,"cell",n);if(t.isConsumed()&&i.consume(),this.fireEvent(i),this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed())if(null!=n){if(this.isTransparentClickEvent(e)){var s=!1,r=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);return!(s=s||e)||e})));null!=r&&(n=r)}this.selectCellForEvent(n,e)}else{var o=null;this.isSwimlaneSelectionEnabled()&&(o=this.getSwimlaneAt(t.getGraphX(),t.getGraphY())),null!=o?this.selectCellForEvent(o,e):this.isToggleEvent(e)||this.clearSelection()}},mxGraph.prototype.dblClick=function(t,e){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(n),!this.isEnabled()||mxEvent.isConsumed(t)||n.isConsumed()||null==e||!this.isCellEditable(e)||this.isEditing(e)||(this.startEditingAtCell(e,t),mxEvent.consume(t))},mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent(),n=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());if(this.fireEvent(n),n.isConsumed()&&(this.panningHandler.panningTrigger=!1),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()&&this.connectionHandler.isEnabled()){var i=this.view.getState(this.connectionHandler.marker.getCell(t));null!=i&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=i,this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t),this.connectionHandler.previous=i,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous)))}},mxGraph.prototype.scrollPointToVisible=function(t,e,n,i){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(t+this.panDx,e+this.panDy));else{var s=this.container;if(i=null!=i?i:20,t>=s.scrollLeft&&e>=s.scrollTop&&t<=s.scrollLeft+s.clientWidth&&e<=s.scrollTop+s.clientHeight){var r=s.scrollLeft+s.clientWidth-t;if(r<i){var o=s.scrollLeft;if(s.scrollLeft+=i-r,n&&o==s.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){var l=this.view.getDrawPane().ownerSVGElement,a=this.container.scrollWidth+i-r;l.style.width=a+"px"}else{a=Math.max(s.clientWidth,s.scrollWidth)+i-r;this.view.getCanvas().style.width=a+"px"}s.scrollLeft+=i-r}}else(r=t-s.scrollLeft)<i&&(s.scrollLeft-=i-r);var h=s.scrollTop+s.clientHeight-e;if(h<i){o=s.scrollTop;if(s.scrollTop+=i-h,o==s.scrollTop&&n){if(this.dialect==mxConstants.DIALECT_SVG){l=this.view.getDrawPane().ownerSVGElement;var u=this.container.scrollHeight+i-h;l.style.height=u+"px"}else{u=Math.max(s.clientHeight,s.scrollHeight)+i-h;this.view.getCanvas().style.height=u+"px"}s.scrollTop+=i-h}}else(h=e-s.scrollTop)<i&&(s.scrollTop-=i-h)}}},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)+("none"!=t.borderLeftStyle?mxUtils.parseCssNumber(t.borderLeftWidth):0),mxUtils.parseCssNumber(t.paddingTop)+("none"!=t.borderTopStyle?mxUtils.parseCssNumber(t.borderTopWidth):0),mxUtils.parseCssNumber(t.paddingRight)+("none"!=t.borderRightStyle?mxUtils.parseCssNumber(t.borderRightWidth):0),mxUtils.parseCssNumber(t.paddingBottom)+("none"!=t.borderBottomStyle?mxUtils.parseCssNumber(t.borderBottomWidth):0))},mxGraph.prototype.getPreferredPageSize=function(t,e,n){this.view.scale;var i=this.view.translate,s=this.pageFormat,r=this.pageScale,o=new mxRectangle(0,0,Math.ceil(s.width*r),Math.ceil(s.height*r)),l=this.pageBreaksVisible?Math.ceil(e/o.width):1,a=this.pageBreaksVisible?Math.ceil(n/o.height):1;return new mxRectangle(0,0,l*o.width+2+i.x,a*o.height+2+i.y)},mxGraph.prototype.fit=function(t,e,n,i,s,r,o){if(null!=this.container){t=null!=t?t:this.getBorder(),e=null!=e&&e,n=null!=n?n:0,i=null==i||i,s=null!=s&&s,r=null!=r&&r;var l=this.getBorderSizes(),a=this.container.offsetWidth-l.x-l.width-1,h=null!=o?o:this.container.offsetHeight-l.y-l.height-1,u=this.view.getGraphBounds();if(u.width>0&&u.height>0){e&&null!=u.x&&null!=u.y&&((u=u.clone()).width+=u.x,u.height+=u.y,u.x=0,u.y=0);var d=this.view.scale,p=u.width/d,m=u.height/d;null!=this.backgroundImage&&(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)+n+1;a-=c,h-=c;var x=s?h/m:r?a/p:Math.min(a/p,h/m);if(null!=this.minFitScale&&(x=Math.max(x,this.minFitScale)),null!=this.maxFitScale&&(x=Math.min(x,this.maxFitScale)),!i)return x;if(e)this.view.scale!=x&&this.view.setScale(x);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(x);var g=this.getGraphBounds();null!=g.x&&(this.container.scrollLeft=g.x),null!=g.y&&(this.container.scrollTop=g.y)}else{var y=null!=u.x?Math.floor(this.view.translate.x-u.x/d+t/x+n/2):t,f=null!=u.y?Math.floor(this.view.translate.y-u.y/d+t/x+n/2):t;this.view.scaleAndTranslate(x,y,f)}}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(null!=this.container){var e=this.getBorder(),n=Math.max(0,t.x)+t.width+2*e,i=Math.max(0,t.y)+t.height+2*e;if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),i=Math.max(i,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,i),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var s=this.getPreferredPageSize(t,Math.max(1,n),Math.max(1,i));null!=s&&(n=s.width*this.view.scale,i=s.height*this.view.scale)}if(null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),i=Math.max(i,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n),i=Math.ceil(i),this.dialect==mxConstants.DIALECT_SVG){var r=this.view.getDrawPane().ownerSVGElement;null!=r&&(r.style.minWidth=Math.max(1,n)+"px",r.style.minHeight=Math.max(1,i)+"px",r.style.width="100%",r.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,i)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,i)+"px");this.updatePageBreaks(this.pageBreaksVisible,n,i)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(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,n){var i=this.view.scale,s=this.view.translate,r=this.pageFormat,o=i*this.pageScale,l=new mxRectangle(0,0,r.width*o,r.height*o),a=mxRectangle.fromRectangle(this.getGraphBounds());a.width=Math.max(1,a.width),a.height=Math.max(1,a.height),l.x=Math.floor((a.x-s.x*i)/l.width)*l.width+s.x*i,l.y=Math.floor((a.y-s.y*i)/l.height)*l.height+s.y*i,a.width=Math.ceil((a.width+(a.x-l.x))/l.width)*l.width,a.height=Math.ceil((a.height+(a.y-l.y))/l.height)*l.height;var h=(t=t&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(a.height/l.height)+1:0,u=t?Math.ceil(a.width/l.width)+1:0,d=(u-1)*l.width,p=(h-1)*l.height;null==this.horizontalPageBreaks&&h>0&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&u>0&&(this.verticalPageBreaks=[]);var m=mxUtils.bind(this,(function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:u,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+n*l.height)),new mxPoint(Math.round(l.x+d),Math.round(l.y+n*l.height))]:[new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y)),new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y+p))];if(null!=t[n])t[n].points=i,t[n].redraw();else{var s=new mxPolyline(i,this.pageBreakColor);s.dialect=this.dialect,s.pointerEvents=!1,s.isDashed=this.pageBreakDashed,s.init(this.view.backgroundPane),s.redraw(),t[n]=s}}for(n=e;n<t.length;n++)t[n].destroy();t.splice(e,t.length-e)}}));m(this.horizontalPageBreaks),m(this.verticalPageBreaks)},mxGraph.prototype.getCellStyle=function(t){var e=this.model.getStyle(t),n=null;return n=this.model.isEdge(t)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle(),null!=e&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(e,n))),null==n&&(n=new Object),n},mxGraph.prototype.postProcessCellStyle=function(t){if(null!=t){var e=t[mxConstants.STYLE_IMAGE],n=this.getImageFromBundles(e);if(null!=n?t[mxConstants.STYLE_IMAGE]=n:n=e,null!=n&&"data:image/"==n.substring(0,11)){if("data:image/svg+xml,<"==n.substring(0,20))n=n.substring(0,19)+encodeURIComponent(n.substring(19));else if("data:image/svg+xml,%3C"!=n.substring(0,22)){var i=n.indexOf(",");i>0&&";base64,"!=n.substring(i-7,i+1)&&(n=n.substring(0,i)+";base64,"+n.substring(i+1))}t[mxConstants.STYLE_IMAGE]=n}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setStyle(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(t,e,n){return n=n||this.getSelectionCell(),this.toggleCellStyles(t,e,[n])},mxGraph.prototype.toggleCellStyles=function(t,e,n){e=null!=e&&e;var i=null;if(null!=(n=n||this.getSelectionCells())&&n.length>0){var s=this.view.getState(n[0]),r=null!=s?s.style:this.getCellStyle(n[0]);null!=r&&(i=mxUtils.getValue(r,t,e)?0:1,this.setCellStyles(t,i,n))}return i},mxGraph.prototype.setCellStyles=function(t,e,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,n){this.setCellStyleFlags(t,e,null,n)},mxGraph.prototype.setCellStyleFlags=function(t,e,n,i){if(null!=(i=i||this.getSelectionCells())&&i.length>0){if(null==n){var s=this.view.getState(i[0]),r=null!=s?s.style:this.getCellStyle(i[0]);if(null!=r)n=!((parseInt(r[t]||0)&e)==e)}mxUtils.setCellStyleFlags(this.model,i,t,e,n)}},mxGraph.prototype.alignCells=function(t,e,n){if(null==e&&(e=this.getSelectionCells()),null!=e&&e.length>1){if(null==n)for(var i=0;i<e.length;i++){if(null!=(r=this.view.getState(e[i]))&&!this.model.isEdge(e[i]))if(null==n){if(t==mxConstants.ALIGN_CENTER){n=r.x+r.width/2;break}if(t==mxConstants.ALIGN_RIGHT)n=r.x+r.width;else if(t==mxConstants.ALIGN_TOP)n=r.y;else{if(t==mxConstants.ALIGN_MIDDLE){n=r.y+r.height/2;break}n=t==mxConstants.ALIGN_BOTTOM?r.y+r.height:r.x}}else n=t==mxConstants.ALIGN_RIGHT?Math.max(n,r.x+r.width):t==mxConstants.ALIGN_TOP?Math.min(n,r.y):t==mxConstants.ALIGN_BOTTOM?Math.max(n,r.y+r.height):Math.min(n,r.x)}if(null!=n){var s=this.view.scale;this.model.beginUpdate();try{for(i=0;i<e.length;i++){var r;if(null!=(r=this.view.getState(e[i]))){var o=this.getCellGeometry(e[i]);null==o||this.model.isEdge(e[i])||(o=o.clone(),t==mxConstants.ALIGN_CENTER?o.x+=(n-r.x-r.width/2)/s:t==mxConstants.ALIGN_RIGHT?o.x+=(n-r.x-r.width)/s:t==mxConstants.ALIGN_TOP?o.y+=(n-r.y)/s:t==mxConstants.ALIGN_MIDDLE?o.y+=(n-r.y-r.height/2)/s:t==mxConstants.ALIGN_BOTTOM?o.y+=(n-r.y-r.height)/s:o.x+=(n-r.x)/s,this.resizeCell(e[i],o))}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",e))}finally{this.model.endUpdate()}}}return e},mxGraph.prototype.flipEdge=function(t){if(null!=t&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var e=this.model.getStyle(t);null==e||0==e.length?this.model.setStyle(t,this.alternateEdgeStyle):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){for(var e=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=t&&e.push(this.imageBundles[n]);this.imageBundles=e},mxGraph.prototype.getImageFromBundles=function(t){if(null!=t)for(var e=0;e<this.imageBundles.length;e++){var n=this.imageBundles[e].getImage(t);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(t,e){null==e&&(e=mxUtils.sortCells(this.getSelectionCells(),!0)),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(null!=t){this.model.beginUpdate();try{for(var n=0;n<t.length;n++){var i=this.model.getParent(t[n]);e?this.model.add(i,t[n],n):this.model.add(i,t[n],this.model.getChildCount(i)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",e,"cells",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(t,e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==t&&(t=this.createGroupCell(n));var i=this.getBoundsForGroup(t,n,e);if(n.length>0&&null!=i){var s=this.model.getParent(t);null==s&&(s=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var r=this.model.getChildCount(s);this.cellsAdded([t],s,r,null,null,!1,!1,!1),r=this.model.getChildCount(t),this.cellsAdded(n,t,r,null,null,!1,!1,!1),this.cellsMoved(n,-i.x,-i.y,!1,!1,!1),this.cellsResized([t],[i],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",n))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&t.length>0){var n=this.model.getParent(t[0]);e.push(t[0]);for(var i=1;i<t.length;i++)this.model.getParent(t[i])==n&&e.push(t[i])}return e},mxGraph.prototype.getBoundsForGroup=function(t,e,n){var i=this.getBoundingBoxFromGeometry(e,!0);if(null!=i){if(this.isSwimlane(t)){var s=this.getStartSize(t);i.x-=s.width,i.y-=s.height,i.width+=s.width,i.height+=s.height}null!=n&&(i.x-=n,i.y-=n,i.width+=2*n,i.height+=2*n)}return i},mxGraph.prototype.createGroupCell=function(t){var e=new mxCell("");return e.setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(t){var e=[];if(null==t){t=this.getSelectionCells();for(var n=[],i=0;i<t.length;i++)this.model.getChildCount(t[i])>0&&n.push(t[i]);t=n}if(null!=t&&t.length>0){this.model.beginUpdate();try{for(i=0;i<t.length;i++){var s=this.model.getChildren(t[i]);if(null!=s&&s.length>0){s=s.slice();var r=this.model.getParent(t[i]),o=this.model.getChildCount(r);this.cellsAdded(s,r,o,null,null,!0),e=e.concat(s)}}this.removeCellsAfterUngroup(t),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),n=this.model.getChildCount(e);this.cellsAdded(t,e,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,n,i,s,r,o){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,n=null!=n&&n,i=null!=i?i:0,s=null!=s?s:0,r=null!=r?r:0,o=null!=o?o:0,this.model.beginUpdate();try{for(var l=t.length-1;l>=0;l--){var a=this.getCellGeometry(t[l]);if(null!=a){var h=this.getChildCells(t[l]);if(null!=h&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,!0);if(null!=u&&u.width>0&&u.height>0){var d=0,p=0;if(this.isSwimlane(t[l])){var m=this.getStartSize(t[l]);d=m.width,p=m.height}a=a.clone(),n&&(a.x=Math.round(a.x+u.x-e-d-o),a.y=Math.round(a.y+u.y-e-p-i)),a.width=Math.round(u.width+2*e+d+o+s),a.height=Math.round(u.height+2*e+p+i+r),this.model.setGeometry(t[l],a),this.moveCells(h,e+d-u.x+o,e+p-u.y+i)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&t.length>0)for(var n=0;n<t.length;n++)if(this.model.isVertex(t[n])||this.model.isEdge(t[n])){var i=this.view.getBoundingBox(this.view.getState(t[n]),!0);null!=i&&(null==e?e=mxRectangle.fromRectangle(i):e.add(i))}return e},mxGraph.prototype.cloneCell=function(t,e,n,i){return this.cloneCells([t],e,n,i)[0]},mxGraph.prototype.cloneCells=function(t,e,n,i){e=null==e||e;var s=null;if(null!=t){for(var r=new mxDictionary,o=[],l=0;l<t.length;l++)r.put(t[l],!0),o.push(t[l]);if(o.length>0){var a=this.view.scale,h=this.view.translate;s=this.model.cloneCells(t,!0,n);for(l=0;l<t.length;l++)if(!e&&this.model.isEdge(s[l])&&null!=this.getEdgeValidationError(s[l],this.model.getTerminal(s[l],!0),this.model.getTerminal(s[l],!1)))s[l]=null;else{var u=this.model.getGeometry(s[l]);if(null!=u){var d=this.view.getState(t[l]),p=this.view.getState(this.model.getParent(t[l]));if(null!=d&&null!=p){var m=i?0:p.origin.x,c=i?0:p.origin.y;if(this.model.isEdge(s[l])){var x=d.absolutePoints;if(null!=x){for(var g=this.model.getTerminal(t[l],!0);null!=g&&!r.get(g);)g=this.model.getParent(g);null==g&&null!=x[0]&&u.setTerminalPoint(new mxPoint(x[0].x/a-h.x,x[0].y/a-h.y),!0);for(var y=this.model.getTerminal(t[l],!1);null!=y&&!r.get(y);)y=this.model.getParent(y);var f=x.length-1;null==y&&null!=x[f]&&u.setTerminalPoint(new mxPoint(x[f].x/a-h.x,x[f].y/a-h.y),!1);var v=u.points;if(null!=v)for(var C=0;C<v.length;C++)v[C].x+=m,v[C].y+=c}}else u.translate(m,c)}}}}else s=[]}return s},mxGraph.prototype.insertVertex=function(t,e,n,i,s,r,o,l,a){var h=this.createVertex(t,e,n,i,s,r,o,l,a);return this.addCell(h,t)},mxGraph.prototype.createVertex=function(t,e,n,i,s,r,o,l,a){var h=new mxGeometry(i,s,r,o);h.relative=null!=a&&a;var u=new mxCell(n,h,l);return u.setId(e),u.setVertex(!0),u.setConnectable(!0),u},mxGraph.prototype.insertEdge=function(t,e,n,i,s,r){var o=this.createEdge(t,e,n,i,s,r);return this.addEdge(o,t,i,s)},mxGraph.prototype.createEdge=function(t,e,n,i,s,r){var o=new mxCell(n,new mxGeometry,r);return o.setId(e),o.setEdge(!0),o.geometry.relative=!0,o},mxGraph.prototype.addEdge=function(t,e,n,i,s){return this.addCell(t,e,s,n,i)},mxGraph.prototype.addCell=function(t,e,n,i,s){return this.addCells([t],e,n,i,s)[0]},mxGraph.prototype.addCells=function(t,e,n,i,s,r){null==e&&(e=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(e)),this.model.beginUpdate();try{this.cellsAdded(t,e,n,i,s,null!=r&&r,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",t,"parent",e,"index",n,"source",i,"target",s))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsAdded=function(t,e,n,i,s,r,o,l){if(null!=t&&null!=e&&null!=n){this.model.beginUpdate();try{for(var a=r?this.view.getState(e):null,h=null!=a?a.origin:null,u=new mxPoint(0,0),d=0;d<t.length;d++)if(null==t[d])n--;else{var p=this.model.getParent(t[d]);if(null!=h&&t[d]!=e&&e!=p){var m=this.view.getState(p),c=null!=m?m.origin:u,x=this.model.getGeometry(t[d]);if(null!=x){var g=c.x-h.x,y=c.y-h.y;(x=x.clone()).translate(g,y),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)}}e==p&&n+d>this.model.getChildCount(e)&&n--,this.model.add(e,t[d],n+d),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[d],!0),(null==l||l)&&this.isExtendParentsOnAdd(t[d])&&this.isExtendParent(t[d])&&this.extendParent(t[d]),(null==o||o)&&this.constrainChild(t[d]),null!=i&&this.cellConnected(t[d],i,!0),null!=s&&this.cellConnected(t[d],s,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",n,"source",i,"target",s,"absolute",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var n=this.model.getChildCount(t),i=0;i<n;i++)this.autoSizeCell(this.model.getChildAt(t,i));this.getModel().isVertex(t)&&this.isAutoSizeCell(t)&&this.updateCellSize(t)},mxGraph.prototype.removeCells=function(t,e){if(e=null==e||e,null==t&&(t=this.getDeletableCells(this.getSelectionCells())),e)t=this.getDeletableCells(this.addAllEdges(t));else{t=t.slice();for(var n=this.getDeletableCells(this.getAllEdges(t)),i=new mxDictionary,s=0;s<t.length;s++)i.put(t[s],!0);for(s=0;s<n.length;s++)null!=this.view.getState(n[s])||i.get(n[s])||(i.put(n[s],!0),t.push(n[s]))}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(null!=t&&t.length>0){var e=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var i=new mxDictionary,s=0;s<t.length;s++)i.put(t[s],!0);for(s=0;s<t.length;s++){for(var r=this.getAllEdges([t[s]]),o=mxUtils.bind(this,(function(i,r){var o=this.model.getGeometry(i);if(null!=o){for(var l=this.model.getTerminal(i,r),a=!1,h=l;null!=h;){if(t[s]==h){a=!0;break}h=this.model.getParent(h)}if(a){o=o.clone();var u=this.view.getState(i);if(null!=u&&null!=u.absolutePoints){var d=u.absolutePoints,p=r?0:d.length-1;o.setTerminalPoint(new mxPoint(d[p].x/e-n.x-u.origin.x,d[p].y/e-n.y-u.origin.y),r)}else{var m=this.view.getState(l);null!=m&&o.setTerminalPoint(new mxPoint(m.getCenterX()/e-n.x,m.getCenterY()/e-n.y),r)}this.model.setGeometry(i,o),this.model.setTerminal(i,null,r)}}})),l=0;l<r.length;l++)i.get(r[l])||(i.put(r[l],!0),o(r[l],!0),o(r[l],!1));this.model.remove(t[s])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(t,e,n,i,s){i=i||0,s=s||0;var r=this.model.getParent(t),o=this.model.getTerminal(t,!0);this.model.beginUpdate();try{if(null==n){n=this.cloneCell(t);var l=this.view.getState(t),a=this.getCellGeometry(n);if(null!=a&&null!=a.points&&null!=l){var h=this.view.translate,u=this.view.scale,d=mxUtils.findNearestSegment(l,(i+h.x)*u,(s+h.y)*u);a.points=a.points.slice(0,d),null!=(a=this.getCellGeometry(t))&&null!=a.points&&((a=a.clone()).points=a.points.slice(d),this.model.setGeometry(t,a))}}this.cellsMoved(e,i,s,!1,!1),this.cellsAdded(e,r,this.model.getChildCount(r),null,null,!0),this.cellsAdded([n],r,this.model.getChildCount(r),o,e[0],!1),this.cellConnected(t,e[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",t,"cells",e,"newEdge",n,"dx",i,"dy",s))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(t,e,n){null==e&&(e=this.getSelectionCells()),n&&(e=this.addAllEdges(e)),this.model.beginUpdate();try{this.cellsToggled(e,t),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",t,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsToggled=function(t,e){if(null!=t&&t.length>0){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setVisible(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(t,e,n,i,s){e=null!=e&&e,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),t)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,t,e,i),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",t,"recurse",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(t,e,n,i){if(null!=t&&t.length>0){this.model.beginUpdate();try{for(var s=0;s<t.length;s++)if((!i||this.isCellFoldable(t[s],e))&&e!=this.isCellCollapsed(t[s])){if(this.model.setCollapsed(t[s],e),this.swapBounds(t[s],e),this.isExtendParent(t[s])&&this.extendParent(t[s]),n){var r=this.model.getChildren(t[s]);this.cellsFolded(r,e,n)}this.constrainChild(t[s])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",t,"collapse",e,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(t,e){if(null!=t){var n=this.model.getGeometry(t);null!=n&&(n=n.clone(),this.updateAlternateBounds(t,n,e),n.swap(),this.model.setGeometry(t,n))}},mxGraph.prototype.updateAlternateBounds=function(t,e,n){if(null!=t&&null!=e){var i=this.view.getState(t),s=null!=i?i.style:this.getCellStyle(t);if(null==e.alternateBounds){var r=e;if(this.collapseToPreferredSize){var o=this.getPreferredSizeForCell(t);if(null!=o){r=o;var l=mxUtils.getValue(s,mxConstants.STYLE_STARTSIZE);l>0&&(r.height=Math.max(r.height,l))}}e.alternateBounds=new mxRectangle(0,0,r.width,r.height)}if(null!=e.alternateBounds){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(s[mxConstants.STYLE_ROTATION]||0);if(0!=a){var h=e.alternateBounds.getCenterX()-e.getCenterX(),u=e.alternateBounds.getCenterY()-e.getCenterY(),d=Math.cos(a),p=Math.sin(a),m=d*h-p*u,c=p*h+d*u;e.alternateBounds.x+=m-h,e.alternateBounds.y+=c-u}}}},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(null!=t)for(var n=0;n<t.length;n++){for(var i=this.model.getEdgeCount(t[n]),s=0;s<i;s++)e.push(this.model.getEdgeAt(t[n],s));var r=this.model.getChildren(t[n]);e=e.concat(this.getAllEdges(r))}return e},mxGraph.prototype.updateCellSize=function(t,e){e=null!=e&&e,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(null!=t){this.model.beginUpdate();try{var n=this.getPreferredSizeForCell(t),i=this.model.getGeometry(t);if(null!=n&&null!=i){var s=this.isCellCollapsed(t);if(i=i.clone(),this.isSwimlane(t)){var r=this.getCellStyle(t),o=this.model.getStyle(t);null==o&&(o=""),mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0)?(o=mxUtils.setStyle(o,mxConstants.STYLE_STARTSIZE,n.height+8),s&&(i.height=n.height+8),i.width=n.width):(o=mxUtils.setStyle(o,mxConstants.STYLE_STARTSIZE,n.width+8),s&&(i.width=n.width+8),i.height=n.height),this.model.setStyle(t,o)}else{var l=this.view.createState(t),a=l.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER;a==mxConstants.ALIGN_RIGHT?i.x+=i.width-n.width:a==mxConstants.ALIGN_CENTER&&(i.x+=Math.round((i.width-n.width)/2));var h=this.getVerticalAlign(l);h==mxConstants.ALIGN_BOTTOM?i.y+=i.height-n.height:h==mxConstants.ALIGN_MIDDLE&&(i.y+=Math.round((i.height-n.height)/2)),i.width=n.width,i.height=n.height}if(!e&&!s){var u=this.view.getBounds(this.model.getChildren(t));if(null!=u){var d=this.view.translate,p=this.view.scale,m=(u.x+u.width)/p-i.x-d.x,c=(u.y+u.height)/p-i.y-d.y;i.width=Math.max(i.width,m),i.height=Math.max(i.height,c)}}this.cellsResized([t],[i],!1)}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(t){var e=null;if(null!=t){var n=this.view.createState(t),i=n.style;if(!this.model.isEdge(t)){var s=i[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,r=0,o=0;null==this.getImage(n)&&null==i[mxConstants.STYLE_IMAGE]||i[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(i[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(r+=parseFloat(i[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),i[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(o+=parseFloat(i[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),r+=2*(i[mxConstants.STYLE_SPACING]||0),r+=i[mxConstants.STYLE_SPACING_LEFT]||0,r+=i[mxConstants.STYLE_SPACING_RIGHT]||0,o+=2*(i[mxConstants.STYLE_SPACING]||0),o+=i[mxConstants.STYLE_SPACING_TOP]||0,o+=i[mxConstants.STYLE_SPACING_BOTTOM]||0;var l=this.getFoldingImage(n);null!=l&&(r+=l.width+8);var a=this.cellRenderer.getLabelValue(n);if(null!=a&&a.length>0){this.isHtmlLabel(n.cell)||(a=mxUtils.htmlEntities(a,!1)),a=a.replace(/\n/g,"<br>");var h=mxUtils.getSizeForString(a,s,i[mxConstants.STYLE_FONTFAMILY],null,i[mxConstants.STYLE_FONTSTYLE]),u=h.width+r,d=h.height+o;if(!mxUtils.getValue(i,mxConstants.STYLE_HORIZONTAL,!0)){var p=d;d=u,u=p}this.gridEnabled&&(u=this.snap(u+this.gridSize/2),d=this.snap(d+this.gridSize/2)),e=new mxRectangle(0,0,u,d)}else{var m=4*this.gridSize;e=new mxRectangle(0,0,m,m)}}}return e},mxGraph.prototype.resizeCell=function(t,e,n){return this.resizeCells([t],[e],n)[0]},mxGraph.prototype.resizeCells=function(t,e,n){n=null!=n?n:this.isRecursiveResize(),this.model.beginUpdate();try{this.cellsResized(t,e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,n){if(n=null!=n&&n,null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var i=0;i<t.length;i++)this.cellResized(t[i],e[i],!1,n),this.isExtendParent(t[i])&&this.extendParent(t[i]),this.constrainChild(t[i]);this.resetEdgesOnResize&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",t,"bounds",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.cellResized=function(t,e,n,i){var s=this.model.getGeometry(t);if(null!=s&&(s.x!=e.x||s.y!=e.y||s.width!=e.width||s.height!=e.height)){if(s=s.clone(),!n&&s.relative){var r=s.offset;null!=r&&(r.x+=e.x-s.x,r.y+=e.y-s.y)}else s.x=e.x,s.y=e.y;s.width=e.width,s.height=e.height,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{i&&this.resizeChildCells(t,s),this.model.setGeometry(t,s),this.constrainChildCells(t)}finally{this.model.endUpdate()}}},mxGraph.prototype.resizeChildCells=function(t,e){for(var n=this.model.getGeometry(t),i=e.width/n.width,s=e.height/n.height,r=this.model.getChildCount(t),o=0;o<r;o++)this.scaleCell(this.model.getChildAt(t,o),i,s,!0)},mxGraph.prototype.constrainChildCells=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.constrainChild(this.model.getChildAt(t,n))},mxGraph.prototype.scaleCell=function(t,e,n,i){var s=this.model.getGeometry(t);if(null!=s){var r=this.view.getState(t),o=null!=r?r.style:this.getCellStyle(t),l=(s=s.clone()).x,a=s.y,h=s.width,u=s.height;s.scale(e,n,"fixed"==o[mxConstants.STYLE_ASPECT]),"1"==o[mxConstants.STYLE_RESIZE_WIDTH]?s.width=h*e:"0"==o[mxConstants.STYLE_RESIZE_WIDTH]&&(s.width=h),"1"==o[mxConstants.STYLE_RESIZE_HEIGHT]?s.height=u*n:"0"==o[mxConstants.STYLE_RESIZE_HEIGHT]&&(s.height=u),this.isCellMovable(t)||(s.x=l,s.y=a),this.isCellResizable(t)||(s.width=h,s.height=u),this.model.isVertex(t)?this.cellResized(t,s,!0,i):this.model.setGeometry(t,s)}},mxGraph.prototype.extendParent=function(t){if(null!=t){var e=this.model.getParent(t),n=this.getCellGeometry(e);if(null!=e&&null!=n&&!this.isCellCollapsed(e)){var i=this.getCellGeometry(t);null!=i&&!i.relative&&(n.width<i.x+i.width||n.height<i.y+i.height)&&((n=n.clone()).width=Math.max(n.width,i.x+i.width),n.height=Math.max(n.height,i.y+i.height),this.cellsResized([e],[n],!1))}}},mxGraph.prototype.importCells=function(t,e,n,i,s,r){return this.moveCells(t,e,n,!0,i,s,r)},mxGraph.prototype.moveCells=function(t,e,n,i,s,r,o){if(e=null!=e?e:0,n=null!=n?n:0,i=null!=i&&i,null!=t&&(0!=e||0!=n||i||null!=s)){t=this.model.getTopmostCells(t),this.model.beginUpdate();try{for(var l=new mxDictionary,a=0;a<t.length;a++)l.put(t[a],!0);var h=mxUtils.bind(this,(function(t){for(;null!=t;){if(l.get(t))return!0;t=this.model.getParent(t)}return!1})),u=[];for(a=0;a<t.length;a++){var d=this.getCellGeometry(t[a]),p=this.model.getParent(t[a]);null!=d&&d.relative&&this.model.isEdge(p)&&(h(this.model.getTerminal(p,!0))||h(this.model.getTerminal(p,!1)))||u.push(t[a])}t=u,i&&(t=this.cloneCells(t,this.isCloneInvalidEdges(),o),null==s&&(s=this.getDefaultParent()));var m=this.isAllowNegativeCoordinates();if(null!=s&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(t,e,n,!i&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==s,this.isExtendParentsOnMove()&&null==s),this.setAllowNegativeCoordinates(m),null!=s){var c=this.model.getChildCount(s);this.cellsAdded(t,s,c,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",t,"dx",e,"dy",n,"clone",i,"target",s,"event",r))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.cellsMoved=function(t,e,n,i,s,r){if(null!=t&&(0!=e||0!=n)){r=null!=r&&r,this.model.beginUpdate();try{i&&this.disconnectGraph(t);for(var o=0;o<t.length;o++)this.translateCell(t[o],e,n),r&&this.isExtendParent(t[o])?this.extendParent(t[o]):s&&this.constrainChild(t[o]);this.resetEdgesOnMove&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",t,"dx",e,"dy",n,"disconnect",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(t,e,n){var i=this.model.getGeometry(t);if(null!=i){if(e=parseFloat(e),n=parseFloat(n),(i=i.clone()).translate(e,n),i.relative||!this.model.isVertex(t)||this.isAllowNegativeCoordinates()||(i.x=Math.max(0,parseFloat(i.x)),i.y=Math.max(0,parseFloat(i.y))),i.relative&&!this.model.isEdge(t)){var s=this.model.getParent(t),r=0;if(this.model.isVertex(s)){var o=this.view.getState(s),l=null!=o?o.style:this.getCellStyle(s);r=mxUtils.getValue(l,mxConstants.STYLE_ROTATION,0)}if(0!=r){var a=mxUtils.toRadians(-r),h=Math.cos(a),u=Math.sin(a),d=mxUtils.getRotatedPoint(new mxPoint(e,n),h,u,new mxPoint(0,0));e=d.x,n=d.y}null==i.offset?i.offset=new mxPoint(e,n):(i.offset.x=parseFloat(i.offset.x)+e,i.offset.y=parseFloat(i.offset.y)+n)}this.model.setGeometry(t,i)}},mxGraph.prototype.getCellContainmentArea=function(t){if(null!=t&&!this.model.isEdge(t)){var e=this.model.getParent(t);if(null!=e&&e!=this.getDefaultParent()){var n=this.model.getGeometry(e);if(null!=n){var i=0,s=0,r=n.width,o=n.height;if(this.isSwimlane(e)){var l=this.getStartSize(e),a=this.view.getState(e),h=null!=a?a.style:this.getCellStyle(e),u=mxUtils.getValue(h,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),d=1==mxUtils.getValue(h,mxConstants.STYLE_FLIPH,0),p=1==mxUtils.getValue(h,mxConstants.STYLE_FLIPV,0);if(u==mxConstants.DIRECTION_SOUTH||u==mxConstants.DIRECTION_NORTH){var m=l.width;l.width=l.height,l.height=m}(u==mxConstants.DIRECTION_EAST&&!p||u==mxConstants.DIRECTION_NORTH&&!d||u==mxConstants.DIRECTION_WEST&&p||u==mxConstants.DIRECTION_SOUTH&&d)&&(i=l.width,s=l.height),r-=l.width,o-=l.height}return new mxRectangle(i,s,r,o)}}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(t,e){if(null!=t){var n=this.getCellGeometry(t);if(null!=n&&(this.isConstrainRelativeChildren()||!n.relative)){var i=this.model.getParent(t);this.getCellGeometry(i);var s=this.getMaximumGraphBounds();if(null!=s){var r=this.getBoundingBoxFromGeometry([i],!1);null!=r&&((s=mxRectangle.fromRectangle(s)).x-=r.x,s.y-=r.y)}if(this.isConstrainChild(t)){var o=this.getCellContainmentArea(t);if(null!=o){var l=this.getOverlap(t);l>0&&((o=mxRectangle.fromRectangle(o)).x-=o.width*l,o.y-=o.height*l,o.width+=2*o.width*l,o.height+=2*o.height*l),null==s?s=o:(s=mxRectangle.fromRectangle(s)).intersect(o)}}if(null!=s){var a=[t];if(!this.isCellCollapsed(t))for(var h=this.model.getDescendants(t),u=0;u<h.length;u++)this.isCellVisible(h[u])&&a.push(h[u]);var d=this.getBoundingBoxFromGeometry(a,!1);if(null!=d){var p=0;(n=n.clone()).width>s.width&&(p=n.width-s.width,n.width-=p),d.x+d.width>s.x+s.width&&(p-=d.x+d.width-s.x-s.width-p);var m=0;n.height>s.height&&(m=n.height-s.height,n.height-=m),d.y+d.height>s.y+s.height&&(m-=d.y+d.height-s.y-s.height-m),d.x<s.x&&(p-=d.x-s.x),d.y<s.y&&(m-=d.y-s.y),0==p&&0==m||(n.relative?(null==n.offset&&(n.offset=new mxPoint),n.offset.x+=p,n.offset.y+=m):(n.x+=p,n.y+=m)),this.model.setGeometry(t,n)}}}}},mxGraph.prototype.resetEdges=function(t){if(null!=t){for(var e=new mxDictionary,n=0;n<t.length;n++)e.put(t[n],!0);this.model.beginUpdate();try{for(n=0;n<t.length;n++){var i=this.model.getEdges(t[n]);if(null!=i)for(var s=0;s<i.length;s++){var r=this.view.getState(i[s]),o=null!=r?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[s],!0),l=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[s],!1);e.get(o)&&e.get(l)||this.resetEdge(i[s])}this.resetEdges(this.model.getChildren(t[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(t){var e=this.model.getGeometry(t);return null!=e&&null!=e.points&&e.points.length>0&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,n){if(null!=e.shape){var i=this.view.getPerimeterBounds(e),s=e.style[mxConstants.STYLE_DIRECTION];if(s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){i.x+=i.width/2-i.height/2,i.y+=i.height/2-i.width/2;var r=i.width;i.width=i.height,i.height=r}var o=mxUtils.toRadians(e.shape.getShapeRotation());if(0!=o){var l=Math.cos(-o),a=Math.sin(-o),h=new mxPoint(i.getCenterX(),i.getCenterY());t=mxUtils.getRotatedPoint(t,l,a,h)}var u=1,d=1,p=0,m=0;if(this.getModel().isVertex(e.cell)){var c=e.style[mxConstants.STYLE_FLIPH],x=e.style[mxConstants.STYLE_FLIPV];if(null!=e.shape&&null!=e.shape.stencil&&(c=1==mxUtils.getValue(e.style,"stencilFlipH",0)||c,x=1==mxUtils.getValue(e.style,"stencilFlipV",0)||x),s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){r=c;c=x,x=r}c&&(u=-1,p=-i.width),x&&(d=-1,m=-i.height)}return t=new mxPoint((t.x-i.x)*u-p+i.x,(t.y-i.y)*d-m+i.y),new mxConnectionConstraint(new mxPoint(0==i.width?0:Math.round(1e3*(t.x-i.x)/i.width)/1e3,0==i.height?0:Math.round(1e3*(t.y-i.y)/i.height)/1e3),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,n){var i=null,s=t.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=s){var r=t.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=r&&(i=new mxPoint(parseFloat(s),parseFloat(r)))}var o=!1,l=0,a=0;return null!=i&&(o=mxUtils.getValue(t.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),l=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),a=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),l=isFinite(l)?l:0,a=isFinite(a)?a:0),new mxConnectionConstraint(i,o,null,l,a)},mxGraph.prototype.setConnectionConstraint=function(t,e,n,i){if(null!=i){this.model.beginUpdate();try{null==i||null==i.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=i.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,i.point.x,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,i.point.y,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,i.dx,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,i.dy,[t]),i.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,n){n=null==n||n;var i=null;if(null!=t&&null!=e.point){var s=this.view.getPerimeterBounds(t),r=new mxPoint(s.getCenterX(),s.getCenterY()),o=t.style[mxConstants.STYLE_DIRECTION],l=0;null!=o&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(o==mxConstants.DIRECTION_NORTH?l+=270:o==mxConstants.DIRECTION_WEST?l+=180:o==mxConstants.DIRECTION_SOUTH&&(l+=90),o!=mxConstants.DIRECTION_NORTH&&o!=mxConstants.DIRECTION_SOUTH||s.rotate90());var a=this.view.scale;i=new mxPoint(s.x+e.point.x*s.width+e.dx*a,s.y+e.point.y*s.height+e.dy*a);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(0!=l){var u=0,d=0;90==l?d=1:180==l?u=-1:270==l&&(d=-1),i=mxUtils.getRotatedPoint(i,u,d,r)}i=this.view.getPerimeterPoint(t,i,!1)}else if(h+=l,this.getModel().isVertex(t.cell)){var p=1==t.style[mxConstants.STYLE_FLIPH],m=1==t.style[mxConstants.STYLE_FLIPV];if(null!=t.shape&&null!=t.shape.stencil&&(p=1==mxUtils.getValue(t.style,"stencilFlipH",0)||p,m=1==mxUtils.getValue(t.style,"stencilFlipV",0)||m),o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){var c=p;p=m,m=c}p&&(i.x=2*s.getCenterX()-i.x),m&&(i.y=2*s.getCenterY()-i.y)}if(0!=h&&null!=i){var x=mxUtils.toRadians(h);u=Math.cos(x),d=Math.sin(x);i=mxUtils.getRotatedPoint(i,u,d,r)}}return n&&null!=i&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),i},mxGraph.prototype.connectCell=function(t,e,n,i){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);this.cellConnected(t,e,n,i),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,n,i){if(null!=t){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);if(this.setConnectionConstraint(t,e,n,i),this.isPortsEnabled()){var r=null;this.isPort(e)&&(r=e.getId(),e=this.getTerminalForPort(e,n));var o=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(o,r,[t])}this.model.setTerminal(t,e,n),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,n=this.view.translate,i=new mxDictionary,s=0;s<t.length;s++)i.put(t[s],!0);for(s=0;s<t.length;s++)if(this.model.isEdge(t[s])){var r=this.model.getGeometry(t[s]);if(null!=r){var o=this.view.getState(t[s]),l=this.view.getState(this.model.getParent(t[s]));if(null!=o&&null!=l){r=r.clone();var a=-l.origin.x,h=-l.origin.y,u=o.absolutePoints,d=this.model.getTerminal(t[s],!0);if(null!=d&&this.isCellDisconnectable(t[s],d,!0)){for(;null!=d&&!i.get(d);)d=this.model.getParent(d);null==d&&(r.setTerminalPoint(new mxPoint(u[0].x/e-n.x+a,u[0].y/e-n.y+h),!0),this.model.setTerminal(t[s],null,!0))}var p=this.model.getTerminal(t[s],!1);if(null!=p&&this.isCellDisconnectable(t[s],p,!1)){for(;null!=p&&!i.get(p);)p=this.model.getParent(p);if(null==p){var m=u.length-1;r.setTerminalPoint(new mxPoint(u[m].x/e-n.x+a,u[m].y/e-n.y+h),!1),this.model.setTerminal(t[s],null,!1)}}this.model.setGeometry(t[s],r)}}}}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!1},mxGraph.prototype.getTerminalForPort=function(t,e){return this.model.getParent(t)},mxGraph.prototype.getChildOffsetForCell=function(t){return null},mxGraph.prototype.enterGroup=function(t){null!=(t=t||this.getSelectionCell())&&this.isValidRoot(t)&&(this.view.setCurrentRoot(t),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var t=this.model.getRoot(),e=this.getCurrentRoot();if(null!=e){for(var n=this.model.getParent(e);n!=t&&!this.isValidRoot(n)&&this.model.getParent(n)!=t;)n=this.model.getParent(n);n==t||this.model.getParent(n)==t?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(e)&&this.setSelectionCell(e)}},mxGraph.prototype.home=function(){var t=this.getCurrentRoot();null!=t&&(this.view.setCurrentRoot(null),null!=this.view.getState(t)&&this.setSelectionCell(t))},mxGraph.prototype.isValidRoot=function(t){return null!=t},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(t,e,n){var i=[t];e&&(i=i.concat(this.model.getEdges(t)));var s=this.view.getBounds(i);if(n)for(var r=this.model.getChildCount(t),o=0;o<r;o++){var l=this.getCellBounds(this.model.getChildAt(t,o),e,!0);null!=s?s.add(l):s=l}return s},mxGraph.prototype.getBoundingBoxFromGeometry=function(t,e){e=null!=e&&e;var n=null;if(null!=t)for(var i=0;i<t.length;i++)if(e||this.model.isVertex(t[i])){var s=this.getCellGeometry(t[i]);if(null!=s){var r=null;if(this.model.isEdge(t[i])){var o=function(t){null!=t&&(null==a?a=new mxRectangle(t.x,t.y,0,0):a.add(new mxRectangle(t.x,t.y,0,0)))};null==this.model.getTerminal(t[i],!0)&&o(s.getTerminalPoint(!0)),null==this.model.getTerminal(t[i],!1)&&o(s.getTerminalPoint(!1));var l=s.points;if(null!=l&&l.length>0)for(var a=new mxRectangle(l[0].x,l[0].y,0,0),h=1;h<l.length;h++)o(l[h]);r=a}else{var u=this.model.getParent(t[i]);if(s.relative){if(this.model.isVertex(u)&&u!=this.view.currentRoot)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(r=new mxRectangle(s.x*a.width,s.y*a.height,s.width,s.height),mxUtils.indexOf(t,u)>=0&&(r.x+=a.x,r.y+=a.y))}else if(r=mxRectangle.fromRectangle(s),this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(r.x+=a.x,r.y+=a.y);null!=r&&null!=s.offset&&(r.x+=s.offset.x,r.y+=s.offset.y)}null!=r&&(null==n?n=mxRectangle.fromRectangle(r):n.add(r))}}return n},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,n,i,s){var r=this.view.translate,o=this.view.scale;if(!n&&this.gridEnabled){var l=this.gridSize*o*.5;if(!i){var a=e.x-(this.snap(e.x/o-r.x)+r.x)*o;Math.abs(t.x-a)<l?t.x=0:t.x=this.snap(t.x/o)*o-a}if(!s){var h=e.y-(this.snap(e.y/o-r.y)+r.y)*o;Math.abs(t.y-h)<l?t.y=0:t.y=this.snap(t.y/o)*o-h}}else{l=.5*o;if(!i){a=e.x-(Math.round(e.x/o-r.x)+r.x)*o;Math.abs(t.x-a)<l?t.x=0:t.x=Math.round(t.x/o)*o-a}if(!s){h=e.y-(Math.round(e.y/o-r.y)+r.y)*o;Math.abs(t.y-h)<l?t.y=0:t.y=Math.round(t.y/o)*o-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 n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==t&&0==e){if(mxClient.IS_IE?n.setAttribute("transform","translate("+t+","+e+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var i=this.shiftPreview1.firstChild;null!=i;){var s=i.nextSibling;this.container.appendChild(i),i=s}for(null!=this.shiftPreview1.parentNode&&this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),i=this.shiftPreview2.firstChild;null!=i;){s=i.nextSibling;this.container.appendChild(i),i=s}null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+t+","+e+")"),null==this.shiftPreview1){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 r=this.shiftPreview1;for(i=this.container.firstChild;null!=i;){s=i.nextSibling;i!=n.parentNode?r.appendChild(i):r=this.shiftPreview2,i=s}null!=this.shiftPreview1.firstChild&&this.container.insertBefore(this.shiftPreview1,n.parentNode),null!=this.shiftPreview2.firstChild&&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 n.style.left=t+"px",n.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(){1==this.view.scale?this.view.setTranslate(0,0):(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,n,i){t=null==t||t,e=null==e||e,n=null!=n?n:.5,i=null!=i?i:.5;var s=mxUtils.hasScrollbars(this.container),r=2*this.getBorder(),o=this.container.clientWidth-r,l=this.container.clientHeight-r,a=this.getGraphBounds(),h=this.view.translate,u=this.view.scale,d=t?o-a.width:0,p=e?l-a.height:0;if(s){a.x-=h.x,a.y-=h.y;var m=this.container.scrollWidth,c=this.container.scrollHeight;m>o&&(d=0),c>l&&(p=0),this.view.setTranslate(Math.floor(d/2-a.x),Math.floor(p/2-a.y)),this.container.scrollLeft=(m-o)/2,this.container.scrollTop=(c-l)/2}else this.view.setTranslate(t?Math.floor(h.x-a.x*u+d*n/u):h.x,e?Math.floor(h.y-a.y*u+p*i/u):h.y)},mxGraph.prototype.zoom=function(t,e){e=null!=e?e:this.centerZoom;var n=Math.round(this.view.scale*t*100)/100,i=this.view.getState(this.getSelectionCell());if(t=n/this.view.scale,this.keepSelectionVisibleOnZoom&&null!=i){var s=new mxRectangle(i.x*t,i.y*t,i.width*t,i.height*t);this.view.scale=n,this.scrollRectToVisible(s)||(this.view.revalidate(),this.view.setScale(n))}else{var r=mxUtils.hasScrollbars(this.container);if(e&&!r){var o,l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1)l*=-(o=(t-1)/(2*n)),a*=-o;else l*=o=(1/t-1)/(2*this.view.scale),a*=o;this.view.scaleAndTranslate(n,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x,u=this.view.translate.y,d=this.container.scrollLeft,p=this.container.scrollTop;if(this.view.setScale(n),r){l=0,a=0;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/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var n=Math.min(this.container.scrollWidth,t.x+t.width),i=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=n-t.x,t.height=i-t.y,e<1){var s=t.height/e,r=(s-t.height)/2;t.height=s;var o=Math.min(t.y,r);t.y=t.y-o,i=Math.min(this.container.scrollHeight,t.y+t.height),t.height=i-t.y}else{var l=t.width*e,a=(l-t.width)/2;t.width=l;var h=Math.min(t.x,a);t.x=t.x-h,n=Math.min(this.container.scrollWidth,t.x+t.width),t.width=n-t.x}var u=this.container.clientWidth/t.width,d=this.view.scale*u;mxUtils.hasScrollbars(this.container)?(this.view.setScale(d),this.container.scrollLeft=Math.round(t.x*u),this.container.scrollTop=Math.round(t.y*u)):this.view.scaleAndTranslate(d,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var n=-this.view.translate.x,i=-this.view.translate.y,s=this.view.getState(t);if(null!=s){var r=new mxRectangle(n+s.x,i+s.y,s.width,s.height);if(e&&null!=this.container){var o=this.container.clientWidth,l=this.container.clientHeight;r.x=r.getCenterX()-o/2,r.width=o,r.y=r.getCenterY()-l/2,r.height=l}var a=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(r)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=a.x,this.view.translate.y=a.y,this.view.setTranslate(h.x,h.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(null!=t){var n=this.container.offsetWidth,i=this.container.offsetHeight,s=Math.min(n,t.width),r=Math.min(i,t.height);if(mxUtils.hasScrollbars(this.container)){var o=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var l=o.scrollLeft-t.x,a=Math.max(l-o.scrollLeft,0);l>0?o.scrollLeft-=l+2:(l=t.x+s-o.scrollLeft-o.clientWidth)>0&&(o.scrollLeft+=l+2);var h=o.scrollTop-t.y,u=Math.max(0,h-o.scrollTop);h>0?o.scrollTop-=h+2:(h=t.y+r-o.scrollTop-o.clientHeight)>0&&(o.scrollTop+=h+2),this.useScrollbarsForPanning||0==a&&0==u||this.view.setTranslate(a,u)}else{var d=-this.view.translate.x,p=-this.view.translate.y,m=this.view.scale;t.x+s>d+n&&(this.view.translate.x-=(t.x+s-n-d)/m,e=!0),t.y+r>p+i&&(this.view.translate.y-=(t.y+r-i-p)/m,e=!0),t.x<d&&(this.view.translate.x+=(d-t.x)/m,e=!0),t.y<p&&(this.view.translate.y+=(p-t.y)/m,e=!0),e&&(this.view.refresh(),null!=this.selectionCellsHandler&&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(null!=e)return e;var n=this.view.getEdgeStyle(t);return n==mxEdgeStyle.SegmentConnector||n==mxEdgeStyle.ElbowConnector||n==mxEdgeStyle.SideToSide||n==mxEdgeStyle.TopToBottom||n==mxEdgeStyle.EntityRelation||n==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(t){var e=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1);return null!=e&&e==n},mxGraph.prototype.isCloneEvent=function(t){return mxEvent.isControlDown(t)},mxGraph.prototype.isTransparentClickEvent=function(t){return!1},mxGraph.prototype.isToggleEvent=function(t){return mxClient.IS_MAC?mxEvent.isMetaDown(t):mxEvent.isControlDown(t)},mxGraph.prototype.isGridEnabledEvent=function(t){return null!=t&&!mxEvent.isAltDown(t)},mxGraph.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t)},mxGraph.prototype.isIgnoreTerminalEvent=function(t){return!1},mxGraph.prototype.validationAlert=function(t){mxUtils.alert(t)},mxGraph.prototype.isEdgeValid=function(t,e,n){return null==this.getEdgeValidationError(t,e,n)},mxGraph.prototype.getEdgeValidationError=function(t,e,n){if(null!=t&&!this.isAllowDanglingEdges()&&(null==e||null==n))return"";if(null!=t&&null==this.model.getTerminal(t,!0)&&null==this.model.getTerminal(t,!1))return null;if(!this.allowLoops&&e==n&&null!=e)return"";if(!this.isValidConnection(e,n))return"";if(null!=e&&null!=n){var i="";if(!this.multigraph){var s=this.model.getEdgesBetween(e,n,!0);(s.length>1||1==s.length&&s[0]!=t)&&(i+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n")}var r=this.model.getDirectedEdgeCount(e,!0,t),o=this.model.getDirectedEdgeCount(n,!1,t);if(null!=this.multiplicities)for(var l=0;l<this.multiplicities.length;l++){var a;null!=(a=this.multiplicities[l].check(this,t,e,n,r,o))&&(i+=a)}return null!=(a=this.validateEdge(t,e,n))&&(i+=a),i.length>0?i:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,n){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var n=!0,i=this.model.getChildCount(t),s=0;s<i;s++){var r=this.model.getChildAt(t,s),o=e;this.isValidRoot(r)&&(o=new Object);var l=this.validateGraph(r,o);null!=l?this.setCellWarning(r,l.replace(/\n/g,"<br>")):this.setCellWarning(r,null),n=n&&null==l}var a="";this.isCellCollapsed(t)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?a+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":a+=this.getCellValidationError(t)||"";var h=this.validateCell(t,e);return null!=h&&(a+=h),null==this.model.getParent(t)&&this.view.validate(),a.length>0||!n?a:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),n=this.model.getDirectedEdgeCount(t,!1),i=this.model.getValue(t),s="";if(null!=this.multiplicities)for(var r=0;r<this.multiplicities.length;r++){var o=this.multiplicities[r];(o.source&&mxUtils.isNode(i,o.type,o.attr,o.value)&&(e>o.max||e<o.min)||!o.source&&mxUtils.isNode(i,o.type,o.attr,o.value)&&(n>o.max||n<o.min))&&(s+=o.countError+"\n")}return s.length>0?s: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(null!=t&&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(null!=e){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&null!=t){var n=this.view.getState(t),i=null!=n?n.style:this.getCellStyle(t);mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,!1)||(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){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return null!=n&&"wrap"==n[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return null!=n&&"hidden"==n[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,e,n,i){var s=null;if(null!=t){if(null==t.control||e!=t.control.node&&e.parentNode!=t.control.node||(s=this.collapseExpandResource,s=mxUtils.htmlEntities(mxResources.get(s)||s).replace(/\\n/g,"<br>")),null==s&&null!=t.overlays&&t.overlays.visit((function(t,n){null!=s||e!=n.node&&e.parentNode!=n.node||(s=n.overlay.toString())})),null==s){var r=this.selectionCellsHandler.getHandler(t.cell);null!=r&&"function"==typeof r.getTooltipForNode&&(s=r.getTooltipForNode(e))}null==s&&(s=this.getTooltipForCell(t.cell))}return s},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},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){var e=new mxRectangle,n=this.view.getState(t),i=null!=n?n.style:this.getCellStyle(t);if(null!=i){var s=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(i,mxConstants.STYLE_HORIZONTAL,!0)?e.height=s:e.width=s}return e},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(null!=t){var n=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),i=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=n==mxConstants.NONE&&i==mxConstants.NONE&&null==this.getImage(t)}return e},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?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){if(null!=t&&this.model.getParent(t)!=this.model.getRoot()){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);if(null!=n&&!this.model.isEdge(t))return n[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE}return!1},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()||null!=e&&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.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsCloneable()&&0!=n[mxConstants.STYLE_CLONEABLE]},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.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsDeletable()&&0!=n[mxConstants.STYLE_DELETABLE]},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.view.getState(t);return 0!=(null!=e?e.style:this.getCellStyle(t))[mxConstants.STYLE_ROTATABLE]},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.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&0!=n[mxConstants.STYLE_MOVABLE]},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.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&"0"!=mxUtils.getValue(n,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=n[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&0!=n[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,n){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 null==t&&this.allowDanglingEdges||null!=t&&(!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(null!=this.cellEditor){var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isAutoSizeCells()||1==n[mxConstants.STYLE_AUTOSIZE]},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!1},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 n=this.view.getState(t),i=null!=n?n.style:this.getCellStyle(t);return this.model.getChildCount(t)>0&&0!=i[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,n){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,n)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,n){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var i=this.model.getTerminal(t,!0),s=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],i)&&!this.model.isAncestor(e[0],s)}return!1},mxGraph.prototype.getDropTarget=function(t,e,n,i){if(!this.isSwimlaneNesting())for(var s=0;s<t.length;s++)if(this.isSwimlane(t[s]))return null;var r=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));r.x-=this.panDx,r.y-=this.panDy;var o=this.getSwimlaneAt(r.x,r.y);if(null==n)n=o;else if(null!=o){for(var l=this.model.getParent(o);null!=l&&this.isSwimlane(l)&&l!=n;)l=this.model.getParent(l);l==n&&(n=o)}for(;null!=n&&!this.isValidDropTarget(n,t,e)&&!this.model.isLayer(n);)n=this.model.getParent(n);if(null==i||!i)for(var a=n;null!=a&&mxUtils.indexOf(t,a)<0;)a=this.model.getParent(a);return this.model.isLayer(n)||null!=a?null:n},mxGraph.prototype.getDefaultParent=function(){var t=this.getCurrentRoot();if(null==t&&null==(t=this.defaultParent)){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){for(;null!=t&&!this.isSwimlane(t);)t=this.model.getParent(t);return t},mxGraph.prototype.getSwimlaneAt=function(t,e,n){if(null!=(n=n||this.getDefaultParent()))for(var i=this.model.getChildCount(n),s=0;s<i;s++){var r=this.model.getChildAt(n,s),o=this.getSwimlaneAt(t,e,r);if(null!=o)return o;if(this.isSwimlane(r)){var l=this.view.getState(r);if(this.intersects(l,t,e))return r}}return null},mxGraph.prototype.getCellAt=function(t,e,n,i,s,r){if(i=null==i||i,s=null==s||s,null==n&&null==(n=this.getCurrentRoot())&&(n=this.getModel().getRoot()),null!=n)for(var o=this.model.getChildCount(n)-1;o>=0;o--){var l=this.model.getChildAt(n,o),a=this.getCellAt(t,e,l,i,s,r);if(null!=a)return a;if(this.isCellVisible(l)&&(s&&this.model.isEdge(l)||i&&this.model.isVertex(l))){var h=this.view.getState(l);if(null!=h&&(null==r||!r(h,t,e))&&this.intersects(h,t,e))return l}}return null},mxGraph.prototype.intersects=function(t,e,n){if(null!=t){var i=t.absolutePoints;if(null!=i)for(var s=this.tolerance*this.tolerance,r=i[0],o=1;o<i.length;o++){var l=i[o];if(mxUtils.ptSegDistSq(r.x,r.y,l.x,l.y,e,n)<=s)return!0;r=l}else{var a=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=a){var h=Math.cos(-a),u=Math.sin(-a),d=new mxPoint(t.getCenterX(),t.getCenterY());e=(r=mxUtils.getRotatedPoint(new mxPoint(e,n),h,u,d)).x,n=r.y}if(mxUtils.contains(t,e,n))return!0}}return!1},mxGraph.prototype.hitsSwimlaneContent=function(t,e,n){var i=this.getView().getState(t),s=this.getStartSize(t);if(null!=i){var r=this.getView().getScale();if(e-=i.x,n-=i.y,s.width>0&&e>0&&e>s.width*r)return!0;if(s.height>0&&n>0&&n>s.height*r)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,n){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,n=null!=n&&n;for(var i=this.model.getChildCells(t,e,n),s=[],r=0;r<i.length;r++)this.isCellVisible(i[r])&&s.push(i[r]);return s},mxGraph.prototype.getConnections=function(t,e){return this.getEdges(t,e,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(t,e){return this.getEdges(t,e,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(t,e){return this.getEdges(t,e,!1,!0,!1)},mxGraph.prototype.getEdges=function(t,e,n,i,s,r){n=null==n||n,i=null==i||i,s=null==s||s,r=null!=r&&r;for(var o=[],l=this.isCellCollapsed(t),a=this.model.getChildCount(t),h=0;h<a;h++){var u=this.model.getChildAt(t,h);!l&&this.isCellVisible(u)||(o=o.concat(this.model.getEdges(u,n,i)))}o=o.concat(this.model.getEdges(t,n,i));var d=[];for(h=0;h<o.length;h++){var p=this.view.getState(o[h]),m=null!=p?p.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[h],!0),c=null!=p?p.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[h],!1);(s&&m==c||m!=c&&(n&&c==t&&(null==e||this.isValidAncestor(m,e,r))||i&&m==t&&(null==e||this.isValidAncestor(c,e,r))))&&d.push(o[h])}return d},mxGraph.prototype.isValidAncestor=function(t,e,n){return n?this.model.isAncestor(e,t):this.model.getParent(t)==e},mxGraph.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var s=[],r=new mxDictionary;if(null!=t)for(var o=0;o<t.length;o++){var l=this.view.getState(t[o]),a=null!=l?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(t[o],!0),h=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(t[o],!1);a==e&&null!=h&&h!=e&&i?r.get(h)||(r.put(h,!0),s.push(h)):h==e&&null!=a&&a!=e&&n&&(r.get(a)||(r.put(a,!0),s.push(a)))}return s},mxGraph.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),s=[],r=0;r<i.length;r++){var o=this.view.getState(i[r]),l=null!=o?o.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[r],!0),a=null!=o?o.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[r],!1);(l==t&&a==e||!n&&l==e&&a==t)&&s.push(i[r])}return s},mxGraph.prototype.getPointForEvent=function(t,e){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),i=this.view.scale,s=this.view.translate,r=0!=e?this.gridSize/2:0;return n.x=this.snap(n.x/i-s.x-r),n.y=this.snap(n.y/i-s.y-r),n},mxGraph.prototype.getCells=function(t,e,n,i,s,r){if(r=null!=r?r:[],n>0||i>0){var o=this.getModel(),l=t+n,a=e+i;if(null==s&&null==(s=this.getCurrentRoot())&&(s=o.getRoot()),null!=s)for(var h=o.getChildCount(s),u=0;u<h;u++){var d=o.getChildAt(s,u),p=this.view.getState(d);if(null!=p&&this.isCellVisible(d)){var m=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION)||0,c=p;0!=m&&(c=mxUtils.getBoundingBox(c,m)),(o.isEdge(d)||o.isVertex(d))&&c.x>=t&&c.y+c.height<=a&&c.y>=e&&c.x+c.width<=l?r.push(d):this.getCells(t,e,n,i,d,r)}}}return r},mxGraph.prototype.getCellsBeyond=function(t,e,n,i,s){var r=[];if((i||s)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var o=this.model.getChildCount(n),l=0;l<o;l++){var a=this.model.getChildAt(n,l),h=this.view.getState(a);this.isCellVisible(a)&&null!=h&&(!i||h.x>=t)&&(!s||h.y>=e)&&r.push(a)}return r},mxGraph.prototype.findTreeRoots=function(t,e,n){e=null!=e&&e,n=null!=n&&n;var i=[];if(null!=t){for(var s=this.getModel(),r=s.getChildCount(t),o=null,l=0,a=0;a<r;a++){var h=s.getChildAt(t,a);if(this.model.isVertex(h)&&this.isCellVisible(h)){for(var u=this.getConnections(h,e?t:null),d=0,p=0,m=0;m<u.length;m++){this.view.getVisibleTerminal(u[m],!0)==h?d++:p++}(n&&0==d&&p>0||!n&&0==p&&d>0)&&i.push(h);var c=n?p-d:d-p;c>l&&(l=c,o=h)}}0==i.length&&null!=o&&i.push(o)}return i},mxGraph.prototype.traverse=function(t,e,n,i,s,r){if(null!=n&&null!=t&&(e=null==e||e,r=null!=r&&r,!(s=s||new mxDictionary).get(t))){s.put(t,!0);var o=n(t,i);if(null==o||o){var l=this.model.getEdgeCount(t);if(l>0)for(var a=0;a<l;a++){var h=this.model.getEdgeAt(t,a),u=this.model.getTerminal(h,!0)==t;if(!e||!r==u){var d=this.model.getTerminal(h,!u);this.traverse(d,e,n,h,s,r)}}}}},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 n=this.getCells(t.x,t.y,t.width,t.height);return this.selectCellsForEvent(n,e),n},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(t,e,n){var i=this.selectionModel,s=i.cells.length>0?i.cells[0]:null;i.cells.length>1&&i.clear();var r=null!=s?this.model.getParent(s):this.getDefaultParent(),o=this.model.getChildCount(r);if(null==s&&o>0){var l=this.model.getChildAt(r,0);this.setSelectionCell(l)}else if(null!=s&&!e||null==this.view.getState(r)||null==this.model.getGeometry(r)){if(null!=s&&n){if(this.model.getChildCount(s)>0){l=this.model.getChildAt(s,0);this.setSelectionCell(l)}}else if(o>0){var a=r.getIndex(s);if(t){a++;l=this.model.getChildAt(r,a%o);this.setSelectionCell(l)}else{var h=--a<0?o-1:a;l=this.model.getChildAt(r,h);this.setSelectionCell(l)}}}else this.getCurrentRoot()!=r&&this.setSelectionCell(r)},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var n=e?this.model.filterDescendants(mxUtils.bind(this,(function(e){return e!=t&&null!=this.view.getState(e)})),t):this.model.getChildren(t);null!=n&&this.setSelectionCells(n)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,n,i){n=n||this.getDefaultParent();var s=mxUtils.bind(this,(function(n){return null!=this.view.getState(n)&&((i||0==this.model.getChildCount(n))&&this.model.isVertex(n)&&t&&!this.model.isEdge(this.model.getParent(n))||this.model.isEdge(n)&&e)})),r=this.model.filterDescendants(s,n);null!=r&&this.setSelectionCells(r)},mxGraph.prototype.selectCellForEvent=function(t,e){var n=this.isCellSelected(t);this.isToggleEvent(e)?n?this.removeSelectionCell(t):this.addSelectionCell(t):n&&1==this.getSelectionCount()||this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(null!=t)if(this.model.isEdge(t.cell)){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1),s=this.getCellGeometry(t.cell),r=this.view.getEdgeStyle(t,null!=s?s.points:null,n,i);e=this.createEdgeHandler(t,r)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(t):new mxEdgeHandler(t)},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(null!=this.mouseListeners)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(null==t.graphX||null==t.graphY){var n=mxUtils.convertPoint(this.container,t.getX(),t.getY());t.graphX=n.x-this.panDx,t.graphY=n.y-this.panDy,null==t.getCell()&&this.isMouseDown&&e==mxEvent.MOUSE_MOVE&&(t.state=this.view.getState(this.getCellAt(n.x,n.y,null,null,null,(function(t){return null==t.shape||t.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(t.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=t.shape.fill&&t.shape.fill!=mxConstants.NONE}))))}return t},mxGraph.prototype.getStateForTouchEvent=function(t){var e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=mxUtils.convertPoint(this.container,e,n);return this.view.getState(this.getCellAt(i.x,i.y))},mxGraph.prototype.isEventIgnored=function(t,e,n){var i=mxEvent.isMouseEvent(e.getEvent()),s=!1;return e.getEvent()==this.lastEvent?s=!0:this.lastEvent=e.getEvent(),null!=this.eventSource&&t!=mxEvent.MOUSE_MOVE?(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.mouseMoveRedirect=null,this.mouseUpRedirect=null,this.eventSource=null):mxClient.IS_GC||null==this.eventSource||e.getSource()==this.eventSource?mxClient.IS_TOUCH&&mxClient.IOS_VERSION<=12&&t==mxEvent.MOUSE_DOWN&&!i&&!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)):s=!0,this.isSyntheticEventIgnored(t,e,n)&&(s=!0),!mxEvent.isPopupTrigger(this.lastEvent)&&t!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail||(t==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:t!=mxEvent.MOUSE_DOWN||this.isMouseDown?!s&&((!mxClient.IS_FF||t!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=i||t==mxEvent.MOUSE_DOWN&&this.isMouseDown||t==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(s=!0):(this.isMouseDown=!0,this.isMouseTrigger=i),s||t!=mxEvent.MOUSE_DOWN||(this.lastMouseX=e.getX(),this.lastMouseY=e.getY()),s)},mxGraph.prototype.isSyntheticEventIgnored=function(t,e,n){var i=!1,s=mxEvent.isMouseEvent(e.getEvent());return this.ignoreMouseEvents&&s&&t!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=t!=mxEvent.MOUSE_UP,i=!0):mxClient.IS_FF&&!s&&t==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0),i},mxGraph.prototype.isEventSourceIgnored=function(t,e){var n=e.getSource(),i=null!=n.nodeName?n.nodeName.toLowerCase():"",s=!mxEvent.isMouseEvent(e.getEvent())||mxEvent.isLeftMouseButton(e.getEvent());return t==mxEvent.MOUSE_DOWN&&s&&("select"==i||"option"==i||"input"==i&&"checkbox"!=n.type&&"radio"!=n.type&&"button"!=n.type&&"submit"!=n.type&&"file"!=n.type)},mxGraph.prototype.getEventState=function(t){return t},mxGraph.prototype.fireMouseEvent=function(t,e,n){if(this.isEventSourceIgnored(t,e))null!=this.tooltipHandler&&this.tooltipHandler.hide();else{if(null==n&&(n=this),e=this.updateMouseEvent(e,t),!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(e.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))){var i=(new Date).getTime();if(!mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_DOWN||mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_UP&&!this.fireDoubleClick)if(null!=this.lastTouchEvent&&this.lastTouchEvent!=e.getEvent()&&i-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 s=!1;if(t==mxEvent.MOUSE_UP){if(e.getCell()==this.lastTouchCell&&null!=this.lastTouchCell){this.lastTouchTime=0;var r=this.lastTouchCell;this.lastTouchCell=null,mxClient.IS_QUIRKS&&e.getSource().fireEvent("ondblclick"),this.dblClick(e.getEvent(),r),s=!0}}else this.fireDoubleClick=!0,this.lastTouchTime=0;if(!mxClient.IS_QUIRKS||s)return void mxEvent.consume(e.getEvent())}else null!=this.lastTouchEvent&&this.lastTouchEvent==e.getEvent()||(this.lastTouchCell=e.getCell(),this.lastTouchX=e.getX(),this.lastTouchY=e.getY(),this.lastTouchTime=i,this.lastTouchEvent=e.getEvent(),this.doubleClickCounter=0);else if((this.isMouseDown||t==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;r=this.lastTouchCell;return this.lastTouchCell=null,this.isMouseDown=!1,void((null!=r||(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance?this.dblClick(e.getEvent(),r):mxEvent.consume(e.getEvent()))}}if(!this.isEventIgnored(t,e,n)){if(e.state=this.getEventState(e.getState()),this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",t,"event",e)),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&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){var o=this.view.scale,l=this.view.translate;this.view.setTranslate(l.x-this.container.scrollLeft/o,l.y-this.container.scrollTop/o),this.container.scrollLeft=0,this.container.scrollTop=0}if(null!=this.mouseListeners){var a=[n,e];e.getEvent().preventDefault||(e.getEvent().returnValue=!0);for(var h=0;h<this.mouseListeners.length;h++){var u=this.mouseListeners[h];t==mxEvent.MOUSE_DOWN?u.mouseDown.apply(u,a):t==mxEvent.MOUSE_MOVE?u.mouseMove.apply(u,a):t==mxEvent.MOUSE_UP&&u.mouseUp.apply(u,a)}}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=!0,this.initialTouchX=e.getGraphX(),this.initialTouchY=e.getGraphY();this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,(function(){this.tapAndHoldValid&&this.tapAndHold(e),this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1})),this.tapAndHoldDelay),this.tapAndHoldValid=!0}else t==mxEvent.MOUSE_UP?(this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1):this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-e.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-e.getGraphY())<this.tolerance);t==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(e.getEvent())&&this.stopEditing(!this.isInvokesStopCellEditing()),this.consumeMouseEvent(t,e,n)}}},mxGraph.prototype.consumeMouseEvent=function(t,e,n){t==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(e.getEvent())&&e.consume(!1)},mxGraph.prototype.fireGestureEvent=function(t,e){this.lastTouchTime=0,this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",t,"cell",e))},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},__mxOutput.mxGraph=void 0!==mxGraph?mxGraph:void 0,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),n=t.view.scale,i=null,s=this.image.width,r=this.image.height;if(e){var o=t.absolutePoints;if(o.length%2==1)i=o[Math.floor(o.length/2)];else{var l=o.length/2,a=o[l-1],h=o[l];i=new mxPoint(a.x+(h.x-a.x)/2,a.y+(h.y-a.y)/2)}}else i=new mxPoint,this.align==mxConstants.ALIGN_LEFT?i.x=t.x:this.align==mxConstants.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==mxConstants.ALIGN_TOP?i.y=t.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height;return new mxRectangle(Math.round(i.x-(s*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(r*this.defaultOverlap-this.offset.y)*n),s*n,r*n)},mxCellOverlay.prototype.toString=function(){return this.tooltip},__mxOutput.mxCellOverlay=void 0!==mxCellOverlay?mxCellOverlay:void 0,mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.labelsVisible=!1,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.minScale=1e-4,mxOutline.prototype.suspended=!1,mxOutline.prototype.forceVmlHandles=8==document.documentMode,mxOutline.prototype.createGraph=function(t){var e=new mxGraph(t,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet());return e.foldingEnabled=!1,e.autoScroll=!1,e},mxOutline.prototype.init=function(t){this.outline=this.createGraph(t);var e=this.outline.graphModelChanged;if(this.outline.graphModelChanged=mxUtils.bind(this,(function(t){this.suspended||null==this.outline||e.apply(this.outline,arguments)})),mxClient.IS_SVG){var n=this.outline.getView().getCanvas().parentNode;n.setAttribute("shape-rendering","optimizeSpeed"),n.setAttribute("image-rendering","optimizeSpeed")}this.outline.labelsVisible=this.labelsVisible,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,(function(t,e){this.suspended||this.active||this.update()})),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this);var i=this.source.getView();i.addListener(mxEvent.SCALE,this.updateHandler),i.addListener(mxEvent.TRANSLATE,this.updateHandler),i.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),i.addListener(mxEvent.DOWN,this.updateHandler),i.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,(function(t){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,this.forceVmlHandles&&(this.selectionBorder.isHtmlAllowed=function(){return!1}),this.selectionBorder.init(this.outline.getView().getOverlayPane());var s=mxUtils.bind(this,(function(t){var e=mxEvent.getSource(t),n=mxUtils.bind(this,(function(t){this.outline.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))})),i=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}));mxEvent.addGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}));mxEvent.addGestureListeners(this.selectionBorder.node,s),this.sizer=this.createSizer(),this.forceVmlHandles&&(this.sizer.isHtmlAllowed=function(){return!1}),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="nwse-resize"),mxEvent.addGestureListeners(this.sizer.node,s),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(!1)},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(!0)},mxOutline.prototype.createSizer=function(){var t;return null!=this.sizerImage?((t=new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src)).dialect=this.outline.dialect,t):((t=new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR)).dialect=this.outline.dialect,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(null!=this.source&&null!=this.source.container&&null!=this.outline&&null!=this.outline.container){var e=this.source.view.scale,n=this.getSourceGraphBounds(),i=new mxRectangle(n.x/e+this.source.panDx,n.y/e+this.source.panDy,n.width/e,n.height/e),s=new mxRectangle(0,0,this.source.container.clientWidth/e,this.source.container.clientHeight/e),r=i.clone();r.add(s);var o=this.getSourceContainerSize(),l=Math.max(o.width/e,r.width),a=Math.max(o.height/e,r.height),h=Math.max(0,this.outline.container.clientWidth-this.border),u=Math.max(0,this.outline.container.clientHeight-this.border),d=Math.min(h/l,u/a),p=isNaN(d)?this.minScale:Math.max(this.minScale,d);if(p>0){this.outline.getView().scale!=p&&(this.outline.getView().scale=p,t=!0);var m=this.outline.getView();m.currentRoot!=this.source.getView().currentRoot&&m.setCurrentRoot(this.source.getView().currentRoot);var c=this.source.view.translate,x=c.x+this.source.panDx,g=c.y+this.source.panDy,y=this.getOutlineOffset(p);null!=y&&(x+=y.x,g+=y.y),i.x<0&&(x-=i.x),i.y<0&&(g-=i.y),m.translate.x==x&&m.translate.y==g||(m.translate.x=x,m.translate.y=g,t=!0);var f=m.translate,v=(p=this.source.getView().scale)/m.scale,C=1/m.scale,E=this.source.container;this.bounds=new mxRectangle((f.x-c.x-this.source.panDx)/C,(f.y-c.y-this.source.panDy)/C,E.clientWidth/v,E.clientHeight/v),this.bounds.x+=this.source.container.scrollLeft*m.scale/p,this.bounds.y+=this.source.container.scrollTop*m.scale/p,(S=this.selectionBorder.bounds).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,T=new mxRectangle(this.bounds.x+this.bounds.width-S.width/2,this.bounds.y+this.bounds.height-S.height/2,S.width,S.height);S.x==T.x&&S.y==T.y&&S.width==T.width&&S.height==T.height||(this.sizer.bounds=T,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var n=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,i=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||n>0)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null;this.zoom=e.isSource(this.sizer)||null!=i&&mxUtils.intersects(shape.bounds,i),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(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 n=this.getTranslateForEvent(e),i=n.x,s=n.y,r=null;if(this.zoom){var o=this.source.container;s=i/(o.clientWidth/o.clientHeight),r=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+i),Math.max(1,this.bounds.height+s)),this.selectionBorder.bounds=r,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;r=new mxRectangle(this.bounds.x+i,this.bounds.y+s,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=r,this.selectionBorder.redraw(),i/=l,i*=this.source.getView().scale,s/=l,s*=this.source.getView().scale,this.source.panGraph(-i-this.dx0,-s-this.dy0)}var a=this.sizer.bounds;this.sizer.bounds=new mxRectangle(r.x+r.width-a.width/2,r.y+r.height-a.height/2,a.width,a.height),"hidden"!=this.sizer.node.style.visibility&&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 n=this.getTranslateForEvent(e),i=n.x,s=n.y;if(Math.abs(i)>0||Math.abs(s)>0){if(this.zoom){var r=this.selectionBorder.bounds.width,o=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,o-i*o/r),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),i/=this.outline.getView().scale,s/=this.outline.getView().scale;var l=this.source.getView().translate;this.source.getView().setTranslate(l.x-i,l.y-s)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(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),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=void 0!==mxOutline?mxOutline:void 0,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=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,n,i,s,r){var o="";(this.source&&this.checkTerminal(t,n,e)||!this.source&&this.checkTerminal(t,i,e))&&(null!=this.countError&&(this.source&&(0==this.max||s>=this.max)||!this.source&&(0==this.max||r>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&this.validNeighbors.length>0&&(this.checkNeighbors(t,e,n,i)||(o+=this.typeError+"\n")));return o.length>0?o:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,n,i){for(var s=t.model.getValue(n),r=t.model.getValue(i),o=!this.validNeighborsAllowed,l=this.validNeighbors,a=0;a<l.length;a++){if(this.source&&this.checkType(t,r,l[a])){o=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(t,s,l[a])){o=this.validNeighborsAllowed;break}}return o},mxMultiplicity.prototype.checkTerminal=function(t,e,n){var i=t.model.getValue(e);return this.checkType(t,i,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(t,e,n,i,s){return null!=e&&(isNaN(e.nodeType)?e==n:mxUtils.isNode(e,n,i,s))},__mxOutput.mxMultiplicity=void 0!==mxMultiplicity?mxMultiplicity:void 0,mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,mxLayoutManager.prototype.updateHandler=null,mxLayoutManager.prototype.moveHandler=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){null!=this.graph&&(this.graph.getModel().removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler));(this.graph=t,null!=this.graph)&&(this.graph.getModel().addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(t){return null},mxLayoutManager.prototype.beforeUndo=function(t){for(var e=this.getCellsForChanges(t.changes),n=this.getGraph().getModel(),i=[],s=0;s<e.length;s++)i=i.concat(n.getDescendants(e[s]));if(e=i,this.isBubbling())for(i=n.getParents(e);i.length>0;)e=e.concat(i),i=n.getParents(i);this.executeLayoutForCells(e)},mxLayoutManager.prototype.executeLayoutForCells=function(t){var e=mxUtils.sortCells(t,!0);e=e.concat(e.slice().reverse()),this.layoutCells(e)},mxLayoutManager.prototype.cellsMoved=function(t,e){if(null!=t&&null!=e)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.getGraph().getModel(),s=0;s<t.length;s++){var r=i.getParent(t[s]);if(mxUtils.indexOf(t,r)<0){var o=this.getLayout(r);null!=o&&o.moveCell(t[s],n.x,n.y)}}},mxLayoutManager.prototype.getCellsForChanges=function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++){var s=t[i];if(s instanceof mxRootChange)return[];for(var r=this.getCellsForChange(s),o=0;o<r.length;o++)null==r[o]||e.get(r[o])||(e.put(r[o],!0),n.push(r[o]))}return n},mxLayoutManager.prototype.getCellsForChange=function(t){var e=this.getGraph().getModel();return t instanceof mxChildChange?[t.child,t.previous,e.getParent(t.child)]:t instanceof mxTerminalChange||t instanceof mxGeometryChange?[t.cell,e.getParent(t.cell)]:t instanceof mxVisibleChange||t instanceof mxStyleChange?[t.cell]:[]},mxLayoutManager.prototype.layoutCells=function(t){if(t.length>0){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=null,i=0;i<t.length;i++)t[i]!=e.getRoot()&&t[i]!=n&&this.executeLayout(this.getLayout(t[i]),t[i])&&(n=t[i]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",t))}finally{e.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(t,e){var n=!1;return null!=t&&null!=e&&(t.execute(e),n=!0),n},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxLayoutManager=void 0!==mxLayoutManager?mxLayoutManager:void 0,mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,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){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=t,null!=this.graph&&(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 1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)this.isSwimlaneIgnored(t[n])||this.swimlaneAdded(t[n])}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(t){for(var e=this.getGraph().getModel(),n=e.getParent(t),i=e.getChildCount(n),s=null,r=0;r<i;r++){var o=e.getChildAt(n,r);if(o!=t&&!this.isSwimlaneIgnored(o)&&null!=(s=e.getGeometry(o)))break}if(null!=s){var l=null!=n?this.isCellHorizontal(n):this.horizontal;this.resizeSwimlane(t,s.width,s.height,l)}},mxSwimlaneManager.prototype.cellsResized=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)if(!this.isSwimlaneIgnored(t[n])){var i=e.getGeometry(t[n]);if(null!=i){for(var s=new mxRectangle(0,0,i.width,i.height),r=t[n],o=r;null!=o;){r=o,o=e.getParent(o);var l=this.graph.isSwimlane(o)?this.graph.getStartSize(o):new mxRectangle;s.width+=l.width,s.height+=l.height}var a=null!=o?this.isCellHorizontal(o):this.horizontal;this.resizeSwimlane(r,s.width,s.height,a)}}}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(t,e,n,i){var s=this.getGraph().getModel();s.beginUpdate();try{var r=this.isCellHorizontal(t);if(!this.isSwimlaneIgnored(t)){var o=s.getGeometry(t);null!=o&&(i&&o.height!=n||!i&&o.width!=e)&&(o=o.clone(),i?o.height=n:o.width=e,s.setGeometry(t,o))}var l=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;e-=l.width,n-=l.height;for(var a=s.getChildCount(t),h=0;h<a;h++){var u=s.getChildAt(t,h);this.resizeSwimlane(u,e,n,r)}}finally{s.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxSwimlaneManager=void 0!==mxSwimlaneManager?mxSwimlaneManager:void 0,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=void 0!==mxTemporaryCellStates?mxTemporaryCellStates:void 0,mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(t,e,n,i,s){i=null==i||i,s=null==s||s;var r=this.deltas.get(t.cell);return null==r?(r={point:new mxPoint(e,n),state:t},this.deltas.put(t.cell,r),this.count++):i?(r.point.x+=e,r.point.y+=n):(r.point.x=e,r.point.y=n),s&&this.addEdges(t),r.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,n){this.revalidateState(n.state,n.point.x,n.point.y,t)})))},mxCellStatePreview.prototype.translateState=function(t,e,n){if(null!=t){var i=this.graph.getModel();if(i.isVertex(t.cell)){t.view.updateCellState(t);var s=i.getGeometry(t.cell);0==e&&0==n||null==s||s.relative&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n)}for(var r=i.getChildCount(t.cell),o=0;o<r;o++)this.translateState(t.view.getState(i.getChildAt(t.cell,o)),e,n)}},mxCellStatePreview.prototype.revalidateState=function(t,e,n,i){if(null!=t){var s=this.graph.getModel();s.isEdge(t.cell)&&t.view.updateCellState(t);var r=this.graph.getCellGeometry(t.cell),o=t.view.getState(s.getParent(t.cell));0==e&&0==n||null==r||!r.relative||!s.isVertex(t.cell)||null!=o&&!s.isVertex(o.cell)&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n),this.graph.cellRenderer.redraw(t),null!=i&&i(t);for(var l=s.getChildCount(t.cell),a=0;a<l;a++)this.revalidateState(this.graph.view.getState(s.getChildAt(t.cell,a)),e,n,i)}},mxCellStatePreview.prototype.addEdges=function(t){for(var e=this.graph.getModel(),n=e.getEdgeCount(t.cell),i=0;i<n;i++){var s=t.view.getState(e.getEdgeAt(t.cell,i));null!=s&&this.moveState(s,0,0)}},__mxOutput.mxCellStatePreview=void 0!==mxCellStatePreview?mxCellStatePreview:void 0,mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxConnectionConstraint.prototype.name=null,mxConnectionConstraint.prototype.dx=null,mxConnectionConstraint.prototype.dy=null,__mxOutput.mxConnectionConstraint=void 0!==mxConnectionConstraint?mxConnectionConstraint:void 0,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.removeEmptyParents=!1,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,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.getInitialCellForEvent=function(t){return t.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(t,e){return this.graph.isCellSelected(t)},mxGraphHandler.prototype.consumeMouseEvent=function(t,e){e.consume()},mxGraphHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())){var n=this.getInitialCellForEvent(e);if(this.delayedSelection=this.isDelayedSelection(n,e),this.cell=null,this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(n,e.getEvent()),this.isMoveEnabled()){var i=this.graph.model,s=i.getGeometry(n);this.graph.isCellMovable(n)&&(!i.isEdge(n)||this.graph.getSelectionCount()>1||null!=s.points&&s.points.length>0||null==i.getTerminal(n,!0)||null==i.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(n,e.getX(),e.getY()):this.delayedSelection&&(this.cell=n),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),n=mxUtils.bind(this,(function(t){return null!=this.graph.view.getState(t)&&e.isVertex(t)&&null!=e.getGeometry(t)&&!e.getGeometry(t).relative}));return this.graph.view.getCellStates(e.filterDescendants(n,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(null!=e){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width<this.minimumSize){var n=this.minimumSize-e.width;e.x-=n/2,e.width=this.minimumSize}else e.x=Math.round(e.x),e.width=Math.ceil(e.width);if(this.graph.view.translate,this.graph.view.scale,e.height<this.minimumSize){var i=this.minimumSize-e.height;e.y-=i/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(null!=t&&t.length>0)for(var n=this.graph.getModel(),i=0;i<t.length;i++)if(n.isVertex(t[i])||n.isEdge(t[i])){var s=this.graph.view.getState(t[i]);if(null!=s){var r=s;n.isVertex(t[i])&&null!=s.shape&&null!=s.shape.boundingBox&&(r=s.shape.boundingBox),null==e?e=mxRectangle.fromRectangle(r):e.add(r)}}return e},mxGraphHandler.prototype.createPreviewShape=function(t){var e=new mxRectangleShape(t,null,this.previewColor);return e.isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1,mxClient.IS_IOS&&(e.getSvgScreenOffset=function(){return 0})),e},mxGraphHandler.prototype.start=function(t,e,n,i){this.cell=t,this.first=mxUtils.convertPoint(this.graph.container,e,n),this.cells=null!=i?i:this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.allCells=new mxDictionary,this.cloning=!1,this.cellCount=0;for(var s=0;s<this.cells.length;s++)this.cellCount+=this.addStates(this.cells[s],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var r=this.graph.model.getParent(t),o=this.graph.model.getChildCount(r)<2,l=new mxDictionary,a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(s=0;s<a.length;s++){var h=this.graph.view.getState(a[s]);null==h||l.get(h)||l.put(h,!0)}this.guide.isStateIgnored=mxUtils.bind(this,(function(t){var e=this.graph.model.getParent(t.cell);return null!=t.cell&&(!this.cloning&&this.isCellMoving(t.cell)||t.cell!=(this.target||r)&&!o&&!l.get(t)&&(null==this.target||this.graph.model.getChildCount(this.target)>=2)&&e!=(this.target||r))}))}},mxGraphHandler.prototype.addStates=function(t,e){var n=this.graph.view.getState(t),i=0;if(null!=n&&null==e.get(t)){e.put(t,n),i++;for(var s=this.graph.model.getChildCount(t),r=0;r<s;r++)i+=this.addStates(this.graph.model.getChildAt(t,r),e)}return i},mxGraphHandler.prototype.isCellMoving=function(t){return null!=this.allCells.get(t)},mxGraphHandler.prototype.useGuidesForEvent=function(t){return null==this.guide||this.guide.isEnabledForEvent(t.getEvent())},mxGraphHandler.prototype.snap=function(t){var e=this.scaleGrid?this.graph.view.scale:1;return t.x=this.graph.snap(t.x/e)*e,t.y=this.graph.snap(t.y/e)*e,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(100*t)/100},mxGraphHandler.prototype.mouseMove=function(t,e){var n=this.graph;if(e.isConsumed()||!n.isMouseDown||null==this.cell||null==this.first||null==this.bounds||this.suspended){if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(null!=e.getState()||null!=e.sourceState)&&!n.isMouseDown){var i=n.getCursorForMouseEvent(e);null==i&&n.isEnabled()&&n.isCellMovable(e.getCell())&&(i=n.getModel().isEdge(e.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=i&&null!=e.sourceState&&e.sourceState.setCursor(i)}}else{if(mxEvent.isMultiTouchEvent(e.getEvent()))return void this.reset();var s=this.getDelta(e),r=n.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(s.x)>r||Math.abs(s.y)>r){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var o=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),l=n.isGridEnabledEvent(e.getEvent()),a=e.getCell(),h=!0,u=null;this.cloning=o,n.isDropEnabled()&&this.highlightEnabled&&(u=n.getDropTarget(this.cells,e.getEvent(),a,o));var d=n.getView().getState(u),p=!1;if(null==d||n.model.getParent(this.cell)==u&&!o){if(this.target=null,this.connectOnDrop&&null!=a&&1==this.cells.length&&n.getModel().isVertex(a)&&n.isCellConnectable(a)&&null!=(d=n.getView().getState(a))){var m=null==n.getEdgeValidationError(null,this.cell,a)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(m),p=!0}}else this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0;null!=d&&p?this.highlight.highlight(d):this.highlight.hide(),this.livePreviewActive&&o?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?o&&this.livePreviewActive||(this.setHandlesVisibleForCells(this.graph.getSelectionCells(),!1),this.livePreviewActive=!0,this.livePreviewUsed=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds)),null!=this.guide&&this.useGuidesForEvent(e)?(s=this.guide.move(this.bounds,s,l,o),h=!1):s=this.graph.snapDelta(s,this.bounds,!l,!1,!1),null!=this.guide&&h&&this.guide.hide(),n.isConstrainedEvent(e.getEvent())&&(Math.abs(s.x)>Math.abs(s.y)?s.y=0:s.x=0),this.currentDx==s.x&&this.currentDy==s.y||(this.currentDx=s.x,this.currentDy=s.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?null!=this.cells&&this.updateLivePreview(this.currentDx,this.currentDy):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(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 n=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,(function(i,s){var r=s.clone();n.push([s,r]),null!=s.shape&&(null==s.shape.originalPointerEvents&&(s.shape.originalPointerEvents=s.shape.pointerEvents),s.shape.pointerEvents=!1,null!=s.text&&(null==s.text.originalPointerEvents&&(s.text.originalPointerEvents=s.text.pointerEvents),s.text.pointerEvents=!1)),this.graph.model.isVertex(s.cell)&&(s.x+=t,s.y+=e,this.cloning||(s.view.graph.cellRenderer.redraw(s,!0),s.view.invalidate(s.cell),s.invalid=!1,null!=s.control&&null!=s.control.node&&(s.control.node.style.visibility="hidden")))})));for(var i=this.graph.view.scale,s=0;s<n.length;s++){var r=n[s][0];if(this.graph.model.isEdge(r.cell)){var o=this.graph.getCellGeometry(r.cell),l=[];if(null!=o&&null!=o.points)for(var a=0;a<o.points.length;a++)null!=o.points[a]&&l.push(new mxPoint(o.points[a].x+t/i,o.points[a].y+e/i));var h=r.visibleSourceState,u=r.visibleTargetState,d=n[s][1].absolutePoints;if(null!=h&&this.isCellMoving(h.cell))r.view.updateFixedTerminalPoint(r,h,!0,this.graph.getConnectionConstraint(r,h,!0));else{var p=d[0];r.setAbsoluteTerminalPoint(new mxPoint(p.x+t,p.y+e),!0),h=null}if(null!=u&&this.isCellMoving(u.cell))r.view.updateFixedTerminalPoint(r,u,!1,this.graph.getConnectionConstraint(r,u,!1));else{var m=d[d.length-1];r.setAbsoluteTerminalPoint(new mxPoint(m.x+t,m.y+e),!1),u=null}r.view.updatePoints(r,l,h,u),r.view.updateFloatingTerminalPoints(r,h,u),r.view.updateEdgeLabelOffset(r),r.invalid=!1,this.cloning||r.view.graph.cellRenderer.redraw(r,!0)}}this.graph.view.validate(),this.redrawHandles(n),this.resetPreviewStates(n)}},mxGraphHandler.prototype.redrawHandles=function(t){for(var e=0;e<t.length;e++){var n=this.graph.selectionCellsHandler.getHandler(t[e][0].cell);null!=n&&n.redraw(!0)}},mxGraphHandler.prototype.resetPreviewStates=function(t){for(var e=0;e<t.length;e++)t[e][0].setState(t[e][1])},mxGraphHandler.prototype.suspend=function(){this.suspended||(this.livePreviewUsed&&this.updateLivePreview(0,0),null!=this.shape&&(this.shape.node.style.visibility="hidden"),null!=this.guide&&this.guide.setVisible(!1),this.suspended=!0)},mxGraphHandler.prototype.resume=function(){this.suspended&&(this.suspended=null,this.livePreviewUsed&&(this.livePreviewActive=!0),null!=this.shape&&(this.shape.node.style.visibility="visible"),null!=this.guide&&this.guide.setVisible(!0))},mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.allCells.visit(mxUtils.bind(this,(function(t,e){null!=e.shape&&null!=e.shape.originalPointerEvents&&(e.shape.pointerEvents=e.shape.originalPointerEvents,e.shape.originalPointerEvents=null,null!=e.text&&(e.text.pointerEvents=e.text.originalPointerEvents,e.text.originalPointerEvents=null)),null!=e.control&&null!=e.control.node&&"hidden"==e.control.node.style.visibility&&(e.control.node.style.visibility=""),e.view.invalidate(e.cell)}))),this.graph.view.validate())},mxGraphHandler.prototype.setHandlesVisibleForCells=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],s=this.graph.selectionCellsHandler.getHandler(i);null!=s&&(s.setHandlesVisible(e),e&&s.redraw())}},mxGraphHandler.prototype.setHighlightColor=function(t){null!=this.highlight&&this.highlight.setHighlightColor(t)},mxGraphHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed())if(this.livePreviewUsed&&this.resetLivePreview(),null==this.cell||null==this.first||null==this.shape&&!this.livePreviewUsed||null==this.currentDx||null==this.currentDy)this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(e);else{var n=this.graph,i=e.getCell();if(this.connectOnDrop&&null==this.target&&null!=i&&n.getModel().isVertex(i)&&n.isCellConnectable(i)&&n.isEdgeValid(null,this.cell,i))n.connectionHandler.connect(this.cell,i,e.getEvent());else{var s=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),r=n.getView().scale,o=this.roundLength(this.currentDx/r),l=this.roundLength(this.currentDy/r),a=this.target;n.isSplitEnabled()&&n.isSplitTarget(a,this.cells,e.getEvent())?n.splitEdge(a,this.cells,null,o,l):this.moveCells(this.cells,o,l,s,this.target,e.getEvent())}}this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,e),this.reset()},mxGraphHandler.prototype.selectDelayed=function(t){this.graph.isCellSelected(this.cell)&&this.graph.popupMenuHandler.isPopupTrigger(t)||this.graph.selectCellForEvent(this.cell,t.getEvent())},mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.getSelectionCells(),!0)),this.destroyShapes(),this.removeHint(),this.delayedSelection=!1,this.livePreviewActive=null,this.livePreviewUsed=null,this.cellWasClicked=!1,this.suspended=null,this.currentDx=null,this.currentDy=null,this.cellCount=null,this.cloning=!1,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,n){if(this.graph.getModel().isVertex(t)){var i=this.graph.getView().getState(t);if(null!=i){var s=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),r=mxUtils.toRadians(mxUtils.getValue(i.style,mxConstants.STYLE_ROTATION)||0);if(0!=r){var o=Math.cos(-r),l=Math.sin(-r),a=new mxPoint(i.getCenterX(),i.getCenterY());s=mxUtils.getRotatedPoint(s,o,l,a)}return!mxUtils.contains(i,s.x,s.y)}}return!1};mxGraphHandler.prototype.moveCells=function(t,e,n,i,s,r){i&&(t=this.graph.getCloneableCells(t));var o=this.graph.getModel().getParent(this.cell);null==s&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(o,t,r)&&(s=this.graph.getDefaultParent()),i=i&&!this.graph.isCellLocked(s||this.graph.getDefaultParent()),this.graph.getModel().beginUpdate();try{var l=[];if(!i&&null!=s&&this.removeEmptyParents){for(var a=new mxDictionary,h=0;h<t.length;h++)a.put(t[h],!0);for(h=0;h<t.length;h++){var u=this.graph.model.getParent(t[h]);null==u||a.get(u)||(a.put(u,!0),l.push(u))}}t=this.graph.moveCells(t,e,n,i,s,r);var d=[];for(h=0;h<l.length;h++)this.shouldRemoveParent(l[h])&&d.push(l[h]);this.graph.removeCells(d,!1)}finally{this.graph.getModel().endUpdate()}i&&this.graph.setSelectionCells(t),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(t[0])},mxGraphHandler.prototype.shouldRemoveParent=function(t){var e=this.graph.view.getState(t);return null!=e&&(this.graph.model.isEdge(e.cell)||this.graph.model.isVertex(e.cell))&&this.graph.isCellDeletable(e.cell)&&0==this.graph.model.getChildCount(e.cell)&&this.graph.isTransparentState(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.refreshHandler=null),this.destroyShapes(),this.removeHint()},__mxOutput.mxGraphHandler=void 0!==mxGraphHandler?mxGraphHandler:void 0,mxPanningHandler.prototype=new mxEventSource,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.pinchEnabled=!0,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||null!=this.initialScale},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&&null==t.getState()&&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,!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=!0},mxPanningHandler.prototype.consumePanningTrigger=function(t){t.consume()},mxPanningHandler.prototype.mouseMove=function(t,e){if(this.dx=e.getX()-this.startX,this.dy=e.getY()-this.startY,this.active)this.previewEnabled&&(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 n=this.active;this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!n&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var n=this.graph.getView().scale,i=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(i.x+this.dx/n,i.y+this.dy/n)}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;null!=this.minScale&&(e=Math.max(this.minScale,e)),null!=this.maxScale&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,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=void 0!==mxPanningHandler?mxPanningHandler:void 0,mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,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){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=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(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=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var n=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var i=mxUtils.getScrollOrigin();this.popup(e.getX()+i.x+1,e.getY()+i.y+1,n,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},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=void 0!==mxPopupMenuHandler?mxPopupMenuHandler:void 0,mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,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 null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,null!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,n){var i=null!=t&&this.isValidState(t);n=null!=n?n:this.getMarkerColor(e.getEvent(),t,i),this.validState=i?t:null,t==this.markedState&&n==this.currentColor||(this.currentColor=n,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var n=this.graph.getView().getState(t);null!=n&&(this.currentColor=null!=e?e:this.validColor,this.markedState=n,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!0},mxCellMarker.prototype.getMarkerColor=function(t,e,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),n=this.getCell(t),i=this.getStateToMark(e.getState(n));return null!=i&&this.intersects(i,t)?i:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return!this.hotspotEnabled||mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=void 0!==mxCellMarker?mxCellMarker:void 0,mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,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.reset=function(){this.handlers.visit((function(t,e){e.reset.apply(e)}))},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=this.graph.getSelectionCells(),n=0;n<e.length;n++){var i=this.graph.view.getState(e[n]);if(null!=i){var s=t.remove(e[n]);null!=s&&(s.state!=i?(s.destroy(),s=null):this.isHandlerActive(s)||(null!=s.refresh&&s.refresh(),s.redraw())),null==s&&(s=this.graph.createHandler(i),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",i))),null!=s&&this.handlers.put(e[n],s)}}t.visit(mxUtils.bind(this,(function(t,e){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",e.state)),e.destroy()})))},mxSelectionCellsHandler.prototype.isHandlerActive=function(t){return null!=t.index},mxSelectionCellsHandler.prototype.updateHandler=function(t){var e=this.handlers.remove(t.cell);if(null!=e){var n=e.index,i=e.startX,s=e.startY;e.destroy(),null!=(e=this.graph.createHandler(t))&&(this.handlers.put(t.cell,e),null!=n&&null!=i&&null!=s&&e.start(i,s,n))}},mxSelectionCellsHandler.prototype.mouseDown=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit((function(t,e){e.mouseDown.apply(e,n)}))}},mxSelectionCellsHandler.prototype.mouseMove=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit((function(t,e){e.mouseMove.apply(e,n)}))}},mxSelectionCellsHandler.prototype.mouseUp=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit((function(t,e){e.mouseUp.apply(e,n)}))}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},__mxOutput.mxSelectionCellsHandler=void 0!==mxSelectionCellsHandler?mxSelectionCellsHandler:void 0,mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1,mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.ignoreMouseDown=!1,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=!1,mxConnectionHandler.prototype.livePreview=!1,mxConnectionHandler.prototype.cursor=null,mxConnectionHandler.prototype.insertBeforeSource=!1,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(t){this.enabled=t},mxConnectionHandler.prototype.isInsertBefore=function(t,e,n,i,s){return this.insertBeforeSource&&e!=n},mxConnectionHandler.prototype.isCreateTarget=function(t){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(t){this.createTarget=t},mxConnectionHandler.prototype.createShape=function(){var t=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);return t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.scale=this.graph.view.scale,t.pointerEvents=!1,t.isDashed=!0,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,null),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){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&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!0},mxConnectionHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph);return t.hotspotEnabled=!0,t.getCell=mxUtils.bind(this,(function(e){var n=mxCellMarker.prototype.getCell.apply(t,arguments);if(this.error=null,null==n&&null!=this.currentPoint&&(n=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y)),null!=n&&!this.graph.isCellConnectable(n)){var i=this.graph.getModel().getParent(n);this.graph.getModel().isVertex(i)&&this.graph.isCellConnectable(i)&&(n=i)}return(this.graph.isSwimlane(n)&&null!=this.currentPoint&&this.graph.hitsSwimlaneContent(n,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(n))&&(n=null),null!=n?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,n),null!=this.error&&0==this.error.length&&(n=null,this.isCreateTarget(e.getEvent())&&(this.error=null))):this.isValidSource(n,e)||(n=null):!this.isConnecting()||this.isCreateTarget(e.getEvent())||this.graph.allowDanglingEdges||(this.error=""),n})),t.isValidState=mxUtils.bind(this,(function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(t,arguments)})),t.getMarkerColor=mxUtils.bind(this,(function(e,n,i){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(t,arguments):null})),t.intersects=mxUtils.bind(this,(function(e,n){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(t,arguments)})),t},mxConnectionHandler.prototype.start=function(t,e,n,i){this.previous=t,this.first=new mxPoint(e,n),this.edgeState=null!=i?i: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 null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(t,e){return this.graph.isValidSource(t)},mxConnectionHandler.prototype.isValidTarget=function(t){return!0},mxConnectionHandler.prototype.validateConnection=function(t,e){return this.isValidTarget(e)?this.graph.getEdgeValidationError(null,t,e):""},mxConnectionHandler.prototype.getConnectImage=function(t){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(t){return null!=t.text&&t.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(t){var e=this.getConnectImage(t);if(null!=e&&null!=t){this.iconState=t;var n=[],i=new mxImageShape(new mxRectangle(0,0,e.width,e.height),e.src,null,null,0);i.preserveImageAspect=!1,this.isMoveIconToFrontForState(t)?(i.dialect=mxConstants.DIALECT_STRICTHTML,i.init(this.graph.container)):(i.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,i.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=i.node.previousSibling&&i.node.parentNode.insertBefore(i.node,i.node.parentNode.firstChild)),i.node.style.cursor=mxConstants.CURSOR_CONNECT;var s=mxUtils.bind(this,(function(){return null!=this.currentState?this.currentState:t})),r=mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.icon=i,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,s())))}));return mxEvent.redirectMouseEvents(i.node,this.graph,s,r),n.push(i),this.redrawIcons(n,this.iconState),n}return null},mxConnectionHandler.prototype.redrawIcons=function(t,e){if(null!=t&&null!=t[0]&&null!=e){var n=this.getIconPosition(t[0],e);t[0].bounds.x=n.x,t[0].bounds.y=n.y,t[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(t,e){var n=this.graph.getView().scale,i=e.getCenterX(),s=e.getCenterY();if(this.graph.isSwimlane(e.cell)){var r=this.graph.getStartSize(e.cell);i=0!=r.width?e.x+r.width*n/2:i,s=0!=r.height?e.y+r.height*n/2:s;var o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0);if(0!=o){var l=Math.cos(o),a=Math.sin(o),h=new mxPoint(e.getCenterX(),e.getCenterY()),u=mxUtils.getRotatedPoint(new mxPoint(i,s),l,a,h);i=u.x,s=u.y}}return new mxPoint(i-t.bounds.width/2,s-t.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){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 null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)},mxConnectionHandler.prototype.mouseDown=function(t,e){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!e.isConsumed()&&!this.isConnecting()&&this.isStartEvent(e)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState){var n=this.graph.getPointForEvent(e.getEvent());this.edgeState.cell.geometry.setTerminalPoint(n,!0)}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),n=t.getEvent(),i=mxEvent.getClientX(n),s=mxEvent.getClientY(n),r=document.documentElement,o=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),l=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-o,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-l;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,s)||(a!=i||h!=s)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxConnectionHandler.prototype.updateCurrentState=function(t,e){if(this.constraintHandler.update(t,null==this.first,!1,null==this.first||t.isSource(this.marker.highlight.shape)?null:e),null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error&&(this.currentState=this.constraintHandler.currentFocus),(null!=this.error||null!=this.currentState&&!this.isCellEnabled(this.currentState.cell))&&this.constraintHandler.reset());else{this.graph.isIgnoreTerminalEvent(t.getEvent())?(this.marker.reset(),this.currentState=null):(this.marker.process(t),this.currentState=this.marker.getValidState()),null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.constraintHandler.reset(),this.marker.reset(),this.currentState=null);var n=this.isOutlineConnectEvent(t);if(null!=this.currentState&&n){t.isSource(this.marker.highlight.shape)&&(e=new mxPoint(t.getGraphX(),t.getGraphY()));var i=this.graph.getOutlineConstraint(e,this.currentState,t);this.constraintHandler.setFocus(t,this.currentState,!1),this.constraintHandler.currentConstraint=i,this.constraintHandler.currentPoint=e}if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var s=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/s/s,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.getValidState()!=t.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/s/s,this.marker.highlight.repaint())}}},mxConnectionHandler.prototype.isCellEnabled=function(t){return!0},mxConnectionHandler.prototype.convertWaypoint=function(t){var e=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();t.x=t.x/e-n.x,t.y=t.y/e-n.y},mxConnectionHandler.prototype.snapToPreview=function(t,e){if(!mxEvent.isAltDown(t.getEvent())&&null!=this.previous){var n=this.graph.gridSize*this.graph.view.scale/2,i=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(i.x-t.getGraphX())<n&&(e.x=i.x),Math.abs(i.y-t.getGraphY())<n&&(e.y=i.y)}},mxConnectionHandler.prototype.mouseMove=function(t,e){if(e.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);var n=this.graph.getView(),i=n.scale,s=n.translate,r=new mxPoint(e.getGraphX(),e.getGraphY());if(this.error=null,this.graph.isGridEnabledEvent(e.getEvent())&&(r=new mxPoint((this.graph.snap(r.x/i-s.x)+s.x)*i,(this.graph.snap(r.y/i-s.y)+s.y)*i)),this.snapToPreview(e,r),this.currentPoint=r,(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(e.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,r),null!=this.first){var o=null,l=r;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(o=this.constraintHandler.currentConstraint,l=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-r.x)<Math.abs(this.previous.getCenterY()-r.y)?r.x=this.previous.getCenterX():r.y=this.previous.getCenterY());var a=this.first;if(null!=this.selectedIcon){var h=this.selectedIcon.bounds.width,u=this.selectedIcon.bounds.height;if(null!=this.currentState&&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(null!=this.edgeState)this.updateEdgeState(l,o),l=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],a=this.edgeState.absolutePoints[0];else{if(null!=this.currentState)if(null==this.constraintHandler.currentConstraint)null!=(c=this.getTargetPerimeterPoint(this.currentState,e))&&(l=c);if(null==this.sourceConstraint&&null!=this.previous){var m=null!=this.waypoints&&this.waypoints.length>0?this.waypoints[0]:l;null!=(c=this.getSourcePerimeterPoint(this.previous,m,e))&&(a=c)}}if(null==this.currentState&&this.movePreviewAway){var c=a;if(null!=this.edgeState&&this.edgeState.absolutePoints.length>=2){var x=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];null!=x&&(c=x)}var g=l.x-c.x,y=l.y-c.y,f=Math.sqrt(g*g+y*y);if(0==f)return;this.originalPoint=l.clone(),l.x-=4*g/f,l.y-=4*y/f}else this.originalPoint=null;if(null==this.shape){g=Math.abs(e.getGraphX()-this.first.x),y=Math.abs(e.getGraphY()-this.first.y);(g>this.graph.tolerance||y>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(e,r))}if(null!=this.shape){if(null!=this.edgeState)this.shape.points=this.edgeState.absolutePoints;else{var v=[a];null!=this.waypoints&&(v=v.concat(this.waypoints)),v.push(l),this.shape.points=v}this.drawPreview()}null!=this.cursor&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||e.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(var C=!1,E=e.getSource(),S=0;S<this.icons.length&&!C;S++)C=E==this.icons[S].node||E.parentNode==this.icons[S].node;C||this.updateIcons(this.currentState,this.icons,e)}}},mxConnectionHandler.prototype.updateEdgeState=function(t,e){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y),null!=e&&null!=e.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=e.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=e.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]),this.edgeState.absolutePoints=[null,null!=this.currentState?null:t],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==e&&(e=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,e));var n=null;if(null!=this.waypoints){n=[];for(var i=0;i<this.waypoints.length;i++){var s=this.waypoints[i].clone();this.convertWaypoint(s),n[i]=s}}this.graph.view.updatePoints(this.edgeState,n,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(t,e){var n=null,i=t.view,s=i.getPerimeterFunction(t);if(null!=s){var r=null!=this.waypoints&&this.waypoints.length>0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),o=s(i.getPerimeterBounds(t),this.edgeState,r,!1);null!=o&&(n=o)}else n=new mxPoint(t.getCenterX(),t.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,n){var i=null,s=t.view,r=s.getPerimeterFunction(t),o=new mxPoint(t.getCenterX(),t.getCenterY());if(null!=r){var l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),a=-l*(Math.PI/180);0!=l&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(a),Math.sin(a),o));var h=r(s.getPerimeterBounds(t),t,e,!1);null!=h&&(0!=l&&(h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-a),Math.sin(-a),o)),i=h)}else i=o;return i},mxConnectionHandler.prototype.updateIcons=function(t,e,n){},mxConnectionHandler.prototype.isStopEvent=function(t){return null!=t.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),n=Math.abs(e.x-this.first.x),i=Math.abs(e.y-this.first.y);if(null!=this.waypoints||this.mouseDownCounter>1&&(n>this.graph.tolerance||i>this.graph.tolerance)){null==this.waypoints&&(this.waypoints=[]);var s=this.graph.view.scale;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 null==t||null==e||null==t.point||null==e.point||!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))return this.addWaypointForEvent(e),void e.consume();var n=this.sourceConstraint,i=this.constraintHandler.currentConstraint,s=null!=this.previous?this.previous.cell:null,r=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(r=this.constraintHandler.currentFocus.cell),null==r&&null!=this.currentState&&(r=this.currentState.cell),null!=this.error||null!=s&&null!=r&&s==r&&!this.checkConstraints(n,i)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),null!=this.error&&this.error.length>0&&this.graph.validationAlert(this.error)):this.connect(s,r,e.getEvent(),e.getCell()),this.destroyIcons(),e.consume()}null!=this.first&&this.reset()},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.cursor&&null!=this.graph.container&&(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(null==this.error),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,n,i){if(null!=e||this.isCreateTarget(n)||this.graph.allowDanglingEdges){var s=this.graph.getModel(),r=!1,o=null;s.beginUpdate();try{if(null!=t&&null==e&&!this.graph.isIgnoreTerminalEvent(n)&&this.isCreateTarget(n)&&null!=(e=this.createTargetVertex(n,t))){if(i=this.graph.getDropTarget([e],n,i),r=!0,null!=i&&this.graph.getModel().isEdge(i))i=this.graph.getDefaultParent();else{var l=this.graph.getView().getState(i);if(null!=l)(d=s.getGeometry(e)).x-=l.origin.x,d.y-=l.origin.y}this.graph.addCell(e,i)}var a=this.graph.getDefaultParent();null!=t&&null!=e&&s.getParent(t)==s.getParent(e)&&s.getParent(s.getParent(t))!=s.getRoot()&&(a=s.getParent(t),null!=t.geometry&&t.geometry.relative&&null!=e.geometry&&e.geometry.relative&&(a=s.getParent(a)));var h=null,u=null;if(null!=this.edgeState&&(h=this.edgeState.cell.value,u=this.edgeState.cell.style),null!=(o=this.insertEdge(a,null,h,t,e,u))){this.graph.setConnectionConstraint(o,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,e,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&s.setGeometry(o,this.edgeState.cell.geometry);a=s.getParent(t);if(this.isInsertBefore(o,t,e,n,i)){for(var d=t;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=o.parent;)d=this.graph.model.getParent(d);null!=d&&null!=d.parent&&d.parent==o.parent&&s.add(a,o,d.parent.getIndex(d))}var p=s.getGeometry(o);if(null==p&&((p=new mxGeometry).relative=!0,s.setGeometry(o,p)),null!=this.waypoints&&this.waypoints.length>0){var m=this.graph.view.scale,c=this.graph.view.translate;p.points=[];for(var x=0;x<this.waypoints.length;x++){var g=this.waypoints[x];p.points.push(new mxPoint(g.x/m-c.x,g.y/m-c.y))}}if(null==e){var y=this.graph.view.translate;m=this.graph.view.scale;(g=null!=this.originalPoint?new mxPoint(this.originalPoint.x/m-y.x,this.originalPoint.y/m-y.y):new mxPoint(this.currentPoint.x/m-y.x,this.currentPoint.y/m-y.y)).x-=this.graph.panDx/this.graph.view.scale,g.y-=this.graph.panDy/this.graph.view.scale,p.setTerminalPoint(g,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",o,"terminal",e,"event",n,"target",i,"terminalInserted",r))}}catch(t){mxLog.show(),mxLog.debug(t.message)}finally{s.endUpdate()}this.select&&this.selectCells(o,r?e:null)}},mxConnectionHandler.prototype.selectCells=function(t,e){this.graph.setSelectionCell(t)},mxConnectionHandler.prototype.insertEdge=function(t,e,n,i,s,r){if(null==this.factoryMethod)return this.graph.insertEdge(t,e,n,i,s,r);var o=this.createEdge(n,i,s,r);return o=this.graph.addEdge(o,t,i,s)},mxConnectionHandler.prototype.createTargetVertex=function(t,e){for(var n=this.graph.getCellGeometry(e);null!=n&&n.relative;)e=this.graph.getModel().getParent(e),n=this.graph.getCellGeometry(e);var i=this.graph.cloneCell(e);if(null!=(n=this.graph.getModel().getGeometry(i))){var s=this.graph.view.translate,r=this.graph.view.scale,o=new mxPoint(this.currentPoint.x/r-s.x,this.currentPoint.y/r-s.y);n.x=Math.round(o.x-n.width/2-this.graph.panDx/r),n.y=Math.round(o.y-n.height/2-this.graph.panDy/r);var l=this.getAlignmentTolerance();if(l>0){var a=this.graph.view.getState(e);if(null!=a){var h=a.x/r-s.x,u=a.y/r-s.y;Math.abs(h-n.x)<=l&&(n.x=Math.round(h)),Math.abs(u-n.y)<=l&&(n.y=Math.round(u))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,n,i){var s=null;if(null!=this.factoryMethod&&(s=this.factoryMethod(e,n,i)),null==s){(s=new mxCell(t||"")).setEdge(!0),s.setStyle(i);var r=new mxGeometry;r.relative=!0,s.setGeometry(r)}return s},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=void 0!==mxConnectionHandler?mxConnectionHandler:void 0,mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,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(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null}null!=this.focusHighlight&&(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,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(t,e){return!1},mxConstraintHandler.prototype.isStateIgnored=function(t,e){return!1},mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null,this.focusPoints=null}},mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)},mxConstraintHandler.prototype.isKeepFocusEvent=function(t){return mxEvent.isShiftDown(t.getEvent())},mxConstraintHandler.prototype.getCellForEvent=function(t,e){var n=t.getCell();if(null!=n||null==e||t.getGraphX()==e.x&&t.getGraphY()==e.y||(n=this.graph.getCellAt(e.x,e.y)),null!=n&&!this.graph.isCellConnectable(n)){var i=this.graph.getModel().getParent(n);this.graph.getModel().isVertex(i)&&this.graph.isCellConnectable(i)&&(n=i)}return this.graph.isCellLocked(n)?null:n},mxConstraintHandler.prototype.update=function(t,e,n,i){if(this.isEnabled()&&!this.isEventIgnored(t)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,(function(){this.reset()})),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var s=this.getTolerance(t),r=new mxRectangle((null!=i?i.x:t.getGraphX())-s,(null!=i?i.y:t.getGraphY())-s,2*s,2*s),o=new mxRectangle(t.getGraphX()-s,t.getGraphY()-s,2*s,2*s),l=this.graph.view.getState(this.getCellForEvent(t,i));this.isKeepFocusEvent(t)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==l&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,o)||l==this.currentFocus||(this.currentFocusArea=null,this.currentFocus=null,this.setFocus(t,l,e)),this.currentConstraint=null,this.currentPoint=null;var a=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==l||this.currentFocus==l))for(var h=o.getCenterX(),u=o.getCenterY(),d=0;d<this.focusIcons.length;d++){var p=h-this.focusIcons[d].bounds.getCenterX(),m=u-this.focusIcons[d].bounds.getCenterY(),c=p*p+m*m;if((this.intersects(this.focusIcons[d],o,e,n)||null!=i&&this.intersects(this.focusIcons[d],r,e,n))&&(null==a||c<a)){if(this.currentConstraint=this.constraints[d],this.currentPoint=this.focusPoints[d],a=c,(c=this.focusIcons[d].bounds.clone()).grow(mxConstants.HIGHLIGHT_SIZE+1),c.width-=1,c.height-=1,null==this.focusHighlight){var x=this.createHighlightShape();x.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,x.pointerEvents=!1,x.init(this.graph.getView().getOverlayPane()),this.focusHighlight=x;var g=mxUtils.bind(this,(function(){return null!=this.currentFocus?this.currentFocus:l}));mxEvent.redirectMouseEvents(x.node,this.graph,g)}this.focusHighlight.bounds=c,this.focusHighlight.redraw()}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentConstraint=null,this.currentFocus=null,this.currentPoint=null},mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){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 n=this.graph.getConnectionPoint(t,this.constraints[e]),i=this.getImageForConstraint(t,this.constraints[e],n),s=new mxRectangle(Math.round(n.x-i.width/2),Math.round(n.y-i.height/2),i.width,i.height);this.focusIcons[e].bounds=s,this.focusIcons[e].redraw(),this.currentFocusArea.add(this.focusIcons[e].bounds),this.focusPoints[e]=n}}},mxConstraintHandler.prototype.setFocus=function(t,e,n){if(this.constraints=null!=e&&!this.isStateIgnored(e,n)&&this.graph.isCellConnectable(e.cell)?this.isEnabled()&&this.graph.getAllConnectionConstraints(e,n)||[]:null,null!=this.constraints){if(this.currentFocus=e,this.currentFocusArea=new mxRectangle(e.x,e.y,e.width,e.height),null!=this.focusIcons){for(var i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusIcons=null,this.focusPoints=null}this.focusPoints=[],this.focusIcons=[];for(i=0;i<this.constraints.length;i++){var s=this.graph.getConnectionPoint(e,this.constraints[i]),r=this.getImageForConstraint(e,this.constraints[i],s),o=r.src,l=new mxImageShape(new mxRectangle(Math.round(s.x-r.width/2),Math.round(s.y-r.height/2),r.width,r.height),o);l.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,l.preserveImageAspect=!1,l.init(this.graph.getView().getDecoratorPane()),(mxClient.IS_QUIRKS||8==document.documentMode)&&mxEvent.addListener(l.node,"dragstart",(function(t){return mxEvent.consume(t),!1})),null!=l.node.previousSibling&&l.node.parentNode.insertBefore(l.node,l.node.parentNode.firstChild);var a=mxUtils.bind(this,(function(){return null!=this.currentFocus?this.currentFocus:e}));l.redraw(),mxEvent.redirectMouseEvents(l.node,this.graph,a),this.currentFocusArea.add(l.bounds),this.focusIcons.push(l),this.focusPoints.push(s)}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);return t.opacity=mxConstants.HIGHLIGHT_OPACITY,t},mxConstraintHandler.prototype.intersects=function(t,e,n,i){return mxUtils.intersects(t.bounds,e)},mxConstraintHandler.prototype.destroy=function(){this.reset(),null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null),null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)},__mxOutput.mxConstraintHandler=void 0!==mxConstraintHandler?mxConstraintHandler:void 0,mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.fadeOut=!1,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()&&null==e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())){var n=mxUtils.getOffset(this.graph.container),i=mxUtils.getScrollOrigin(this.graph.container);i.x-=n.x,i.y-=n.y,this.start(e.getX()+i.x,e.getY()+i.y),e.consume(!1)}},mxRubberband.prototype.start=function(t,e){this.first=new mxPoint(t,e);var n=this.graph.container;function i(t){var e=new mxMouseEvent(t),i=mxUtils.convertPoint(n,e.getX(),e.getY());return e.graphX=i.x,e.graphY=i.y,e}this.dragHandler=mxUtils.bind(this,(function(t){this.mouseMove(this.graph,i(t))})),this.dropHandler=mxUtils.bind(this,(function(t){this.mouseUp(this.graph,i(t))})),mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)},mxRubberband.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),i=mxUtils.getOffset(this.graph.container);n.x-=i.x,n.y-=i.y;var s=e.getX()+n.x,r=e.getY()+n.y,o=this.first.x-s,l=this.first.y-r,a=this.graph.tolerance;(null!=this.div||Math.abs(o)>a||Math.abs(l)>a)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(s,r),e.consume())}},mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(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;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return null!=this.div&&"none"!=this.div.style.display},mxRubberband.prototype.mouseUp=function(t,e){var n=this.isActive();this.reset(),n&&(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(null!=this.div)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(null!=this.div){var t=this.currentX-this.graph.panDx,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 n=mxClient.IS_VML?this.graph.panDx:0,i=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+n+"px",this.div.style.top=this.y+i+"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(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},__mxOutput.mxRubberband=void 0!==mxRubberband?mxRubberband:void 0,mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,n){},mxHandle.prototype.execute=function(){},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,n=this.graph.view.translate,i=new mxPoint(t.getGraphX()/e-n.x,t.getGraphY()/e-n.y);null!=this.shape&&null!=this.shape.bounds&&(i.x-=this.shape.bounds.width/e/4,i.y-=this.shape.bounds.height/e/4);var s=-mxUtils.toRadians(this.getRotation()),r=-mxUtils.toRadians(this.getTotalRotation())-s;i=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(i,s),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),r)),this.setPosition(this.state.getPaintBounds(),i,t),this.positionChanged(),this.redraw()},mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state),null!=this.state.shape&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):this.shape=this.createShape(t),this.initShape(t)},mxHandle.prototype.createShape=function(t){return new mxRectangleShape(new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&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(null!=this.shape&&null!=this.state.shape){var t=this.getPosition(this.state.getPaintBounds());if(null!=t){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var n=this.graph.view.scale,i=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+i.x)*n-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+i.y)*n-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var n=this.state.getCellBounds(),i=new mxPoint(n.getCenterX(),n.getCenterY()),s=Math.cos(e),r=Math.sin(e);return mxUtils.getRotatedPoint(t,s,r,i)},mxHandle.prototype.flipPoint=function(t){if(null!=this.state.shape){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=void 0!==mxHandle?mxHandle:void 0,mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(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=!1,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),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var t=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],t||this.graph.isLabelMovable(this.state.cell)&&this.state.width>=2&&this.state.height>=2){var e=0;t&&(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 n=this.graph.model.getGeometry(this.state.cell);null==n||n.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 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))}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(),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)&&this.state.width>=2&&this.state.height>=2},mxVertexHandler.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!1},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),null!=this.minBounds)){var e=this.state.view.scale,n=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-n.x,this.y0=this.state.y/e-n.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(t,null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),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,n,i){var s=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),r=this.createSizerShape(s,e,i);return r.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(r.bounds.height-=1,r.bounds.width-=1,r.dialect=mxConstants.DIALECT_STRICTHTML,r.init(this.graph.container)):(r.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,r.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(r.node,this.graph,this.state),this.graph.isEnabled()&&r.setCursor(t),this.isSizerVisible(e)||(r.visible=!1),r},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,n){if(null!=this.handleImage){var i=new mxImageShape(t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height),this.handleImage.src);return i.preserveImageAspect=!1,i}return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,n){null!=t&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(n-t.bounds.height/2),null!=t.node&&"none"!=t.node.style.display&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null;function i(e){return null!=e&&(t.isSource(e)||null!=n&&mxUtils.intersects(e.bounds,n)&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility)}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var s=this.customHandles.length-1;s>=0;s--)if(i(this.customHandles[s].shape))return mxEvent.CUSTOM_HANDLE-s;if(i(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(i(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(s=0;s<this.sizers.length;s++)if(i(this.sizers[s]))return s;return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){var n=mxEvent.isMouseEvent(e.getEvent())?0:this.tolerance;if(!e.isConsumed()&&this.graph.isEnabled()&&(n>0||e.getState()==this.state)){var i=this.getHandleForEvent(e);null!=i&&(this.start(e.getGraphX(),e.getGraphY(),i),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke},mxVertexHandler.prototype.start=function(t,e,n){if(null!=this.selectionBorder){this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=n,this.startX=t,this.startY=e;var i=this.state.view.graph.model,s=i.getParent(this.state.cell);if(this.state.view.currentRoot!=s&&(i.isVertex(s)||i.isEdge(s))&&(this.parentState=this.state.view.graph.view.getState(s)),this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.livePreviewActive&&!this.isLivePreviewBorder()||(this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))),n==mxEvent.ROTATION_HANDLE){var r=this.getRotationHandlePosition(),o=r.x-this.state.getCenterX(),l=r.y-this.state.getCenterY();this.startAngle=0!=o?180*Math.atan(l/o)/Math.PI+90:l<0?180:0,this.startDist=Math.sqrt(o*o+l*l)}if(this.livePreviewActive){this.hideSizers(),n==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":n==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&null!=this.sizers[n]?this.sizers[n].node.style.display="":n<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-n].setVisible(!0);var a=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var h=0;h<a.length;h++){var u=this.graph.selectionCellsHandler.getHandler(a[h]);null!=u&&this.edgeHandlers.push(u)}}}},mxVertexHandler.prototype.setHandlesVisible=function(t){if(null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].node.style.display=t?"":"none";if(null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)},mxVertexHandler.prototype.checkTolerance=function(t){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(t.getEvent())||Math.abs(t.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(10*t)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(100*t)/100},mxVertexHandler.prototype.mouseMove=function(t,e){e.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(e)||e.consume(!1):(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e)),e.consume())},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.graph.view.translate,i=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/i-n.x)+n.x)*i,e.y=(this.graph.snap(e.y/i-n.y)+n.y)*i);var s=null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[s],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.state.x+this.state.width/2-e.x,i=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=0!=n?180*Math.atan(i/n)/Math.PI+90:i<0?180:0,n>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){n=e.x-this.state.getCenterX(),i=e.y-this.state.getCenterY();var s=Math.sqrt(n*n+i*i);s-this.startDist<2?raster=15:s-this.startDist<25?raster=5: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(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),i=new mxPoint(t.getGraphX(),t.getGraphY()),s=this.graph.view.translate,r=this.graph.view.scale,o=Math.cos(-n),l=Math.sin(-n),a=l*(c=i.x-this.startX)+o*(x=i.y-this.startY);c=o*c-l*x,x=a;var h=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(h,c/r,x/r,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!h.relative){var u=this.graph.getMaximumGraphBounds();if(null!=u&&null!=this.parentState&&((u=mxRectangle.fromRectangle(u)).x-=(this.parentState.x-s.x*r)/r,u.y-=(this.parentState.y-s.y*r)/r),this.graph.isConstrainChild(this.state.cell)){var d=this.graph.getCellContainmentArea(this.state.cell);if(null!=d){var p=this.graph.getOverlap(this.state.cell);p>0&&((d=mxRectangle.fromRectangle(d)).x-=d.width*p,d.y-=d.height*p,d.width+=2*d.width*p,d.height+=2*d.height*p),null==u?u=d:(u=mxRectangle.fromRectangle(u)).intersect(d)}}null!=u&&(this.unscaledBounds.x<u.x&&(this.unscaledBounds.width-=u.x-this.unscaledBounds.x,this.unscaledBounds.x=u.x),this.unscaledBounds.y<u.y&&(this.unscaledBounds.height-=u.y-this.unscaledBounds.y,this.unscaledBounds.y=u.y),this.unscaledBounds.x+this.unscaledBounds.width>u.x+u.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-u.x-u.width),this.unscaledBounds.y+this.unscaledBounds.height>u.y+u.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-u.y-u.height))}var m=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:s.x*r)+this.unscaledBounds.x*r,(null!=this.parentState?this.parentState.y:s.y*r)+this.unscaledBounds.y*r,this.unscaledBounds.width*r,this.unscaledBounds.height*r),h.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),o=Math.cos(n),l=Math.sin(n);var c,x,g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),y=o*(c=g.x-e.x)-l*(x=g.y-e.y)-c,f=l*c+o*x-x,v=this.bounds.x-this.state.x,C=this.bounds.y-this.state.y,E=o*v-l*C,S=l*v+o*C;this.bounds.x+=y,this.bounds.y+=f,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+y/r),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+f/r),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),this.graph.isCellCollapsed(this.state.cell)||0==y&&0==f?(this.childOffsetX=0,this.childOffsetY=0):(this.childOffsetX=this.state.x-this.bounds.x+E,this.childOffsetY=this.state.y-this.bounds.y+S),m.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),null!=this.preview&&this.drawPreview())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-n.x,this.state.y/e-n.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var s=this.state.absoluteOffset;s=new mxPoint(s.x,s.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var r=this.graph.getCellGeometry(this.state.cell);if(null!=r){var o=r.offset||this.EMPTY_POINT;null==o||r.relative||(this.state.absoluteOffset.x=this.state.view.scale*o.x,this.state.absoluteOffset.y=this.state.view.scale*o.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden"),this.state.setState(i)},mxVertexHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.state){var n=new mxPoint(e.getGraphX(),e.getGraphY()),i=this.index;this.index=null,this.graph.getModel().beginUpdate();try{if(i<=mxEvent.CUSTOM_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-i].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-i].execute());else if(i==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var s=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=s&&this.rotateCell(this.state.cell,s)}else this.rotateClick();else{var r=this.graph.isGridEnabledEvent(e.getEvent()),o=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-o),a=Math.sin(-o),h=n.x-this.startX,u=n.y-this.startY,d=a*h+l*u;h=l*h-a*u,u=d;var p=this.graph.view.scale,m=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(h/p),this.roundLength(u/p),i,r,this.isConstrainedEvent(e),m)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,n){if(0!=e){var i=this.graph.getModel();if(i.isVertex(t)||i.isEdge(t)){if(!i.isEdge(t)){var s=this.graph.view.getState(t),r=null!=s?s.style:this.graph.getCellStyle(t);if(null!=r){var o=(r[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,o,[t])}}var l=this.graph.getCellGeometry(t);if(null!=l){var a=this.graph.getCellGeometry(n);if(null==a||i.isEdge(n)||((l=l.clone()).rotate(e,new mxPoint(a.width/2,a.height/2)),i.setGeometry(t,l)),i.isVertex(t)&&!l.relative||i.isEdge(t))for(var h=i.getChildCount(t),u=0;u<h;u++)this.rotateCell(i.getChildAt(t,u),e,t)}}}},mxVertexHandler.prototype.reset=function(){if(null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display=""),this.currentAlpha=null,this.inTolerance=null,this.index=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),this.livePreviewActive&&null!=this.sizers){for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="")}if(null!=this.customHandles)for(t=0;t<this.customHandles.length;t++)this.customHandles[t].active?(this.customHandles[t].active=!1,this.customHandles[t].reset()):this.customHandles[t].setVisible(!0);null!=this.selectionBorder&&(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.unscaledBounds=null,this.livePreviewActive=null},mxVertexHandler.prototype.resizeCell=function(t,e,n,i,s,r,o){var l=this.graph.model.getGeometry(t);if(null!=l)if(i==mxEvent.LABEL_HANDLE){var a=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),d=this.graph.view.scale,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);null==(l=l.clone()).offset?l.offset=p:(l.offset.x+=p.x,l.offset.y+=p.y),this.graph.model.setGeometry(t,l)}else if(null!=this.unscaledBounds){d=this.graph.view.scale;0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(t,Math.round(this.childOffsetX/d),Math.round(this.childOffsetY/d)),this.graph.resizeCell(t,this.unscaledBounds,o)}},mxVertexHandler.prototype.moveChildren=function(t,e,n){for(var i=this.graph.getModel(),s=i.getChildCount(t),r=0;r<s;r++){var o=i.getChildAt(t,r),l=this.graph.getCellGeometry(o);null!=l&&((l=l.clone()).translate(e,n),i.setGeometry(o,l))}},mxVertexHandler.prototype.union=function(t,e,n,i,s,r,o,l,a){if(s=null!=s?s&&this.graph.gridEnabled:this.graph.gridEnabled,this.singleSizer){var h=t.x+t.width+e,u=t.y+t.height+n;s&&(h=this.graph.snap(h/r)*r,u=this.graph.snap(u/r)*r);var d=new mxRectangle(t.x,t.y,0,0);return d.add(new mxRectangle(h,u,0,0)),d}var p=t.width,m=t.height,c=t.x-o.x*r,x=c+p,g=t.y-o.y*r,y=g+m,f=c+p/2,v=g+m/2;i>4?(y+=n,y=s?this.graph.snap(y/r)*r:Math.round(y/r)*r):i<3&&(g+=n,g=s?this.graph.snap(g/r)*r:Math.round(g/r)*r),0==i||3==i||5==i?(c+=e,c=s?this.graph.snap(c/r)*r:Math.round(c/r)*r):2!=i&&4!=i&&7!=i||(x+=e,x=s?this.graph.snap(x/r)*r:Math.round(x/r)*r);var C=x-c,E=y-g;if(l){var S=this.graph.getCellGeometry(this.state.cell);if(null!=S){var T=S.width/S.height;1==i||2==i||7==i||6==i?C=E*T:E=C/T,0==i&&(c=x-C,g=y-E)}}if(a){var b=f-(c+(C+=C-p)/2),w=v-(g+(E+=E-m)/2);c+=b,g+=w,x+=b,y+=w}C<0&&(c+=C,C=Math.abs(C)),E<0&&(g+=E,E=Math.abs(E));var L=new mxRectangle(c+o.x*r,g+o.y*r,C,E);return null!=this.minBounds&&(L.width=Math.max(L.width,this.minBounds.x*r+this.minBounds.width*r+Math.max(0,this.x0*r-L.x)),L.height=Math.max(L.height,this.minBounds.y*r+this.minBounds.height*r+Math.max(0,this.y0*r-L.y))),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(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]&&(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),t},mxVertexHandler.prototype.redrawHandles=function(){var t=this.tolerance;this.horizontalOffset=0,this.verticalOffset=0;var e=this.bounds;if(null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&this.sizers.length>=8){var n=this.getHandlePadding();this.horizontalOffset=n.x,this.verticalOffset=n.y,0==this.horizontalOffset&&0==this.verticalOffset||((e=new mxRectangle(e.x,e.y,e.width,e.height)).x-=this.horizontalOffset/2,e.width+=this.horizontalOffset,e.y-=this.verticalOffset/2,e.height+=this.verticalOffset),this.sizers.length>=8&&(e.width<2*this.sizers[0].bounds.width+2*t||e.height<2*this.sizers[0].bounds.height+2*t?(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"):(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 i=e.x+e.width,s=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],i,s);else{var r=e.x+e.width/2,o=e.y+e.height/2;if(this.sizers.length>=8){var l=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),d=Math.round(4*a/Math.PI),p=new mxPoint(e.getCenterX(),e.getCenterY()),m=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),h,u,p);this.moveSizerTo(this.sizers[0],m.x,m.y),this.sizers[0].setCursor(l[mxUtils.mod(0+d,l.length)]),m.x=r,m.y=e.y,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[1],m.x,m.y),this.sizers[1].setCursor(l[mxUtils.mod(1+d,l.length)]),m.x=i,m.y=e.y,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[2],m.x,m.y),this.sizers[2].setCursor(l[mxUtils.mod(2+d,l.length)]),m.x=e.x,m.y=o,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[3],m.x,m.y),this.sizers[3].setCursor(l[mxUtils.mod(7+d,l.length)]),m.x=i,m.y=o,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[4],m.x,m.y),this.sizers[4].setCursor(l[mxUtils.mod(3+d,l.length)]),m.x=e.x,m.y=s,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[5],m.x,m.y),this.sizers[5].setCursor(l[mxUtils.mod(6+d,l.length)]),m.x=r,m.y=s,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[6],m.x,m.y),this.sizers[6].setCursor(l[mxUtils.mod(5+d,l.length)]),m.x=i,m.y=s,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[7],m.x,m.y),this.sizers[7].setCursor(l[mxUtils.mod(4+d,l.length)]),m.x=r+this.state.absoluteOffset.x,m.y=o+this.state.absoluteOffset.y,m=mxUtils.getRotatedPoint(m,h,u,p),this.moveSizerTo(this.sizers[8],m.x,m.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],r+this.state.absoluteOffset.x,o+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(null!=this.rotationShape){a=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),p=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),h,u,p);null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,m.x,m.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()?"hidden":"")}if(null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.edgeHandlers)for(var c=0;c<this.edgeHandlers.length;c++)this.edgeHandlers[c].redraw();if(null!=this.customHandles)for(c=0;c<this.customHandles.length;c++){var x=this.customHandles[c].shape.node.style.display;this.customHandles[c].redraw(),this.customHandles[c].shape.node.style.display=x,this.customHandles[c].shape.node.style.visibility=this.graph.isEditing()?"hidden":""}this.updateParentHighlight()},mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)},mxVertexHandler.prototype.updateParentHighlight=function(){if(null!=this.selectionBorder)if(null!=this.parentHighlight){var t=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(t)){var e=this.graph.view.getState(t),n=this.parentHighlight.bounds;null==e||n.x==e.x&&n.y==e.y&&n.width==e.width&&n.height==e.height||(this.parentHighlight.bounds=e,this.parentHighlight.redraw())}else this.parentHighlight.destroy(),this.parentHighlight=null}else if(this.parentHighlightEnabled){t=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(t))null!=(e=this.graph.view.getState(t))&&(this.parentHighlight=this.createParentHighlightShape(e),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(e.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()))}},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,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.bounds,this.selectionBorder.redraw(),null!=this.parentHighlight&&this.parentHighlight.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.parentHighlight&&(this.parentHighlight.destroy(),this.parentHighlight=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.labelShape=null,this.removeHint(),null!=this.sizers){for(var t=0;t<this.sizers.length;t++)this.sizers[t].destroy();this.sizers=null}if(null!=this.customHandles){for(t=0;t<this.customHandles.length;t++)this.customHandles[t].destroy();this.customHandles=null}},__mxOutput.mxVertexHandler=void 0!==mxVertexHandler?mxVertexHandler:void 0,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=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.dblClickRemoveEnabled=!1,mxEdgeHandler.prototype.mergeRemoveEnabled=!1,mxEdgeHandler.prototype.straightRemoveEnabled=!1,mxEdgeHandler.prototype.virtualBendsEnabled=!1,mxEdgeHandler.prototype.virtualBendOpacity=20,mxEdgeHandler.prototype.parentHighlightEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.outlineConnect=!1,mxEdgeHandler.prototype.manageLabelHandle=!1,mxEdgeHandler.prototype.init=function(){if(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=!1,this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var t=this.state.getVisibleTerminalState(!0);if(null!=t&&(this.preferHtml=null!=t.text&&t.text.node.parentNode==this.graph.container),!this.preferHtml){var e=this.state.getVisibleTerminalState(!1);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}}if(this.parentHighlightEnabled){var n=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(n)){var i=this.graph.view.getState(n);null!=i&&(this.parentHighlight=this.createParentHighlightShape(i),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(i.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()))}}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends(),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.redraw()},mxEdgeHandler.prototype.createCustomHandles=function(){return null},mxEdgeHandler.prototype.isVirtualBendsEnabled=function(t){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)},mxEdgeHandler.prototype.isCellEnabled=function(t){return!0},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(t,null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.createSelectionShape=function(t){var e=new this.state.shape.constructor;return e.outline=!0,e.apply(this.state),e.isDashed=this.isSelectionDashed(),e.stroke=this.getSelectionColor(),e.isShadow=!1,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!0},mxEdgeHandler.prototype.getCellAt=function(t,e){return this.outlineConnect?null:this.graph.getCellAt(t,e)},mxEdgeHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph),e=this;return t.getCell=function(t){var n=mxCellMarker.prototype.getCell.apply(this,arguments);if(n!=e.state.cell&&null!=n||null==e.currentPoint||(n=e.graph.getCellAt(e.currentPoint.x,e.currentPoint.y)),null!=n&&!this.graph.isCellConnectable(n)){var i=this.graph.getModel().getParent(n);this.graph.getModel().isVertex(i)&&this.graph.isCellConnectable(i)&&(n=i)}var s=e.graph.getModel();return(this.graph.isSwimlane(n)&&null!=e.currentPoint&&this.graph.hitsSwimlaneContent(n,e.currentPoint.x,e.currentPoint.y)||!e.isConnectableCell(n)||n==e.state.cell||null!=n&&!e.graph.connectableEdges&&s.isEdge(n)||s.isAncestor(e.state.cell,n))&&(n=null),this.graph.isCellConnectable(n)||(n=null),n},t.isValidState=function(t){var n=e.graph.getModel(),i=e.graph.view.getTerminalPort(t,e.graph.view.getState(n.getTerminal(e.state.cell,!e.isSource)),!e.isSource),s=null!=i?i.cell:null,r=e.isSource?t.cell:s,o=e.isSource?s:t.cell;return e.error=e.validateConnection(r,o),null==e.error},t},mxEdgeHandler.prototype.validateConnection=function(t,e){return this.graph.getEdgeValidationError(this.state.cell,t,e)},mxEdgeHandler.prototype.createBends=function(){for(var t=this.state.cell,e=[],n=0;n<this.abspoints.length;n++)if(this.isHandleVisible(n)){var i=0==n,s=n==this.abspoints.length-1,r=i||s;(r||this.graph.isCellBendable(t))&&mxUtils.bind(this,(function(t){var i=this.createHandleShape(t);this.initBend(i,mxUtils.bind(this,mxUtils.bind(this,(function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,t)})))),this.isHandleEnabled(n)&&i.setCursor(r?mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE),e.push(i),r||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}))(n)}return e},mxEdgeHandler.prototype.createVirtualBends=function(){var t=this.state.cell;this.abspoints[0];var e=[];if(this.graph.isCellBendable(t))for(var n=1;n<this.abspoints.length;n++)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!0},mxEdgeHandler.prototype.isHandleVisible=function(t){var e=this.state.getVisibleTerminalState(!0),n=this.state.getVisibleTerminalState(!1),i=this.graph.getCellGeometry(this.state.cell);return(null!=i?this.graph.view.getEdgeStyle(this.state,i.points,e,n):null)!=mxEdgeStyle.EntityRelation||0==t||t==this.abspoints.length-1},mxEdgeHandler.prototype.createHandleShape=function(t){if(null!=this.handleImage){var e=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src);return e.preserveImageAspect=!1,e}var n=mxConstants.HANDLE_SIZE;return this.preferHtml&&(n-=1),new mxRectangleShape(new mxRectangle(0,0,n,n),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var t=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);return t.preserveImageAspect=!1,t}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){this.preferHtml?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(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),(mxClient.IS_QUIRKS||8==document.documentMode)&&mxEvent.addListener(t.node,"dragstart",(function(t){return mxEvent.consume(t),!1})),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")},mxEdgeHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,i=null,s=null;function r(e){if(null!=e&&null!=e.node&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility&&(t.isSource(e)||null!=n&&mxUtils.intersects(e.bounds,n))){var s=t.getGraphX()-e.bounds.getCenterX(),r=t.getGraphY()-e.bounds.getCenterY(),o=s*s+r*r;if(null==i||o<=i)return i=o,!0}return!1}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var o=this.customHandles.length-1;o>=0;o--)if(r(this.customHandles[o].shape))return mxEvent.CUSTOM_HANDLE-o;if((t.isSource(this.state.text)||r(this.labelShape))&&(s=mxEvent.LABEL_HANDLE),null!=this.bends)for(o=0;o<this.bends.length;o++)r(this.bends[o])&&(s=o);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(t))for(o=0;o<this.virtualBends.length;o++)r(this.virtualBends[o])&&(s=mxEvent.VIRTUAL_HANDLE-o);return s},mxEdgeHandler.prototype.isAddVirtualBendEvent=function(t){return!0},mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return!0},mxEdgeHandler.prototype.mouseDown=function(t,e){var n=this.getHandleForEvent(e);if(null!=this.bends&&null!=this.bends[n]){var i=this.bends[n].bounds;this.snapPoint=new mxPoint(i.getCenterX(),i.getCenterY())}this.addEnabled&&null==n&&this.isAddPointEvent(e.getEvent())?(this.addPoint(this.state,e.getEvent()),e.consume()):null!=n&&!e.isConsumed()&&this.graph.isEnabled()&&(this.removeEnabled&&this.isRemovePointEvent(e.getEvent())?this.removePoint(this.state,n):(n!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(e.getCell()))&&(n<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-n].node,100),this.start(e.getX(),e.getY(),n)),e.consume())},mxEdgeHandler.prototype.start=function(t,e,n){if(this.startX=t,this.startY=e,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget){var i=this.state.cell,s=this.graph.model.getTerminal(i,this.isSource);(null==s&&this.graph.isTerminalPointMovable(i,this.isSource)||null!=s&&this.graph.isCellDisconnectable(i,s,this.isSource))&&(this.index=n)}else this.index=n;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(var r=0;r<this.customHandles.length;r++)r!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[r].setVisible(!1)},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(),n=e.scale,i=new mxPoint(this.roundLength(t.getGraphX()/n)*n,this.roundLength(t.getGraphY()/n)*n),s=this.getSnapToTerminalTolerance(),r=!1,o=!1;if(s>0&&this.isSnapToTerminalsEvent(t)){function t(t){if(null!=t){var e=t.x;Math.abs(i.x-e)<s&&(i.x=e,r=!0);var n=t.y;Math.abs(i.y-n)<s&&(i.y=n,o=!0)}}function n(n){null!=n&&t.call(this,new mxPoint(e.getRoutingCenterX(n),e.getRoutingCenterY(n)))}if(n.call(this,this.state.getVisibleTerminalState(!0)),n.call(this,this.state.getVisibleTerminalState(!1)),null!=this.state.absolutePoints)for(var l=0;l<this.state.absolutePoints.length;l++)t.call(this,this.state.absolutePoints[l])}if(this.graph.isGridEnabledEvent(t.getEvent())){var a=e.translate;r||(i.x=(this.graph.snap(i.x/n-a.x)+a.x)*n),o||(i.y=(this.graph.snap(i.y/n-a.y)+a.y)*n)}return i},mxEdgeHandler.prototype.getPreviewTerminalState=function(t){if(this.constraintHandler.update(t,this.isSource,!0,t.isSource(this.marker.highlight.shape)?null:this.currentPoint),null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint){null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent");var e=this.graph.getModel(),n=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(e.getTerminal(this.state.cell,!this.isSource)),!this.isSource),i=null!=n?n.cell:null,s=this.isSource?this.constraintHandler.currentFocus.cell:i,r=this.isSource?i:this.constraintHandler.currentFocus.cell;this.error=this.validateConnection(s,r);var o=null;return null==this.error&&(o=this.constraintHandler.currentFocus),(null!=this.error||null!=o&&!this.isCellEnabled(o.cell))&&this.constraintHandler.reset(),o}if(this.graph.isIgnoreTerminalEvent(t.getEvent()))return this.marker.reset(),null;this.marker.process(t);var l=this.marker.getValidState();return null==l||this.isCellEnabled(l.cell)||(this.constraintHandler.reset(),this.marker.reset()),this.marker.getValidState()},mxEdgeHandler.prototype.getPreviewPoints=function(t,e){var n,i,s=this.graph.getCellGeometry(this.state.cell),r=null!=s.points?s.points.slice():null,o=new mxPoint(t.x,t.y),l=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(r=null);else if(this.convertPoint(o,!1),null==r)r=[o];else{if(this.index<=mxEvent.VIRTUAL_HANDLE&&r.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,o),!this.isSource&&!this.isTarget){for(var a=0;a<this.bends.length;a++)if(a!=this.index){var h=this.bends[a];null!=h&&mxUtils.contains(h.bounds,t.x,t.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?r.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):r.splice(this.index-1,1),l=r)}if(null==l&&this.straightRemoveEnabled&&(null==e||!mxEvent.isAltDown(e.getEvent()))){var u=this.graph.tolerance*this.graph.tolerance,d=this.state.absolutePoints.slice();d[this.index]=t;var p=this.state.getVisibleTerminalState(!0);if(null!=p)null!=(m=this.graph.getConnectionConstraint(this.state,p,!0))&&null!=this.graph.getConnectionPoint(p,m)||(d[0]=new mxPoint(p.view.getRoutingCenterX(p),p.view.getRoutingCenterY(p)));var m,c=this.state.getVisibleTerminalState(!1);if(null!=c)null!=(m=this.graph.getConnectionConstraint(this.state,c,!1))&&null!=this.graph.getConnectionPoint(c,m)||(d[d.length-1]=new mxPoint(c.view.getRoutingCenterX(c),c.view.getRoutingCenterY(c)));n=this.index,i=t,n>0&&n<d.length-1&&mxUtils.ptSegDistSq(d[n-1].x,d[n-1].y,d[n+1].x,d[n+1].y,i.x,i.y)<u&&(r.splice(n-1,1),l=r)}}null==l&&this.index>mxEvent.VIRTUAL_HANDLE&&(r[this.index-1]=o)}return null!=l?l:r},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=t.getEvent(),i=mxEvent.getClientX(n),s=mxEvent.getClientY(n),r=document.documentElement,o=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),l=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-o,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-l;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,s)||(a!=i||h!=s)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,n,i,s){var r=this.isSource?n:this.state.getVisibleTerminalState(!0),o=this.isTarget?n:this.state.getVisibleTerminalState(!1),l=this.graph.getConnectionConstraint(t,r,!0),a=this.graph.getConnectionConstraint(t,o,!1),h=this.constraintHandler.currentConstraint;if(null==h&&s&&(null!=n?(i.isSource(this.marker.highlight.shape)&&(e=new mxPoint(i.getGraphX(),i.getGraphY())),h=this.graph.getOutlineConstraint(e,n,i),this.constraintHandler.setFocus(i,n,this.isSource),this.constraintHandler.currentConstraint=h,this.constraintHandler.currentPoint=e):h=new mxConnectionConstraint),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var u=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=s?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.marker.getValidState()==i.getState()?mxConstants.DEFAULT_VALID_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint())}this.isSource?l=h:this.isTarget&&(a=h),(this.isSource||this.isTarget)&&(null!=h&&null!=h.point?(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):(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(r,!0),t.setVisibleTerminalState(o,!1),this.isSource&&null==r||t.view.updateFixedTerminalPoint(t,r,!0,l),this.isTarget&&null==o||t.view.updateFixedTerminalPoint(t,o,!1,a),(this.isSource||this.isTarget)&&null==n&&(t.setAbsoluteTerminalPoint(e,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,r,o),t.view.updateFloatingTerminalPoints(t,r,o)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(null!=this.index&&null!=this.marker){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y),this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);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 n=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var i=!(!this.isSource&&!this.isTarget)&&this.isOutlineConnectEvent(e);i?n=this.marker.highlight.state:null!=n&&n!=e.getState()&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),n=null)}null==n||this.isCellEnabled(n.cell)||(n=null,this.marker.reset());var s=this.clonePreviewState(this.currentPoint,null!=n?n.cell:null);this.updatePreviewState(s,this.currentPoint,n,e,i);var r=null==this.error?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(r),this.abspoints=s.absolutePoints,this.active=!0}this.updateHint(e,this.currentPoint),this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(e)&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.marker){var n=this.state.cell,i=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var s=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)this.error.length>0&&this.graph.validationAlert(this.error);else if(i<=mxEvent.CUSTOM_HANDLE&&i>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){(o=this.graph.getModel()).beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-i].execute()}finally{o.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var r=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(r=this.constraintHandler.currentFocus.cell),null==r&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(r=this.marker.validState.cell),null!=r){var o,l=(o=this.graph.getModel()).getParent(n);o.beginUpdate();try{if(s){var a=o.getGeometry(n);s=this.graph.cloneCell(n);o.add(l,s,o.getChildCount(l)),null!=a&&(a=a.clone(),o.setGeometry(s,a));var h=o.getTerminal(n,!this.isSource);this.graph.connectCell(s,h,!this.isSource),n=s}n=this.connect(n,r,this.isSource,s,e)}finally{o.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(n));null!=d&&(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,n=this.changeTerminalPoint(n,u,this.isSource,s)}}else this.active?n=this.changePoints(n,this.points,s):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),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=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&null!=this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");if(null!=this.marker&&this.marker.reset(),null!=this.constraintHandler&&this.constraintHandler.reset(),null!=this.customHandles)for(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){null!=this.shape&&(this.shape.stroke=t)},mxEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate();e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x),t.y=Math.round(t.y/n-i.y);var s=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));return null!=s&&(t.x-=s.origin.x,t.y-=s.origin.y),t},mxEdgeHandler.prototype.moveLabel=function(t,e,n){var i=this.graph.getModel(),s=i.getGeometry(t.cell);if(null!=s){var r=this.graph.getView().scale;if((s=s.clone()).relative){var o=this.graph.getView().getRelativePoint(t,e,n);s.x=Math.round(1e4*o.x)/1e4,s.y=Math.round(o.y),s.offset=new mxPoint(0,0);o=this.graph.view.getPoint(t,s);s.offset=new mxPoint(Math.round((e-o.x)/r),Math.round((n-o.y)/r))}else{var l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=a&&null!=h){var u=a.x+(h.x-a.x)/2,d=a.y+(h.y-a.y)/2;s.offset=new mxPoint(Math.round((e-u)/r),Math.round((n-d)/r)),s.x=0,s.y=0}}i.setGeometry(t.cell,s)}},mxEdgeHandler.prototype.connect=function(t,e,n,i,s){var r=this.graph.getModel();r.getParent(t),r.beginUpdate();try{var o=this.constraintHandler.currentConstraint;null==o&&(o=new mxConnectionConstraint),this.graph.connectCell(t,e,n,o)}finally{r.endUpdate()}return t},mxEdgeHandler.prototype.changeTerminalPoint=function(t,e,n,i){var s=this.graph.getModel();s.beginUpdate();try{if(i){var r=s.getParent(t),o=s.getTerminal(t,!n);t=this.graph.cloneCell(t),s.add(r,t,s.getChildCount(r)),s.setTerminal(t,o,!n)}var l=s.getGeometry(t);null!=l&&((l=l.clone()).setTerminalPoint(e,n),s.setGeometry(t,l),this.graph.connectCell(t,null,n,new mxConnectionConstraint))}finally{s.endUpdate()}return t},mxEdgeHandler.prototype.changePoints=function(t,e,n){var i=this.graph.getModel();i.beginUpdate();try{if(n){var s=i.getParent(t),r=i.getTerminal(t,!0),o=i.getTerminal(t,!1);t=this.graph.cloneCell(t),i.add(s,t,i.getChildCount(s)),i.setTerminal(t,r,!0),i.setTerminal(t,o,!1)}var l=i.getGeometry(t);null!=l&&((l=l.clone()).points=e,i.setGeometry(t,l))}finally{i.endUpdate()}return t},mxEdgeHandler.prototype.addPoint=function(t,e){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.graph.isGridEnabledEvent(e);this.convertPoint(n,i),this.addPointAt(t,n.x,n.y),mxEvent.consume(e)},mxEdgeHandler.prototype.addPointAt=function(t,e,n){var i=this.graph.getCellGeometry(t.cell),s=new mxPoint(e,n);if(null!=i){i=i.clone();var r=this.graph.view.translate,o=this.graph.view.scale,l=new mxPoint(r.x*o,r.y*o),a=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(a)){var h=this.graph.view.getState(a);l=new mxPoint(h.x,h.y)}var u=mxUtils.findNearestSegment(t,s.x*o+l.x,s.y*o+l.y);null==i.points?i.points=[s]:i.points.splice(u,0,s),this.graph.getModel().setGeometry(t.cell,i),this.refresh(),this.redraw()}},mxEdgeHandler.prototype.removePoint=function(t,e){if(e>0&&e<this.abspoints.length-1){var n=this.graph.getCellGeometry(this.state.cell);null!=n&&null!=n.points&&((n=n.clone()).points.splice(e-1,1),this.graph.getModel().setGeometry(t.cell,n),this.refresh(),this.redraw())}},mxEdgeHandler.prototype.getHandleFillColor=function(t){var e=0==t,n=this.state.cell,i=this.graph.getModel().getTerminal(n,e),s=mxConstants.HANDLE_FILLCOLOR;return null!=i&&!this.graph.isCellDisconnectable(n,i,e)||null==i&&!this.graph.isTerminalPointMovable(n,e)?s=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=i&&this.graph.isCellDisconnectable(n,i,e)&&(s=mxConstants.CONNECT_HANDLE_FILLCOLOR),s},mxEdgeHandler.prototype.redraw=function(t){this.abspoints=this.state.absolutePoints.slice();var e=this.graph.getModel().getGeometry(this.state.cell);if(null!=e){var n=e.points;if(null!=this.bends&&this.bends.length>0&&null!=n){null==this.points&&(this.points=[]);for(var i=1;i<this.bends.length-1;i++)null!=this.bends[i]&&null!=this.abspoints[i]&&(this.points[i-1]=n[i-1])}}this.drawPreview(),t||this.redrawHandles()},mxEdgeHandler.prototype.redrawHandles=function(){var t=this.state.cell,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 n=this.graph.getLabel(t);if(this.labelShape.visible=null!=n&&n.length>0&&this.graph.isLabelMovable(t),null!=this.bends&&this.bends.length>0){var i=this.abspoints.length-1,s=this.abspoints[0],r=s.x,o=s.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(r-e.width/2),Math.floor(o-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var l=this.abspoints[i],a=l.x,h=l.y,u=this.bends.length-1;e=this.bends[u].bounds,this.bends[u].bounds=new mxRectangle(Math.floor(a-e.width/2),Math.floor(h-e.height/2),e.width,e.height),this.bends[u].fill=this.getHandleFillColor(u),this.bends[u].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[u].bounds),this.redrawInnerBends(s,l)}if(null!=this.abspoints&&null!=this.virtualBends&&this.virtualBends.length>0)for(var d=this.abspoints[0],p=0;p<this.virtualBends.length;p++)if(null!=this.virtualBends[p]&&null!=this.abspoints[p+1]){var m=this.abspoints[p+1],c=(e=this.virtualBends[p],d.x+(m.x-d.x)/2),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,this.manageLabelHandle&&this.checkLabelHandle(e.bounds)}if(null!=this.labelShape&&this.labelShape.redraw(),null!=this.customHandles)for(p=0;p<this.customHandles.length;p++)this.customHandles[p].redraw()},mxEdgeHandler.prototype.setHandlesVisible=function(t){if(null!=this.bends)for(var e=0;e<this.bends.length;e++)this.bends[e].node.style.display=t?"":"none";if(null!=this.virtualBends)for(e=0;e<this.virtualBends.length;e++)this.virtualBends[e].node.style.display=t?"":"none";if(null!=this.labelShape&&(this.labelShape.node.style.display=t?"":"none"),null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxEdgeHandler.prototype.redrawInnerBends=function(t,e){for(var n=1;n<this.bends.length-1;n++)if(null!=this.bends[n])if(null!=this.abspoints[n]){var i=this.abspoints[n].x,s=this.abspoints[n].y,r=this.bends[n].bounds;this.bends[n].node.style.visibility="visible",this.bends[n].bounds=new mxRectangle(Math.round(i-r.width/2),Math.round(s-r.height/2),r.width,r.height),this.manageLabelHandle?this.checkLabelHandle(this.bends[n].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[n].bounds,this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+3,h=mxConstants.HANDLE_SIZE+3,this.bends[n].bounds=new mxRectangle(Math.round(i-w/2),Math.round(s-h/2),w,h)),this.bends[n].redraw()}else this.bends[n].destroy(),this.bends[n]=null},mxEdgeHandler.prototype.checkLabelHandle=function(t){if(null!=this.labelShape){var e=this.labelShape.bounds;mxUtils.intersects(t,e)&&(t.getCenterY()<e.getCenterY()?e.y=t.y+t.height:e.y=t.y-e.height)}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var t=this.labelShape.bounds,e=new mxRectangle(Math.round(this.label.x-t.width/2),Math.round(this.label.y-t.height/2),t.width,t.height);this.labelShape.bounds.equals(e)||(this.labelShape.bounds=e,this.labelShape.redraw())}null==this.shape||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=!1,this.shape.redraw()),null!=this.parentHighlight&&this.parentHighlight.redraw()},mxEdgeHandler.prototype.refresh=function(){this.abspoints=this.getSelectionPoints(this.state),this.points=[],null!=this.bends&&(this.destroyBends(this.bends),this.bends=this.createBends()),null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=this.createVirtualBends()),null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=this.createCustomHandles()),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node)},mxEdgeHandler.prototype.destroyBends=function(t){if(null!=t)for(var e=0;e<t.length;e++)null!=t[e]&&t[e].destroy()},mxEdgeHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.parentHighlight&&(this.parentHighlight.destroy(),this.parentHighlight=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(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=void 0!==mxEdgeHandler?mxEdgeHandler:void 0,mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t.push(this.createVirtualBend(mxUtils.bind(this,(function(t){!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),t},mxElbowEdgeHandler.prototype.createVirtualBend=function(t){var e=this.createHandleShape();return this.initBend(e,t),e.setCursor(this.getCursorForBend()),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),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;return null==this.bends||null==this.bends[1]||t!=this.bends[1].node&&t.parentNode!=this.bends[1].node||(e=this.doubleClickOrientationResource,e=mxResources.get(e)||e),e},mxElbowEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate(),s=this.state.origin;return e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x-s.x),t.y=Math.round(t.y/n-i.y-s.y),t},mxElbowEdgeHandler.prototype.redrawInnerBends=function(t,e){var n=this.graph.getModel().getGeometry(this.state.cell),i=this.state.absolutePoints,s=null;i.length>1?(t=i[1],e=i[i.length-2]):null!=n.points&&n.points.length>0&&(s=i[0]),s=null==s?new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):new mxPoint(this.graph.getView().scale*(s.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(s.y+this.graph.getView().translate.y+this.state.origin.y));var r=this.bends[1].bounds,o=r.width,l=r.height,a=new mxRectangle(Math.round(s.x-o/2),Math.round(s.y-l/2),o,l);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(o=mxConstants.HANDLE_SIZE+3,l=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(s.x-o/2),Math.floor(s.y-l/2),o,l)),this.bends[1].bounds=a,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=void 0!==mxElbowEdgeHandler?mxElbowEdgeHandler:void 0,mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(null!=t){var e=Math.max(1,this.graph.view.scale);if(2==t.length||3==t.length&&(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 n=t[0].x+(t[t.length-1].x-t[0].x)/2,i=t[0].y+(t[t.length-1].y-t[0].y)/2;t=[t[0],new mxPoint(n,i),new mxPoint(n,i),t[t.length-1]]}}return t},mxEdgeSegmentHandler.prototype.getPreviewPoints=function(t){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var e=this.getCurrentPoints(),n=this.convertPoint(e[0].clone(),!1);t=this.convertPoint(t.clone(),!1);for(var i=[],s=1;s<e.length;s++){var r=this.convertPoint(e[s].clone(),!1);s==this.index&&(0==Math.round(n.x-r.x)&&(n.x=t.x,r.x=t.x),0==Math.round(n.y-r.y)&&(n.y=t.y,r.y=t.y)),s<e.length-1&&i.push(r),n=r}if(1==i.length){var o=this.state.getVisibleTerminalState(!0),l=this.state.getVisibleTerminalState(!1),a=this.state.view.getScale(),h=this.state.view.getTranslate(),u=i[0].x*a+h.x,d=i[0].y*a+h.y;(null!=o&&mxUtils.contains(o,u,d)||null!=l&&mxUtils.contains(l,u,d))&&(i=[t,t])}return i},mxEdgeSegmentHandler.prototype.updatePreviewState=function(t,e,n,i){if(mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments),!this.isSource&&!this.isTarget){e=this.convertPoint(e.clone(),!1);for(var s=t.absolutePoints,r=s[0],o=s[1],l=[],a=2;a<s.length;a++){var h=s[a];0==Math.round(r.x-o.x)&&0==Math.round(o.x-h.x)||0==Math.round(r.y-o.y)&&0==Math.round(o.y-h.y)||l.push(this.convertPoint(o.clone(),!1)),r=o,o=h}var u=this.state.getVisibleTerminalState(!0),d=this.state.getVisibleTerminalState(!1),p=this.state.absolutePoints;if(0!=l.length||0!=Math.round(s[0].x-s[s.length-1].x)&&0!=Math.round(s[0].y-s[s.length-1].y)){if(5==s.length&&2==l.length&&null!=u&&null!=d&&null!=p&&0==Math.round(p[0].x-p[p.length-1].x)){var m=this.graph.getView(),c=m.getScale(),x=m.getTranslate(),g=m.getRoutingCenterY(u)/c-x.y,y=this.graph.getConnectionConstraint(t,u,!0);if(null!=y)null!=(f=this.graph.getConnectionPoint(u,y))&&(this.convertPoint(f,!1),g=f.y);var f,v=m.getRoutingCenterY(d)/c-x.y,C=this.graph.getConnectionConstraint(t,d,!1);if(C)null!=(f=this.graph.getConnectionPoint(d,C))&&(this.convertPoint(f,!1),v=f.y);l=[new mxPoint(e.x,g),new mxPoint(e.x,v)]}}else l=[e,e];this.points=l,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,n,i,s){var r=this.graph.getModel(),o=null;if(null!=(p=r.getGeometry(t))&&null!=p.points&&p.points.length>0){var l=this.abspoints,a=l[0],h=l[1];o=[];for(var u=2;u<l.length;u++){var d=l[u];0==Math.round(a.x-h.x)&&0==Math.round(h.x-d.x)||0==Math.round(a.y-h.y)&&0==Math.round(h.y-d.y)||o.push(this.convertPoint(h.clone(),!1)),a=h,h=d}}r.beginUpdate();try{var p;if(null!=o)null!=(p=r.getGeometry(t))&&((p=p.clone()).points=o,r.setGeometry(t,p));t=mxEdgeHandler.prototype.connect.apply(this,arguments)}finally{r.endUpdate()}return t},mxEdgeSegmentHandler.prototype.getTooltipForNode=function(t){return null},mxEdgeSegmentHandler.prototype.start=function(t,e,n){mxEdgeHandler.prototype.start.apply(this,arguments),null==this.bends||null==this.bends[n]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[n].node,100)},mxEdgeSegmentHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e);var n=this.getCurrentPoints();if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var i=0;i<n.length-1;i++){e=this.createVirtualBend(),t.push(e);var s=0==Math.round(n[i].x-n[i+1].x);0==Math.round(n[i].y-n[i+1].y)&&i<n.length-2&&(s=0==Math.round(n[i].x-n[i+2].x)),e.setCursor(s?"col-resize":"row-resize"),this.points.push(new mxPoint(0,0))}}e=this.createHandleShape(n.length);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),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 n=this.getCurrentPoints();if(null!=n&&n.length>1){var i=!1;if(4==n.length&&0==Math.round(n[1].x-n[2].x)&&0==Math.round(n[1].y-n[2].y))if(i=!0,0==Math.round(n[0].y-n[n.length-1].y)){var s=n[0].x+(n[n.length-1].x-n[0].x)/2;n[1]=new mxPoint(s,n[1].y),n[2]=new mxPoint(s,n[2].y)}else{var r=n[0].y+(n[n.length-1].y-n[0].y)/2;n[1]=new mxPoint(n[1].x,r),n[2]=new mxPoint(n[2].x,r)}for(var o=0;o<n.length-1;o++)if(null!=this.bends[o+1]){t=n[o],e=n[o+1];var l=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2),a=this.bends[o+1].bounds;this.bends[o+1].bounds=new mxRectangle(Math.floor(l.x-a.width/2),Math.floor(l.y-a.height/2),a.width,a.height),this.bends[o+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[o+1].bounds)}i&&(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity))}}},__mxOutput.mxEdgeSegmentHandler=void 0!==mxEdgeSegmentHandler?mxEdgeSegmentHandler:void 0,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=!0,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){return null==t||mxEvent.isAltDown(t)?null:this.isControlDown(t)?mxEvent.isShiftDown(t)?this.controlShiftKeys[t.keyCode]:this.controlKeys[t.keyCode]:mxEvent.isShiftDown(t)?this.shiftKeys[t.keyCode]:this.normalKeys[t.keyCode]},mxKeyHandler.prototype.isGraphEvent=function(t){var e=mxEvent.getSource(t);return!!(e==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(t))||mxUtils.isAncestorNode(this.graph.container,e)},mxKeyHandler.prototype.keyDown=function(t){if(this.isEnabledForEvent(t))if(27==t.keyCode)this.escape(t);else if(!this.isEventIgnored(t)){var e=this.getFunction(t);null!=e&&(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){this.graph.isEscapeEnabled()&&this.graph.escape(t)},mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null),this.target=null},__mxOutput.mxKeyHandler=void 0!==mxKeyHandler?mxKeyHandler:void 0,mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.ignoreTouchEvents=!0,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.destroyed=!1,mxTooltipHandler.prototype.enabled=!0,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(){null!=document.body&&(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){this.hideTooltip()}))))},mxTooltipHandler.prototype.getStateForEvent=function(t){return t.getState()},mxTooltipHandler.prototype.mouseDown=function(t,e){this.reset(e,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(t,e){if(e.getX()!=this.lastX||e.getY()!=this.lastY){this.reset(e,!0);var n=this.getStateForEvent(e);(this.isHideOnHover()||n!=this.state||e.getSource()!=this.node&&(!this.stateSource||null!=n&&this.stateSource==(e.isSource(n.shape)||!e.isSource(n.text))))&&this.hideTooltip()}this.lastX=e.getX(),this.lastY=e.getY()},mxTooltipHandler.prototype.mouseUp=function(t,e){this.reset(e,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(t,e,n){if((!this.ignoreTouchEvents||mxEvent.isMouseEvent(t.getEvent()))&&(this.resetTimer(),n=null!=n?n:this.getStateForEvent(t),e&&this.isEnabled()&&null!=n&&(null==this.div||"hidden"==this.div.style.visibility))){var i=t.getSource(),s=t.getX(),r=t.getY(),o=t.isSource(n.shape)||t.isSource(n.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(n,i,s,r);this.show(t,s,r),this.state=n,this.node=i,this.stateSource=o}})),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerHTML="")},mxTooltipHandler.prototype.show=function(t,e,n){if(!this.destroyed&&null!=t&&t.length>0){null==this.div&&this.init();var i=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+i.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+i.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=void 0!==mxTooltipHandler?mxTooltipHandler:void 0,mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=void 0!==mxCellTracker?mxCellTracker:void 0,mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,null!=this.shape&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),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);return 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=!1,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),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(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=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||8==document.documentMode)&&("transparent"==this.shape.stroke?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=t,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var n=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var i=document.elementFromPoint(t,e);null!=i;){if(i==this.shape.node){n=!0;break}i=i.parentNode}return n},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=void 0!==mxCellHighlight?mxCellHighlight:void 0,mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,n){var i=mxUtils.bind(this,(function(){this.editor.execute(e)}));n?this.handler.bindControlKey(t,i):this.handler.bindKey(t,i)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=void 0!==mxDefaultKeyHandler?mxDefaultKeyHandler:void 0,mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,n,i){if(null!=this.config){var s=this.createConditions(t,n,i),r=this.config.firstChild;this.addItems(t,e,n,i,s,r,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,n,i,s,r,o){for(var l=!1;null!=r;){if("add"==r.nodeName){var a=r.getAttribute("if");if(null==a||s[a]){var h=r.getAttribute("as");h=mxResources.get(h)||h;var u=mxUtils.eval(mxUtils.getTextContent(r)),d=r.getAttribute("action"),p=r.getAttribute("icon"),m=r.getAttribute("iconCls"),c=r.getAttribute("enabled-if"),x=null==c||s[c];l&&(e.addSeparator(o),l=!1),null!=p&&this.imageBasePath&&(p=this.imageBasePath+p);var g=this.addAction(e,t,h,p,u,d,n,o,m,x);this.addItems(t,e,n,i,s,r.firstChild,g)}}else"separator"==r.nodeName&&(l=!0);r=r.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,n,i,s,r,o,l,a,h){return t.addItem(n,i,(function(t){"function"==typeof s&&s.call(e,e,o,t),null!=r&&e.execute(r,o,t)}),l,a,h)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,n){var i=t.graph.getModel(),s=i.getChildCount(e),r=[];r.nocell=null==e,r.ncells=t.graph.getSelectionCount()>1,r.notRoot=i.getRoot()!=i.getParent(t.graph.getDefaultParent()),r.cell=null!=e;var o=null!=e&&1==t.graph.getSelectionCount();r.nonEmpty=o&&s>0,r.expandable=o&&t.graph.isCellFoldable(e,!1),r.collapsable=o&&t.graph.isCellFoldable(e,!0),r.validRoot=o&&t.graph.isValidRoot(e),r.emptyValidRoot=r.validRoot&&0==s,r.swimlane=o&&t.graph.isSwimlane(e);for(var l=this.config.getElementsByTagName("condition"),a=0;a<l.length;a++){var h=mxUtils.eval(mxUtils.getTextContent(l[a])),u=l[a].getAttribute("name");null!=u&&"function"==typeof h&&(r[u]=h(t,e,n))}return r},__mxOutput.mxDefaultPopupMenu=void 0!==mxDefaultPopupMenu?mxDefaultPopupMenu:void 0,mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(t){null!=t&&(this.toolbar=new mxToolbar(t),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,(function(t,e){var n=e.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,(function(){n.apply(this,arguments),this.toolbar.resetMode()})):null}))),this.resetHandler=mxUtils.bind(this,(function(){null!=this.toolbar&&this.toolbar.resetMode(!0)})),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(t,e,n,i){var s=mxUtils.bind(this,(function(){null!=n&&n.length>0&&this.editor.execute(n)}));return this.toolbar.addItem(t,e,s,i)},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,n){var i=mxUtils.bind(this,(function(){this.editor.execute(n)}));this.addOption(t,e,i)},mxDefaultToolbar.prototype.addOption=function(t,e,n){return this.toolbar.addOption(t,e,n)},mxDefaultToolbar.prototype.addMode=function(t,e,n,i,s){var r=mxUtils.bind(this,(function(){this.editor.setMode(n),null!=s&&s(this.editor)}));return this.toolbar.addSwitchMode(t,e,r,i)},mxDefaultToolbar.prototype.addPrototype=function(t,e,n,i,s,r){var o=mxUtils.bind(this,(function(){return"function"==typeof n?n():null!=n?this.editor.graph.cloneCell(n):null})),l=mxUtils.bind(this,(function(t,e){"function"==typeof s?s(this.editor,o(),t,e):this.drop(o(),t,e),this.toolbar.resetMode(),mxEvent.consume(t)})),a=this.toolbar.addMode(t,e,l,i,null,r);return this.installDropHandler(a,(function(t,e,n){l(e,n)})),a},mxDefaultToolbar.prototype.drop=function(t,e,n){var i=this.editor.graph,s=i.getModel();if(null!=n&&!s.isEdge(n)&&this.connectOnDrop&&i.isCellConnectable(n))this.connect(t,e,n);else{for(;null!=n&&!i.isValidDropTarget(n,[t],e);)n=s.getParent(n);this.insert(t,e,n)}},mxDefaultToolbar.prototype.insert=function(t,e,n){var i=this.editor.graph;if(i.canImportCell(t)){var s=mxEvent.getClientX(e),r=mxEvent.getClientY(e),o=mxUtils.convertPoint(i.container,s,r);return i.isSplitEnabled()&&i.isSplitTarget(n,[t],e)?i.splitEdge(n,[t],null,o.x,o.y):this.editor.addVertex(n,t,o.x,o.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,n){var i=this.editor.graph,s=i.getModel();if(null!=n&&i.isCellConnectable(t)&&i.isEdgeValid(null,n,t)){var r=null;s.beginUpdate();try{var o=s.getGeometry(n),l=s.getGeometry(t).clone();l.x=o.x+(o.width-l.width)/2,l.y=o.y+(o.height-l.height)/2;var a=this.spacing*i.gridSize,h=20*s.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?l.x+=(l.width+o.width)/2+a+h:l.y+=(l.height+o.height)/2+a+h,t.setGeometry(l);var u=s.getParent(n);if(i.addCell(t,u),i.constrainChild(t),r=this.editor.createEdge(n,t),null==s.getGeometry(r)){var d=new mxGeometry;d.relative=!0,s.setGeometry(r,d)}i.addEdge(r,u,n,t)}finally{s.endUpdate()}i.setSelectionCells([t,r]),i.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var n=document.createElement("img");n.setAttribute("src",t.getAttribute("src"));var i=mxUtils.bind(this,(function(s){n.style.width=2*t.offsetWidth+"px",n.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,n),mxEvent.removeListener(n,"load",i)}));mxClient.IS_IE?i():mxEvent.addListener(n,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=void 0!==mxDefaultToolbar?mxDefaultToolbar:void 0,mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"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=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,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=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,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=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,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){new mxPrintPreview(t.graph,1).open()})),this.addAction("show",(function(t){mxUtils.show(t.graph,null,10,10)})),this.addAction("exportImage",(function(t){var e=t.getUrlImage();if(null==e||mxClient.IS_LOCAL)t.execute("show");else{var n=mxUtils.getViewXml(t.graph,1),i=mxUtils.getXml(n,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(i),document,"_blank")}})),this.addAction("refresh",(function(t){t.graph.refresh()})),this.addAction("cut",(function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)})),this.addAction("copy",(function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)})),this.addAction("paste",(function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)})),this.addAction("delete",(function(t){t.graph.isEnabled()&&t.graph.removeCells()})),this.addAction("group",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())})),this.addAction("ungroup",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())})),this.addAction("removeFromParent",(function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()})),this.addAction("undo",(function(t){t.graph.isEnabled()&&t.undo()})),this.addAction("redo",(function(t){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){t.graph.isEnabled()&&t.graph.selectAll()})),this.addAction("selectNone",(function(t){t.graph.isEnabled()&&t.graph.clearSelection()})),this.addAction("selectVertices",(function(t){t.graph.isEnabled()&&t.graph.selectVertices()})),this.addAction("selectEdges",(function(t){t.graph.isEnabled()&&t.graph.selectEdges()})),this.addAction("edit",(function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)})),this.addAction("toBack",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)})),this.addAction("toFront",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)})),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){t.graph.isEnabled()&&t.graph.selectPreviousCell()})),this.addAction("selectNext",(function(t){t.graph.isEnabled()&&t.graph.selectNextCell()})),this.addAction("selectParent",(function(t){t.graph.isEnabled()&&t.graph.selectParentCell()})),this.addAction("selectChild",(function(t){t.graph.isEnabled()&&t.graph.selectChildCell()})),this.addAction("collapse",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)})),this.addAction("collapseAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}})),this.addAction("expand",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)})),this.addAction("expandAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}})),this.addAction("bold",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)})),this.addAction("italic",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)})),this.addAction("underline",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)})),this.addAction("alignCellsLeft",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)})),this.addAction("alignCellsCenter",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)})),this.addAction("alignCellsRight",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)})),this.addAction("alignCellsTop",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)})),this.addAction("alignCellsMiddle",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)})),this.addAction("alignCellsBottom",(function(t){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){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)})),this.addAction("alignFontRight",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)})),this.addAction("alignFontTop",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)})),this.addAction("alignFontMiddle",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)})),this.addAction("alignFontBottom",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)})),this.addAction("zoom",(function(t){var e=100*t.graph.getView().scale,n=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(n)||t.graph.getView().setScale(n)})),this.addAction("toggleTasks",(function(t){null!=t.tasks?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()})),this.addAction("toggleHelp",(function(t){null!=t.help?t.help.setVisible(!t.help.isVisible()):t.showHelp()})),this.addAction("toggleOutline",(function(t){null==t.outline?t.showOutline():t.outline.setVisible(!t.outline.isVisible())})),this.addAction("toggleConsole",(function(t){mxLog.setVisible(!mxLog.isVisible())}))},mxEditor.prototype.configure=function(t){null!=t&&(new mxCodec(t.ownerDocument).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(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,n){var i=this.actions[t];if(null!=i)try{var s=arguments;s[0]=this,i.apply(this,s)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},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);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,(function(t,e,n){return this.createPopupMenu(t,e,n)})),t.connectionHandler.factoryMethod=mxUtils.bind(this,(function(t,e){return this.createEdge(t,e)})),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,(function(){return this.horizontalFlow})),e.isEnabled=mxUtils.bind(this,(function(){return this.maintainSwimlanes})),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),n=this;return e.getLayout=function(e){var i=null,s=n.graph.getModel();return null!=s.getParent(e)&&(n.layoutSwimlanes&&t.isSwimlane(e)?(null==n.swimlaneLayout&&(n.swimlaneLayout=n.createSwimlaneLayout()),i=n.swimlaneLayout):n.layoutDiagram&&(t.isValidRoot(e)||null==s.getParent(s.getParent(e)))&&(null==n.diagramLayout&&(n.diagramLayout=n.createDiagramLayout()),i=n.diagramLayout)),i},e},mxEditor.prototype.setGraphContainer=function(t){null==this.graph.container&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,(function(e,n){var i=n.getProperty("cell");null!=i&&t.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,i),n.consume())})))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,(function(t,e){var n=e.getProperty("edit");this.undoManager.undoableEditHappened(n)}));t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var n=function(e,n){var i=n.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(i))};this.undoManager.addListener(mxEvent.UNDO,n),this.undoManager.addListener(mxEvent.REDO,n)},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,n){this.setModified(!0),1==this.validating&&t.validateGraph();for(var i=n.getProperty("edit").changes,s=0;s<i.length;s++){var r=i[s];if(r instanceof mxRootChange||r instanceof mxValueChange&&r.cell==this.graph.model.root||r instanceof mxCellAttributeChange&&r.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,n={mouseDown:function(t,n){null==e.insertFunction||n.isPopupTrigger()||!e.forcedInserting&&null!=n.getState()||(e.graph.clearSelection(),e.insertFunction(n.getEvent(),n.getCell()),this.isActive=!0,n.consume())},mouseMove:function(t,e){this.isActive&&e.consume()},mouseUp:function(t,e){this.isActive&&(this.isActive=!1,e.consume())}};t.addMouseListener(n)},mxEditor.prototype.createDiagramLayout=function(){var t=this.graph.gridSize,e=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*t,2*t);return e.isVertexIgnored=function(t){return!e.graph.isSwimlane(t)},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),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.setStatusContainer=function(t){null==this.status&&(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)}))),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.setStatus=function(t){null!=this.status&&null!=t&&(this.status.innerHTML=t)},mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,(function(e){t.innerHTML=this.getTitle()}))),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.treeLayout=function(t,e){null!=t&&new mxCompactTreeLayout(this.graph,e).execute(t)},mxEditor.prototype.getTitle=function(){for(var t="",e=this.graph,n=e.getCurrentRoot();null!=n&&null!=e.getModel().getParent(e.getModel().getParent(n));)e.isValidRoot(n)&&(t=" > "+e.convertValueToString(n)+t),n=e.getModel().getParent(n);return this.getRootTitle()+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=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(null!=t){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){new mxCodec(t.ownerDocument).decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(null!=(t=t||this.getUrlPost())&&t.length>0){var n=this.writeGraphModel(e);this.postDiagram(t,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,(function(n){this.fireEvent(new mxEventObject(mxEvent.POST,"request",n,"url",t,"data",e))})))},mxEditor.prototype.writeGraphModel=function(t){t=null!=t?t:this.linefeed;var e=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(e,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var n=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(null==(t=t||this.graph.getSelectionCell())&&null==(t=this.graph.getCurrentRoot())&&(t=this.graph.getModel().getRoot()),null!=t){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),n=e.x+10,i=e.y;if(null==this.properties||this.movePropertiesDialog){var s=this.graph.getCellBounds(t);null!=s&&(n+=s.x+Math.min(200,s.width),i+=s.y)}else n=this.properties.getX(),i=this.properties.getY();this.hideProperties();var r=this.createProperties(t);null!=r&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,r,n,i,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),n=e.getValue(t);if(mxUtils.isNode(n)){var i=new mxForm("properties");i.addText("ID",t.getId()).setAttribute("readonly","true");var s=null,r=null,o=null,l=null,a=null;e.isVertex(t)&&null!=(s=e.getGeometry(t))&&(r=i.addText("top",s.y),o=i.addText("left",s.x),l=i.addText("width",s.width),a=i.addText("height",s.height));for(var h=e.getStyle(t),u=i.addText("Style",h||""),d=n.attributes,p=[],m=0;m<d.length;m++){var c=d[m].value;p[m]=i.addTextarea(d[m].nodeName,c,"label"==d[m].nodeName?4:2)}var x=mxUtils.bind(this,(function(){this.hideProperties(),e.beginUpdate();try{null!=s&&((s=s.clone()).x=parseFloat(o.value),s.y=parseFloat(r.value),s.width=parseFloat(l.value),s.height=parseFloat(a.value),e.setGeometry(t,s)),u.value.length>0?e.setStyle(t,u.value):e.setStyle(t,null);for(var n=0;n<d.length;n++){var i=new mxCellAttributeChange(t,d[n].nodeName,p[n].value);e.execute(i)}this.graph.isAutoSizeCell(t)&&this.graph.updateCellSize(t)}finally{e.endUpdate()}})),g=mxUtils.bind(this,(function(){this.hideProperties()}));return i.addButtons(x,g),i.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var t=document.createElement("div");t.style.padding="4px",t.style.paddingLeft="20px";var e=document.body.clientWidth,n=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200);n.setClosable(!0),n.destroyOnClose=!1;var i=mxUtils.bind(this,(function(e){mxEvent.release(t),t.innerHTML="",this.createTasks(t)}));this.graph.getModel().addListener(mxEvent.CHANGE,i),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,i),this.graph.addListener(mxEvent.ROOT,i),null!=this.tasksWindowImage&&n.setImage(this.tasksWindowImage),this.tasks=n,this.createTasks(t)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(t){if(null!=this.tasks){t=this.tasks.content;mxEvent.release(t),t.innerHTML="",this.createTasks(t)}},mxEditor.prototype.createTasks=function(t){},mxEditor.prototype.showHelp=function(t){if(null==this.help){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 n=document.body.clientWidth,i=document.body.clientHeight||document.documentElement.clientHeight,s=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,e,(n-this.helpWidth)/2,(i-this.helpHeight)/3,this.helpWidth,this.helpHeight);if(s.setMaximizable(!0),s.setClosable(!0),s.destroyOnClose=!1,s.setResizable(!0),null!=this.helpWindowImage&&s.setImage(this.helpWindowImage),mxClient.IS_NS){var r=function(t){var n=s.div.offsetHeight;e.setAttribute("height",n-26+"px")};s.addListener(mxEvent.RESIZE_END,r),s.addListener(mxEvent.MAXIMIZE,r),s.addListener(mxEvent.NORMALIZE,r),s.addListener(mxEvent.SHOW,r)}this.help=s}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var t=document.createElement("div");t.style.overflow="hidden",t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.background="white",t.style.cursor="move",8==document.documentMode&&(t.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=100)");var e=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,t,600,480,200,200,!1),n=new mxOutline(this.graph,t);e.setClosable(!0),e.setResizable(!0),e.destroyOnClose=!1,e.addListener(mxEvent.RESIZE_END,(function(){n.update()})),this.outline=e,this.outline.outline=n}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(t){"select"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==t&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(t,e,n){this.popupHandler.createMenu(this,t,e,n)},mxEditor.prototype.createEdge=function(t,e){var n=null;if(null!=this.defaultEdge){n=this.graph.getModel().cloneCell(this.defaultEdge)}else{(n=new mxCell("")).setEdge(!0);var i=new mxGeometry;i.relative=!0,n.setGeometry(i)}var s=this.getEdgeStyle();return null!=s&&n.setStyle(s),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(t){return null!=this.cycleAttributeValues&&this.cycleAttributeValues.length>0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(null!=this.cycleAttributeName){var e=this.consumeCycleAttribute(t);null!=e&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,n,i){for(var s=this.graph.getModel();null!=t&&!this.graph.isValidDropTarget(t);)t=s.getParent(t);t=null!=t?t:this.graph.getSwimlaneAt(n,i);var r=this.graph.getView().scale,o=s.getGeometry(e),l=s.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(null==t&&this.swimlaneRequired)return null;if(null!=t&&null!=l){var a=this.graph.getView().getState(t);if(null!=a){if(n-=a.origin.x*r,i-=a.origin.y*r,this.graph.isConstrainedMoving){var h=o.width,u=o.height,d=a.x+a.width;n+h>d&&(n-=n+h-d),i+u>(d=a.y+a.height)&&(i-=i+u-d)}}else null!=l&&(n-=l.x*r,i-=l.y*r)}}(o=o.clone()).x=this.graph.snap(n/r-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(i/r-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(o),null==t&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),s.beginUpdate();try{null!=(e=this.graph.addCell(e,t))&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{s.endUpdate()}return null!=e&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=void 0!==mxEditor?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(null!=t){var e=t.getName();mxCodecRegistry.codecs[e]=t;var n=mxUtils.getFunctionName(t.template.constructor);n!=e&&mxCodecRegistry.addAlias(n,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(null!=t){var n=mxUtils.getFunctionName(t),i=mxCodecRegistry.aliases[n];if(null!=i&&(n=i),null==(e=mxCodecRegistry.codecs[n]))try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch(t){}}return e}},codec;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(t,e,n,i){for(var s in this.template=t,this.exclude=null!=e?e:[],this.idrefs=null!=n?n:[],this.mapping=null!=i?i:[],this.reverse=new Object,this.mapping)this.reverse[this.mapping[s]]=s}__mxOutput.mxCodecRegistry=void 0!==mxCodecRegistry?mxCodecRegistry:void 0,mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(null!=t&&null==(e=this.objects[t])&&null==(e=this.lookup(t))){var n=this.getElementById(t);null!=n&&(e=this.decode(n))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=new Object,null!=this.document.documentElement&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(null!=e)if(null==this.elements[e])this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}for(t=t.firstChild;null!=t;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return null!=t&&null==(e=this.reference(t))&&t instanceof mxCell&&null==(e=t.getId())&&0==(e=mxCellPath.create(t)).length&&(e="root"),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(null!=t&&null!=t.constructor){var n=mxCodecRegistry.getCodec(t.constructor);null!=n?e=n.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=null;try{i=window[t.nodeName]}catch(t){}var s=mxCodecRegistry.getCodec(i);null!=s?n=s.decode(this,t,e):(n=t.cloneNode(!0)).removeAttribute("as")}return n},mxCodec.prototype.encodeCell=function(t,e,n){if(e.appendChild(this.encode(t)),null==n||n)for(var i=t.getChildCount(),s=0;s<i;s++)this.encodeCell(t.getChildAt(s),e)},mxCodec.prototype.isCellCodec=function(t){return null!=t&&"function"==typeof t.isCellCodec&&t.isCellCodec()},mxCodec.prototype.decodeCell=function(t,e){e=null==e||e;var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=mxCodecRegistry.getCodec(t.nodeName);if(!this.isCellCodec(i))for(var s=t.firstChild;null!=s&&!this.isCellCodec(i);)i=mxCodecRegistry.getCodec(s.nodeName),s=s.nextSibling;this.isCellCodec(i)||(i=mxCodecRegistry.getCodec(mxCell)),n=i.decode(this,t),e&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(t){var e=t.parent,n=t.getTerminal(!0),i=t.getTerminal(!1);if(t.setTerminal(null,!1),t.setTerminal(null,!0),t.parent=null,null!=e){if(e==t)throw new Error(e.id+": Self Reference");e.insert(t)}null!=n&&n.insertEdge(t,!0),null!=i&&i.insertEdge(t,!1)},mxCodec.prototype.setAttribute=function(t,e,n){null!=e&&null!=n&&t.setAttribute(e,n)},__mxOutput.mxCodec=void 0!==mxCodec?mxCodec:void 0,mxObjectCodec.allowEval=!1,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(null!=t){var e=this.reverse[t];null!=e&&(t=e)}return t},mxObjectCodec.prototype.getAttributeName=function(t){if(null!=t){var e=this.mapping[t];null!=e&&(t=e)}return t},mxObjectCodec.prototype.isExcluded=function(t,e,n,i){return e==mxObjectIdentity.FIELD_NAME||mxUtils.indexOf(this.exclude,e)>=0},mxObjectCodec.prototype.isReference=function(t,e,n,i){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var n=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,n),this.encodeObject(t,e,n),this.afterEncode(t,e,n)},mxObjectCodec.prototype.encodeObject=function(t,e,n){for(var i in t.setAttribute(n,"id",t.getId(e)),e){var s=i,r=e[s];null==r||this.isExcluded(e,s,r,!0)||(mxUtils.isInteger(s)&&(s=null),this.encodeValue(t,e,s,r,n))}},mxObjectCodec.prototype.encodeValue=function(t,e,n,i,s){if(null!=i){if(this.isReference(e,n,i,!0)){var r=t.getId(i);if(null==r)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+i);i=r}var o=this.template[n];(null==n||t.encodeDefaults||o!=i)&&(n=this.getAttributeName(n),this.writeAttribute(t,e,n,i,s))}},mxObjectCodec.prototype.writeAttribute=function(t,e,n,i,s){"object"!=typeof i?this.writePrimitiveAttribute(t,e,n,i,s):this.writeComplexAttribute(t,e,n,i,s)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,n,i,s){if(i=this.convertAttributeToXml(t,e,n,i,s),null==n){var r=t.document.createElement("add");"function"==typeof i?r.appendChild(t.document.createTextNode(i)):t.setAttribute(r,"value",i),s.appendChild(r)}else"function"!=typeof i&&t.setAttribute(s,n,i)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,n,i,s){var r=t.encode(i);null!=r?(null!=n&&r.setAttribute("as",n),s.appendChild(r)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+i)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,n,i){return this.isBooleanAttribute(t,e,n,i)&&(i=1==i?"1":"0"),i},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,n,i){return void 0===i.length&&(1==i||0==i)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,n){var i=e.value;return this.isNumericAttribute(t,e,n)&&(i=parseFloat(i),!isNaN(i)&&isFinite(i)||(i=0)),i},mxObjectCodec.prototype.isNumericAttribute=function(t,e,n){return n.constructor==mxGeometry&&("x"==e.name||"y"==e.name||"width"==e.name||"height"==e.name)||n.constructor==mxPoint&&("x"==e.name||"y"==e.name)||mxUtils.isNumeric(e.value)},mxObjectCodec.prototype.beforeEncode=function(t,e,n){return e},mxObjectCodec.prototype.afterEncode=function(t,e,n){return n},mxObjectCodec.prototype.decode=function(t,e,n){var i=e.getAttribute("id"),s=t.objects[i];return null==s&&(s=n||this.cloneTemplate(),null!=i&&t.putObject(i,s)),e=this.beforeDecode(t,e,s),this.decodeNode(t,e,s),this.afterDecode(t,e,s)},mxObjectCodec.prototype.decodeNode=function(t,e,n){null!=e&&(this.decodeAttributes(t,e,n),this.decodeChildren(t,e,n))},mxObjectCodec.prototype.decodeAttributes=function(t,e,n){var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++)this.decodeAttribute(t,i[s],n)},mxObjectCodec.prototype.isIgnoredAttribute=function(t,e,n){return"as"==e.nodeName||"id"==e.nodeName},mxObjectCodec.prototype.decodeAttribute=function(t,e,n){if(!this.isIgnoredAttribute(t,e,n)){var i=e.nodeName,s=this.convertAttributeFromXml(t,e,n),r=this.getFieldName(i);if(this.isReference(n,r,s,!1)){var o=t.getObject(s);if(null==o)return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+i+"="+s);s=o}this.isExcluded(n,i,s,!1)||(n[i]=s)}},mxObjectCodec.prototype.decodeChildren=function(t,e,n){for(var i=e.firstChild;null!=i;){var s=i.nextSibling;i.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(t,i,n)||this.decodeChild(t,i,n),i=s}},mxObjectCodec.prototype.decodeChild=function(t,e,n){var i=this.getFieldName(e.getAttribute("as"));if(null==i||!this.isExcluded(n,i,e,!1)){var s=this.getFieldTemplate(n,i,e),r=null;"add"==e.nodeName?null==(r=e.getAttribute("value"))&&mxObjectCodec.allowEval&&(r=mxUtils.eval(mxUtils.getTextContent(e))):r=t.decode(e,s);try{this.addObjectValue(n,i,r,s)}catch(t){throw new Error(t.message+" for "+e.nodeName)}}},mxObjectCodec.prototype.getFieldTemplate=function(t,e,n){var i=t[e];return i instanceof Array&&i.length>0&&(i=null),i},mxObjectCodec.prototype.addObjectValue=function(t,e,n,i){null!=n&&n!=i&&(null!=e&&e.length>0?t[e]=n:t.push(n))},mxObjectCodec.prototype.processInclude=function(t,e,n){if("include"==e.nodeName){var i=e.getAttribute("name");if(null!=i)try{var s=mxUtils.load(i).getDocumentElement();null!=s&&t.decode(s,n)}catch(t){}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,n){return e},mxObjectCodec.prototype.afterDecode=function(t,e,n){return n},__mxOutput.mxObjectCodec=void 0!==mxObjectCodec?mxObjectCodec:void 0,mxCodecRegistry.register((codec=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]),codec.isCellCodec=function(){return!0},codec.isNumericAttribute=function(t,e,n){return"value"!==e.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},codec.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&"value"==e&&n.nodeType==mxConstants.NODETYPE_ELEMENT},codec.afterEncode=function(t,e,n){if(null!=e.value&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var i=n;(n=mxUtils.importNode(t.document,e.value,!0)).appendChild(i);var s=i.getAttribute("id");n.setAttribute("id",s),i.removeAttribute("id")}return n},codec.beforeDecode=function(t,e,n){var i=e.cloneNode(!0),s=this.getName();if(e.nodeName!=s){var r=e.getElementsByTagName(s)[0];null!=r&&r.parentNode==e?(mxUtils.removeWhitespace(r,!0),mxUtils.removeWhitespace(r,!1),r.parentNode.removeChild(r),i=r):i=null,n.value=e.cloneNode(!0);var o=n.value.getAttribute("id");null!=o&&(n.setId(o),n.value.removeAttribute("id"))}else n.setId(e.getAttribute("id"));if(null!=i)for(var l=0;l<this.idrefs.length;l++){var a=this.idrefs[l],h=i.getAttribute(a);if(null!=h){i.removeAttribute(a);var u=t.objects[h]||t.lookup(h);if(null==u){var d=t.getElementById(h);null!=d&&(u=(mxCodecRegistry.codecs[d.nodeName]||this).decode(t,d))}n[a]=u}}return i},codec)),__mxOutput.mxCellCodec="undefined"!=typeof mxCellCodec?mxCellCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphModel);return t.encodeObject=function(t,e,n){var i=t.document.createElement("root");t.encodeCell(e.getRoot(),i),n.appendChild(i)},t.decodeChild=function(t,e,n){"root"==e.nodeName?this.decodeRoot(t,e,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeRoot=function(t,e,n){for(var i=null,s=e.firstChild;null!=s;){var r=t.decodeCell(s);null!=r&&null==r.getParent()&&(i=r),s=s.nextSibling}null!=i&&n.setRoot(i)},t}()),__mxOutput.mxModelCodec="undefined"!=typeof mxModelCodec?mxModelCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return t.afterEncode=function(t,e,n){return t.encodeCell(e.root,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.root=t.decodeCell(i,!1);var s=i.nextSibling;for(i.parentNode.removeChild(i),i=s;null!=i;)s=i.nextSibling,t.decodeCell(i),i.parentNode.removeChild(i),i=s}return e},t.afterDecode=function(t,e,n){return n.previous=n.root,n},t}()),__mxOutput.mxRootChangeCodec="undefined"!=typeof mxRootChangeCodec?mxRootChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return t.isReference=function(t,e,n,i){return!("child"!=e||i&&!t.model.contains(t.previous))||mxUtils.indexOf(this.idrefs,e)>=0},t.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&null!=n&&("previous"==e||"parent"==e)&&!t.model.contains(n)},t.afterEncode=function(t,e,n){return this.isReference(e,"child",e.child,!0)?n.setAttribute("child",t.getId(e.child)):t.encodeCell(e.child,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.child=t.decodeCell(i,!1);var s=i.nextSibling;for(i.parentNode.removeChild(i),i=s;null!=i;){if(s=i.nextSibling,i.nodeType==mxConstants.NODETYPE_ELEMENT){var r=i.getAttribute("id");null==t.lookup(r)&&t.decodeCell(i)}i.parentNode.removeChild(i),i=s}}else{var o=e.getAttribute("child");n.child=t.getObject(o)}return e},t.afterDecode=function(t,e,n){return null!=n.child&&(null!=n.child.parent&&null!=n.previous&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),__mxOutput.mxChildChangeCodec="undefined"!=typeof mxChildChangeCodec?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(t,e,n){return n.previous=n.terminal,n},t}()),__mxOutput.mxTerminalChangeCodec="undefined"!=typeof mxTerminalChangeCodec?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var n=new mxObjectCodec(t,["model","previous"],["cell"]);return n.afterDecode=function(t,n,i){return mxUtils.isNode(i.cell)&&(i.cell=t.decodeCell(i.cell,!1)),i.previous=i[e],i},n};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=void 0!==mxGenericChangeCodec?mxGenericChangeCodec:void 0,mxCodecRegistry.register(new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])),__mxOutput.mxGraphCodec="undefined"!=typeof mxGraphCodec?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())},t.encodeCell=function(t,e,n){var i=e.graph.getModel(),s=e.getState(n),r=i.getParent(n);if(null==r||null!=s){var o=i.getChildCount(n),l=e.graph.getCellGeometry(n),a=null;if(r==i.getRoot()?a="layer":null==r?a="graph":i.isEdge(n)?a="edge":o>0&&null!=l?a="group":i.isVertex(n)&&(a="vertex"),null!=a){var h=t.document.createElement(a);if(null!=e.graph.getLabel(n)&&(h.setAttribute("label",e.graph.getLabel(n)),e.graph.isHtmlLabel(n)&&h.setAttribute("html",!0)),null==r){var u=e.getGraphBounds();null!=u&&(h.setAttribute("x",Math.round(u.x)),h.setAttribute("y",Math.round(u.y)),h.setAttribute("width",Math.round(u.width)),h.setAttribute("height",Math.round(u.height))),h.setAttribute("scale",e.scale)}else if(null!=s&&null!=l){for(var d in s.style){var p=s.style[d];"function"==typeof p&&"object"==typeof p&&(p=mxStyleRegistry.getName(p)),null!=p&&"function"!=typeof p&&"object"!=typeof p&&h.setAttribute(d,p)}var m=s.absolutePoints;if(null!=m&&m.length>0){var c=Math.round(m[0].x)+","+Math.round(m[0].y);for(d=1;d<m.length;d++)c+=" "+Math.round(m[d].x)+","+Math.round(m[d].y);h.setAttribute("points",c)}else h.setAttribute("x",Math.round(s.x)),h.setAttribute("y",Math.round(s.y)),h.setAttribute("width",Math.round(s.width)),h.setAttribute("height",Math.round(s.height));var x=s.absoluteOffset;null!=x&&(0!=x.x&&h.setAttribute("dx",Math.round(x.x)),0!=x.y&&h.setAttribute("dy",Math.round(x.y)))}for(d=0;d<o;d++){var g=this.encodeCell(t,e,i.getChildAt(n,d));null!=g&&h.appendChild(g)}}}return h},t}()),__mxOutput.mxGraphViewCodec="undefined"!=typeof mxGraphViewCodec?mxGraphViewCodec:void 0;var mxStylesheetCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxStylesheet);return t.encode=function(t,e){var n=t.document.createElement(this.getName());for(var i in e.styles){var s=e.styles[i],r=t.document.createElement("add");if(null!=i){for(var o in r.setAttribute("as",i),s){var l=this.getStringValue(o,s[o]);if(null!=l){var a=t.document.createElement("add");a.setAttribute("value",l),a.setAttribute("as",o),r.appendChild(a)}}r.childNodes.length>0&&n.appendChild(r)}}return n},t.getStringValue=function(t,e){var n=typeof e;return"function"==n?e=mxStyleRegistry.getName(e):"object"==n&&(e=null),e},t.decode=function(t,e,n){var i=n||new this.template.constructor,s=e.getAttribute("id");for(null!=s&&(t.objects[s]=i),e=e.firstChild;null!=e;){if(!this.processInclude(t,e,i)&&"add"==e.nodeName){var r=e.getAttribute("as");if(null!=r){var o=e.getAttribute("extend"),l=null!=o?mxUtils.clone(i.styles[o]):null;null==l&&(null!=o&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+o+" not found to extend"),l=new Object);for(var a=e.firstChild;null!=a;){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var h=a.getAttribute("as");if("add"==a.nodeName){var u=mxUtils.getTextContent(a),d=null;null!=u&&u.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(u):(d=a.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),null!=d&&(l[h]=d)}else"remove"==a.nodeName&&delete l[h]}a=a.nextSibling}i.putCellStyle(r,l)}}e=e.nextSibling}return i},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=void 0!==mxStylesheetCodec?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n)for(n.editor,e=e.firstChild;null!=e;){if(!this.processInclude(t,e,n)&&"add"==e.nodeName){var i=e.getAttribute("as"),s=e.getAttribute("action"),r=e.getAttribute("control");n.bindAction(i,s,r)}e=e.nextSibling}return n},t}()),__mxOutput.mxDefaultKeyHandlerCodec="undefined"!=typeof mxDefaultKeyHandlerCodec?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n){var i=n.editor;for(e=e.firstChild;null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,e,n))if("separator"==e.nodeName)n.addSeparator();else if("br"==e.nodeName)n.toolbar.addBreak();else if("hr"==e.nodeName)n.toolbar.addLine();else if("add"==e.nodeName){var s=e.getAttribute("as");s=mxResources.get(s)||s;var r=e.getAttribute("icon"),o=e.getAttribute("pressedIcon"),l=e.getAttribute("action"),a=e.getAttribute("mode"),h=e.getAttribute("template"),u="0"!=e.getAttribute("toggle"),d=mxUtils.getTextContent(e),p=null;if(null!=l)p=n.addItem(s,r,l,o);else if(null!=a){var m=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;p=n.addMode(s,r,a,o,m)}else if(null!=h||null!=d&&d.length>0){var c=i.templates[h],x=e.getAttribute("style");null!=c&&null!=x&&(c=i.graph.cloneCell(c)).setStyle(x);var g=null;null!=d&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(g=mxUtils.eval(d)),p=n.addPrototype(s,r,c,o,g,u)}else{var y=mxUtils.getChildNodes(e);if(y.length>0)if(null==r)for(var f=n.addActionCombo(s),v=0;v<y.length;v++){if("separator"==(b=y[v]).nodeName)n.addOption(f,"---");else if("add"==b.nodeName){var C=b.getAttribute("as"),E=b.getAttribute("action");n.addActionOption(f,C,E)}}else{var S=null,T=n.addPrototype(s,r,(function(){var t=i.templates[S.value];if(null!=t){var e=t.clone(),n=S.options[S.selectedIndex].cellStyle;return null!=n&&e.setStyle(n),e}return mxLog.warn("Template "+t+" not found"),null}),null,null,u);S=n.addCombo(),mxEvent.addListener(S,"change",(function(){n.toolbar.selectMode(T,(function(t){var e=mxUtils.convertPoint(i.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t));return i.addVertex(null,m(),e.x,e.y)})),n.toolbar.noReset=!1}));for(v=0;v<y.length;v++){var b;if("separator"==(b=y[v]).nodeName)n.addOption(S,"---");else if("add"==b.nodeName){C=b.getAttribute("as");var w=b.getAttribute("template");n.addOption(S,C,w||h).cellStyle=b.getAttribute("style")}}}}if(null!=p){var L=e.getAttribute("id");null!=L&&L.length>0&&p.setAttribute("id",L)}}e=e.nextSibling}}return n},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=void 0!==mxDefaultToolbarCodec?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(t,e){return null},t.decode=function(t,e,n){var i=e.getElementsByTagName("include")[0];return null!=i?this.processInclude(t,i,n):null!=n&&(n.config=e),n},t}()),__mxOutput.mxDefaultPopupMenuCodec="undefined"!=typeof mxDefaultPopupMenuCodec?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(t,e,n){var i=e.getAttribute("defaultEdge");null!=i&&(e.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[i]);var s=e.getAttribute("defaultGroup");return null!=s&&(e.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(t,e,n){if("Array"==e.nodeName){var i=e.getAttribute("as");if("templates"==i)return void this.decodeTemplates(t,e,n)}else if("ui"==e.nodeName)return void this.decodeUi(t,e,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(t,e,n){for(var i=e.firstChild;null!=i;){if("add"==i.nodeName){var s=i.getAttribute("as"),r=i.getAttribute("element"),o=i.getAttribute("style"),l=null;if(null!=r)null!=(l=document.getElementById(r))&&null!=o&&(l.style.cssText+=";"+o);else{var a=parseInt(i.getAttribute("x")),h=parseInt(i.getAttribute("y")),u=i.getAttribute("width"),d=i.getAttribute("height");(l=document.createElement("div")).style.cssText=o,new mxWindow(mxResources.get(s)||s,l,a,h,u,d,!1,!0).setVisible(!0)}"graph"==s?n.setGraphContainer(l):"toolbar"==s?n.setToolbarContainer(l):"title"==s?n.setTitleContainer(l):"status"==s?n.setStatusContainer(l):"map"==s&&n.setMapContainer(l)}else"resource"==i.nodeName?mxResources.add(i.getAttribute("basename")):"stylesheet"==i.nodeName&&mxClient.link("stylesheet",i.getAttribute("name"));i=i.nextSibling}},t.decodeTemplates=function(t,e,n){null==n.templates&&(n.templates=[]);for(var i=mxUtils.getChildNodes(e),s=0;s<i.length;s++){for(var r=i[s].getAttribute("as"),o=i[s].firstChild;null!=o&&1!=o.nodeType;)o=o.nextSibling;null!=o&&(n.templates[r]=t.decodeCell(o))}},t}()),__mxOutput.mxEditorCodec="undefined"!=typeof mxEditorCodec?mxEditorCodec:void 0,__mxOutput}}))}));const mxgraph=initialize();function initialize(){return window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxForceIncludes=!1,window.mxResourceExtension=".txt",build({})}class BpmnStyleIdentifier{}BpmnStyleIdentifier.EDGE="bpmn.edge",BpmnStyleIdentifier.EDGE_START_FILL_COLOR="bpmn.edge.startFillColor",BpmnStyleIdentifier.EDGE_END_FILL_COLOR="bpmn.edge.endFillColor",BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND="bpmn.gatewayKind",BpmnStyleIdentifier.EVENT_DEFINITION_KIND="bpmn.eventDefinitionKind",BpmnStyleIdentifier.GLOBAL_TASK_KIND="bpmn.globalTaskKind",BpmnStyleIdentifier.SUB_PROCESS_KIND="bpmn.subProcessKind",BpmnStyleIdentifier.IS_INITIATING="bpmn.isInitiating",BpmnStyleIdentifier.IS_INSTANTIATING="bpmn.isInstantiating",BpmnStyleIdentifier.IS_INTERRUPTING="bpmn.isInterrupting",BpmnStyleIdentifier.EXTRA_CSS_CLASSES="bpmn.extra.css.classes",BpmnStyleIdentifier.MARKERS="bpmn.markers",BpmnStyleIdentifier.MESSAGE_FLOW_ICON="bpmn.messageFlowIcon";class MarkerIdentifier{}var StyleDefault;MarkerIdentifier.ARROW_DASH="bpmn.dash",exports.StyleDefault=void 0,StyleDefault=exports.StyleDefault||(exports.StyleDefault={}),StyleDefault[StyleDefault.STROKE_WIDTH_THIN=2]="STROKE_WIDTH_THIN",StyleDefault[StyleDefault.STROKE_WIDTH_THICK=5]="STROKE_WIDTH_THICK",StyleDefault[StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN=7]="SHAPE_ACTIVITY_BOTTOM_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_TOP_MARGIN=7]="SHAPE_ACTIVITY_TOP_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_LEFT_MARGIN=7]="SHAPE_ACTIVITY_LEFT_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_FROM_CENTER_MARGIN=7]="SHAPE_ACTIVITY_FROM_CENTER_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN=5]="SHAPE_ACTIVITY_MARKER_ICON_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE=20]="SHAPE_ACTIVITY_MARKER_ICON_SIZE",StyleDefault[StyleDefault.POOL_LABEL_SIZE=30]="POOL_LABEL_SIZE",StyleDefault.POOL_LABEL_FILL_COLOR="none",StyleDefault[StyleDefault.LANE_LABEL_SIZE=30]="LANE_LABEL_SIZE",StyleDefault.LANE_LABEL_FILL_COLOR="none",StyleDefault[StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH=10]="TEXT_ANNOTATION_BORDER_LENGTH",StyleDefault.TEXT_ANNOTATION_FILL_COLOR="none",StyleDefault.GROUP_FILL_COLOR="none",StyleDefault.DEFAULT_FILL_COLOR="White",StyleDefault.DEFAULT_STROKE_COLOR="Black",StyleDefault.DEFAULT_FONT_FAMILY="Arial, Helvetica, sans-serif",StyleDefault[StyleDefault.DEFAULT_FONT_SIZE=11]="DEFAULT_FONT_SIZE",StyleDefault.DEFAULT_FONT_COLOR="Black",StyleDefault[StyleDefault.DEFAULT_MARGIN=0]="DEFAULT_MARGIN",StyleDefault[StyleDefault.SHAPE_ARC_SIZE=20]="SHAPE_ARC_SIZE",StyleDefault.DEFAULT_OVERLAY_FILL_COLOR="White",StyleDefault[StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY=100]="DEFAULT_OVERLAY_FILL_OPACITY",StyleDefault.DEFAULT_OVERLAY_STROKE_COLOR="Black",StyleDefault[StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH=1]="DEFAULT_OVERLAY_STROKE_WIDTH",StyleDefault[StyleDefault.DEFAULT_OVERLAY_FONT_SIZE=11]="DEFAULT_OVERLAY_FONT_SIZE",StyleDefault.DEFAULT_OVERLAY_FONT_COLOR="Black",StyleDefault.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR="White",StyleDefault.MESSAGE_FLOW_MARKER_START_FILL_COLOR="White",StyleDefault.MESSAGE_FLOW_MARKER_END_FILL_COLOR="White";class StyleUtils{static getFillColor(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_FILLCOLOR,exports.StyleDefault.DEFAULT_FILL_COLOR)}static getStrokeColor(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_STROKECOLOR,exports.StyleDefault.DEFAULT_STROKE_COLOR)}static getStrokeWidth(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_STROKEWIDTH,exports.StyleDefault.STROKE_WIDTH_THIN)}static getMargin(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_MARGIN,exports.StyleDefault.DEFAULT_MARGIN)}static getBpmnEventDefinitionKind(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.EVENT_DEFINITION_KIND,exports.ShapeBpmnEventDefinitionKind.NONE)}static getBpmnSubProcessKind(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.SUB_PROCESS_KIND,void 0)}static getBpmnIsInterrupting(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.IS_INTERRUPTING,void 0)}static getBpmnMarkers(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.MARKERS,void 0)}static getBpmnIsInstantiating(t){return JSON.parse(mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.IS_INSTANTIATING,!1))}static getBpmnIsInitiating(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.IS_INITIATING,void 0)}static getBpmnIsParallelEventBasedGateway(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND,exports.ShapeBpmnEventBasedGatewayKind.Exclusive)==exports.ShapeBpmnEventBasedGatewayKind.Parallel}static getBpmnGlobalTaskKind(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.GLOBAL_TASK_KIND,void 0)}}class StyleConfigurator{constructor(t){this.graph=t,this.specificFlowStyles=new MapWithDefault([[exports.FlowKind.SEQUENCE_FLOW,t=>{t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN}],[exports.FlowKind.MESSAGE_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="8 5",t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OVAL,t[mxgraph.mxConstants.STYLE_STARTSIZE]=8,t[mxgraph.mxConstants.STYLE_STARTFILL]=!0,t[BpmnStyleIdentifier.EDGE_START_FILL_COLOR]=exports.StyleDefault.MESSAGE_FLOW_MARKER_START_FILL_COLOR,t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN,t[mxgraph.mxConstants.STYLE_ENDFILL]=!0,t[BpmnStyleIdentifier.EDGE_END_FILL_COLOR]=exports.StyleDefault.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[exports.FlowKind.ASSOCIATION_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="1 2",t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=12}]]),this.specificSequenceFlowStyles=new MapWithDefault([[exports.SequenceFlowKind.DEFAULT,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=MarkerIdentifier.ARROW_DASH}],[exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_DIAMOND_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=18,t[mxgraph.mxConstants.STYLE_STARTFILL]=!0,t[BpmnStyleIdentifier.EDGE_START_FILL_COLOR]=exports.StyleDefault.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),this.specificAssociationFlowStyles=new MapWithDefault([[exports.AssociationDirectionKind.NONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0,t[mxgraph.mxConstants.STYLE_ENDARROW]=void 0}],[exports.AssociationDirectionKind.ONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0}],[exports.AssociationDirectionKind.BOTH,t=>{}]])}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){StyleConfigurator.configureCommonDefaultStyle(this.getStylesheet().getDefaultVertexStyle())}configurePoolStyle(){const t={};t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_STARTSIZE]=exports.StyleDefault.POOL_LABEL_SIZE,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.POOL,t)}configureLaneStyle(){const t={};t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_SWIMLANE_LINE]=0,t[mxgraph.mxConstants.STYLE_STARTSIZE]=exports.StyleDefault.LANE_LABEL_SIZE,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.LANE,t)}configureEventStyles(){ShapeUtil.eventKinds().forEach((t=>{const e={};e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.EllipsePerimeter,e[mxgraph.mxConstants.STYLE_STROKEWIDTH]=t==exports.ShapeBpmnElementKind.EVENT_END?exports.StyleDefault.STROKE_WIDTH_THICK:exports.StyleDefault.STROKE_WIDTH_THIN,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_BOTTOM,this.putCellStyle(t,e)}))}configureTextAnnotationStyle(){const t={};t[mxgraph.mxConstants.STYLE_SHAPE]=exports.ShapeBpmnElementKind.TEXT_ANNOTATION,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_LEFT,t[mxgraph.mxConstants.STYLE_SPACING_LEFT]=5,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.TEXT_ANNOTATION_FILL_COLOR,t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(exports.ShapeBpmnElementKind.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[mxgraph.mxConstants.STYLE_ROUNDED]=!0,t[mxgraph.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,t[mxgraph.mxConstants.STYLE_ARCSIZE]=exports.StyleDefault.SHAPE_ARC_SIZE,t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.GROUP_FILL_COLOR,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_TOP,this.putCellStyle(exports.ShapeBpmnElementKind.GROUP,t)}configureActivityStyles(){ShapeUtil.activityKinds().forEach((t=>{const e={};e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,e[mxgraph.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,e[mxgraph.mxConstants.STYLE_ARCSIZE]=exports.StyleDefault.SHAPE_ARC_SIZE,e[mxgraph.mxConstants.STYLE_STROKEWIDTH]=t==exports.ShapeBpmnElementKind.CALL_ACTIVITY?exports.StyleDefault.STROKE_WIDTH_THICK:exports.StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(t,e)}))}configureGatewayStyles(){ShapeUtil.gatewayKinds().forEach((t=>{const e={};e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.RhombusPerimeter,e[mxgraph.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_TOP,e[mxgraph.mxConstants.STYLE_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_LEFT,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_TOP,this.putCellStyle(t,e)}))}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=BpmnStyleIdentifier.EDGE,t[mxgraph.mxConstants.STYLE_ENDSIZE]=12,t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=1.5,t[mxgraph.mxConstants.STYLE_ROUNDED]=1,t[mxgraph.mxConstants.STYLE_ARCSIZE]=5,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_BOTTOM,delete t[mxgraph.mxConstants.STYLE_ENDARROW],StyleConfigurator.configureCommonDefaultStyle(t)}static configureCommonDefaultStyle(t){t[mxgraph.mxConstants.STYLE_FONTFAMILY]=exports.StyleDefault.DEFAULT_FONT_FAMILY,t[mxgraph.mxConstants.STYLE_FONTSIZE]=exports.StyleDefault.DEFAULT_FONT_SIZE,t[mxgraph.mxConstants.STYLE_FONTCOLOR]=exports.StyleDefault.DEFAULT_FONT_COLOR,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.DEFAULT_FILL_COLOR,t[mxgraph.mxConstants.STYLE_STROKECOLOR]=exports.StyleDefault.DEFAULT_STROKE_COLOR,t[mxgraph.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=mxgraph.mxConstants.NONE,t[mxgraph.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(t,e){t.forEach((t=>{const n={};e.get(t)(n),this.graph.getStylesheet().putCellStyle(t.toString(),n)}))}configureFlowStyles(){this.configureEdgeStyles(Object.values(exports.FlowKind),this.specificFlowStyles),this.configureEdgeStyles(Object.values(exports.SequenceFlowKind),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(exports.AssociationDirectionKind),this.specificAssociationFlowStyles)}}class MapWithDefault extends Map{get(t){var e;return null!==(e=super.get(t))&&void 0!==e?e:()=>{}}}function computeScaledIconSize(t,e,n,i){let s,r;t.height<t.width||t.height==t.width&&n.width<=n.height?(s=n.width,r=n.width*t.height/t.width):(s=n.height*t.width/t.height,r=n.height);const o=e.strokeWidth?2*(e.strokeWidth-1):0;return{width:s*i-o,height:r*i-o}}class BpmnCanvas{constructor({canvas:t,shapeConfig:e,iconConfig:n}){this.iconPaintingOriginX=0,this.iconPaintingOriginY=0,this.canvas=t,this.shapeConfiguration=e,this.iconOriginalSize=n.originalSize;const i=n.ratioFromParent;if(i){const t=computeScaledIconSize(this.iconOriginalSize,n.styleConfig,this.shapeConfiguration,i);this.scaleX=t.width/this.iconOriginalSize.width,this.scaleY=t.height/this.iconOriginalSize.height}else this.scaleX=1,this.scaleY=1;this.updateCanvasStyle(n.styleConfig),n.setIconOriginFunct(this)}setIconOriginToShapeTopLeftProportionally(t){const e=this.shapeConfiguration;this.iconPaintingOriginX=e.x+e.width/t,this.iconPaintingOriginY=e.y+e.height/t}setIconOriginToShapeTopLeft(t=exports.StyleDefault.SHAPE_ACTIVITY_TOP_MARGIN,e=exports.StyleDefault.SHAPE_ACTIVITY_LEFT_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+e,this.iconPaintingOriginY=n.y+t}setIconOriginForIconCentered(){const t=this.shapeConfiguration;this.iconPaintingOriginX=t.x+(t.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=t.y+(t.height-this.iconOriginalSize.height*this.scaleY)/2}setIconOriginForIconBottomCentered(t=exports.StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN){const e=this.shapeConfiguration;this.iconPaintingOriginX=e.x+(e.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=e.y+(e.height-this.iconOriginalSize.height*this.scaleY-t)}setIconOriginForIconOnBottomLeft(t=exports.StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN,e=exports.StyleDefault.SHAPE_ACTIVITY_FROM_CENTER_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+(n.width-this.iconOriginalSize.width*this.scaleX)/3-e,this.iconPaintingOriginY=n.y+(n.height-this.iconOriginalSize.height*this.scaleY-t)}translateIconOrigin(t,e){this.iconPaintingOriginX+=this.scaleX*t,this.iconPaintingOriginY+=this.scaleY*e}computeScaleFromOriginX(t){return this.iconPaintingOriginX+t*this.scaleX}computeScaleFromOriginY(t){return this.iconPaintingOriginY+t*this.scaleY}updateCanvasStyle({isFilled:t,strokeColor:e,fillColor:n,strokeWidth:i}){t?this.canvas.setFillColor(e):this.canvas.setFillColor(n),this.canvas.setStrokeWidth(i)}arcTo(t,e,n,i,s,r,o){this.canvas.arcTo(t*this.scaleX,e*this.scaleY,n,i,s,this.computeScaleFromOriginX(r),this.computeScaleFromOriginY(o))}begin(){this.canvas.begin()}close(){this.canvas.close()}curveTo(t,e,n,i,s,r){this.canvas.curveTo(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),this.computeScaleFromOriginX(n),this.computeScaleFromOriginY(i),this.computeScaleFromOriginX(s),this.computeScaleFromOriginY(r))}fill(){this.canvas.fill()}fillAndStroke(){this.canvas.fillAndStroke()}setFillColor(t){this.canvas.setFillColor(t)}stroke(){this.canvas.stroke()}setStrokeColor(t){this.canvas.setStrokeColor(t)}setRoundLineJoin(){this.canvas.setLineJoin("round")}lineTo(t,e){this.canvas.lineTo(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e))}moveTo(t,e){this.canvas.moveTo(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e))}rect(t,e,n,i){this.canvas.rect(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),n*this.scaleX,i*this.scaleY)}roundrect(t,e,n,i,s,r){this.canvas.roundrect(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),n*this.scaleX,i*this.scaleY,s,r)}ellipse(t,e,n,i){this.canvas.ellipse(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),n*this.scaleX,i*this.scaleY)}rotateOnIconCenter(t){const e=this.iconPaintingOriginX+this.iconOriginalSize.width/2*this.scaleX,n=this.iconPaintingOriginY+this.iconOriginalSize.height/2*this.scaleY;this.canvas.rotate(t,!1,!1,e,n)}}function buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:r,ratioFromParent:o,isFilled:l,iconStrokeWidth:a}){return null!=o||(o=.25),null!=l||(l=!1),null!=a||(a=0),{canvas:t,ratioFromParent:o,setIconOriginFunct:t=>t.setIconOriginForIconCentered(),shapeConfig:{x:e,y:n,width:i,height:s,strokeWidth:r.strokewidth||StyleUtils.getStrokeWidth(r.style)},iconStyleConfig:{isFilled:l,fillColor:r.fill||StyleUtils.getFillColor(r.style),strokeColor:r.stroke||StyleUtils.getStrokeColor(r.style),strokeWidth:a,margin:StyleUtils.getMargin(r.style)}}}class IconPainter{paintEmptyIcon(){}newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:n,shapeConfig:i,iconStyleConfig:s},r){return new BpmnCanvas({canvas:t,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:s,ratioFromParent:e,setIconOriginFunct:n}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;n.rect(0,0,i,s),n.fillAndStroke();const{iconStyleConfig:r}=t;r.isFilled&&n.setStrokeColor(r.fillColor),n.begin(),n.moveTo(0,0),n.lineTo(.5*i,.6*s),n.lineTo(i,0),n.moveTo(0,s),n.lineTo(i/3,.45*s),n.moveTo(i,s),n.lineTo(2*i/3,.45*s),n.stroke()}paintCircleIcon(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;i>0&&s>0&&n.ellipse(0,0,i,s),t.iconStyleConfig.isFilled?n.fillAndStroke():n.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0})}),{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});IconPainter.paintGearIconBackground(e),e.translateIconOrigin(14,14),IconPainter.paintGearIconForeground(e)}static paintGearIconBackground(t){t.begin(),t.moveTo(2.06,24.62),t.lineTo(10.17,30.95),t.lineTo(9.29,37.73),t.lineTo(0,41.42),t.lineTo(2.95,54.24),t.lineTo(13.41,52.92),t.lineTo(17.39,58.52),t.lineTo(13.56,67.66),t.lineTo(24.47,74.44),t.lineTo(30.81,66.33),t.lineTo(37.88,67.21),t.lineTo(41.57,76.5),t.lineTo(54.24,73.55),t.lineTo(53.06,62.94),t.lineTo(58.52,58.52),t.lineTo(67.21,63.09),t.lineTo(74.58,51.88),t.lineTo(66.03,45.25),t.lineTo(66.92,38.62),t.lineTo(76.5,34.93),t.lineTo(73.7,22.26),t.lineTo(62.64,23.44),t.lineTo(58.81,18.42),t.lineTo(62.79,8.7),t.lineTo(51.74,2.21),t.lineTo(44.81,10.47),t.lineTo(38.03,9.43),t.lineTo(33.75,0),t.lineTo(21.52,3.24),t.lineTo(22.7,13.56),t.lineTo(18.13,17.54),t.lineTo(8.7,13.56),t.close();IconPainter.paintGearInnerCircle(t,24.8,39)}static paintGearIconForeground(t){t.begin(),t.moveTo(16.46,41.42),t.lineTo(24.57,47.75),t.lineTo(23.69,54.53),t.lineTo(14.4,58.22),t.lineTo(17.35,71.04),t.lineTo(27.81,69.72),t.lineTo(31.79,75.32),t.lineTo(27.96,84.46),t.lineTo(38.87,91.24),t.lineTo(45.21,83.13),t.lineTo(52.28,84.01),t.lineTo(55.97,93.3),t.lineTo(68.64,90.35),t.lineTo(67.46,79.74),t.lineTo(72.92,75.32),t.lineTo(81.61,79.89),t.lineTo(88.98,68.68),t.lineTo(80.43,62.05),t.lineTo(81.32,55.42),t.lineTo(90.9,51.73),t.lineTo(88.1,39.06),t.lineTo(77.04,40.24),t.lineTo(73.21,35.22),t.lineTo(77.19,25.5),t.lineTo(66.14,19.01),t.lineTo(59.21,27.27),t.lineTo(52.43,26.23),t.lineTo(48.15,16.8),t.lineTo(35.92,20.04),t.lineTo(37.1,30.36),t.lineTo(32.53,34.34),t.lineTo(23.1,30.36),t.close();IconPainter.paintGearInnerCircle(t,39.2,55.8),t.begin(),IconPainter.paintGearInnerCircle(t,39.2,55.8)}static paintGearInnerCircle(t,e,n){const i=13.5;t.moveTo(e,n),t.arcTo(i,i,0,1,1,e+27,n),t.arcTo(i,i,0,0,1,e,n),t.close(),t.fillAndStroke()}paintExpandIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;n.roundrect(0,0,i,s,2,2),n.stroke(),n.begin(),n.moveTo(i/2,s/4),n.lineTo(i/2,3*s/4),n.close(),n.moveTo(i/4,s/2),n.lineTo(3*i/4,s/2),n.close(),n.fillAndStroke()}paintLoopIcon(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const n=this.newBpmnCanvas(t,{width:22.49,height:21.62});n.begin(),n.moveTo(5.5,19.08),n.arcTo(8,8,0,1,1,10.5,21.08),n.stroke(),n.begin(),n.moveTo(7.5,14.08),n.lineTo(5.75,19.08),n.lineTo(0,17.08),n.close(),n.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:s}=t;i.setFillColor(s.strokeColor);const r=e.width,o=e.height/5;n.rect(0,0,r,o),n.fill(),n.rect(0,2*o,r,o),n.fill(),n.rect(0,4*o,r,o),n.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:s}=t;i.setFillColor(s.strokeColor);const r=e.width/5,o=e.height;n.begin(),n.rect(0,0,r,o),n.fill(),n.rect(2*r,0,r,o),n.fill(),n.rect(4*r,0,r,o),n.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}class IconPainterProvider{static get(){return this.instance}static set(t){this.instance=t}}IconPainterProvider.instance=new IconPainter;class EventShape extends mxgraph.mxEllipse{constructor(){super(void 0,void 0,void 0),this.iconPainter=IconPainterProvider.get(),this.iconPainters=new Map([[exports.ShapeBpmnEventDefinitionKind.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{ratioFromParent:.5}))],[exports.ShapeBpmnEventDefinitionKind.TERMINATE,t=>this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6}))],[exports.ShapeBpmnEventDefinitionKind.TIMER,t=>this.iconPainter.paintClockIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(5)}))],[exports.ShapeBpmnEventDefinitionKind.SIGNAL,t=>this.iconPainter.paintTriangleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:exports.StyleDefault.STROKE_WIDTH_THIN.valueOf()}),setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(4)}))],[exports.ShapeBpmnEventDefinitionKind.LINK,t=>this.iconPainter.paintRightArrowIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.ERROR,t=>this.iconPainter.paintErrorIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon(Object.assign(Object.assign({},t),{ratioFromParent:.7,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.CANCEL,t=>this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{ratioFromParent:.78}))],[exports.ShapeBpmnEventDefinitionKind.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:exports.StyleDefault.STROKE_WIDTH_THIN.valueOf()})}))],[exports.ShapeBpmnEventDefinitionKind.CONDITIONAL,t=>this.iconPainter.paintListIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))]]),this.withFilledIcon=!1}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,isFilled:this.withFilledIcon});EventShape.setDashedOuterShapePattern(r,StyleUtils.getBpmnIsInterrupting(this.style)),this.paintOuterShape(r),EventShape.restoreOriginalOuterShapePattern(r),this.paintInnerShape(r)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s}}){super.paintVertexShape(t,e,n,i,s)}paintInnerShape(t){(this.iconPainters.get(StyleUtils.getBpmnEventDefinitionKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,e){t.canvas.save(),"false"===e&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class EndEventShape extends EventShape{constructor(){super(),this.withFilledIcon=!0}}class IntermediateEventShape extends EventShape{paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s,strokeWidth:r}}){t.ellipse(e,n,i,s),t.fillAndStroke();const o=1.5*r;t.ellipse(.02*i+o+e,.02*s+o+n,.96*i-2*o,.96*s-2*o),t.stroke()}}class ThrowIntermediateEventShape extends IntermediateEventShape{constructor(){super(),this.withFilledIcon=!0}}class GatewayShape extends mxgraph.mxRhombus{constructor(){super(...arguments),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this});this.paintOuterShape(r),this.paintInnerShape(r)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s}}){super.paintVertexShape(t,e,n,i,s)}}class ExclusiveGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class ParallelGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class InclusiveGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.62,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!1,strokeWidth:exports.StyleDefault.STROKE_WIDTH_THICK.valueOf()})}))}}class EventBasedGatewayShape extends GatewayShape{paintInnerShape(t){t=Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1})}),this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55})),StyleUtils.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.45}));const e=Object.assign(Object.assign({},t),{ratioFromParent:.3});StyleUtils.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}const referenceOrderedMarkers=[exports.ShapeBpmnMarkerKind.LOOP,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL,exports.ShapeBpmnMarkerKind.COMPENSATION,exports.ShapeBpmnMarkerKind.EXPAND,exports.ShapeBpmnMarkerKind.ADHOC];function orderActivityMarkers(t){const e=referenceOrderedMarkers.filter((e=>t.includes(e)));return t.filter((t=>!e.includes(t))).forEach((t=>e.push(t))),e}function paintEnvelopeIcon(t,e){IconPainterProvider.get().paintEnvelopeIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:e})}))}class BaseActivityShape extends mxgraph.mxRectangleShape{constructor(){super(void 0,void 0,void 0),this.iconPainter=IconPainterProvider.get(),this.isRounded=!0}paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s),this.paintMarkerIcons(buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const e=StyleUtils.getBpmnMarkers(this.style);e&&orderActivityMarkers(e.split(",")).forEach(((e,n,i)=>{switch((t=Object.assign(Object.assign({},t),{setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,n+1)})).canvas.save(),e){case exports.ShapeBpmnMarkerKind.LOOP:this.iconPainter.paintLoopIcon(t);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case exports.ShapeBpmnMarkerKind.EXPAND:this.iconPainter.paintExpandIcon(t)}t.canvas.restore()}))}getMarkerIconOriginFunction(t,e){let n;return n=1===t?t=>t.setIconOriginForIconBottomCentered():t=>{t.setIconOriginForIconBottomCentered();const n=Math.pow(-1,e)*(exports.StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+exports.StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);t.translateIconOrigin(n,0)},n}}class BaseTaskShape extends BaseActivityShape{paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s),this.paintTaskIcon(buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this}))}}class TaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintEmptyIcon()}}class ServiceTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintGearIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class UserTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ReceiveTaskShape extends BaseTaskShape{paintTaskIcon(t){if(!StyleUtils.getBpmnIsInstantiating(this.style))return void paintEnvelopeIcon(t,!1);const e=Object.assign(Object.assign({},t.shapeConfig),{width:20,height:20});this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:e,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!1}),ratioFromParent:void 0,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(4,4)}),e.x+=4,e.y+=4,this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{shapeConfig:e,ratioFromParent:.65,setIconOriginFunct:t=>t.setIconOriginForIconCentered()}))}}class SendTaskShape extends BaseTaskShape{paintTaskIcon(t){paintEnvelopeIcon(t,!0)}}class ManualTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintHandIcon(Object.assign(Object.assign({},t),{ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ScriptTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},t),{ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class CallActivityShape extends BaseActivityShape{paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s);const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this});switch(StyleUtils.getBpmnGlobalTaskKind(this.style)){case exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon(Object.assign(Object.assign({},r),{ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},r),{ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},r),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon(Object.assign(Object.assign({},r),{ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class SubProcessShape extends BaseActivityShape{paintBackground(t,e,n,i,s){const r=StyleUtils.getBpmnSubProcessKind(this.style);t.save(),r===exports.ShapeBpmnSubProcessKind.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,n,i,s),t.restore()}}class BusinessRuleTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintTableIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)}))}}class TextAnnotationShape extends mxgraph.mxRectangleShape{paintBackground(t,e,n,i,s){t.begin(),t.moveTo(e+exports.StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n),t.lineTo(e,n),t.lineTo(e,n+s),t.lineTo(e+exports.StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n+s),t.fillAndStroke()}}class MessageFlowIconShape extends mxgraph.mxRectangleShape{constructor(t,e,n,i){super(t,e,n,i),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,ratioFromParent:1,isFilled:StyleUtils.getBpmnIsInitiating(this.style)===exports.MessageVisibleKind.NON_INITIATING});this.iconPainter.paintEnvelopeIcon(r)}}function computeAllBpmnClassNamesOfCell(t,e){return computeAllBpmnClassNames(t.style,e)}function computeAllBpmnClassNames(t,e){const n=[],i=t.split(";"),s=i[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",ShapeUtil.isActivity(s)),r.set("bpmn-type-container",ShapeUtil.isPoolOrLane(s)),r.set("bpmn-type-event",ShapeUtil.isEvent(s)),r.set("bpmn-type-flow",isFlowKind(s)),r.set("bpmn-type-gateway",ShapeUtil.isGateway(s)),r.set("bpmn-type-task",ShapeUtil.isTask(s)),[...r].filter((([,t])=>t)).forEach((([t])=>n.push(t))),n.push(computeBpmnBaseClassName(s)),i.map((t=>{const e=t.split("=");return[e[0],e[1]]})).forEach((([t,e])=>{switch(t){case BpmnStyleIdentifier.EVENT_DEFINITION_KIND:n.push(`bpmn-event-def-${e}`);break;case BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND:n.push(`bpmn-gateway-kind-${e.toLowerCase()}`);break;case BpmnStyleIdentifier.IS_INITIATING:n.push(e==exports.MessageVisibleKind.NON_INITIATING?"bpmn-icon-non-initiating":"bpmn-icon-initiating");break;case BpmnStyleIdentifier.SUB_PROCESS_KIND:n.push(`bpmn-sub-process-${e.toLowerCase()}`);break;case BpmnStyleIdentifier.GLOBAL_TASK_KIND:n.push(computeBpmnBaseClassName(e))}})),e&&n.push("bpmn-label"),n}function isFlowKind(t){return Object.values(exports.FlowKind).map((t=>t)).includes(t)}function computeBpmnBaseClassName(t){return t?"bpmn-"+t.replace(/([A-Z])/g,(t=>"-"+t[0].toLowerCase())):""}class MxGraphCustomOverlay extends mxgraph.mxCellOverlay{constructor(t,e){super(null,"",e.position.horizontalAlign,e.position.verticalAlign,null,"default"),this.label=t,this.style=e.style}getBounds(t){const e=t.view.graph.getModel().isEdge(t.cell),n=t.view.scale;let i;return e?i=this.computeEdgeBounds(t):(i=new mxgraph.mxPoint,this.align==mxgraph.mxConstants.ALIGN_LEFT?i.x=t.x:this.align==mxgraph.mxConstants.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==mxgraph.mxConstants.ALIGN_TOP?i.y=t.y:this.verticalAlign==mxgraph.mxConstants.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height),new mxgraph.mxRectangle(Math.round(i.x-(0*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(0*this.defaultOverlap-this.offset.y)*n),0*n,0*n)}computeEdgeBounds(t){const e=t.absolutePoints;if(this.align==mxgraph.mxConstants.ALIGN_LEFT)return e[0];if(this.align==mxgraph.mxConstants.ALIGN_CENTER){if(e.length%2==1)return e[Math.floor(e.length/2)];{const t=e.length/2,n=e[t-1],i=e[t];return new mxgraph.mxPoint(n.x+(i.x-n.x)/2,n.y+(i.y-n.y)/2)}}return e[e.length-1]}}class OverlayBadgeShape extends mxgraph.mxText{constructor(t,e,n){super(t,e,void 0,void 0,n.font.color,void 0,n.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,n.fill.color,n.stroke.color),this.fillOpacity=n.fill.opacity,this.strokewidth=n.stroke.width}}class BpmnConnector extends mxgraph.mxConnector{constructor(t,e,n){super(t,e,n)}paintEdgeShape(t,e){const n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),null!=n&&(t.setFillColor(mxgraph.mxUtils.getValue(this.style,BpmnStyleIdentifier.EDGE_START_FILL_COLOR,this.stroke)),n()),null!=i&&(t.setFillColor(mxgraph.mxUtils.getValue(this.style,BpmnStyleIdentifier.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(t,e){const n=getPointerEventsValue(t);setPointerEventsValue(t,"stroke"),this.paintLine(t,e,this.isRounded),setPointerEventsValue(t,n)}}function getPointerEventsValue(t){return t instanceof mxgraph.mxSvgCanvas2D?t.pointerEventsValue:null}function setPointerEventsValue(t,e){t instanceof mxgraph.mxSvgCanvas2D&&(t.pointerEventsValue=e)}class ShapeConfigurator{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_END,EndEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_START,EventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW,ThrowIntermediateEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH,IntermediateEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_BOUNDARY,IntermediateEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED,EventBasedGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,ExclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE,InclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_PARALLEL,ParallelGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.SUB_PROCESS,SubProcessShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.CALL_ACTIVITY,CallActivityShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK,TaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SERVICE,ServiceTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_USER,UserTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_RECEIVE,ReceiveTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SEND,SendTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_MANUAL,ManualTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SCRIPT,ScriptTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_BUSINESS_RULE,BusinessRuleTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TEXT_ANNOTATION,TextAnnotationShape),mxgraph.mxCellRenderer.registerShape(BpmnStyleIdentifier.EDGE,BpmnConnector),mxgraph.mxCellRenderer.registerShape(BpmnStyleIdentifier.MESSAGE_FLOW_ICON,MessageFlowIconShape)}initMxSvgCanvasPrototype(){mxgraph.mxSvgCanvas2D.prototype.getTextCss=function(){const t=this.state,e=mxgraph.mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxgraph.mxConstants.LINE_HEIGHT+"px":mxgraph.mxConstants.LINE_HEIGHT*this.lineHeightCorrection;let n="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: none; ";(t.fontStyle&mxgraph.mxConstants.FONT_BOLD)==mxgraph.mxConstants.FONT_BOLD&&(n+="font-weight: bold; "),(t.fontStyle&mxgraph.mxConstants.FONT_ITALIC)==mxgraph.mxConstants.FONT_ITALIC&&(n+="font-style: italic; ");const i=[];return(t.fontStyle&mxgraph.mxConstants.FONT_UNDERLINE)==mxgraph.mxConstants.FONT_UNDERLINE&&i.push("underline"),(t.fontStyle&mxgraph.mxConstants.FONT_STRIKETHROUGH)==mxgraph.mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(n+="text-decoration: "+i.join(" ")+"; "),n}}initMxShapePrototype(){mxgraph.mxShape.prototype.createSvgCanvas=function(){const t=new mxgraph.mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;const e=this.getSvgScreenOffset();if(0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),this.state&&this.state.cell){let t=computeAllBpmnClassNamesOfCell(this.state.cell,this.dialect===mxgraph.mxConstants.DIALECT_STRICTHTML);const e=this.state.style[BpmnStyleIdentifier.EXTRA_CSS_CLASSES];e&&(t=t.concat(e)),this.node.setAttribute("class",t.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t}}initMxCellRendererCreateCellOverlays(){mxgraph.mxCellRenderer.prototype.createCellOverlays=function(t){const e=t.view.graph.getCellOverlays(t.cell);let n=null;if(null!=e){n=new mxgraph.mxDictionary;for(const i of e){const e=null!=t.overlays?t.overlays.remove(i):null;if(null!=e){n.put(i,e);continue}let s;i instanceof MxGraphCustomOverlay?s=new OverlayBadgeShape(i.label,new mxgraph.mxRectangle(0,0,0,0),i.style):(s=new mxgraph.mxImageShape(new mxgraph.mxRectangle(0,0,0,0),i.image.src),s.preserveImageAspect=!1),s.dialect=t.view.graph.dialect,s.overlay=i,this.initializeOverlay(t,s),this.installCellOverlayListeners(t,i,s),null!=i.cursor&&(s.node.style.cursor=i.cursor),s instanceof OverlayBadgeShape&&(s.node.classList.add("overlay-badge"),s.node.setAttribute("data-bpmn-id",t.cell.id)),n.put(i,s)}}null!=t.overlays&&t.overlays.visit((function(t,e){e.destroy()})),t.overlays=n}}}class MarkerConfigurator{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){mxgraph.mxMarker.addMarker(MarkerIdentifier.ARROW_DASH,((t,e,n,i,s,r,o,l,a)=>{const h=s*(o+a+4),u=r*(o+a+4);return function(){t.begin(),t.moveTo(i.x-h/2-u/2,i.y-u/2+h/2),t.lineTo(i.x+u/2-3*h/2,i.y-3*u/2-h/2),t.stroke()}}))}}function ensureInRange(t,e,n,i){let s=null==t?i:t;return s=Math.min(Math.max(s,e),n),s}function ensurePositiveValue(t){return Math.max(t||0,0)}function ensureValidZoomConfiguration(t){const e=null!=t?t:{};return e.debounceDelay=ensureInRange(e.debounceDelay,0,100,50),e.throttleDelay=ensureInRange(e.throttleDelay,0,100,50),e}var FUNC_ERROR_TEXT$1="Expected a function",NAN$1=NaN,symbolTag$1="[object Symbol]",reTrim$1=/^\s+|\s+$/g,reIsBadHex$1=/^[-+]0x[0-9a-f]+$/i,reIsBinary$1=/^0b[01]+$/i,reIsOctal$1=/^0o[0-7]+$/i,freeParseInt$1=parseInt,freeGlobal$1="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf$1="object"==typeof self&&self&&self.Object===Object&&self,root$1=freeGlobal$1||freeSelf$1||Function("return this")(),objectProto$1=Object.prototype,objectToString$1=objectProto$1.toString,nativeMax$1=Math.max,nativeMin$1=Math.min,now$1=function(){return root$1.Date.now()};function debounce$1(t,e,n){var i,s,r,o,l,a,h=0,u=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT$1);function m(e){var n=i,r=s;return i=s=void 0,h=e,o=t.apply(r,n)}function c(t){return h=t,l=setTimeout(g,e),u?m(t):o}function x(t){var n=t-a;return void 0===a||n>=e||n<0||d&&t-h>=r}function g(){var t=now$1();if(x(t))return y(t);l=setTimeout(g,function(t){var n=e-(t-a);return d?nativeMin$1(n,r-(t-h)):n}(t))}function y(t){return l=void 0,p&&i?m(t):(i=s=void 0,o)}function f(){var t=now$1(),n=x(t);if(i=arguments,s=this,a=t,n){if(void 0===l)return c(a);if(d)return l=setTimeout(g,e),m(a)}return void 0===l&&(l=setTimeout(g,e)),o}return e=toNumber$2(e)||0,isObject$1(n)&&(u=!!n.leading,r=(d="maxWait"in n)?nativeMax$1(toNumber$2(n.maxWait)||0,e):r,p="trailing"in n?!!n.trailing:p),f.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=a=s=l=void 0},f.flush=function(){return void 0===l?o:y(now$1())},f}function isObject$1(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike$1(t){return!!t&&"object"==typeof t}function isSymbol$1(t){return"symbol"==typeof t||isObjectLike$1(t)&&objectToString$1.call(t)==symbolTag$1}function toNumber$2(t){if("number"==typeof t)return t;if(isSymbol$1(t))return NAN$1;if(isObject$1(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject$1(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim$1,"");var n=reIsBinary$1.test(t);return n||reIsOctal$1.test(t)?freeParseInt$1(t.slice(2),n?2:8):reIsBadHex$1.test(t)?NAN$1:+t}var lodash_debounce=debounce$1,FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(t,e,n){var i,s,r,o,l,a,h=0,u=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);function m(e){var n=i,r=s;return i=s=void 0,h=e,o=t.apply(r,n)}function c(t){return h=t,l=setTimeout(g,e),u?m(t):o}function x(t){var n=t-a;return void 0===a||n>=e||n<0||d&&t-h>=r}function g(){var t=now();if(x(t))return y(t);l=setTimeout(g,function(t){var n=e-(t-a);return d?nativeMin(n,r-(t-h)):n}(t))}function y(t){return l=void 0,p&&i?m(t):(i=s=void 0,o)}function f(){var t=now(),n=x(t);if(i=arguments,s=this,a=t,n){if(void 0===l)return c(a);if(d)return l=setTimeout(g,e),m(a)}return void 0===l&&(l=setTimeout(g,e)),o}return e=toNumber$1(e)||0,isObject(n)&&(u=!!n.leading,r=(d="maxWait"in n)?nativeMax(toNumber$1(n.maxWait)||0,e):r,p="trailing"in n?!!n.trailing:p),f.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=a=s=l=void 0},f.flush=function(){return void 0===l?o:y(now())},f}function throttle(t,e,n){var i=!0,s=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);return isObject(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),debounce(t,e,{leading:i,maxWait:e,trailing:s})}function isObject(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike(t){return!!t&&"object"==typeof t}function isSymbol(t){return"symbol"==typeof t||isObjectLike(t)&&objectToString.call(t)==symbolTag}function toNumber$1(t){if("number"==typeof t)return t;if(isSymbol(t))return NAN;if(isObject(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim,"");var n=reIsBinary.test(t);return n||reIsOctal.test(t)?freeParseInt(t.slice(2),n?2:8):reIsBadHex.test(t)?NAN:+t}var lodash_throttle=throttle;class BpmnGraph extends mxgraph.mxGraph{constructor(t){super(t),this.cumulativeZoomFactor=1,this.container&&(this.container.style.cursor="default")}createGraphView(){return new BpmnGraphView(this)}fit(t,e,n,i,s,r,o){const l=super.fit(t,e,n,i,s,r,o);return this.cumulativeZoomFactor=l,l}zoomActual(){super.zoomActual(),this.cumulativeZoomFactor=this.view.scale}customFit(t){this.zoomActual();const e=null==t?void 0:t.type;if(null==e||e==exports.FitType.None)return;const n=ensurePositiveValue(null==t?void 0:t.margin);if(e!=exports.FitType.Center){let t=!1,i=!1;switch(e){case exports.FitType.Horizontal:i=!0;break;case exports.FitType.Vertical:t=!0}this.fit(this.border,!1,n,!0,t,i)}else{const t=3,e=this.getGraphBounds(),i=this.container.clientWidth-n,s=this.container.clientHeight-n,r=e.width/this.view.scale,o=e.height/this.view.scale,l=Math.min(t,Math.min(i/r,s/o));this.cumulativeZoomFactor=l,this.view.scaleAndTranslate(l,(n+i-r*l)/(2*l)-e.x/this.view.scale,(n+s-o*l)/(2*l)-e.y/this.view.scale)}}zoomTo(t,e,n,i,s,r){if(null===t){const[t,e,o]=this.getScaleAndTranslationDeltas(n,i,s);r&&this.view.scaleAndTranslate(t,this.view.translate.x+e,this.view.translate.y+o)}else super.zoomTo(t,e)}createMouseWheelZoomExperience(t){t=ensureValidZoomConfiguration(t),mxgraph.mxEvent.addMouseWheelListener(lodash_debounce(this.getZoomHandler(!0),t.debounceDelay),this.container),mxgraph.mxEvent.addMouseWheelListener(lodash_throttle(this.getZoomHandler(!1),t.throttleDelay),this.container)}performZoom(t,e,n){const[i,s]=this.getRelativeEventCoordinates(e);this.zoomTo(null,null,t,i,s,n),n&&mxgraph.mxEvent.consume(e)}getZoomHandler(t){return(e,n)=>{if(mxgraph.mxEvent.isConsumed(e))return;const i=e;i.ctrlKey&&!i.altKey&&!i.shiftKey&&!i.metaKey&&this.performZoom(n,i,t)}}getRelativeEventCoordinates(t){const e=this.container.getBoundingClientRect();return[t.clientX-e.left,t.clientY-e.top]}getScaleAndTranslationDeltas(t,e,n){let i=2*e,s=2*n;const[r,o]=this.calculateFactorAndScale(t);return[i,s]=this.calculateTranslationDeltas(r,o,i,s),[o,i,s]}calculateTranslationDeltas(t,e,n,i){if(t>1){const s=(t-1)/(2*e);n*=-s,i*=-s}else{const e=(1/t-1)/(2*this.view.scale);n*=e,i*=e}return[n,i]}calculateFactorAndScale(t){this.cumulativeZoomFactor*=t?Math.sqrt(1.25):Math.sqrt(.8);let e=this.cumulativeZoomFactor/this.view.scale;const n=Math.round(this.view.scale*e*100)/100;return e=n/this.view.scale,[e,n]}}class BpmnGraphView extends mxgraph.mxGraphView{getFloatingTerminalPoint(t,e,n,i){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,n,i);const s=t.absolutePoints;return i?s[1]:s[s.length-2]}}class GraphConfigurator{constructor(t){this.container=t,this.graph=new BpmnGraph(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new StyleConfigurator(this.graph).configureStyles(),(new ShapeConfigurator).configureShapes(),(new MarkerConfigurator).configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var e,n;const i=this.graph.panningHandler;(null===(e=null==t?void 0:t.navigation)||void 0===e?void 0:e.enabled)?(i.addListener(mxgraph.mxEvent.PAN_START,this.getPanningHandler("grab")),i.addListener(mxgraph.mxEvent.PAN_END,this.getPanningHandler("default")),this.graph.panningHandler.usePopupTrigger=!1,i.isForcePanningEvent=t=>mxgraph.mxEvent.isLeftMouseButton(t.getEvent())||mxgraph.mxEvent.isMultiTouchEvent(t.getEvent()),this.graph.setPanning(!0),this.graph.createMouseWheelZoomExperience(null===(n=null==t?void 0:t.navigation)||void 0===n?void 0:n.zoom)):(this.graph.setPanning(!1),i.setPinchEnabled(!1),i.isForcePanningEvent=t=>!1)}getPanningHandler(t){return this.getPanningHandlerCallback(t).bind(this.graph)}getPanningHandlerCallback(t){return function(){this.isEnabled()&&(this.container.style.cursor=t)}}}class Flow{constructor(t,e,n,i,s){this.id=t,this.name=e,this.kind=n,this.sourceRefId=i,this.targetRefId=s}}class SequenceFlow extends Flow{constructor(t,e,n,i,s=exports.SequenceFlowKind.NORMAL){super(t,e,exports.FlowKind.SEQUENCE_FLOW,n,i),this.sequenceFlowKind=s}}class MessageFlow extends Flow{constructor(t,e,n,i){super(t,e,exports.FlowKind.MESSAGE_FLOW,n,i)}}class AssociationFlow extends Flow{constructor(t,e,n,i,s=exports.AssociationDirectionKind.NONE){super(t,e,exports.FlowKind.ASSOCIATION_FLOW,n,i),this.associationDirectionKind=s}}class CoordinatesTranslator{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const n=this.getTranslateForRoot(t),i=e.x+n.x,s=e.y+n.y;return new mxgraph.mxPoint(i,s)}getTranslateForRoot(t){const e=this.graph.getModel(),n=new mxgraph.mxPoint(0,0);for(;null!=t;){const i=e.getGeometry(t);null!=i&&(n.x-=i.x,n.y-=i.y),t=e.getParent(t)}return n}computeEdgeCenter(t){const e=t.geometry.points,n=e[0],i=e[e.length-1];if(null!=n&&null!=i){const t=i.x-n.x,e=i.y-n.y;return new mxgraph.mxPoint(n.x+t/2,n.y+e/2)}}}class Shape{constructor(t,e,n,i,s){this.id=t,this.bpmnElement=e,this.bounds=n,this.label=i,this.isHorizontal=s}}class ShapeBpmnElement{constructor(t,e,n,i,s=!1){this.id=t,this.name=e,this.kind=n,this.parentId=i,this.instantiate=s}}class ShapeBpmnActivity extends ShapeBpmnElement{constructor(t,e,n,i,s,r=[]){super(t,e,n,i,s),this.markers=r}}class ShapeBpmnCallActivity extends ShapeBpmnActivity{constructor(t,e,n,i,s,r){super(t,e,exports.ShapeBpmnElementKind.CALL_ACTIVITY,i,void 0,s),this.callActivityKind=n,this.globalTaskKind=r}}class ShapeBpmnSubProcess extends ShapeBpmnActivity{constructor(t,e,n,i,s){super(t,e,exports.ShapeBpmnElementKind.SUB_PROCESS,i,void 0,s),this.subProcessKind=n}}class ShapeBpmnEvent extends ShapeBpmnElement{constructor(t,e,n,i,s){super(t,e,n,s),this.eventDefinitionKind=i}}class ShapeBpmnStartEvent extends ShapeBpmnEvent{constructor(t,e,n,i,s){super(t,e,exports.ShapeBpmnElementKind.EVENT_START,n,i),this.isInterrupting=s}}class ShapeBpmnBoundaryEvent extends ShapeBpmnEvent{constructor(t,e,n,i,s=!0){super(t,e,exports.ShapeBpmnElementKind.EVENT_BOUNDARY,n,i),this.isInterrupting=s}}class ShapeBpmnEventBasedGateway extends ShapeBpmnElement{constructor(t,e,n,i,s=exports.ShapeBpmnEventBasedGatewayKind.None){super(t,e,exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED,n,i),this.gatewayKind=s}}class Participant{constructor(t,e,n){this.id=t,this.name=e,this.processRef=n}}class StyleComputer{computeStyle(t,e){const n=[t.bpmnElement.kind];let i;t instanceof Shape?i=StyleComputer.computeShapeStyle(t):(n.push(...StyleComputer.computeEdgeStyle(t)),i=new Map);const s=StyleComputer.computeFontStyleValues(t),r=StyleComputer.computeLabelStyleValues(t,e);return[].concat([...n]).concat([...i,...s,...r].filter((([,t])=>t&&"undefined"!=t)).map((([t,e])=>t+"="+e))).join(";")}static computeShapeStyle(t){const e=new Map,n=t.bpmnElement;return n instanceof ShapeBpmnEvent?this.computeEventShapeStyle(n,e):n instanceof ShapeBpmnActivity?this.computeActivityShapeStyle(n,e):ShapeUtil.isPoolOrLane(n.kind)?e.set(mxgraph.mxConstants.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):n instanceof ShapeBpmnEventBasedGateway&&(e.set(BpmnStyleIdentifier.IS_INSTANTIATING,String(n.instantiate)),e.set(BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND,String(n.gatewayKind))),e}static computeEventShapeStyle(t,e){e.set(BpmnStyleIdentifier.EVENT_DEFINITION_KIND,t.eventDefinitionKind),(t instanceof ShapeBpmnBoundaryEvent||t instanceof ShapeBpmnStartEvent&&void 0!==t.isInterrupting)&&e.set(BpmnStyleIdentifier.IS_INTERRUPTING,String(t.isInterrupting))}static computeActivityShapeStyle(t,e){t instanceof ShapeBpmnSubProcess?e.set(BpmnStyleIdentifier.SUB_PROCESS_KIND,t.subProcessKind):t.kind===exports.ShapeBpmnElementKind.TASK_RECEIVE?e.set(BpmnStyleIdentifier.IS_INSTANTIATING,String(t.instantiate)):t instanceof ShapeBpmnCallActivity&&e.set(BpmnStyleIdentifier.GLOBAL_TASK_KIND,t.globalTaskKind);const n=t.markers;n.length>0&&e.set(BpmnStyleIdentifier.MARKERS,n.join(","))}static computeEdgeStyle(t){const e=[],n=t.bpmnElement;return n instanceof SequenceFlow&&e.push(n.sequenceFlowKind),n instanceof AssociationFlow&&e.push(n.associationDirectionKind),e}static computeFontStyleValues(t){var e;const n=new Map,i=null===(e=t.label)||void 0===e?void 0:e.font;return i&&(n.set(mxgraph.mxConstants.STYLE_FONTFAMILY,i.name),n.set(mxgraph.mxConstants.STYLE_FONTSIZE,i.size),n.set(mxgraph.mxConstants.STYLE_FONTSTYLE,StyleComputer.getFontStyleValue(i))),n}static computeLabelStyleValues(t,e){const n=new Map,i=t.bpmnElement;return e?(n.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),t.bpmnElement.kind!=exports.ShapeBpmnElementKind.TEXT_ANNOTATION&&n.set(mxgraph.mxConstants.STYLE_ALIGN,mxgraph.mxConstants.ALIGN_CENTER),t instanceof Shape&&(n.set(mxgraph.mxConstants.STYLE_LABEL_WIDTH,e.width+1),n.set(mxgraph.mxConstants.STYLE_LABEL_POSITION,mxgraph.mxConstants.ALIGN_TOP),n.set(mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxgraph.mxConstants.ALIGN_LEFT))):t instanceof Shape&&(i instanceof ShapeBpmnSubProcess||i instanceof ShapeBpmnCallActivity&&i.callActivityKind===exports.ShapeBpmnCallActivityKind.CALLING_PROCESS)&&!i.markers.includes(exports.ShapeBpmnMarkerKind.EXPAND)&&n.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),n}computeMessageFlowIconStyle(t){return`shape=${BpmnStyleIdentifier.MESSAGE_FLOW_ICON};${BpmnStyleIdentifier.IS_INITIATING}=${t.messageVisibleKind}`}static getFontStyleValue(t){let e=0;return t.isBold&&(e+=mxgraph.mxConstants.FONT_BOLD),t.isItalic&&(e+=mxgraph.mxConstants.FONT_ITALIC),t.isStrikeThrough&&(e+=mxgraph.mxConstants.FONT_STRIKETHROUGH),t.isUnderline&&(e+=mxgraph.mxConstants.FONT_UNDERLINE),e}}class BpmnRenderer{constructor(t,e,n){this.graph=t,this.coordinatesTranslator=e,this.styleComputer=n}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(null==e?void 0:e.fit)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:n,otherFlowNodes:i,boundaryEvents:s,edges:r}){const o=this.graph.getModel();o.clear(),o.beginUpdate();try{this.insertShapes(t),this.insertShapes(e),this.insertShapes(n),this.insertShapes(i),this.insertShapes(s),this.insertEdges(r)}finally{o.endUpdate()}}insertShapes(t){t.forEach((t=>this.insertShape(t)))}getParent(t){const e=this.getCell(t.parentId);return null!=e?e:this.graph.getDefaultParent()}insertShape(t){var e;const n=t.bpmnElement,i=this.getParent(n),s=t.bounds;let r=null===(e=t.label)||void 0===e?void 0:e.bounds;r=ShapeUtil.isPoolOrLane(n.kind)?void 0:r;const o=this.styleComputer.computeStyle(t,r);this.insertVertex(i,n.id,n.name,s,r,o)}insertEdges(t){t.forEach((t=>{var e;const n=t.bpmnElement,i=this.graph.getDefaultParent(),s=this.getCell(n.sourceRefId),r=this.getCell(n.targetRefId),o=null===(e=t.label)||void 0===e?void 0:e.bounds,l=this.styleComputer.computeStyle(t,o),a=this.graph.insertEdge(i,n.id,n.name,s,r,l);if(this.insertWaypoints(t.waypoints,a),o){a.geometry.width=o.width,a.geometry.height=o.height;const t=this.coordinatesTranslator.computeEdgeCenter(a);if(t){a.geometry.relative=!1;const e=this.coordinatesTranslator.computeRelativeCoordinates(a.parent,new mxgraph.mxPoint(o.x,o.y)),n=e.x+o.width/2-t.x,i=e.y-t.y;a.geometry.offset=new mxgraph.mxPoint(n,i)}}this.insertMessageFlowIconIfNeeded(t,a)}))}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof MessageFlow&&t.messageVisibleKind!==exports.MessageVisibleKind.NONE){const n=this.graph.insertVertex(e,messageFowIconId(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));n.geometry.relative=!0,n.geometry.offset=new mxgraph.mxPoint(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map((t=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new mxgraph.mxPoint(t.x,t.y)))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,n,i,s,r){const o=this.coordinatesTranslator.computeRelativeCoordinates(t,new mxgraph.mxPoint(i.x,i.y)),l=this.graph.insertVertex(t,e,n,o.x,o.y,i.width,i.height,r);if(s){const t=s.x-i.x,e=s.y-i.y;l.geometry.offset=new mxgraph.mxPoint(t,e)}return l}}function newBpmnRenderer(t){return new BpmnRenderer(t,new CoordinatesTranslator(t),new StyleComputer)}function messageFowIconId(t){return`messageFlowIcon_of_${t}`}var util=createCommonjsModule((function(t,e){const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+i+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,n){if(e){const i=Object.keys(e),s=i.length;for(let r=0;r<s;r++)t[i[r]]="strict"===n?[e[i[r]]]:e[i[r]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(t){const e=s.exec(t);return!(null==e)},e.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n},e.nameRegexp=i}));util.isExist,util.isEmptyObject,util.merge,util.getValue,util.isName,util.getAllMatches,util.nameRegexp;const defaultOptions$2={allowBooleanAttributes:!1,unpairedTags:[]};var validate=function(t,e){e=Object.assign({},defaultOptions$2,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let r=0;r<t.length;r++)if("<"===t[r]&&"?"===t[r+1]){if(r+=2,r=readPI(t,r),r.err)return r}else{if("<"!==t[r]){if(isWhiteSpace(t[r]))continue;return getErrorObject("InvalidChar","char '"+t[r]+"' is not expected.",getLineNumberForPosition(t,r))}{let o=r;if(r++,"!"===t[r]){r=readCommentAndCDATA(t,r);continue}{let l=!1;"/"===t[r]&&(l=!0,r++);let a="";for(;r<t.length&&">"!==t[r]&&" "!==t[r]&&"\t"!==t[r]&&"\n"!==t[r]&&"\r"!==t[r];r++)a+=t[r];if(a=a.trim(),"/"===a[a.length-1]&&(a=a.substring(0,a.length-1),r--),!validateTagName(a)){let e;return e=0===a.trim().length?"Invalid space after '<'.":"Tag '"+a+"' is an invalid name.",getErrorObject("InvalidTag",e,getLineNumberForPosition(t,r))}const h=readAttributeStr(t,r);if(!1===h)return getErrorObject("InvalidAttr","Attributes for '"+a+"' have open quote.",getLineNumberForPosition(t,r));let u=h.value;if(r=h.index,"/"===u[u.length-1]){const n=r-u.length;u=u.substring(0,u.length-1);const s=validateAttributeString(u,e);if(!0!==s)return getErrorObject(s.err.code,s.err.msg,getLineNumberForPosition(t,n+s.err.line));i=!0}else if(l){if(!h.tagClosed)return getErrorObject("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",getLineNumberForPosition(t,r));if(u.trim().length>0)return getErrorObject("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",getLineNumberForPosition(t,o));{const e=n.pop();if(a!==e.tagName){let n=getLineNumberForPosition(t,e.tagStartPos);return getErrorObject("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+a+"'.",getLineNumberForPosition(t,o))}0==n.length&&(s=!0)}}else{const l=validateAttributeString(u,e);if(!0!==l)return getErrorObject(l.err.code,l.err.msg,getLineNumberForPosition(t,r-u.length+l.err.line));if(!0===s)return getErrorObject("InvalidXml","Multiple possible root nodes found.",getLineNumberForPosition(t,r));-1!==e.unpairedTags.indexOf(a)||n.push({tagName:a,tagStartPos:o}),i=!0}for(r++;r<t.length;r++)if("<"===t[r]){if("!"===t[r+1]){r++,r=readCommentAndCDATA(t,r);continue}if("?"!==t[r+1])break;if(r=readPI(t,++r),r.err)return r}else if("&"===t[r]){const e=validateAmpersand(t,r);if(-1==e)return getErrorObject("InvalidChar","char '&' is not expected.",getLineNumberForPosition(t,r));r=e}else if(!0===s&&!isWhiteSpace(t[r]))return getErrorObject("InvalidXml","Extra text at the end",getLineNumberForPosition(t,r));"<"===t[r]&&r--}}}return i?1==n.length?getErrorObject("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",getLineNumberForPosition(t,n[0].tagStartPos)):!(n.length>0)||getErrorObject("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):getErrorObject("InvalidXml","Start tag expected.",1)};function isWhiteSpace(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function readPI(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return getErrorObject("InvalidXml","XML declaration allowed only at the start of the document.",getLineNumberForPosition(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function readCommentAndCDATA(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const doubleQuote='"',singleQuote="'";function readAttributeStr(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]===doubleQuote||t[e]===singleQuote)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const validAttrStrRegxp=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function validateAttributeString(t,e){const n=util.getAllMatches(t,validAttrStrRegxp),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return getErrorObject("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",getPositionFromMatch(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return getErrorObject("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",getPositionFromMatch(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return getErrorObject("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",getPositionFromMatch(n[t]));const s=n[t][2];if(!validateAttrName(s))return getErrorObject("InvalidAttr","Attribute '"+s+"' is an invalid name.",getPositionFromMatch(n[t]));if(i.hasOwnProperty(s))return getErrorObject("InvalidAttr","Attribute '"+s+"' is repeated.",getPositionFromMatch(n[t]));i[s]=1}return!0}function validateNumberAmpersand(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}function validateAmpersand(t,e){if(";"===t[++e])return-1;if("#"===t[e])return validateNumberAmpersand(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function getErrorObject(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function validateAttrName(t){return util.isName(t)}function validateTagName(t){return util.isName(t)}function getLineNumberForPosition(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function getPositionFromMatch(t){return t.startIndex+t[1].length}var validator={validate};const defaultOptions$1={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1},buildOptions$1=function(t){return Object.assign({},defaultOptions$1,t)};var buildOptions_1=buildOptions$1,defaultOptions_1=defaultOptions$1,OptionsBuilder={buildOptions:buildOptions_1,defaultOptions:defaultOptions_1};class XmlNode{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){this.child.push({[t]:e})}addChild(t){t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}var xmlNode=XmlNode;function readDocType(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o=!1,l="";for(;e<t.length;e++)if("<"===t[e]){if(s&&"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7])e+=7,r=!0;else if(s&&"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8])e+=8;else{if("!"!==t[e+1]||"-"!==t[e+2]||"-"!==t[e+3])throw new Error("Invalid DOCTYPE");o=!0}i++,l=""}else if(">"===t[e]){if(o){if("-"!==t[e-1]||"-"!==t[e-2])throw new Error("Invalid XML comment in DOCTYPE");o=!1}else r&&(parseEntityExp(l,n),r=!1);if(i--,0===i)break}else"["===t[e]?s=!0:l+=t[e];if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}const entityRegex=RegExp("^\\s([a-zA-z0-0]+)[ \t](['\"])([^&]+)\\2");function parseEntityExp(t,e){const n=entityRegex.exec(t);n&&(e[n[1]]={regx:RegExp(`&${n[1]};`,"g"),val:n[3]})}var DocTypeReader=readDocType;const hexRegex=/^[-+]?0x[a-fA-F0-9]+$/,numRegex=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const consider={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function toNumber(t,e={}){if(e=Object.assign({},consider,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(e.hex&&hexRegex.test(n))return Number.parseInt(n,16);{const i=numRegex.exec(n);if(i){const s=i[1],r=i[2];let o=trimZeros(i[3]);const l=i[4]||i[6];if(!e.leadingZeros&&r.length>0&&s&&"."!==n[2])return t;if(!e.leadingZeros&&r.length>0&&!s&&"."!==n[1])return t;{const i=Number(n),a=""+i;return-1!==a.search(/[eE]/)||l?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===a&&""===o||a===o||s&&a==="-"+o?i:t:r?o===a||s+o===a?i:t:n===a||n===s+a?i:t}}return t}}function trimZeros(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}var strnum=toNumber;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,util.nameRegexp);class OrderedObjParser{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={amp:{regex:/&(amp|#38|#x26);/g,val:"&"},apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=addExternalEntities,this.parseXml=parseXml,this.parseTextData=parseTextData,this.resolveNameSpace=resolveNameSpace,this.buildAttributesMap=buildAttributesMap,this.isItStopNode=isItStopNode,this.replaceEntitiesValue=replaceEntitiesValue$2,this.readStopNodeData=readStopNodeData,this.saveTextToParentTag=saveTextToParentTag}}function addExternalEntities(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function parseTextData(t,e,n,i,s,r,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return parseValue(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?parseValue(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function resolveNameSpace(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const attrsRegx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function buildAttributesMap(t,e){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=util.getAllMatches(t,attrsRegx),i=n.length,s={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);let r=n[t][4];const o=this.options.attributeNamePrefix+i;if(i.length)if(void 0!==r){this.options.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r);const t=this.options.attributeValueProcessor(i,r,e);s[o]=null==t?r:typeof t!=typeof r||t!==r?t:parseValue(r,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[o]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=s,t}return s}}const parseXml=function(t){t=t.replace(/\r\n?/g,"\n");const e=new xmlNode("!xml");let n=e,i="",s="";for(let r=0;r<t.length;r++){if("<"===t[r])if("/"===t[r+1]){const e=findClosingIndex(t,">",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}n&&(i=this.saveTextToParentTag(i,n,s)),s=s.substr(0,s.lastIndexOf(".")),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=readTagExp(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new xmlNode(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s)),n.addChild(t)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=findClosingIndex(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=DocTypeReader(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=findClosingIndex(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);if(i=this.saveTextToParentTag(i,n,s),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let t=this.parseTextData(o,n.tagname,s,!0,!1,!0);t||(t=""),n.add(this.options.textNodeName,t)}r=e+2}else{let o=readTagExp(t,r,this.options.removeNSPrefix),l=o.tagName,a=o.tagExp,h=o.attrExpPresent,u=o.closeIndex;n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1)),l!==e.tagname&&(s+=s?"."+l:l);const d=n;if(d&&-1!==this.options.unpairedTags.indexOf(d.tagname)&&(n=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,s,l)){let e="";if(a.length>0&&a.lastIndexOf("/")===a.length-1)r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new xmlNode(l);l!==a&&h&&(i[":@"]=this.buildAttributesMap(a,s)),e&&(e=this.parseTextData(e,l,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),n.addChild(i)}else{if(a.length>0&&a.lastIndexOf("/")===a.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),a=l):a=a.substr(0,a.length-1);const t=new xmlNode(l);l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s)),s=s.substr(0,s.lastIndexOf(".")),n.addChild(t)}else{const t=new xmlNode(l);this.tagsNodeStack.push(n),l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s)),n.addChild(t),n=t}i="",r=u}}else i+=t[r]}return e.child},replaceEntitiesValue$2=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}}return t};function saveTextToParentTag(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function isItStopNode(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function tagExpWithClosingIndex(t,e,n=">"){let i,s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}function findClosingIndex(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function readTagExp(t,e,n,i=">"){const s=tagExpWithClosingIndex(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,l=r.search(/\s/);let a=r,h=!0;if(-1!==l&&(a=r.substr(0,l).replace(/\s\s*$/,""),r=r.substr(l+1)),n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),h=a!==s.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:o,attrExpPresent:h}}function readStopNodeData(t,e,n){const i=n;for(;n<t.length;n++)if("<"===t[n]&&"/"===t[n+1]){const s=findClosingIndex(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e)return{tagContent:t.substring(i,n),i:s};n=s}}function parseValue(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&strnum(t,n)}return util.isExist(t)?t:""}var OrderedObjParser_1=OrderedObjParser;function prettify$1(t,e){return compress(t,e)}function compress(t,e,n){let i;const s={};for(let r=0;r<t.length;r++){const o=t[r],l=propName$1(o);let a="";if(a=void 0===n?l:n+"."+l,l===e.textNodeName)void 0===i?i=o[l]:i+=""+o[l];else{if(void 0===l)continue;if(o[l]){let t=compress(o[l],e,a);const n=isLeafTag(t,e);o[":@"]?assignAttributes(t,o[":@"],a,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[l]?(Array.isArray(s[l])||(s[l]=[s[l]]),s[l].push(t)):e.isArray(l,a,n)?s[l]=[t]:s[l]=t}}}return"string"==typeof i?i.length>0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function propName$1(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function assignAttributes(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];i.isArray(r,n+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function isLeafTag(t,e){const n=Object.keys(t).length;return!!(0===n||1===n&&t[e.textNodeName])}var prettify_1=prettify$1,node2json={prettify:prettify_1};const{buildOptions}=OptionsBuilder,{prettify}=node2json;class XMLParser{constructor(t){this.externalEntities={},this.options=buildOptions(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=validator.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new OrderedObjParser_1(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:prettify(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");this.externalEntities[t]=e}}var XMLParser_1=XMLParser;const EOL="\n";function toXml(t,e){return arrToStr(t,e,"",0)}function arrToStr(t,e,n,i){let s="",r="";e.format&&e.indentBy.length>0&&(r=EOL+""+e.indentBy.repeat(i));for(let o=0;o<t.length;o++){const l=t[o],a=propName(l);let h="";if(h=0===n.length?a:`${n}.${a}`,a===e.textNodeName){let t=l[a];isStopNode(h,e)||(t=e.tagValueProcessor(a,t),t=replaceEntitiesValue$1(t,e)),s+=r+t;continue}if(a===e.cdataPropName){s+=r+`<![CDATA[${l[a][0][e.textNodeName]}]]>`;continue}if(a===e.commentPropName){s+=r+`\x3c!--${l[a][0][e.textNodeName]}--\x3e`;continue}if("?"===a[0]){const t=attr_to_str(l[":@"],e);s+=r+`<${a} ${l[a][0][e.textNodeName]} ${t}?>`;continue}let u=r+`<${a}${attr_to_str(l[":@"],e)}`,d=arrToStr(l[a],e,h,i+1);-1!==e.unpairedTags.indexOf(a)?e.suppressUnpairedNode?s+=u+">":s+=u+"/>":d&&0!==d.length||!e.suppressEmptyNode?s+=u+`>${d}${r}</${a}>`:s+=u+"/>"}return s}function propName(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function attr_to_str(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){let s=e.attributeValueProcessor(i,t[i]);s=replaceEntitiesValue$1(s,e),!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function isStopNode(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function replaceEntitiesValue$1(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}var orderedJs2Xml=toXml;const defaultOptions={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:"  ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[]};function Builder(t){this.options=Object.assign({},defaultOptions,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=isAttribute),this.processTextOrObjNode=processTextOrObjNode,this.options.format?(this.indentate=indentate,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.suppressEmptyNode?(this.buildTextNode=buildEmptyTextNode,this.buildObjNode=buildEmptyObjNode):(this.buildTextNode=buildTextValNode,this.buildObjNode=buildObjectNode),this.buildTextValNode=buildTextValNode,this.buildObjectNode=buildObjectNode,this.replaceEntitiesValue=replaceEntitiesValue,this.buildAttrPairStr=buildAttrPairStr}function buildAttrPairStr(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'}function processTextOrObjNode(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjNode(i.val,e,i.attrStr,n)}function buildObjectNode(t,e,n,i){let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),n&&-1===t.indexOf("<")?this.indentate(i)+"<"+e+n+r+">"+t+s:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s}function buildEmptyObjNode(t,e,n,i){return""!==t?this.buildObjectNode(t,e,n,i):"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+"/"+this.tagEndChar}function buildTextValNode(t,e,n,i){let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s&&-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode?this.indentate(i)+"<"+e+this.tagEndChar:this.indentate(i)+"<"+e+"/"+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}function replaceEntitiesValue(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t}function buildEmptyTextNode(t,e,n,i){return""===t&&-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode?this.indentate(i)+"<"+e+this.tagEndChar:this.indentate(i)+"<"+e+"/"+this.tagEndChar:""!==t?this.buildTextValNode(t,e,n,i):"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+"/"+this.tagEndChar}function indentate(t){return this.options.indentBy.repeat(t)}function isAttribute(t){return!!t.startsWith(this.options.attributeNamePrefix)&&t.substr(this.attrPrefixLen)}Builder.prototype.build=function(t){return this.options.preserveOrder?orderedJs2Xml(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},Builder.prototype.j2x=function(t,e){let n="",i="";for(let s in t)if(void 0===t[s]);else if(null===t[s])"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextNode(t[s],s,"",e);else if("object"!=typeof t[s]){const r=this.isAttribute(s);if(r)n+=this.buildAttrPairStr(r,""+t[s]);else if(s===this.options.textNodeName){let e=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const n=t[s].length;for(let r=0;r<n;r++){const n=t[s][r];void 0===n||(null===n?"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar:i+="object"==typeof n?this.processTextOrObjNode(n,s,e):this.buildTextNode(n,s,"",e))}}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const e=Object.keys(t[s]),i=e.length;for(let r=0;r<i;r++)n+=this.buildAttrPairStr(e[r],""+t[s][e[r]])}else i+=this.processTextOrObjNode(t[s],s,e);return{attrStr:n,val:i}};var json2xml=Builder,fxp={XMLParser:XMLParser_1,XMLValidator:validator,XMLBuilder:json2xml},fxp_1=fxp.XMLParser,decodeDataHtml=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=new Uint16Array([14866,60,237,340,721,1312,1562,1654,1838,1957,2183,2239,2301,2958,3037,3893,4123,4298,4330,4801,5191,5395,5752,5903,5943,5972,6050,0,0,0,0,0,0,6135,6565,7422,8183,8738,9242,9503,9938,10189,10573,10637,10715,11950,12246,13539,13950,14445,14533,15364,16514,16980,17390,17763,17849,18036,18125,4096,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,92,100,106,115,122,137,142,151,157,163,167,182,196,204,220,229,108,105,103,33024,198,59,32768,198,80,33024,38,59,32768,38,99,117,116,101,33024,193,59,32768,193,114,101,118,101,59,32768,258,512,105,121,127,134,114,99,33024,194,59,32768,194,59,32768,1040,114,59,32896,55349,56580,114,97,118,101,33024,192,59,32768,192,112,104,97,59,32768,913,97,99,114,59,32768,256,100,59,32768,10835,512,103,112,172,177,111,110,59,32768,260,102,59,32896,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,32768,8289,105,110,103,33024,197,59,32768,197,512,99,115,209,214,114,59,32896,55349,56476,105,103,110,59,32768,8788,105,108,100,101,33024,195,59,32768,195,109,108,33024,196,59,32768,196,2048,97,99,101,102,111,114,115,117,253,278,282,310,315,321,327,332,512,99,114,258,267,107,115,108,97,115,104,59,32768,8726,583,271,274,59,32768,10983,101,100,59,32768,8966,121,59,32768,1041,768,99,114,116,289,296,306,97,117,115,101,59,32768,8757,110,111,117,108,108,105,115,59,32768,8492,97,59,32768,914,114,59,32896,55349,56581,112,102,59,32896,55349,56633,101,118,101,59,32768,728,99,114,59,32768,8492,109,112,101,113,59,32768,8782,3584,72,79,97,99,100,101,102,104,105,108,111,114,115,117,368,373,380,426,461,466,487,491,495,533,593,695,701,707,99,121,59,32768,1063,80,89,33024,169,59,32768,169,768,99,112,121,387,393,419,117,116,101,59,32768,262,512,59,105,398,400,32768,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,32768,8517,108,101,121,115,59,32768,8493,1024,97,101,105,111,435,441,449,454,114,111,110,59,32768,268,100,105,108,33024,199,59,32768,199,114,99,59,32768,264,110,105,110,116,59,32768,8752,111,116,59,32768,266,512,100,110,471,478,105,108,108,97,59,32768,184,116,101,114,68,111,116,59,32768,183,114,59,32768,8493,105,59,32768,935,114,99,108,101,1024,68,77,80,84,508,513,520,526,111,116,59,32768,8857,105,110,117,115,59,32768,8854,108,117,115,59,32768,8853,105,109,101,115,59,32768,8855,111,512,99,115,539,562,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,32768,8754,101,67,117,114,108,121,512,68,81,573,586,111,117,98,108,101,81,117,111,116,101,59,32768,8221,117,111,116,101,59,32768,8217,1024,108,110,112,117,602,614,648,664,111,110,512,59,101,609,611,32768,8759,59,32768,10868,768,103,105,116,621,629,634,114,117,101,110,116,59,32768,8801,110,116,59,32768,8751,111,117,114,73,110,116,101,103,114,97,108,59,32768,8750,512,102,114,653,656,59,32768,8450,111,100,117,99,116,59,32768,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,32768,8755,111,115,115,59,32768,10799,99,114,59,32896,55349,56478,112,512,59,67,713,715,32768,8915,97,112,59,32768,8781,2816,68,74,83,90,97,99,101,102,105,111,115,743,758,763,768,773,795,809,821,826,910,1295,512,59,111,748,750,32768,8517,116,114,97,104,100,59,32768,10513,99,121,59,32768,1026,99,121,59,32768,1029,99,121,59,32768,1039,768,103,114,115,780,786,790,103,101,114,59,32768,8225,114,59,32768,8609,104,118,59,32768,10980,512,97,121,800,806,114,111,110,59,32768,270,59,32768,1044,108,512,59,116,815,817,32768,8711,97,59,32768,916,114,59,32896,55349,56583,512,97,102,831,897,512,99,109,836,891,114,105,116,105,99,97,108,1024,65,68,71,84,852,859,877,884,99,117,116,101,59,32768,180,111,581,864,867,59,32768,729,98,108,101,65,99,117,116,101,59,32768,733,114,97,118,101,59,32768,96,105,108,100,101,59,32768,732,111,110,100,59,32768,8900,102,101,114,101,110,116,105,97,108,68,59,32768,8518,2113,920,0,0,0,925,946,0,1139,102,59,32896,55349,56635,768,59,68,69,931,933,938,32768,168,111,116,59,32768,8412,113,117,97,108,59,32768,8784,98,108,101,1536,67,68,76,82,85,86,961,978,996,1080,1101,1125,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,32768,8751,111,1093,985,0,0,988,59,32768,168,110,65,114,114,111,119,59,32768,8659,512,101,111,1001,1034,102,116,768,65,82,84,1010,1017,1029,114,114,111,119,59,32768,8656,105,103,104,116,65,114,114,111,119,59,32768,8660,101,101,59,32768,10980,110,103,512,76,82,1041,1068,101,102,116,512,65,82,1049,1056,114,114,111,119,59,32768,10232,105,103,104,116,65,114,114,111,119,59,32768,10234,105,103,104,116,65,114,114,111,119,59,32768,10233,105,103,104,116,512,65,84,1089,1096,114,114,111,119,59,32768,8658,101,101,59,32768,8872,112,1042,1108,0,0,1115,114,114,111,119,59,32768,8657,111,119,110,65,114,114,111,119,59,32768,8661,101,114,116,105,99,97,108,66,97,114,59,32768,8741,110,1536,65,66,76,82,84,97,1152,1179,1186,1236,1272,1288,114,114,111,119,768,59,66,85,1163,1165,1170,32768,8595,97,114,59,32768,10515,112,65,114,114,111,119,59,32768,8693,114,101,118,101,59,32768,785,101,102,116,1315,1196,0,1209,0,1220,105,103,104,116,86,101,99,116,111,114,59,32768,10576,101,101,86,101,99,116,111,114,59,32768,10590,101,99,116,111,114,512,59,66,1229,1231,32768,8637,97,114,59,32768,10582,105,103,104,116,805,1245,0,1256,101,101,86,101,99,116,111,114,59,32768,10591,101,99,116,111,114,512,59,66,1265,1267,32768,8641,97,114,59,32768,10583,101,101,512,59,65,1279,1281,32768,8868,114,114,111,119,59,32768,8615,114,114,111,119,59,32768,8659,512,99,116,1300,1305,114,59,32896,55349,56479,114,111,107,59,32768,272,4096,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1344,1348,1354,1363,1386,1391,1396,1405,1413,1460,1475,1483,1514,1527,1531,1538,71,59,32768,330,72,33024,208,59,32768,208,99,117,116,101,33024,201,59,32768,201,768,97,105,121,1370,1376,1383,114,111,110,59,32768,282,114,99,33024,202,59,32768,202,59,32768,1069,111,116,59,32768,278,114,59,32896,55349,56584,114,97,118,101,33024,200,59,32768,200,101,109,101,110,116,59,32768,8712,512,97,112,1418,1423,99,114,59,32768,274,116,121,1060,1431,0,0,1444,109,97,108,108,83,113,117,97,114,101,59,32768,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,32768,9643,512,103,112,1465,1470,111,110,59,32768,280,102,59,32896,55349,56636,115,105,108,111,110,59,32768,917,117,512,97,105,1489,1504,108,512,59,84,1495,1497,32768,10869,105,108,100,101,59,32768,8770,108,105,98,114,105,117,109,59,32768,8652,512,99,105,1519,1523,114,59,32768,8496,109,59,32768,10867,97,59,32768,919,109,108,33024,203,59,32768,203,512,105,112,1543,1549,115,116,115,59,32768,8707,111,110,101,110,116,105,97,108,69,59,32768,8519,1280,99,102,105,111,115,1572,1576,1581,1620,1648,121,59,32768,1060,114,59,32896,55349,56585,108,108,101,100,1060,1591,0,0,1604,109,97,108,108,83,113,117,97,114,101,59,32768,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,32768,9642,1601,1628,0,1633,0,0,1639,102,59,32896,55349,56637,65,108,108,59,32768,8704,114,105,101,114,116,114,102,59,32768,8497,99,114,59,32768,8497,3072,74,84,97,98,99,100,102,103,111,114,115,116,1678,1683,1688,1701,1708,1729,1734,1739,1742,1748,1828,1834,99,121,59,32768,1027,33024,62,59,32768,62,109,109,97,512,59,100,1696,1698,32768,915,59,32768,988,114,101,118,101,59,32768,286,768,101,105,121,1715,1721,1726,100,105,108,59,32768,290,114,99,59,32768,284,59,32768,1043,111,116,59,32768,288,114,59,32896,55349,56586,59,32768,8921,112,102,59,32896,55349,56638,101,97,116,101,114,1536,69,70,71,76,83,84,1766,1783,1794,1803,1809,1821,113,117,97,108,512,59,76,1775,1777,32768,8805,101,115,115,59,32768,8923,117,108,108,69,113,117,97,108,59,32768,8807,114,101,97,116,101,114,59,32768,10914,101,115,115,59,32768,8823,108,97,110,116,69,113,117,97,108,59,32768,10878,105,108,100,101,59,32768,8819,99,114,59,32896,55349,56482,59,32768,8811,2048,65,97,99,102,105,111,115,117,1854,1861,1874,1880,1884,1897,1919,1934,82,68,99,121,59,32768,1066,512,99,116,1866,1871,101,107,59,32768,711,59,32768,94,105,114,99,59,32768,292,114,59,32768,8460,108,98,101,114,116,83,112,97,99,101,59,32768,8459,833,1902,0,1906,102,59,32768,8461,105,122,111,110,116,97,108,76,105,110,101,59,32768,9472,512,99,116,1924,1928,114,59,32768,8459,114,111,107,59,32768,294,109,112,533,1940,1950,111,119,110,72,117,109,112,59,32768,8782,113,117,97,108,59,32768,8783,3584,69,74,79,97,99,100,102,103,109,110,111,115,116,117,1985,1990,1996,2001,2010,2025,2030,2034,2043,2077,2134,2155,2160,2167,99,121,59,32768,1045,108,105,103,59,32768,306,99,121,59,32768,1025,99,117,116,101,33024,205,59,32768,205,512,105,121,2015,2022,114,99,33024,206,59,32768,206,59,32768,1048,111,116,59,32768,304,114,59,32768,8465,114,97,118,101,33024,204,59,32768,204,768,59,97,112,2050,2052,2070,32768,8465,512,99,103,2057,2061,114,59,32768,298,105,110,97,114,121,73,59,32768,8520,108,105,101,115,59,32768,8658,837,2082,0,2110,512,59,101,2086,2088,32768,8748,512,103,114,2093,2099,114,97,108,59,32768,8747,115,101,99,116,105,111,110,59,32768,8898,105,115,105,98,108,101,512,67,84,2120,2127,111,109,109,97,59,32768,8291,105,109,101,115,59,32768,8290,768,103,112,116,2141,2146,2151,111,110,59,32768,302,102,59,32896,55349,56640,97,59,32768,921,99,114,59,32768,8464,105,108,100,101,59,32768,296,828,2172,0,2177,99,121,59,32768,1030,108,33024,207,59,32768,207,1280,99,102,111,115,117,2193,2206,2211,2217,2232,512,105,121,2198,2203,114,99,59,32768,308,59,32768,1049,114,59,32896,55349,56589,112,102,59,32896,55349,56641,820,2222,0,2227,114,59,32896,55349,56485,114,99,121,59,32768,1032,107,99,121,59,32768,1028,1792,72,74,97,99,102,111,115,2253,2258,2263,2269,2283,2288,2294,99,121,59,32768,1061,99,121,59,32768,1036,112,112,97,59,32768,922,512,101,121,2274,2280,100,105,108,59,32768,310,59,32768,1050,114,59,32896,55349,56590,112,102,59,32896,55349,56642,99,114,59,32896,55349,56486,2816,74,84,97,99,101,102,108,109,111,115,116,2323,2328,2333,2374,2396,2775,2780,2797,2804,2934,2954,99,121,59,32768,1033,33024,60,59,32768,60,1280,99,109,110,112,114,2344,2350,2356,2360,2370,117,116,101,59,32768,313,98,100,97,59,32768,923,103,59,32768,10218,108,97,99,101,116,114,102,59,32768,8466,114,59,32768,8606,768,97,101,121,2381,2387,2393,114,111,110,59,32768,317,100,105,108,59,32768,315,59,32768,1051,512,102,115,2401,2702,116,2560,65,67,68,70,82,84,85,86,97,114,2423,2470,2479,2530,2537,2561,2618,2666,2683,2690,512,110,114,2428,2441,103,108,101,66,114,97,99,107,101,116,59,32768,10216,114,111,119,768,59,66,82,2451,2453,2458,32768,8592,97,114,59,32768,8676,105,103,104,116,65,114,114,111,119,59,32768,8646,101,105,108,105,110,103,59,32768,8968,111,838,2485,0,2498,98,108,101,66,114,97,99,107,101,116,59,32768,10214,110,805,2503,0,2514,101,101,86,101,99,116,111,114,59,32768,10593,101,99,116,111,114,512,59,66,2523,2525,32768,8643,97,114,59,32768,10585,108,111,111,114,59,32768,8970,105,103,104,116,512,65,86,2546,2553,114,114,111,119,59,32768,8596,101,99,116,111,114,59,32768,10574,512,101,114,2566,2591,101,768,59,65,86,2574,2576,2583,32768,8867,114,114,111,119,59,32768,8612,101,99,116,111,114,59,32768,10586,105,97,110,103,108,101,768,59,66,69,2604,2606,2611,32768,8882,97,114,59,32768,10703,113,117,97,108,59,32768,8884,112,768,68,84,86,2626,2638,2649,111,119,110,86,101,99,116,111,114,59,32768,10577,101,101,86,101,99,116,111,114,59,32768,10592,101,99,116,111,114,512,59,66,2659,2661,32768,8639,97,114,59,32768,10584,101,99,116,111,114,512,59,66,2676,2678,32768,8636,97,114,59,32768,10578,114,114,111,119,59,32768,8656,105,103,104,116,97,114,114,111,119,59,32768,8660,115,1536,69,70,71,76,83,84,2716,2730,2741,2750,2756,2768,113,117,97,108,71,114,101,97,116,101,114,59,32768,8922,117,108,108,69,113,117,97,108,59,32768,8806,114,101,97,116,101,114,59,32768,8822,101,115,115,59,32768,10913,108,97,110,116,69,113,117,97,108,59,32768,10877,105,108,100,101,59,32768,8818,114,59,32896,55349,56591,512,59,101,2785,2787,32768,8920,102,116,97,114,114,111,119,59,32768,8666,105,100,111,116,59,32768,319,768,110,112,119,2811,2899,2904,103,1024,76,82,108,114,2821,2848,2860,2887,101,102,116,512,65,82,2829,2836,114,114,111,119,59,32768,10229,105,103,104,116,65,114,114,111,119,59,32768,10231,105,103,104,116,65,114,114,111,119,59,32768,10230,101,102,116,512,97,114,2868,2875,114,114,111,119,59,32768,10232,105,103,104,116,97,114,114,111,119,59,32768,10234,105,103,104,116,97,114,114,111,119,59,32768,10233,102,59,32896,55349,56643,101,114,512,76,82,2911,2922,101,102,116,65,114,114,111,119,59,32768,8601,105,103,104,116,65,114,114,111,119,59,32768,8600,768,99,104,116,2941,2945,2948,114,59,32768,8466,59,32768,8624,114,111,107,59,32768,321,59,32768,8810,2048,97,99,101,102,105,111,115,117,2974,2978,2982,3007,3012,3022,3028,3033,112,59,32768,10501,121,59,32768,1052,512,100,108,2987,2998,105,117,109,83,112,97,99,101,59,32768,8287,108,105,110,116,114,102,59,32768,8499,114,59,32896,55349,56592,110,117,115,80,108,117,115,59,32768,8723,112,102,59,32896,55349,56644,99,114,59,32768,8499,59,32768,924,2304,74,97,99,101,102,111,115,116,117,3055,3060,3067,3089,3201,3206,3874,3880,3889,99,121,59,32768,1034,99,117,116,101,59,32768,323,768,97,101,121,3074,3080,3086,114,111,110,59,32768,327,100,105,108,59,32768,325,59,32768,1053,768,103,115,119,3096,3160,3194,97,116,105,118,101,768,77,84,86,3108,3121,3145,101,100,105,117,109,83,112,97,99,101,59,32768,8203,104,105,512,99,110,3128,3137,107,83,112,97,99,101,59,32768,8203,83,112,97,99,101,59,32768,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,32768,8203,116,101,100,512,71,76,3168,3184,114,101,97,116,101,114,71,114,101,97,116,101,114,59,32768,8811,101,115,115,76,101,115,115,59,32768,8810,76,105,110,101,59,32768,10,114,59,32896,55349,56593,1024,66,110,112,116,3215,3222,3238,3242,114,101,97,107,59,32768,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,32768,160,102,59,32768,8469,3328,59,67,68,69,71,72,76,78,80,82,83,84,86,3269,3271,3293,3312,3352,3430,3455,3551,3589,3625,3678,3821,3861,32768,10988,512,111,117,3276,3286,110,103,114,117,101,110,116,59,32768,8802,112,67,97,112,59,32768,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,32768,8742,768,108,113,120,3319,3327,3345,101,109,101,110,116,59,32768,8713,117,97,108,512,59,84,3335,3337,32768,8800,105,108,100,101,59,32896,8770,824,105,115,116,115,59,32768,8708,114,101,97,116,101,114,1792,59,69,70,71,76,83,84,3373,3375,3382,3394,3404,3410,3423,32768,8815,113,117,97,108,59,32768,8817,117,108,108,69,113,117,97,108,59,32896,8807,824,114,101,97,116,101,114,59,32896,8811,824,101,115,115,59,32768,8825,108,97,110,116,69,113,117,97,108,59,32896,10878,824,105,108,100,101,59,32768,8821,117,109,112,533,3437,3448,111,119,110,72,117,109,112,59,32896,8782,824,113,117,97,108,59,32896,8783,824,101,512,102,115,3461,3492,116,84,114,105,97,110,103,108,101,768,59,66,69,3477,3479,3485,32768,8938,97,114,59,32896,10703,824,113,117,97,108,59,32768,8940,115,1536,59,69,71,76,83,84,3506,3508,3515,3524,3531,3544,32768,8814,113,117,97,108,59,32768,8816,114,101,97,116,101,114,59,32768,8824,101,115,115,59,32896,8810,824,108,97,110,116,69,113,117,97,108,59,32896,10877,824,105,108,100,101,59,32768,8820,101,115,116,101,100,512,71,76,3561,3578,114,101,97,116,101,114,71,114,101,97,116,101,114,59,32896,10914,824,101,115,115,76,101,115,115,59,32896,10913,824,114,101,99,101,100,101,115,768,59,69,83,3603,3605,3613,32768,8832,113,117,97,108,59,32896,10927,824,108,97,110,116,69,113,117,97,108,59,32768,8928,512,101,105,3630,3645,118,101,114,115,101,69,108,101,109,101,110,116,59,32768,8716,103,104,116,84,114,105,97,110,103,108,101,768,59,66,69,3663,3665,3671,32768,8939,97,114,59,32896,10704,824,113,117,97,108,59,32768,8941,512,113,117,3683,3732,117,97,114,101,83,117,512,98,112,3694,3712,115,101,116,512,59,69,3702,3705,32896,8847,824,113,117,97,108,59,32768,8930,101,114,115,101,116,512,59,69,3722,3725,32896,8848,824,113,117,97,108,59,32768,8931,768,98,99,112,3739,3757,3801,115,101,116,512,59,69,3747,3750,32896,8834,8402,113,117,97,108,59,32768,8840,99,101,101,100,115,1024,59,69,83,84,3771,3773,3781,3793,32768,8833,113,117,97,108,59,32896,10928,824,108,97,110,116,69,113,117,97,108,59,32768,8929,105,108,100,101,59,32896,8831,824,101,114,115,101,116,512,59,69,3811,3814,32896,8835,8402,113,117,97,108,59,32768,8841,105,108,100,101,1024,59,69,70,84,3834,3836,3843,3854,32768,8769,113,117,97,108,59,32768,8772,117,108,108,69,113,117,97,108,59,32768,8775,105,108,100,101,59,32768,8777,101,114,116,105,99,97,108,66,97,114,59,32768,8740,99,114,59,32896,55349,56489,105,108,100,101,33024,209,59,32768,209,59,32768,925,3584,69,97,99,100,102,103,109,111,112,114,115,116,117,118,3921,3927,3936,3951,3958,3963,3972,3996,4002,4034,4037,4055,4071,4078,108,105,103,59,32768,338,99,117,116,101,33024,211,59,32768,211,512,105,121,3941,3948,114,99,33024,212,59,32768,212,59,32768,1054,98,108,97,99,59,32768,336,114,59,32896,55349,56594,114,97,118,101,33024,210,59,32768,210,768,97,101,105,3979,3984,3989,99,114,59,32768,332,103,97,59,32768,937,99,114,111,110,59,32768,927,112,102,59,32896,55349,56646,101,110,67,117,114,108,121,512,68,81,4014,4027,111,117,98,108,101,81,117,111,116,101,59,32768,8220,117,111,116,101,59,32768,8216,59,32768,10836,512,99,108,4042,4047,114,59,32896,55349,56490,97,115,104,33024,216,59,32768,216,105,573,4060,4067,100,101,33024,213,59,32768,213,101,115,59,32768,10807,109,108,33024,214,59,32768,214,101,114,512,66,80,4085,4109,512,97,114,4090,4094,114,59,32768,8254,97,99,512,101,107,4101,4104,59,32768,9182,101,116,59,32768,9140,97,114,101,110,116,104,101,115,105,115,59,32768,9180,2304,97,99,102,104,105,108,111,114,115,4141,4150,4154,4159,4163,4166,4176,4198,4284,114,116,105,97,108,68,59,32768,8706,121,59,32768,1055,114,59,32896,55349,56595,105,59,32768,934,59,32768,928,117,115,77,105,110,117,115,59,32768,177,512,105,112,4181,4194,110,99,97,114,101,112,108,97,110,101,59,32768,8460,102,59,32768,8473,1024,59,101,105,111,4207,4209,4251,4256,32768,10939,99,101,100,101,115,1024,59,69,83,84,4223,4225,4232,4244,32768,8826,113,117,97,108,59,32768,10927,108,97,110,116,69,113,117,97,108,59,32768,8828,105,108,100,101,59,32768,8830,109,101,59,32768,8243,512,100,112,4261,4267,117,99,116,59,32768,8719,111,114,116,105,111,110,512,59,97,4278,4280,32768,8759,108,59,32768,8733,512,99,105,4289,4294,114,59,32896,55349,56491,59,32768,936,1024,85,102,111,115,4306,4313,4318,4323,79,84,33024,34,59,32768,34,114,59,32896,55349,56596,112,102,59,32768,8474,99,114,59,32896,55349,56492,3072,66,69,97,99,101,102,104,105,111,114,115,117,4354,4360,4366,4395,4417,4473,4477,4481,4743,4764,4776,4788,97,114,114,59,32768,10512,71,33024,174,59,32768,174,768,99,110,114,4373,4379,4383,117,116,101,59,32768,340,103,59,32768,10219,114,512,59,116,4389,4391,32768,8608,108,59,32768,10518,768,97,101,121,4402,4408,4414,114,111,110,59,32768,344,100,105,108,59,32768,342,59,32768,1056,512,59,118,4422,4424,32768,8476,101,114,115,101,512,69,85,4433,4458,512,108,113,4438,4446,101,109,101,110,116,59,32768,8715,117,105,108,105,98,114,105,117,109,59,32768,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,32768,10607,114,59,32768,8476,111,59,32768,929,103,104,116,2048,65,67,68,70,84,85,86,97,4501,4547,4556,4607,4614,4671,4719,4736,512,110,114,4506,4519,103,108,101,66,114,97,99,107,101,116,59,32768,10217,114,111,119,768,59,66,76,4529,4531,4536,32768,8594,97,114,59,32768,8677,101,102,116,65,114,114,111,119,59,32768,8644,101,105,108,105,110,103,59,32768,8969,111,838,4562,0,4575,98,108,101,66,114,97,99,107,101,116,59,32768,10215,110,805,4580,0,4591,101,101,86,101,99,116,111,114,59,32768,10589,101,99,116,111,114,512,59,66,4600,4602,32768,8642,97,114,59,32768,10581,108,111,111,114,59,32768,8971,512,101,114,4619,4644,101,768,59,65,86,4627,4629,4636,32768,8866,114,114,111,119,59,32768,8614,101,99,116,111,114,59,32768,10587,105,97,110,103,108,101,768,59,66,69,4657,4659,4664,32768,8883,97,114,59,32768,10704,113,117,97,108,59,32768,8885,112,768,68,84,86,4679,4691,4702,111,119,110,86,101,99,116,111,114,59,32768,10575,101,101,86,101,99,116,111,114,59,32768,10588,101,99,116,111,114,512,59,66,4712,4714,32768,8638,97,114,59,32768,10580,101,99,116,111,114,512,59,66,4729,4731,32768,8640,97,114,59,32768,10579,114,114,111,119,59,32768,8658,512,112,117,4748,4752,102,59,32768,8477,110,100,73,109,112,108,105,101,115,59,32768,10608,105,103,104,116,97,114,114,111,119,59,32768,8667,512,99,104,4781,4785,114,59,32768,8475,59,32768,8625,108,101,68,101,108,97,121,101,100,59,32768,10740,3328,72,79,97,99,102,104,105,109,111,113,115,116,117,4827,4842,4849,4856,4889,4894,4949,4955,4967,4973,5059,5065,5070,512,67,99,4832,4838,72,99,121,59,32768,1065,121,59,32768,1064,70,84,99,121,59,32768,1068,99,117,116,101,59,32768,346,1280,59,97,101,105,121,4867,4869,4875,4881,4886,32768,10940,114,111,110,59,32768,352,100,105,108,59,32768,350,114,99,59,32768,348,59,32768,1057,114,59,32896,55349,56598,111,114,116,1024,68,76,82,85,4906,4917,4928,4940,111,119,110,65,114,114,111,119,59,32768,8595,101,102,116,65,114,114,111,119,59,32768,8592,105,103,104,116,65,114,114,111,119,59,32768,8594,112,65,114,114,111,119,59,32768,8593,103,109,97,59,32768,931,97,108,108,67,105,114,99,108,101,59,32768,8728,112,102,59,32896,55349,56650,1091,4979,0,0,4983,116,59,32768,8730,97,114,101,1024,59,73,83,85,4994,4996,5010,5052,32768,9633,110,116,101,114,115,101,99,116,105,111,110,59,32768,8851,117,512,98,112,5016,5033,115,101,116,512,59,69,5024,5026,32768,8847,113,117,97,108,59,32768,8849,101,114,115,101,116,512,59,69,5043,5045,32768,8848,113,117,97,108,59,32768,8850,110,105,111,110,59,32768,8852,99,114,59,32896,55349,56494,97,114,59,32768,8902,1024,98,99,109,112,5079,5102,5155,5158,512,59,115,5084,5086,32768,8912,101,116,512,59,69,5093,5095,32768,8912,113,117,97,108,59,32768,8838,512,99,104,5107,5148,101,101,100,115,1024,59,69,83,84,5120,5122,5129,5141,32768,8827,113,117,97,108,59,32768,10928,108,97,110,116,69,113,117,97,108,59,32768,8829,105,108,100,101,59,32768,8831,84,104,97,116,59,32768,8715,59,32768,8721,768,59,101,115,5165,5167,5185,32768,8913,114,115,101,116,512,59,69,5176,5178,32768,8835,113,117,97,108,59,32768,8839,101,116,59,32768,8913,2816,72,82,83,97,99,102,104,105,111,114,115,5213,5221,5227,5241,5252,5274,5279,5323,5362,5368,5378,79,82,78,33024,222,59,32768,222,65,68,69,59,32768,8482,512,72,99,5232,5237,99,121,59,32768,1035,121,59,32768,1062,512,98,117,5246,5249,59,32768,9,59,32768,932,768,97,101,121,5259,5265,5271,114,111,110,59,32768,356,100,105,108,59,32768,354,59,32768,1058,114,59,32896,55349,56599,512,101,105,5284,5300,835,5289,0,5297,101,102,111,114,101,59,32768,8756,97,59,32768,920,512,99,110,5305,5315,107,83,112,97,99,101,59,32896,8287,8202,83,112,97,99,101,59,32768,8201,108,100,101,1024,59,69,70,84,5335,5337,5344,5355,32768,8764,113,117,97,108,59,32768,8771,117,108,108,69,113,117,97,108,59,32768,8773,105,108,100,101,59,32768,8776,112,102,59,32896,55349,56651,105,112,108,101,68,111,116,59,32768,8411,512,99,116,5383,5388,114,59,32896,55349,56495,114,111,107,59,32768,358,5426,5417,5444,5458,5473,0,5480,5485,0,0,0,0,0,5494,5500,5564,5579,0,5726,5732,5738,5745,512,99,114,5421,5429,117,116,101,33024,218,59,32768,218,114,512,59,111,5435,5437,32768,8607,99,105,114,59,32768,10569,114,820,5449,0,5453,121,59,32768,1038,118,101,59,32768,364,512,105,121,5462,5469,114,99,33024,219,59,32768,219,59,32768,1059,98,108,97,99,59,32768,368,114,59,32896,55349,56600,114,97,118,101,33024,217,59,32768,217,97,99,114,59,32768,362,512,100,105,5504,5548,101,114,512,66,80,5511,5535,512,97,114,5516,5520,114,59,32768,95,97,99,512,101,107,5527,5530,59,32768,9183,101,116,59,32768,9141,97,114,101,110,116,104,101,115,105,115,59,32768,9181,111,110,512,59,80,5555,5557,32768,8899,108,117,115,59,32768,8846,512,103,112,5568,5573,111,110,59,32768,370,102,59,32896,55349,56652,2048,65,68,69,84,97,100,112,115,5595,5624,5635,5648,5664,5671,5682,5712,114,114,111,119,768,59,66,68,5606,5608,5613,32768,8593,97,114,59,32768,10514,111,119,110,65,114,114,111,119,59,32768,8645,111,119,110,65,114,114,111,119,59,32768,8597,113,117,105,108,105,98,114,105,117,109,59,32768,10606,101,101,512,59,65,5655,5657,32768,8869,114,114,111,119,59,32768,8613,114,114,111,119,59,32768,8657,111,119,110,97,114,114,111,119,59,32768,8661,101,114,512,76,82,5689,5700,101,102,116,65,114,114,111,119,59,32768,8598,105,103,104,116,65,114,114,111,119,59,32768,8599,105,512,59,108,5718,5720,32768,978,111,110,59,32768,933,105,110,103,59,32768,366,99,114,59,32896,55349,56496,105,108,100,101,59,32768,360,109,108,33024,220,59,32768,220,2304,68,98,99,100,101,102,111,115,118,5770,5776,5781,5785,5798,5878,5883,5889,5895,97,115,104,59,32768,8875,97,114,59,32768,10987,121,59,32768,1042,97,115,104,512,59,108,5793,5795,32768,8873,59,32768,10982,512,101,114,5803,5806,59,32768,8897,768,98,116,121,5813,5818,5866,97,114,59,32768,8214,512,59,105,5823,5825,32768,8214,99,97,108,1024,66,76,83,84,5837,5842,5848,5859,97,114,59,32768,8739,105,110,101,59,32768,124,101,112,97,114,97,116,111,114,59,32768,10072,105,108,100,101,59,32768,8768,84,104,105,110,83,112,97,99,101,59,32768,8202,114,59,32896,55349,56601,112,102,59,32896,55349,56653,99,114,59,32896,55349,56497,100,97,115,104,59,32768,8874,1280,99,101,102,111,115,5913,5919,5925,5930,5936,105,114,99,59,32768,372,100,103,101,59,32768,8896,114,59,32896,55349,56602,112,102,59,32896,55349,56654,99,114,59,32896,55349,56498,1024,102,105,111,115,5951,5956,5959,5965,114,59,32896,55349,56603,59,32768,926,112,102,59,32896,55349,56655,99,114,59,32896,55349,56499,2304,65,73,85,97,99,102,111,115,117,5990,5995,6e3,6005,6014,6027,6032,6038,6044,99,121,59,32768,1071,99,121,59,32768,1031,99,121,59,32768,1070,99,117,116,101,33024,221,59,32768,221,512,105,121,6019,6024,114,99,59,32768,374,59,32768,1067,114,59,32896,55349,56604,112,102,59,32896,55349,56656,99,114,59,32896,55349,56500,109,108,59,32768,376,2048,72,97,99,100,101,102,111,115,6066,6071,6078,6092,6097,6119,6123,6128,99,121,59,32768,1046,99,117,116,101,59,32768,377,512,97,121,6083,6089,114,111,110,59,32768,381,59,32768,1047,111,116,59,32768,379,835,6102,0,6116,111,87,105,100,116,104,83,112,97,99,101,59,32768,8203,97,59,32768,918,114,59,32768,8488,112,102,59,32768,8484,99,114,59,32896,55349,56501,5938,6159,6168,6175,0,6214,6222,6233,0,0,0,0,6242,6267,6290,6429,6444,0,6495,6503,6531,6540,0,6547,99,117,116,101,33024,225,59,32768,225,114,101,118,101,59,32768,259,1536,59,69,100,105,117,121,6187,6189,6193,6196,6203,6210,32768,8766,59,32896,8766,819,59,32768,8767,114,99,33024,226,59,32768,226,116,101,33024,180,59,32768,180,59,32768,1072,108,105,103,33024,230,59,32768,230,512,59,114,6226,6228,32768,8289,59,32896,55349,56606,114,97,118,101,33024,224,59,32768,224,512,101,112,6246,6261,512,102,112,6251,6257,115,121,109,59,32768,8501,104,59,32768,8501,104,97,59,32768,945,512,97,112,6271,6284,512,99,108,6276,6280,114,59,32768,257,103,59,32768,10815,33024,38,59,32768,38,1077,6295,0,0,6326,1280,59,97,100,115,118,6305,6307,6312,6315,6322,32768,8743,110,100,59,32768,10837,59,32768,10844,108,111,112,101,59,32768,10840,59,32768,10842,1792,59,101,108,109,114,115,122,6340,6342,6345,6349,6391,6410,6422,32768,8736,59,32768,10660,101,59,32768,8736,115,100,512,59,97,6356,6358,32768,8737,2098,6368,6371,6374,6377,6380,6383,6386,6389,59,32768,10664,59,32768,10665,59,32768,10666,59,32768,10667,59,32768,10668,59,32768,10669,59,32768,10670,59,32768,10671,116,512,59,118,6397,6399,32768,8735,98,512,59,100,6405,6407,32768,8894,59,32768,10653,512,112,116,6415,6419,104,59,32768,8738,59,32768,197,97,114,114,59,32768,9084,512,103,112,6433,6438,111,110,59,32768,261,102,59,32896,55349,56658,1792,59,69,97,101,105,111,112,6458,6460,6463,6469,6472,6476,6480,32768,8776,59,32768,10864,99,105,114,59,32768,10863,59,32768,8778,100,59,32768,8779,115,59,32768,39,114,111,120,512,59,101,6488,6490,32768,8776,113,59,32768,8778,105,110,103,33024,229,59,32768,229,768,99,116,121,6509,6514,6517,114,59,32896,55349,56502,59,32768,42,109,112,512,59,101,6524,6526,32768,8776,113,59,32768,8781,105,108,100,101,33024,227,59,32768,227,109,108,33024,228,59,32768,228,512,99,105,6551,6559,111,110,105,110,116,59,32768,8755,110,116,59,32768,10769,4096,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,6597,6602,6673,6688,6701,6707,6768,6773,6891,6898,6999,7023,7309,7316,7334,7383,111,116,59,32768,10989,512,99,114,6607,6652,107,1024,99,101,112,115,6617,6623,6632,6639,111,110,103,59,32768,8780,112,115,105,108,111,110,59,32768,1014,114,105,109,101,59,32768,8245,105,109,512,59,101,6646,6648,32768,8765,113,59,32768,8909,583,6656,6661,101,101,59,32768,8893,101,100,512,59,103,6667,6669,32768,8965,101,59,32768,8965,114,107,512,59,116,6680,6682,32768,9141,98,114,107,59,32768,9142,512,111,121,6693,6698,110,103,59,32768,8780,59,32768,1073,113,117,111,59,32768,8222,1280,99,109,112,114,116,6718,6731,6738,6743,6749,97,117,115,512,59,101,6726,6728,32768,8757,59,32768,8757,112,116,121,118,59,32768,10672,115,105,59,32768,1014,110,111,117,59,32768,8492,768,97,104,119,6756,6759,6762,59,32768,946,59,32768,8502,101,101,110,59,32768,8812,114,59,32896,55349,56607,103,1792,99,111,115,116,117,118,119,6789,6809,6834,6850,6872,6879,6884,768,97,105,117,6796,6800,6805,112,59,32768,8898,114,99,59,32768,9711,112,59,32768,8899,768,100,112,116,6816,6821,6827,111,116,59,32768,10752,108,117,115,59,32768,10753,105,109,101,115,59,32768,10754,1090,6840,0,0,6846,99,117,112,59,32768,10758,97,114,59,32768,9733,114,105,97,110,103,108,101,512,100,117,6862,6868,111,119,110,59,32768,9661,112,59,32768,9651,112,108,117,115,59,32768,10756,101,101,59,32768,8897,101,100,103,101,59,32768,8896,97,114,111,119,59,32768,10509,768,97,107,111,6905,6976,6994,512,99,110,6910,6972,107,768,108,115,116,6918,6927,6935,111,122,101,110,103,101,59,32768,10731,113,117,97,114,101,59,32768,9642,114,105,97,110,103,108,101,1024,59,100,108,114,6951,6953,6959,6965,32768,9652,111,119,110,59,32768,9662,101,102,116,59,32768,9666,105,103,104,116,59,32768,9656,107,59,32768,9251,770,6981,0,6991,771,6985,0,6988,59,32768,9618,59,32768,9617,52,59,32768,9619,99,107,59,32768,9608,512,101,111,7004,7019,512,59,113,7009,7012,32896,61,8421,117,105,118,59,32896,8801,8421,116,59,32768,8976,1024,112,116,119,120,7032,7037,7049,7055,102,59,32896,55349,56659,512,59,116,7042,7044,32768,8869,111,109,59,32768,8869,116,105,101,59,32768,8904,3072,68,72,85,86,98,100,104,109,112,116,117,118,7080,7101,7126,7147,7182,7187,7208,7233,7240,7246,7253,7274,1024,76,82,108,114,7089,7092,7095,7098,59,32768,9559,59,32768,9556,59,32768,9558,59,32768,9555,1280,59,68,85,100,117,7112,7114,7117,7120,7123,32768,9552,59,32768,9574,59,32768,9577,59,32768,9572,59,32768,9575,1024,76,82,108,114,7135,7138,7141,7144,59,32768,9565,59,32768,9562,59,32768,9564,59,32768,9561,1792,59,72,76,82,104,108,114,7162,7164,7167,7170,7173,7176,7179,32768,9553,59,32768,9580,59,32768,9571,59,32768,9568,59,32768,9579,59,32768,9570,59,32768,9567,111,120,59,32768,10697,1024,76,82,108,114,7196,7199,7202,7205,59,32768,9557,59,32768,9554,59,32768,9488,59,32768,9484,1280,59,68,85,100,117,7219,7221,7224,7227,7230,32768,9472,59,32768,9573,59,32768,9576,59,32768,9516,59,32768,9524,105,110,117,115,59,32768,8863,108,117,115,59,32768,8862,105,109,101,115,59,32768,8864,1024,76,82,108,114,7262,7265,7268,7271,59,32768,9563,59,32768,9560,59,32768,9496,59,32768,9492,1792,59,72,76,82,104,108,114,7289,7291,7294,7297,7300,7303,7306,32768,9474,59,32768,9578,59,32768,9569,59,32768,9566,59,32768,9532,59,32768,9508,59,32768,9500,114,105,109,101,59,32768,8245,512,101,118,7321,7326,118,101,59,32768,728,98,97,114,33024,166,59,32768,166,1024,99,101,105,111,7343,7348,7353,7364,114,59,32896,55349,56503,109,105,59,32768,8271,109,512,59,101,7359,7361,32768,8765,59,32768,8909,108,768,59,98,104,7372,7374,7377,32768,92,59,32768,10693,115,117,98,59,32768,10184,573,7387,7399,108,512,59,101,7392,7394,32768,8226,116,59,32768,8226,112,768,59,69,101,7406,7408,7411,32768,8782,59,32768,10926,512,59,113,7416,7418,32768,8783,59,32768,8783,6450,7448,0,7523,7571,7576,7613,0,7618,7647,0,0,7764,0,0,7779,0,0,7899,7914,7949,7955,0,8158,0,8176,768,99,112,114,7454,7460,7509,117,116,101,59,32768,263,1536,59,97,98,99,100,115,7473,7475,7480,7487,7500,7505,32768,8745,110,100,59,32768,10820,114,99,117,112,59,32768,10825,512,97,117,7492,7496,112,59,32768,10827,112,59,32768,10823,111,116,59,32768,10816,59,32896,8745,65024,512,101,111,7514,7518,116,59,32768,8257,110,59,32768,711,1024,97,101,105,117,7531,7544,7552,7557,833,7536,0,7540,115,59,32768,10829,111,110,59,32768,269,100,105,108,33024,231,59,32768,231,114,99,59,32768,265,112,115,512,59,115,7564,7566,32768,10828,109,59,32768,10832,111,116,59,32768,267,768,100,109,110,7582,7589,7596,105,108,33024,184,59,32768,184,112,116,121,118,59,32768,10674,116,33280,162,59,101,7603,7605,32768,162,114,100,111,116,59,32768,183,114,59,32896,55349,56608,768,99,101,105,7624,7628,7643,121,59,32768,1095,99,107,512,59,109,7635,7637,32768,10003,97,114,107,59,32768,10003,59,32768,967,114,1792,59,69,99,101,102,109,115,7662,7664,7667,7742,7745,7752,7757,32768,9675,59,32768,10691,768,59,101,108,7674,7676,7680,32768,710,113,59,32768,8791,101,1074,7687,0,0,7709,114,114,111,119,512,108,114,7695,7701,101,102,116,59,32768,8634,105,103,104,116,59,32768,8635,1280,82,83,97,99,100,7719,7722,7725,7730,7736,59,32768,174,59,32768,9416,115,116,59,32768,8859,105,114,99,59,32768,8858,97,115,104,59,32768,8861,59,32768,8791,110,105,110,116,59,32768,10768,105,100,59,32768,10991,99,105,114,59,32768,10690,117,98,115,512,59,117,7771,7773,32768,9827,105,116,59,32768,9827,1341,7785,7804,7850,0,7871,111,110,512,59,101,7791,7793,32768,58,512,59,113,7798,7800,32768,8788,59,32768,8788,1086,7809,0,0,7820,97,512,59,116,7814,7816,32768,44,59,32768,64,768,59,102,108,7826,7828,7832,32768,8705,110,59,32768,8728,101,512,109,120,7838,7844,101,110,116,59,32768,8705,101,115,59,32768,8450,824,7854,0,7866,512,59,100,7858,7860,32768,8773,111,116,59,32768,10861,110,116,59,32768,8750,768,102,114,121,7877,7881,7886,59,32896,55349,56660,111,100,59,32768,8720,33280,169,59,115,7892,7894,32768,169,114,59,32768,8471,512,97,111,7903,7908,114,114,59,32768,8629,115,115,59,32768,10007,512,99,117,7918,7923,114,59,32896,55349,56504,512,98,112,7928,7938,512,59,101,7933,7935,32768,10959,59,32768,10961,512,59,101,7943,7945,32768,10960,59,32768,10962,100,111,116,59,32768,8943,1792,100,101,108,112,114,118,119,7969,7983,7996,8009,8057,8147,8152,97,114,114,512,108,114,7977,7980,59,32768,10552,59,32768,10549,1089,7989,0,0,7993,114,59,32768,8926,99,59,32768,8927,97,114,114,512,59,112,8004,8006,32768,8630,59,32768,10557,1536,59,98,99,100,111,115,8022,8024,8031,8044,8049,8053,32768,8746,114,99,97,112,59,32768,10824,512,97,117,8036,8040,112,59,32768,10822,112,59,32768,10826,111,116,59,32768,8845,114,59,32768,10821,59,32896,8746,65024,1024,97,108,114,118,8066,8078,8116,8123,114,114,512,59,109,8073,8075,32768,8631,59,32768,10556,121,768,101,118,119,8086,8104,8109,113,1089,8093,0,0,8099,114,101,99,59,32768,8926,117,99,99,59,32768,8927,101,101,59,32768,8910,101,100,103,101,59,32768,8911,101,110,33024,164,59,32768,164,101,97,114,114,111,119,512,108,114,8134,8140,101,102,116,59,32768,8630,105,103,104,116,59,32768,8631,101,101,59,32768,8910,101,100,59,32768,8911,512,99,105,8162,8170,111,110,105,110,116,59,32768,8754,110,116,59,32768,8753,108,99,116,121,59,32768,9005,4864,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8221,8226,8231,8267,8282,8296,8327,8351,8366,8379,8466,8471,8487,8621,8647,8676,8697,8712,8720,114,114,59,32768,8659,97,114,59,32768,10597,1024,103,108,114,115,8240,8246,8252,8256,103,101,114,59,32768,8224,101,116,104,59,32768,8504,114,59,32768,8595,104,512,59,118,8262,8264,32768,8208,59,32768,8867,572,8271,8278,97,114,111,119,59,32768,10511,97,99,59,32768,733,512,97,121,8287,8293,114,111,110,59,32768,271,59,32768,1076,768,59,97,111,8303,8305,8320,32768,8518,512,103,114,8310,8316,103,101,114,59,32768,8225,114,59,32768,8650,116,115,101,113,59,32768,10871,768,103,108,109,8334,8339,8344,33024,176,59,32768,176,116,97,59,32768,948,112,116,121,118,59,32768,10673,512,105,114,8356,8362,115,104,116,59,32768,10623,59,32896,55349,56609,97,114,512,108,114,8373,8376,59,32768,8643,59,32768,8642,1280,97,101,103,115,118,8390,8418,8421,8428,8433,109,768,59,111,115,8398,8400,8415,32768,8900,110,100,512,59,115,8407,8409,32768,8900,117,105,116,59,32768,9830,59,32768,9830,59,32768,168,97,109,109,97,59,32768,989,105,110,59,32768,8946,768,59,105,111,8440,8442,8461,32768,247,100,101,33280,247,59,111,8450,8452,32768,247,110,116,105,109,101,115,59,32768,8903,110,120,59,32768,8903,99,121,59,32768,1106,99,1088,8478,0,0,8483,114,110,59,32768,8990,111,112,59,32768,8973,1280,108,112,116,117,119,8498,8504,8509,8556,8570,108,97,114,59,32768,36,102,59,32896,55349,56661,1280,59,101,109,112,115,8520,8522,8535,8542,8548,32768,729,113,512,59,100,8528,8530,32768,8784,111,116,59,32768,8785,105,110,117,115,59,32768,8760,108,117,115,59,32768,8724,113,117,97,114,101,59,32768,8865,98,108,101,98,97,114,119,101,100,103,101,59,32768,8966,110,768,97,100,104,8578,8585,8597,114,114,111,119,59,32768,8595,111,119,110,97,114,114,111,119,115,59,32768,8650,97,114,112,111,111,110,512,108,114,8608,8614,101,102,116,59,32768,8643,105,103,104,116,59,32768,8642,563,8625,8633,107,97,114,111,119,59,32768,10512,1088,8638,0,0,8643,114,110,59,32768,8991,111,112,59,32768,8972,768,99,111,116,8654,8666,8670,512,114,121,8659,8663,59,32896,55349,56505,59,32768,1109,108,59,32768,10742,114,111,107,59,32768,273,512,100,114,8681,8686,111,116,59,32768,8945,105,512,59,102,8692,8694,32768,9663,59,32768,9662,512,97,104,8702,8707,114,114,59,32768,8693,97,114,59,32768,10607,97,110,103,108,101,59,32768,10662,512,99,105,8725,8729,121,59,32768,1119,103,114,97,114,114,59,32768,10239,4608,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,8774,8788,8807,8844,8849,8852,8866,8895,8929,8977,8989,9004,9046,9136,9151,9171,9184,9199,512,68,111,8779,8784,111,116,59,32768,10871,116,59,32768,8785,512,99,115,8793,8801,117,116,101,33024,233,59,32768,233,116,101,114,59,32768,10862,1024,97,105,111,121,8816,8822,8835,8841,114,111,110,59,32768,283,114,512,59,99,8828,8830,32768,8790,33024,234,59,32768,234,108,111,110,59,32768,8789,59,32768,1101,111,116,59,32768,279,59,32768,8519,512,68,114,8857,8862,111,116,59,32768,8786,59,32896,55349,56610,768,59,114,115,8873,8875,8883,32768,10906,97,118,101,33024,232,59,32768,232,512,59,100,8888,8890,32768,10902,111,116,59,32768,10904,1024,59,105,108,115,8904,8906,8914,8917,32768,10905,110,116,101,114,115,59,32768,9191,59,32768,8467,512,59,100,8922,8924,32768,10901,111,116,59,32768,10903,768,97,112,115,8936,8941,8960,99,114,59,32768,275,116,121,768,59,115,118,8950,8952,8957,32768,8709,101,116,59,32768,8709,59,32768,8709,112,512,49,59,8966,8975,516,8970,8973,59,32768,8196,59,32768,8197,32768,8195,512,103,115,8982,8985,59,32768,331,112,59,32768,8194,512,103,112,8994,8999,111,110,59,32768,281,102,59,32896,55349,56662,768,97,108,115,9011,9023,9028,114,512,59,115,9017,9019,32768,8917,108,59,32768,10723,117,115,59,32768,10865,105,768,59,108,118,9036,9038,9043,32768,949,111,110,59,32768,949,59,32768,1013,1024,99,115,117,118,9055,9071,9099,9128,512,105,111,9060,9065,114,99,59,32768,8790,108,111,110,59,32768,8789,1082,9077,0,0,9081,109,59,32768,8770,97,110,116,512,103,108,9088,9093,116,114,59,32768,10902,101,115,115,59,32768,10901,768,97,101,105,9106,9111,9116,108,115,59,32768,61,115,116,59,32768,8799,118,512,59,68,9122,9124,32768,8801,68,59,32768,10872,112,97,114,115,108,59,32768,10725,512,68,97,9141,9146,111,116,59,32768,8787,114,114,59,32768,10609,768,99,100,105,9158,9162,9167,114,59,32768,8495,111,116,59,32768,8784,109,59,32768,8770,512,97,104,9176,9179,59,32768,951,33024,240,59,32768,240,512,109,114,9189,9195,108,33024,235,59,32768,235,111,59,32768,8364,768,99,105,112,9206,9210,9215,108,59,32768,33,115,116,59,32768,8707,512,101,111,9220,9230,99,116,97,116,105,111,110,59,32768,8496,110,101,110,116,105,97,108,101,59,32768,8519,4914,9262,0,9276,0,9280,9287,0,0,9318,9324,0,9331,0,9352,9357,9386,0,9395,9497,108,108,105,110,103,100,111,116,115,101,113,59,32768,8786,121,59,32768,1092,109,97,108,101,59,32768,9792,768,105,108,114,9293,9299,9313,108,105,103,59,32768,64259,1082,9305,0,0,9309,103,59,32768,64256,105,103,59,32768,64260,59,32896,55349,56611,108,105,103,59,32768,64257,108,105,103,59,32896,102,106,768,97,108,116,9337,9341,9346,116,59,32768,9837,105,103,59,32768,64258,110,115,59,32768,9649,111,102,59,32768,402,833,9361,0,9366,102,59,32896,55349,56663,512,97,107,9370,9375,108,108,59,32768,8704,512,59,118,9380,9382,32768,8916,59,32768,10969,97,114,116,105,110,116,59,32768,10765,512,97,111,9399,9491,512,99,115,9404,9487,1794,9413,9443,9453,9470,9474,0,9484,1795,9421,9426,9429,9434,9437,0,9440,33024,189,59,32768,189,59,32768,8531,33024,188,59,32768,188,59,32768,8533,59,32768,8537,59,32768,8539,772,9447,0,9450,59,32768,8532,59,32768,8534,1285,9459,9464,0,0,9467,33024,190,59,32768,190,59,32768,8535,59,32768,8540,53,59,32768,8536,775,9478,0,9481,59,32768,8538,59,32768,8541,56,59,32768,8542,108,59,32768,8260,119,110,59,32768,8994,99,114,59,32896,55349,56507,4352,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,9537,9547,9575,9582,9595,9600,9679,9684,9694,9700,9705,9725,9773,9779,9785,9810,9917,512,59,108,9542,9544,32768,8807,59,32768,10892,768,99,109,112,9554,9560,9572,117,116,101,59,32768,501,109,97,512,59,100,9567,9569,32768,947,59,32768,989,59,32768,10886,114,101,118,101,59,32768,287,512,105,121,9587,9592,114,99,59,32768,285,59,32768,1075,111,116,59,32768,289,1024,59,108,113,115,9609,9611,9614,9633,32768,8805,59,32768,8923,768,59,113,115,9621,9623,9626,32768,8805,59,32768,8807,108,97,110,116,59,32768,10878,1024,59,99,100,108,9642,9644,9648,9667,32768,10878,99,59,32768,10921,111,116,512,59,111,9655,9657,32768,10880,512,59,108,9662,9664,32768,10882,59,32768,10884,512,59,101,9672,9675,32896,8923,65024,115,59,32768,10900,114,59,32896,55349,56612,512,59,103,9689,9691,32768,8811,59,32768,8921,109,101,108,59,32768,8503,99,121,59,32768,1107,1024,59,69,97,106,9714,9716,9719,9722,32768,8823,59,32768,10898,59,32768,10917,59,32768,10916,1024,69,97,101,115,9734,9737,9751,9768,59,32768,8809,112,512,59,112,9743,9745,32768,10890,114,111,120,59,32768,10890,512,59,113,9756,9758,32768,10888,512,59,113,9763,9765,32768,10888,59,32768,8809,105,109,59,32768,8935,112,102,59,32896,55349,56664,97,118,101,59,32768,96,512,99,105,9790,9794,114,59,32768,8458,109,768,59,101,108,9802,9804,9807,32768,8819,59,32768,10894,59,32768,10896,34304,62,59,99,100,108,113,114,9824,9826,9838,9843,9849,9856,32768,62,512,99,105,9831,9834,59,32768,10919,114,59,32768,10874,111,116,59,32768,8919,80,97,114,59,32768,10645,117,101,115,116,59,32768,10876,1280,97,100,101,108,115,9867,9882,9887,9906,9912,833,9872,0,9879,112,114,111,120,59,32768,10886,114,59,32768,10616,111,116,59,32768,8919,113,512,108,113,9893,9899,101,115,115,59,32768,8923,108,101,115,115,59,32768,10892,101,115,115,59,32768,8823,105,109,59,32768,8819,512,101,110,9922,9932,114,116,110,101,113,113,59,32896,8809,65024,69,59,32896,8809,65024,2560,65,97,98,99,101,102,107,111,115,121,9958,9963,10015,10020,10026,10060,10065,10085,10147,10171,114,114,59,32768,8660,1024,105,108,109,114,9972,9978,9982,9988,114,115,112,59,32768,8202,102,59,32768,189,105,108,116,59,32768,8459,512,100,114,9993,9998,99,121,59,32768,1098,768,59,99,119,10005,10007,10012,32768,8596,105,114,59,32768,10568,59,32768,8621,97,114,59,32768,8463,105,114,99,59,32768,293,768,97,108,114,10033,10048,10054,114,116,115,512,59,117,10041,10043,32768,9829,105,116,59,32768,9829,108,105,112,59,32768,8230,99,111,110,59,32768,8889,114,59,32896,55349,56613,115,512,101,119,10071,10078,97,114,111,119,59,32768,10533,97,114,111,119,59,32768,10534,1280,97,109,111,112,114,10096,10101,10107,10136,10141,114,114,59,32768,8703,116,104,116,59,32768,8763,107,512,108,114,10113,10124,101,102,116,97,114,114,111,119,59,32768,8617,105,103,104,116,97,114,114,111,119,59,32768,8618,102,59,32896,55349,56665,98,97,114,59,32768,8213,768,99,108,116,10154,10159,10165,114,59,32896,55349,56509,97,115,104,59,32768,8463,114,111,107,59,32768,295,512,98,112,10176,10182,117,108,108,59,32768,8259,104,101,110,59,32768,8208,5426,10211,0,10220,0,10239,10255,10267,0,10276,10312,0,0,10318,10371,10458,10485,10491,0,10500,10545,10558,99,117,116,101,33024,237,59,32768,237,768,59,105,121,10226,10228,10235,32768,8291,114,99,33024,238,59,32768,238,59,32768,1080,512,99,120,10243,10247,121,59,32768,1077,99,108,33024,161,59,32768,161,512,102,114,10259,10262,59,32768,8660,59,32896,55349,56614,114,97,118,101,33024,236,59,32768,236,1024,59,105,110,111,10284,10286,10300,10306,32768,8520,512,105,110,10291,10296,110,116,59,32768,10764,116,59,32768,8749,102,105,110,59,32768,10716,116,97,59,32768,8489,108,105,103,59,32768,307,768,97,111,112,10324,10361,10365,768,99,103,116,10331,10335,10357,114,59,32768,299,768,101,108,112,10342,10345,10351,59,32768,8465,105,110,101,59,32768,8464,97,114,116,59,32768,8465,104,59,32768,305,102,59,32768,8887,101,100,59,32768,437,1280,59,99,102,111,116,10381,10383,10389,10403,10409,32768,8712,97,114,101,59,32768,8453,105,110,512,59,116,10396,10398,32768,8734,105,101,59,32768,10717,100,111,116,59,32768,305,1280,59,99,101,108,112,10420,10422,10427,10444,10451,32768,8747,97,108,59,32768,8890,512,103,114,10432,10438,101,114,115,59,32768,8484,99,97,108,59,32768,8890,97,114,104,107,59,32768,10775,114,111,100,59,32768,10812,1024,99,103,112,116,10466,10470,10475,10480,121,59,32768,1105,111,110,59,32768,303,102,59,32896,55349,56666,97,59,32768,953,114,111,100,59,32768,10812,117,101,115,116,33024,191,59,32768,191,512,99,105,10504,10509,114,59,32896,55349,56510,110,1280,59,69,100,115,118,10521,10523,10526,10531,10541,32768,8712,59,32768,8953,111,116,59,32768,8949,512,59,118,10536,10538,32768,8948,59,32768,8947,59,32768,8712,512,59,105,10549,10551,32768,8290,108,100,101,59,32768,297,828,10562,0,10567,99,121,59,32768,1110,108,33024,239,59,32768,239,1536,99,102,109,111,115,117,10585,10598,10603,10609,10615,10630,512,105,121,10590,10595,114,99,59,32768,309,59,32768,1081,114,59,32896,55349,56615,97,116,104,59,32768,567,112,102,59,32896,55349,56667,820,10620,0,10625,114,59,32896,55349,56511,114,99,121,59,32768,1112,107,99,121,59,32768,1108,2048,97,99,102,103,104,106,111,115,10653,10666,10680,10685,10692,10697,10702,10708,112,112,97,512,59,118,10661,10663,32768,954,59,32768,1008,512,101,121,10671,10677,100,105,108,59,32768,311,59,32768,1082,114,59,32896,55349,56616,114,101,101,110,59,32768,312,99,121,59,32768,1093,99,121,59,32768,1116,112,102,59,32896,55349,56668,99,114,59,32896,55349,56512,5888,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,10761,10783,10789,10799,10804,10957,11011,11047,11094,11349,11372,11382,11409,11414,11451,11478,11526,11698,11711,11755,11823,11910,11929,768,97,114,116,10768,10773,10777,114,114,59,32768,8666,114,59,32768,8656,97,105,108,59,32768,10523,97,114,114,59,32768,10510,512,59,103,10794,10796,32768,8806,59,32768,10891,97,114,59,32768,10594,4660,10824,0,10830,0,10838,0,0,0,0,0,10844,10850,0,10867,10870,10877,0,10933,117,116,101,59,32768,314,109,112,116,121,118,59,32768,10676,114,97,110,59,32768,8466,98,100,97,59,32768,955,103,768,59,100,108,10857,10859,10862,32768,10216,59,32768,10641,101,59,32768,10216,59,32768,10885,117,111,33024,171,59,32768,171,114,2048,59,98,102,104,108,112,115,116,10894,10896,10907,10911,10915,10919,10923,10928,32768,8592,512,59,102,10901,10903,32768,8676,115,59,32768,10527,115,59,32768,10525,107,59,32768,8617,112,59,32768,8619,108,59,32768,10553,105,109,59,32768,10611,108,59,32768,8610,768,59,97,101,10939,10941,10946,32768,10923,105,108,59,32768,10521,512,59,115,10951,10953,32768,10925,59,32896,10925,65024,768,97,98,114,10964,10969,10974,114,114,59,32768,10508,114,107,59,32768,10098,512,97,107,10979,10991,99,512,101,107,10985,10988,59,32768,123,59,32768,91,512,101,115,10996,10999,59,32768,10635,108,512,100,117,11005,11008,59,32768,10639,59,32768,10637,1024,97,101,117,121,11020,11026,11040,11044,114,111,110,59,32768,318,512,100,105,11031,11036,105,108,59,32768,316,108,59,32768,8968,98,59,32768,123,59,32768,1083,1024,99,113,114,115,11056,11060,11072,11090,97,59,32768,10550,117,111,512,59,114,11067,11069,32768,8220,59,32768,8222,512,100,117,11077,11083,104,97,114,59,32768,10599,115,104,97,114,59,32768,10571,104,59,32768,8626,1280,59,102,103,113,115,11105,11107,11228,11231,11250,32768,8804,116,1280,97,104,108,114,116,11119,11136,11157,11169,11216,114,114,111,119,512,59,116,11128,11130,32768,8592,97,105,108,59,32768,8610,97,114,112,111,111,110,512,100,117,11147,11153,111,119,110,59,32768,8637,112,59,32768,8636,101,102,116,97,114,114,111,119,115,59,32768,8647,105,103,104,116,768,97,104,115,11180,11194,11204,114,114,111,119,512,59,115,11189,11191,32768,8596,59,32768,8646,97,114,112,111,111,110,115,59,32768,8651,113,117,105,103,97,114,114,111,119,59,32768,8621,104,114,101,101,116,105,109,101,115,59,32768,8907,59,32768,8922,768,59,113,115,11238,11240,11243,32768,8804,59,32768,8806,108,97,110,116,59,32768,10877,1280,59,99,100,103,115,11261,11263,11267,11286,11298,32768,10877,99,59,32768,10920,111,116,512,59,111,11274,11276,32768,10879,512,59,114,11281,11283,32768,10881,59,32768,10883,512,59,101,11291,11294,32896,8922,65024,115,59,32768,10899,1280,97,100,101,103,115,11309,11317,11322,11339,11344,112,112,114,111,120,59,32768,10885,111,116,59,32768,8918,113,512,103,113,11328,11333,116,114,59,32768,8922,103,116,114,59,32768,10891,116,114,59,32768,8822,105,109,59,32768,8818,768,105,108,114,11356,11362,11368,115,104,116,59,32768,10620,111,111,114,59,32768,8970,59,32896,55349,56617,512,59,69,11377,11379,32768,8822,59,32768,10897,562,11386,11405,114,512,100,117,11391,11394,59,32768,8637,512,59,108,11399,11401,32768,8636,59,32768,10602,108,107,59,32768,9604,99,121,59,32768,1113,1280,59,97,99,104,116,11425,11427,11432,11440,11446,32768,8810,114,114,59,32768,8647,111,114,110,101,114,59,32768,8990,97,114,100,59,32768,10603,114,105,59,32768,9722,512,105,111,11456,11462,100,111,116,59,32768,320,117,115,116,512,59,97,11470,11472,32768,9136,99,104,101,59,32768,9136,1024,69,97,101,115,11487,11490,11504,11521,59,32768,8808,112,512,59,112,11496,11498,32768,10889,114,111,120,59,32768,10889,512,59,113,11509,11511,32768,10887,512,59,113,11516,11518,32768,10887,59,32768,8808,105,109,59,32768,8934,2048,97,98,110,111,112,116,119,122,11543,11556,11561,11616,11640,11660,11667,11680,512,110,114,11548,11552,103,59,32768,10220,114,59,32768,8701,114,107,59,32768,10214,103,768,108,109,114,11569,11596,11604,101,102,116,512,97,114,11577,11584,114,114,111,119,59,32768,10229,105,103,104,116,97,114,114,111,119,59,32768,10231,97,112,115,116,111,59,32768,10236,105,103,104,116,97,114,114,111,119,59,32768,10230,112,97,114,114,111,119,512,108,114,11627,11633,101,102,116,59,32768,8619,105,103,104,116,59,32768,8620,768,97,102,108,11647,11651,11655,114,59,32768,10629,59,32896,55349,56669,117,115,59,32768,10797,105,109,101,115,59,32768,10804,562,11671,11676,115,116,59,32768,8727,97,114,59,32768,95,768,59,101,102,11687,11689,11695,32768,9674,110,103,101,59,32768,9674,59,32768,10731,97,114,512,59,108,11705,11707,32768,40,116,59,32768,10643,1280,97,99,104,109,116,11722,11727,11735,11747,11750,114,114,59,32768,8646,111,114,110,101,114,59,32768,8991,97,114,512,59,100,11742,11744,32768,8651,59,32768,10605,59,32768,8206,114,105,59,32768,8895,1536,97,99,104,105,113,116,11768,11774,11779,11782,11798,11817,113,117,111,59,32768,8249,114,59,32896,55349,56513,59,32768,8624,109,768,59,101,103,11790,11792,11795,32768,8818,59,32768,10893,59,32768,10895,512,98,117,11803,11806,59,32768,91,111,512,59,114,11812,11814,32768,8216,59,32768,8218,114,111,107,59,32768,322,34816,60,59,99,100,104,105,108,113,114,11841,11843,11855,11860,11866,11872,11878,11885,32768,60,512,99,105,11848,11851,59,32768,10918,114,59,32768,10873,111,116,59,32768,8918,114,101,101,59,32768,8907,109,101,115,59,32768,8905,97,114,114,59,32768,10614,117,101,115,116,59,32768,10875,512,80,105,11890,11895,97,114,59,32768,10646,768,59,101,102,11902,11904,11907,32768,9667,59,32768,8884,59,32768,9666,114,512,100,117,11916,11923,115,104,97,114,59,32768,10570,104,97,114,59,32768,10598,512,101,110,11934,11944,114,116,110,101,113,113,59,32896,8808,65024,69,59,32896,8808,65024,3584,68,97,99,100,101,102,104,105,108,110,111,112,115,117,11978,11984,12061,12075,12081,12095,12100,12104,12170,12181,12188,12204,12207,12223,68,111,116,59,32768,8762,1024,99,108,112,114,11993,11999,12019,12055,114,33024,175,59,32768,175,512,101,116,12004,12007,59,32768,9794,512,59,101,12012,12014,32768,10016,115,101,59,32768,10016,512,59,115,12024,12026,32768,8614,116,111,1024,59,100,108,117,12037,12039,12045,12051,32768,8614,111,119,110,59,32768,8615,101,102,116,59,32768,8612,112,59,32768,8613,107,101,114,59,32768,9646,512,111,121,12066,12072,109,109,97,59,32768,10793,59,32768,1084,97,115,104,59,32768,8212,97,115,117,114,101,100,97,110,103,108,101,59,32768,8737,114,59,32896,55349,56618,111,59,32768,8487,768,99,100,110,12111,12118,12146,114,111,33024,181,59,32768,181,1024,59,97,99,100,12127,12129,12134,12139,32768,8739,115,116,59,32768,42,105,114,59,32768,10992,111,116,33024,183,59,32768,183,117,115,768,59,98,100,12155,12157,12160,32768,8722,59,32768,8863,512,59,117,12165,12167,32768,8760,59,32768,10794,564,12174,12178,112,59,32768,10971,114,59,32768,8230,112,108,117,115,59,32768,8723,512,100,112,12193,12199,101,108,115,59,32768,8871,102,59,32896,55349,56670,59,32768,8723,512,99,116,12212,12217,114,59,32896,55349,56514,112,111,115,59,32768,8766,768,59,108,109,12230,12232,12240,32768,956,116,105,109,97,112,59,32768,8888,97,112,59,32768,8888,6144,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,12294,12315,12364,12376,12393,12472,12496,12547,12553,12636,12641,12703,12725,12747,12752,12876,12881,12957,13033,13089,13294,13359,13384,13499,512,103,116,12299,12303,59,32896,8921,824,512,59,118,12308,12311,32896,8811,8402,59,32896,8811,824,768,101,108,116,12322,12348,12352,102,116,512,97,114,12329,12336,114,114,111,119,59,32768,8653,105,103,104,116,97,114,114,111,119,59,32768,8654,59,32896,8920,824,512,59,118,12357,12360,32896,8810,8402,59,32896,8810,824,105,103,104,116,97,114,114,111,119,59,32768,8655,512,68,100,12381,12387,97,115,104,59,32768,8879,97,115,104,59,32768,8878,1280,98,99,110,112,116,12404,12409,12415,12420,12452,108,97,59,32768,8711,117,116,101,59,32768,324,103,59,32896,8736,8402,1280,59,69,105,111,112,12431,12433,12437,12442,12446,32768,8777,59,32896,10864,824,100,59,32896,8779,824,115,59,32768,329,114,111,120,59,32768,8777,117,114,512,59,97,12459,12461,32768,9838,108,512,59,115,12467,12469,32768,9838,59,32768,8469,836,12477,0,12483,112,33024,160,59,32768,160,109,112,512,59,101,12489,12492,32896,8782,824,59,32896,8783,824,1280,97,101,111,117,121,12507,12519,12525,12540,12544,833,12512,0,12515,59,32768,10819,111,110,59,32768,328,100,105,108,59,32768,326,110,103,512,59,100,12532,12534,32768,8775,111,116,59,32896,10861,824,112,59,32768,10818,59,32768,1085,97,115,104,59,32768,8211,1792,59,65,97,100,113,115,120,12568,12570,12575,12596,12602,12608,12623,32768,8800,114,114,59,32768,8663,114,512,104,114,12581,12585,107,59,32768,10532,512,59,111,12590,12592,32768,8599,119,59,32768,8599,111,116,59,32896,8784,824,117,105,118,59,32768,8802,512,101,105,12613,12618,97,114,59,32768,10536,109,59,32896,8770,824,105,115,116,512,59,115,12631,12633,32768,8708,59,32768,8708,114,59,32896,55349,56619,1024,69,101,115,116,12650,12654,12688,12693,59,32896,8807,824,768,59,113,115,12661,12663,12684,32768,8817,768,59,113,115,12670,12672,12676,32768,8817,59,32896,8807,824,108,97,110,116,59,32896,10878,824,59,32896,10878,824,105,109,59,32768,8821,512,59,114,12698,12700,32768,8815,59,32768,8815,768,65,97,112,12710,12715,12720,114,114,59,32768,8654,114,114,59,32768,8622,97,114,59,32768,10994,768,59,115,118,12732,12734,12744,32768,8715,512,59,100,12739,12741,32768,8956,59,32768,8954,59,32768,8715,99,121,59,32768,1114,1792,65,69,97,100,101,115,116,12767,12772,12776,12781,12785,12853,12858,114,114,59,32768,8653,59,32896,8806,824,114,114,59,32768,8602,114,59,32768,8229,1024,59,102,113,115,12794,12796,12821,12842,32768,8816,116,512,97,114,12802,12809,114,114,111,119,59,32768,8602,105,103,104,116,97,114,114,111,119,59,32768,8622,768,59,113,115,12828,12830,12834,32768,8816,59,32896,8806,824,108,97,110,116,59,32896,10877,824,512,59,115,12847,12850,32896,10877,824,59,32768,8814,105,109,59,32768,8820,512,59,114,12863,12865,32768,8814,105,512,59,101,12871,12873,32768,8938,59,32768,8940,105,100,59,32768,8740,512,112,116,12886,12891,102,59,32896,55349,56671,33536,172,59,105,110,12899,12901,12936,32768,172,110,1024,59,69,100,118,12911,12913,12917,12923,32768,8713,59,32896,8953,824,111,116,59,32896,8949,824,818,12928,12931,12934,59,32768,8713,59,32768,8951,59,32768,8950,105,512,59,118,12942,12944,32768,8716,818,12949,12952,12955,59,32768,8716,59,32768,8958,59,32768,8957,768,97,111,114,12964,12992,12999,114,1024,59,97,115,116,12974,12976,12983,12988,32768,8742,108,108,101,108,59,32768,8742,108,59,32896,11005,8421,59,32896,8706,824,108,105,110,116,59,32768,10772,768,59,99,101,13006,13008,13013,32768,8832,117,101,59,32768,8928,512,59,99,13018,13021,32896,10927,824,512,59,101,13026,13028,32768,8832,113,59,32896,10927,824,1024,65,97,105,116,13042,13047,13066,13077,114,114,59,32768,8655,114,114,768,59,99,119,13056,13058,13062,32768,8603,59,32896,10547,824,59,32896,8605,824,103,104,116,97,114,114,111,119,59,32768,8603,114,105,512,59,101,13084,13086,32768,8939,59,32768,8941,1792,99,104,105,109,112,113,117,13104,13128,13151,13169,13174,13179,13194,1024,59,99,101,114,13113,13115,13120,13124,32768,8833,117,101,59,32768,8929,59,32896,10928,824,59,32896,55349,56515,111,114,116,1086,13137,0,0,13142,105,100,59,32768,8740,97,114,97,108,108,101,108,59,32768,8742,109,512,59,101,13157,13159,32768,8769,512,59,113,13164,13166,32768,8772,59,32768,8772,105,100,59,32768,8740,97,114,59,32768,8742,115,117,512,98,112,13186,13190,101,59,32768,8930,101,59,32768,8931,768,98,99,112,13201,13241,13254,1024,59,69,101,115,13210,13212,13216,13219,32768,8836,59,32896,10949,824,59,32768,8840,101,116,512,59,101,13226,13229,32896,8834,8402,113,512,59,113,13235,13237,32768,8840,59,32896,10949,824,99,512,59,101,13247,13249,32768,8833,113,59,32896,10928,824,1024,59,69,101,115,13263,13265,13269,13272,32768,8837,59,32896,10950,824,59,32768,8841,101,116,512,59,101,13279,13282,32896,8835,8402,113,512,59,113,13288,13290,32768,8841,59,32896,10950,824,1024,103,105,108,114,13303,13307,13315,13319,108,59,32768,8825,108,100,101,33024,241,59,32768,241,103,59,32768,8824,105,97,110,103,108,101,512,108,114,13330,13344,101,102,116,512,59,101,13338,13340,32768,8938,113,59,32768,8940,105,103,104,116,512,59,101,13353,13355,32768,8939,113,59,32768,8941,512,59,109,13364,13366,32768,957,768,59,101,115,13373,13375,13380,32768,35,114,111,59,32768,8470,112,59,32768,8199,2304,68,72,97,100,103,105,108,114,115,13403,13409,13415,13420,13426,13439,13446,13476,13493,97,115,104,59,32768,8877,97,114,114,59,32768,10500,112,59,32896,8781,8402,97,115,104,59,32768,8876,512,101,116,13431,13435,59,32896,8805,8402,59,32896,62,8402,110,102,105,110,59,32768,10718,768,65,101,116,13453,13458,13462,114,114,59,32768,10498,59,32896,8804,8402,512,59,114,13467,13470,32896,60,8402,105,101,59,32896,8884,8402,512,65,116,13481,13486,114,114,59,32768,10499,114,105,101,59,32896,8885,8402,105,109,59,32896,8764,8402,768,65,97,110,13506,13511,13532,114,114,59,32768,8662,114,512,104,114,13517,13521,107,59,32768,10531,512,59,111,13526,13528,32768,8598,119,59,32768,8598,101,97,114,59,32768,10535,9252,13576,0,0,0,0,0,0,0,0,0,0,0,0,0,13579,0,13596,13617,13653,13659,13673,13695,13708,0,0,13713,13750,0,13788,13794,0,13815,13890,13913,13937,13944,59,32768,9416,512,99,115,13583,13591,117,116,101,33024,243,59,32768,243,116,59,32768,8859,512,105,121,13600,13613,114,512,59,99,13606,13608,32768,8858,33024,244,59,32768,244,59,32768,1086,1280,97,98,105,111,115,13627,13632,13638,13642,13646,115,104,59,32768,8861,108,97,99,59,32768,337,118,59,32768,10808,116,59,32768,8857,111,108,100,59,32768,10684,108,105,103,59,32768,339,512,99,114,13663,13668,105,114,59,32768,10687,59,32896,55349,56620,1600,13680,0,0,13684,0,13692,110,59,32768,731,97,118,101,33024,242,59,32768,242,59,32768,10689,512,98,109,13699,13704,97,114,59,32768,10677,59,32768,937,110,116,59,32768,8750,1024,97,99,105,116,13721,13726,13741,13746,114,114,59,32768,8634,512,105,114,13731,13735,114,59,32768,10686,111,115,115,59,32768,10683,110,101,59,32768,8254,59,32768,10688,768,97,101,105,13756,13761,13766,99,114,59,32768,333,103,97,59,32768,969,768,99,100,110,13773,13779,13782,114,111,110,59,32768,959,59,32768,10678,117,115,59,32768,8854,112,102,59,32896,55349,56672,768,97,101,108,13800,13804,13809,114,59,32768,10679,114,112,59,32768,10681,117,115,59,32768,8853,1792,59,97,100,105,111,115,118,13829,13831,13836,13869,13875,13879,13886,32768,8744,114,114,59,32768,8635,1024,59,101,102,109,13845,13847,13859,13864,32768,10845,114,512,59,111,13853,13855,32768,8500,102,59,32768,8500,33024,170,59,32768,170,33024,186,59,32768,186,103,111,102,59,32768,8886,114,59,32768,10838,108,111,112,101,59,32768,10839,59,32768,10843,768,99,108,111,13896,13900,13908,114,59,32768,8500,97,115,104,33024,248,59,32768,248,108,59,32768,8856,105,573,13917,13924,100,101,33024,245,59,32768,245,101,115,512,59,97,13930,13932,32768,8855,115,59,32768,10806,109,108,33024,246,59,32768,246,98,97,114,59,32768,9021,5426,13972,0,14013,0,14017,14053,0,14058,14086,0,0,14107,14199,0,14202,0,0,14229,14425,0,14438,114,1024,59,97,115,116,13981,13983,13997,14009,32768,8741,33280,182,59,108,13989,13991,32768,182,108,101,108,59,32768,8741,1082,14003,0,0,14007,109,59,32768,10995,59,32768,11005,59,32768,8706,121,59,32768,1087,114,1280,99,105,109,112,116,14028,14033,14038,14043,14046,110,116,59,32768,37,111,100,59,32768,46,105,108,59,32768,8240,59,32768,8869,101,110,107,59,32768,8241,114,59,32896,55349,56621,768,105,109,111,14064,14074,14080,512,59,118,14069,14071,32768,966,59,32768,981,109,97,116,59,32768,8499,110,101,59,32768,9742,768,59,116,118,14092,14094,14103,32768,960,99,104,102,111,114,107,59,32768,8916,59,32768,982,512,97,117,14111,14132,110,512,99,107,14117,14128,107,512,59,104,14123,14125,32768,8463,59,32768,8462,118,59,32768,8463,115,2304,59,97,98,99,100,101,109,115,116,14152,14154,14160,14163,14168,14179,14182,14188,14193,32768,43,99,105,114,59,32768,10787,59,32768,8862,105,114,59,32768,10786,512,111,117,14173,14176,59,32768,8724,59,32768,10789,59,32768,10866,110,33024,177,59,32768,177,105,109,59,32768,10790,119,111,59,32768,10791,59,32768,177,768,105,112,117,14208,14216,14221,110,116,105,110,116,59,32768,10773,102,59,32896,55349,56673,110,100,33024,163,59,32768,163,2560,59,69,97,99,101,105,110,111,115,117,14249,14251,14254,14258,14263,14336,14348,14367,14413,14418,32768,8826,59,32768,10931,112,59,32768,10935,117,101,59,32768,8828,512,59,99,14268,14270,32768,10927,1536,59,97,99,101,110,115,14283,14285,14293,14302,14306,14331,32768,8826,112,112,114,111,120,59,32768,10935,117,114,108,121,101,113,59,32768,8828,113,59,32768,10927,768,97,101,115,14313,14321,14326,112,112,114,111,120,59,32768,10937,113,113,59,32768,10933,105,109,59,32768,8936,105,109,59,32768,8830,109,101,512,59,115,14343,14345,32768,8242,59,32768,8473,768,69,97,115,14355,14358,14362,59,32768,10933,112,59,32768,10937,105,109,59,32768,8936,768,100,102,112,14374,14377,14402,59,32768,8719,768,97,108,115,14384,14390,14396,108,97,114,59,32768,9006,105,110,101,59,32768,8978,117,114,102,59,32768,8979,512,59,116,14407,14409,32768,8733,111,59,32768,8733,105,109,59,32768,8830,114,101,108,59,32768,8880,512,99,105,14429,14434,114,59,32896,55349,56517,59,32768,968,110,99,115,112,59,32768,8200,1536,102,105,111,112,115,117,14457,14462,14467,14473,14480,14486,114,59,32896,55349,56622,110,116,59,32768,10764,112,102,59,32896,55349,56674,114,105,109,101,59,32768,8279,99,114,59,32896,55349,56518,768,97,101,111,14493,14513,14526,116,512,101,105,14499,14508,114,110,105,111,110,115,59,32768,8461,110,116,59,32768,10774,115,116,512,59,101,14520,14522,32768,63,113,59,32768,8799,116,33024,34,59,32768,34,5376,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,14575,14597,14603,14608,14775,14829,14865,14901,14943,14966,15e3,15139,15159,15176,15182,15236,15261,15267,15309,15352,15360,768,97,114,116,14582,14587,14591,114,114,59,32768,8667,114,59,32768,8658,97,105,108,59,32768,10524,97,114,114,59,32768,10511,97,114,59,32768,10596,1792,99,100,101,110,113,114,116,14623,14637,14642,14650,14672,14679,14751,512,101,117,14628,14632,59,32896,8765,817,116,101,59,32768,341,105,99,59,32768,8730,109,112,116,121,118,59,32768,10675,103,1024,59,100,101,108,14660,14662,14665,14668,32768,10217,59,32768,10642,59,32768,10661,101,59,32768,10217,117,111,33024,187,59,32768,187,114,2816,59,97,98,99,102,104,108,112,115,116,119,14703,14705,14709,14720,14723,14727,14731,14735,14739,14744,14748,32768,8594,112,59,32768,10613,512,59,102,14714,14716,32768,8677,115,59,32768,10528,59,32768,10547,115,59,32768,10526,107,59,32768,8618,112,59,32768,8620,108,59,32768,10565,105,109,59,32768,10612,108,59,32768,8611,59,32768,8605,512,97,105,14756,14761,105,108,59,32768,10522,111,512,59,110,14767,14769,32768,8758,97,108,115,59,32768,8474,768,97,98,114,14782,14787,14792,114,114,59,32768,10509,114,107,59,32768,10099,512,97,107,14797,14809,99,512,101,107,14803,14806,59,32768,125,59,32768,93,512,101,115,14814,14817,59,32768,10636,108,512,100,117,14823,14826,59,32768,10638,59,32768,10640,1024,97,101,117,121,14838,14844,14858,14862,114,111,110,59,32768,345,512,100,105,14849,14854,105,108,59,32768,343,108,59,32768,8969,98,59,32768,125,59,32768,1088,1024,99,108,113,115,14874,14878,14885,14897,97,59,32768,10551,100,104,97,114,59,32768,10601,117,111,512,59,114,14892,14894,32768,8221,59,32768,8221,104,59,32768,8627,768,97,99,103,14908,14934,14938,108,1024,59,105,112,115,14918,14920,14925,14931,32768,8476,110,101,59,32768,8475,97,114,116,59,32768,8476,59,32768,8477,116,59,32768,9645,33024,174,59,32768,174,768,105,108,114,14950,14956,14962,115,104,116,59,32768,10621,111,111,114,59,32768,8971,59,32896,55349,56623,512,97,111,14971,14990,114,512,100,117,14977,14980,59,32768,8641,512,59,108,14985,14987,32768,8640,59,32768,10604,512,59,118,14995,14997,32768,961,59,32768,1009,768,103,110,115,15007,15123,15127,104,116,1536,97,104,108,114,115,116,15022,15039,15060,15086,15099,15111,114,114,111,119,512,59,116,15031,15033,32768,8594,97,105,108,59,32768,8611,97,114,112,111,111,110,512,100,117,15050,15056,111,119,110,59,32768,8641,112,59,32768,8640,101,102,116,512,97,104,15068,15076,114,114,111,119,115,59,32768,8644,97,114,112,111,111,110,115,59,32768,8652,105,103,104,116,97,114,114,111,119,115,59,32768,8649,113,117,105,103,97,114,114,111,119,59,32768,8605,104,114,101,101,116,105,109,101,115,59,32768,8908,103,59,32768,730,105,110,103,100,111,116,115,101,113,59,32768,8787,768,97,104,109,15146,15151,15156,114,114,59,32768,8644,97,114,59,32768,8652,59,32768,8207,111,117,115,116,512,59,97,15168,15170,32768,9137,99,104,101,59,32768,9137,109,105,100,59,32768,10990,1024,97,98,112,116,15191,15204,15209,15229,512,110,114,15196,15200,103,59,32768,10221,114,59,32768,8702,114,107,59,32768,10215,768,97,102,108,15216,15220,15224,114,59,32768,10630,59,32896,55349,56675,117,115,59,32768,10798,105,109,101,115,59,32768,10805,512,97,112,15241,15253,114,512,59,103,15247,15249,32768,41,116,59,32768,10644,111,108,105,110,116,59,32768,10770,97,114,114,59,32768,8649,1024,97,99,104,113,15276,15282,15287,15290,113,117,111,59,32768,8250,114,59,32896,55349,56519,59,32768,8625,512,98,117,15295,15298,59,32768,93,111,512,59,114,15304,15306,32768,8217,59,32768,8217,768,104,105,114,15316,15322,15328,114,101,101,59,32768,8908,109,101,115,59,32768,8906,105,1024,59,101,102,108,15338,15340,15343,15346,32768,9657,59,32768,8885,59,32768,9656,116,114,105,59,32768,10702,108,117,104,97,114,59,32768,10600,59,32768,8478,6706,15391,15398,15404,15499,15516,15592,0,15606,15660,0,0,15752,15758,0,15827,15863,15886,16e3,16006,16038,16086,0,16467,0,0,16506,99,117,116,101,59,32768,347,113,117,111,59,32768,8218,2560,59,69,97,99,101,105,110,112,115,121,15424,15426,15429,15441,15446,15458,15463,15482,15490,15495,32768,8827,59,32768,10932,833,15434,0,15437,59,32768,10936,111,110,59,32768,353,117,101,59,32768,8829,512,59,100,15451,15453,32768,10928,105,108,59,32768,351,114,99,59,32768,349,768,69,97,115,15470,15473,15477,59,32768,10934,112,59,32768,10938,105,109,59,32768,8937,111,108,105,110,116,59,32768,10771,105,109,59,32768,8831,59,32768,1089,111,116,768,59,98,101,15507,15509,15512,32768,8901,59,32768,8865,59,32768,10854,1792,65,97,99,109,115,116,120,15530,15535,15556,15562,15566,15572,15587,114,114,59,32768,8664,114,512,104,114,15541,15545,107,59,32768,10533,512,59,111,15550,15552,32768,8600,119,59,32768,8600,116,33024,167,59,32768,167,105,59,32768,59,119,97,114,59,32768,10537,109,512,105,110,15578,15584,110,117,115,59,32768,8726,59,32768,8726,116,59,32768,10038,114,512,59,111,15597,15600,32896,55349,56624,119,110,59,32768,8994,1024,97,99,111,121,15614,15619,15632,15654,114,112,59,32768,9839,512,104,121,15624,15629,99,121,59,32768,1097,59,32768,1096,114,116,1086,15640,0,0,15645,105,100,59,32768,8739,97,114,97,108,108,101,108,59,32768,8741,33024,173,59,32768,173,512,103,109,15664,15681,109,97,768,59,102,118,15673,15675,15678,32768,963,59,32768,962,59,32768,962,2048,59,100,101,103,108,110,112,114,15698,15700,15705,15715,15725,15735,15739,15745,32768,8764,111,116,59,32768,10858,512,59,113,15710,15712,32768,8771,59,32768,8771,512,59,69,15720,15722,32768,10910,59,32768,10912,512,59,69,15730,15732,32768,10909,59,32768,10911,101,59,32768,8774,108,117,115,59,32768,10788,97,114,114,59,32768,10610,97,114,114,59,32768,8592,1024,97,101,105,116,15766,15788,15796,15808,512,108,115,15771,15783,108,115,101,116,109,105,110,117,115,59,32768,8726,104,112,59,32768,10803,112,97,114,115,108,59,32768,10724,512,100,108,15801,15804,59,32768,8739,101,59,32768,8995,512,59,101,15813,15815,32768,10922,512,59,115,15820,15822,32768,10924,59,32896,10924,65024,768,102,108,112,15833,15839,15857,116,99,121,59,32768,1100,512,59,98,15844,15846,32768,47,512,59,97,15851,15853,32768,10692,114,59,32768,9023,102,59,32896,55349,56676,97,512,100,114,15868,15882,101,115,512,59,117,15875,15877,32768,9824,105,116,59,32768,9824,59,32768,8741,768,99,115,117,15892,15921,15977,512,97,117,15897,15909,112,512,59,115,15903,15905,32768,8851,59,32896,8851,65024,112,512,59,115,15915,15917,32768,8852,59,32896,8852,65024,117,512,98,112,15927,15952,768,59,101,115,15934,15936,15939,32768,8847,59,32768,8849,101,116,512,59,101,15946,15948,32768,8847,113,59,32768,8849,768,59,101,115,15959,15961,15964,32768,8848,59,32768,8850,101,116,512,59,101,15971,15973,32768,8848,113,59,32768,8850,768,59,97,102,15984,15986,15996,32768,9633,114,566,15991,15994,59,32768,9633,59,32768,9642,59,32768,9642,97,114,114,59,32768,8594,1024,99,101,109,116,16014,16019,16025,16031,114,59,32896,55349,56520,116,109,110,59,32768,8726,105,108,101,59,32768,8995,97,114,102,59,32768,8902,512,97,114,16042,16053,114,512,59,102,16048,16050,32768,9734,59,32768,9733,512,97,110,16058,16081,105,103,104,116,512,101,112,16067,16076,112,115,105,108,111,110,59,32768,1013,104,105,59,32768,981,115,59,32768,175,1280,98,99,109,110,112,16096,16221,16288,16291,16295,2304,59,69,100,101,109,110,112,114,115,16115,16117,16120,16125,16137,16143,16154,16160,16166,32768,8834,59,32768,10949,111,116,59,32768,10941,512,59,100,16130,16132,32768,8838,111,116,59,32768,10947,117,108,116,59,32768,10945,512,69,101,16148,16151,59,32768,10955,59,32768,8842,108,117,115,59,32768,10943,97,114,114,59,32768,10617,768,101,105,117,16173,16206,16210,116,768,59,101,110,16181,16183,16194,32768,8834,113,512,59,113,16189,16191,32768,8838,59,32768,10949,101,113,512,59,113,16201,16203,32768,8842,59,32768,10955,109,59,32768,10951,512,98,112,16215,16218,59,32768,10965,59,32768,10963,99,1536,59,97,99,101,110,115,16235,16237,16245,16254,16258,16283,32768,8827,112,112,114,111,120,59,32768,10936,117,114,108,121,101,113,59,32768,8829,113,59,32768,10928,768,97,101,115,16265,16273,16278,112,112,114,111,120,59,32768,10938,113,113,59,32768,10934,105,109,59,32768,8937,105,109,59,32768,8831,59,32768,8721,103,59,32768,9834,3328,49,50,51,59,69,100,101,104,108,109,110,112,115,16322,16327,16332,16337,16339,16342,16356,16368,16382,16388,16394,16405,16411,33024,185,59,32768,185,33024,178,59,32768,178,33024,179,59,32768,179,32768,8835,59,32768,10950,512,111,115,16347,16351,116,59,32768,10942,117,98,59,32768,10968,512,59,100,16361,16363,32768,8839,111,116,59,32768,10948,115,512,111,117,16374,16378,108,59,32768,10185,98,59,32768,10967,97,114,114,59,32768,10619,117,108,116,59,32768,10946,512,69,101,16399,16402,59,32768,10956,59,32768,8843,108,117,115,59,32768,10944,768,101,105,117,16418,16451,16455,116,768,59,101,110,16426,16428,16439,32768,8835,113,512,59,113,16434,16436,32768,8839,59,32768,10950,101,113,512,59,113,16446,16448,32768,8843,59,32768,10956,109,59,32768,10952,512,98,112,16460,16463,59,32768,10964,59,32768,10966,768,65,97,110,16473,16478,16499,114,114,59,32768,8665,114,512,104,114,16484,16488,107,59,32768,10534,512,59,111,16493,16495,32768,8601,119,59,32768,8601,119,97,114,59,32768,10538,108,105,103,33024,223,59,32768,223,5938,16538,16552,16557,16579,16584,16591,0,16596,16692,0,0,0,0,0,16731,16780,0,16787,16908,0,0,0,16938,1091,16543,0,0,16549,103,101,116,59,32768,8982,59,32768,964,114,107,59,32768,9140,768,97,101,121,16563,16569,16575,114,111,110,59,32768,357,100,105,108,59,32768,355,59,32768,1090,111,116,59,32768,8411,108,114,101,99,59,32768,8981,114,59,32896,55349,56625,1024,101,105,107,111,16604,16641,16670,16684,835,16609,0,16624,101,512,52,102,16614,16617,59,32768,8756,111,114,101,59,32768,8756,97,768,59,115,118,16631,16633,16638,32768,952,121,109,59,32768,977,59,32768,977,512,99,110,16646,16665,107,512,97,115,16652,16660,112,112,114,111,120,59,32768,8776,105,109,59,32768,8764,115,112,59,32768,8201,512,97,115,16675,16679,112,59,32768,8776,105,109,59,32768,8764,114,110,33024,254,59,32768,254,829,16696,16701,16727,100,101,59,32768,732,101,115,33536,215,59,98,100,16710,16712,16723,32768,215,512,59,97,16717,16719,32768,8864,114,59,32768,10801,59,32768,10800,116,59,32768,8749,768,101,112,115,16737,16741,16775,97,59,32768,10536,1024,59,98,99,102,16750,16752,16757,16762,32768,8868,111,116,59,32768,9014,105,114,59,32768,10993,512,59,111,16767,16770,32896,55349,56677,114,107,59,32768,10970,97,59,32768,10537,114,105,109,101,59,32768,8244,768,97,105,112,16793,16798,16899,100,101,59,32768,8482,1792,97,100,101,109,112,115,116,16813,16868,16873,16876,16883,16889,16893,110,103,108,101,1280,59,100,108,113,114,16828,16830,16836,16850,16853,32768,9653,111,119,110,59,32768,9663,101,102,116,512,59,101,16844,16846,32768,9667,113,59,32768,8884,59,32768,8796,105,103,104,116,512,59,101,16862,16864,32768,9657,113,59,32768,8885,111,116,59,32768,9708,59,32768,8796,105,110,117,115,59,32768,10810,108,117,115,59,32768,10809,98,59,32768,10701,105,109,101,59,32768,10811,101,122,105,117,109,59,32768,9186,768,99,104,116,16914,16926,16931,512,114,121,16919,16923,59,32896,55349,56521,59,32768,1094,99,121,59,32768,1115,114,111,107,59,32768,359,512,105,111,16942,16947,120,116,59,32768,8812,104,101,97,100,512,108,114,16956,16967,101,102,116,97,114,114,111,119,59,32768,8606,105,103,104,116,97,114,114,111,119,59,32768,8608,4608,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,17016,17021,17026,17043,17057,17072,17095,17110,17119,17139,17172,17187,17202,17290,17330,17336,17365,17381,114,114,59,32768,8657,97,114,59,32768,10595,512,99,114,17031,17039,117,116,101,33024,250,59,32768,250,114,59,32768,8593,114,820,17049,0,17053,121,59,32768,1118,118,101,59,32768,365,512,105,121,17062,17069,114,99,33024,251,59,32768,251,59,32768,1091,768,97,98,104,17079,17084,17090,114,114,59,32768,8645,108,97,99,59,32768,369,97,114,59,32768,10606,512,105,114,17100,17106,115,104,116,59,32768,10622,59,32896,55349,56626,114,97,118,101,33024,249,59,32768,249,562,17123,17135,114,512,108,114,17128,17131,59,32768,8639,59,32768,8638,108,107,59,32768,9600,512,99,116,17144,17167,1088,17150,0,0,17163,114,110,512,59,101,17156,17158,32768,8988,114,59,32768,8988,111,112,59,32768,8975,114,105,59,32768,9720,512,97,108,17177,17182,99,114,59,32768,363,33024,168,59,32768,168,512,103,112,17192,17197,111,110,59,32768,371,102,59,32896,55349,56678,1536,97,100,104,108,115,117,17215,17222,17233,17257,17262,17280,114,114,111,119,59,32768,8593,111,119,110,97,114,114,111,119,59,32768,8597,97,114,112,111,111,110,512,108,114,17244,17250,101,102,116,59,32768,8639,105,103,104,116,59,32768,8638,117,115,59,32768,8846,105,768,59,104,108,17270,17272,17275,32768,965,59,32768,978,111,110,59,32768,965,112,97,114,114,111,119,115,59,32768,8648,768,99,105,116,17297,17320,17325,1088,17303,0,0,17316,114,110,512,59,101,17309,17311,32768,8989,114,59,32768,8989,111,112,59,32768,8974,110,103,59,32768,367,114,105,59,32768,9721,99,114,59,32896,55349,56522,768,100,105,114,17343,17348,17354,111,116,59,32768,8944,108,100,101,59,32768,361,105,512,59,102,17360,17362,32768,9653,59,32768,9652,512,97,109,17370,17375,114,114,59,32768,8648,108,33024,252,59,32768,252,97,110,103,108,101,59,32768,10663,3840,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,17420,17425,17437,17443,17613,17617,17623,17667,17672,17678,17693,17699,17705,17711,17754,114,114,59,32768,8661,97,114,512,59,118,17432,17434,32768,10984,59,32768,10985,97,115,104,59,32768,8872,512,110,114,17448,17454,103,114,116,59,32768,10652,1792,101,107,110,112,114,115,116,17469,17478,17485,17494,17515,17526,17578,112,115,105,108,111,110,59,32768,1013,97,112,112,97,59,32768,1008,111,116,104,105,110,103,59,32768,8709,768,104,105,114,17501,17505,17508,105,59,32768,981,59,32768,982,111,112,116,111,59,32768,8733,512,59,104,17520,17522,32768,8597,111,59,32768,1009,512,105,117,17531,17537,103,109,97,59,32768,962,512,98,112,17542,17560,115,101,116,110,101,113,512,59,113,17553,17556,32896,8842,65024,59,32896,10955,65024,115,101,116,110,101,113,512,59,113,17571,17574,32896,8843,65024,59,32896,10956,65024,512,104,114,17583,17589,101,116,97,59,32768,977,105,97,110,103,108,101,512,108,114,17600,17606,101,102,116,59,32768,8882,105,103,104,116,59,32768,8883,121,59,32768,1074,97,115,104,59,32768,8866,768,101,108,114,17630,17648,17654,768,59,98,101,17637,17639,17644,32768,8744,97,114,59,32768,8891,113,59,32768,8794,108,105,112,59,32768,8942,512,98,116,17659,17664,97,114,59,32768,124,59,32768,124,114,59,32896,55349,56627,116,114,105,59,32768,8882,115,117,512,98,112,17685,17689,59,32896,8834,8402,59,32896,8835,8402,112,102,59,32896,55349,56679,114,111,112,59,32768,8733,116,114,105,59,32768,8883,512,99,117,17716,17721,114,59,32896,55349,56523,512,98,112,17726,17740,110,512,69,101,17732,17736,59,32896,10955,65024,59,32896,8842,65024,110,512,69,101,17746,17750,59,32896,10956,65024,59,32896,8843,65024,105,103,122,97,103,59,32768,10650,1792,99,101,102,111,112,114,115,17777,17783,17815,17820,17826,17829,17842,105,114,99,59,32768,373,512,100,105,17788,17809,512,98,103,17793,17798,97,114,59,32768,10847,101,512,59,113,17804,17806,32768,8743,59,32768,8793,101,114,112,59,32768,8472,114,59,32896,55349,56628,112,102,59,32896,55349,56680,59,32768,8472,512,59,101,17834,17836,32768,8768,97,116,104,59,32768,8768,99,114,59,32896,55349,56524,5428,17871,17891,0,17897,0,17902,17917,0,0,17920,17935,17940,17945,0,0,17977,17992,0,18008,18024,18029,768,97,105,117,17877,17881,17886,112,59,32768,8898,114,99,59,32768,9711,112,59,32768,8899,116,114,105,59,32768,9661,114,59,32896,55349,56629,512,65,97,17906,17911,114,114,59,32768,10234,114,114,59,32768,10231,59,32768,958,512,65,97,17924,17929,114,114,59,32768,10232,114,114,59,32768,10229,97,112,59,32768,10236,105,115,59,32768,8955,768,100,112,116,17951,17956,17970,111,116,59,32768,10752,512,102,108,17961,17965,59,32896,55349,56681,117,115,59,32768,10753,105,109,101,59,32768,10754,512,65,97,17981,17986,114,114,59,32768,10233,114,114,59,32768,10230,512,99,113,17996,18001,114,59,32896,55349,56525,99,117,112,59,32768,10758,512,112,116,18012,18018,108,117,115,59,32768,10756,114,105,59,32768,9651,101,101,59,32768,8897,101,100,103,101,59,32768,8896,2048,97,99,101,102,105,111,115,117,18052,18068,18081,18087,18092,18097,18103,18109,99,512,117,121,18058,18065,116,101,33024,253,59,32768,253,59,32768,1103,512,105,121,18073,18078,114,99,59,32768,375,59,32768,1099,110,33024,165,59,32768,165,114,59,32896,55349,56630,99,121,59,32768,1111,112,102,59,32896,55349,56682,99,114,59,32896,55349,56526,512,99,109,18114,18118,121,59,32768,1102,108,33024,255,59,32768,255,2560,97,99,100,101,102,104,105,111,115,119,18145,18152,18166,18171,18186,18191,18196,18204,18210,18216,99,117,116,101,59,32768,378,512,97,121,18157,18163,114,111,110,59,32768,382,59,32768,1079,111,116,59,32768,380,512,101,116,18176,18182,116,114,102,59,32768,8488,97,59,32768,950,114,59,32896,55349,56631,99,121,59,32768,1078,103,114,97,114,114,59,32768,8669,112,102,59,32896,55349,56683,99,114,59,32896,55349,56527,512,106,110,18221,18224,59,32768,8205,106,59,32768,8204])}));unwrapExports(decodeDataHtml);var decodeDataXml=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=new Uint16Array([1024,97,103,108,113,9,23,27,31,1086,15,0,0,19,112,59,32768,38,111,115,59,32768,39,116,59,32768,62,116,59,32768,60,117,111,116,59,32768,34])}));unwrapExports(decodeDataXml);var decode_codepoint=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),i=String.fromCodePoint||function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)};e.default=function(t){var e;return t>=55296&&t<=57343||t>1114111?"�":i(null!==(e=n.get(t))&&void 0!==e?e:t)}}));unwrapExports(decode_codepoint);var require$$0=decodeDataHtml,require$$1=decodeDataXml,require$$2=decode_codepoint,decode=createCommonjsModule((function(t,e){var n=commonjsGlobal&&commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXML=e.decodeHTMLStrict=e.decodeHTML=e.determineBranch=e.JUMP_OFFSET_BASE=e.BinTrieFlags=e.xmlDecodeTree=e.htmlDecodeTree=void 0;var i=n(require$$0);e.htmlDecodeTree=i.default;var s=n(require$$1);e.xmlDecodeTree=s.default;var r,o=n(require$$2);function l(t){return function(e,n){for(var i="",s=0,l=0;(l=e.indexOf("&",l))>=0;)if(i+=e.slice(s,l),s=l,l+=1,35!==e.charCodeAt(l)){for(var h=null,u=1,d=0,p=t[d];l<e.length&&!((d=a(t,p,d+1,e.charCodeAt(l)))<0);l++,u++)(p=t[d])&r.HAS_VALUE&&(n&&59!==e.charCodeAt(l)?d+=1:(h=p&r.MULTI_BYTE?String.fromCharCode(t[++d],t[++d]):String.fromCharCode(t[++d]),u=0));null!=h&&(i+=h,s=l-u+1)}else{var m=l+1,c=10,x=e.charCodeAt(m);for(120==(32|x)&&(c=16,l+=1,m+=1);(x=e.charCodeAt(++l))>=48&&x<=57||16===c&&(32|x)>=97&&(32|x)<=102;);if(m!==l){var g=e.substring(m,l),y=parseInt(g,c);if(59===e.charCodeAt(l))l+=1;else if(n)continue;i+=o.default(y),s=l}}return i+e.slice(s)}}function a(t,n,i,s){if(n<=128)return s===n?i:-1;var o=(n&r.BRANCH_LENGTH)>>8;if(0===o)return-1;if(1===o)return s===t[i]?i+1:-1;var l=n&r.JUMP_TABLE;if(l){var a=s-e.JUMP_OFFSET_BASE-l;return a<0||a>o?-1:t[i+a]-1}for(var h=i,u=h+o-1;h<=u;){var d=h+u>>>1,p=t[d];if(p<s)h=d+1;else{if(!(p>s))return t[d+o];u=d-1}}return-1}!function(t){t[t.HAS_VALUE=32768]="HAS_VALUE",t[t.BRANCH_LENGTH=32512]="BRANCH_LENGTH",t[t.MULTI_BYTE=128]="MULTI_BYTE",t[t.JUMP_TABLE=127]="JUMP_TABLE"}(r=e.BinTrieFlags||(e.BinTrieFlags={})),e.JUMP_OFFSET_BASE=47,e.determineBranch=a;var h=l(i.default),u=l(s.default);e.decodeHTML=function(t){return h(t,!1)},e.decodeHTMLStrict=function(t){return h(t,!0)},e.decodeXML=function(t){return u(t,!0)}}));unwrapExports(decode);var decode_1=decode.decodeXML;decode.decodeHTMLStrict,decode.decodeHTML,decode.determineBranch,decode.JUMP_OFFSET_BASE,decode.BinTrieFlags,decode.xmlDecodeTree,decode.htmlDecodeTree;class BpmnXmlParser{constructor(){this.x2jOptions={attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,attributeValueProcessor:(t,e)=>decode_1(e)},this.xmlParser=new fxp_1(this.x2jOptions)}parse(t){let e;try{e=this.xmlParser.parse(t)}catch(t){throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}}class CollaborationConverter{constructor(t){this.convertedElements=t}deserialize(t){ensureIsArray(t).forEach((t=>this.parseCollaboration(t)))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerParticipant(new Participant(t.id,t.name,t.processRef))))}buildMessageFlows(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerMessageFlow(new MessageFlow(t.id,t.name,t.sourceRef,t.targetRef))))}buildGroups(t){ensureIsArray(t).forEach((t=>{const e=this.convertedElements.buildShapeBpmnGroup(t);e&&this.convertedElements.registerFlowNode(e)}))}}class JsonParsingWarning{}class ParsingMessageCollector{warning(t){const e=t.getMessage();console.warn(e.template,...e.arguments)}}class GroupUnknownCategoryValueWarning extends JsonParsingWarning{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueRef=e}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class ShapeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class EdgeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class LabelStyleMissingFontWarning extends JsonParsingWarning{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class LaneUnknownFlowNodeRefWarning extends JsonParsingWarning{constructor(t,e){super(),this.laneId=t,this.flowNodeRef=e}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class BoundaryEventNotAttachedToActivityWarning extends JsonParsingWarning{constructor(t,e,n){super(),this.bpmnElementId=t,this.attachedToRef=e,this.attachedToKind=n}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToRef,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class ProcessConverter{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e,this.defaultSequenceFlowIds=[]}deserialize(t){ensureIsArray(t).forEach((t=>this.parseProcess(t)))}parseProcess(t){this.convertedElements.registerProcess(new ShapeBpmnElement(t.id,t.name,exports.ShapeBpmnElementKind.POOL)),this.buildProcessInnerElements(t)}buildProcessInnerElements(t){const e=t.id;ShapeUtil.flowNodeKinds().filter((t=>t!=exports.ShapeBpmnElementKind.EVENT_BOUNDARY)).forEach((n=>this.buildFlowNodeBpmnElements(e,t[n],n))),this.buildFlowNodeBpmnElements(e,t.boundaryEvent,exports.ShapeBpmnElementKind.EVENT_BOUNDARY),this.buildLaneBpmnElements(e,t[exports.ShapeBpmnElementKind.LANE]),this.buildLaneSetBpmnElements(e,t.laneSet),this.buildSequenceFlows(t[exports.FlowKind.SEQUENCE_FLOW]),this.buildAssociationFlows(t[exports.FlowKind.ASSOCIATION_FLOW])}buildFlowNodeBpmnElements(t,e,n){ensureIsArray(e).forEach((e=>{let i;if(ShapeUtil.isEvent(n))i=this.buildShapeBpmnEvent(e,n,t);else if(ShapeUtil.isActivity(n))i=this.buildShapeBpmnActivity(e,n,t);else if(n==exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED){const n=e;i=new ShapeBpmnEventBasedGateway(e.id,n.name,t,n.instantiate,exports.ShapeBpmnEventBasedGatewayKind[n.eventGatewayType])}else if(n==exports.ShapeBpmnElementKind.GROUP)i=this.convertedElements.buildShapeBpmnGroup(e,t);else{const s=n===exports.ShapeBpmnElementKind.TEXT_ANNOTATION?e.text:e.name;i=new ShapeBpmnElement(e.id,s,n,t,e.instantiate)}const s=e.default;ShapeUtil.isWithDefaultSequenceFlow(n)&&s&&this.defaultSequenceFlowIds.push(s),i&&this.convertedElements.registerFlowNode(i)}))}buildShapeBpmnActivity(t,e,n){const i=ProcessConverter.buildMarkers(t);return ShapeUtil.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,n,i):ShapeUtil.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,n,i):new ShapeBpmnActivity(t.id,t.name,e,n,t.instantiate,i)}buildShapeBpmnCallActivity(t,e,n){const i=this.convertedElements.findGlobalTask(t.calledElement);return i?new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK,e,n,i):new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_PROCESS,e,n)}static buildMarkers(t){const e=[],n=t.standardLoopCharacteristics,i=ensureIsArray(t.multiInstanceLoopCharacteristics,!0)[0];return n||""===n?e.push(exports.ShapeBpmnMarkerKind.LOOP):i&&i.isSequential?e.push(exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL):(i&&!i.isSequential||""===i)&&e.push(exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL),e}buildShapeBpmnEvent(t,e,n){const i=this.getEventDefinitions(t),s=i.map((t=>t.counter)).reduce(((t,e)=>t+e),0);if(0==s&&ShapeUtil.canHaveNoneEvent(e))return new ShapeBpmnEvent(t.id,t.name,e,exports.ShapeBpmnEventDefinitionKind.NONE,n);if(1==s){const s=i[0].kind;return ShapeUtil.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,s):ShapeUtil.isStartEvent(e)?new ShapeBpmnStartEvent(t.id,t.name,s,n,t.isInterrupting):new ShapeBpmnEvent(t.id,t.name,e,s,n)}}buildShapeBpmnBoundaryEvent(t,e){const n=this.convertedElements.findFlowNode(t.attachedToRef);if(ShapeUtil.isActivity(null==n?void 0:n.kind))return new ShapeBpmnBoundaryEvent(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new BoundaryEventNotAttachedToActivityWarning(t.id,t.attachedToRef,null==n?void 0:n.kind))}getEventDefinitions(t){const e=new Map;return eventDefinitionKinds.forEach((n=>{const i=ensureIsArray(t[n+"EventDefinition"],!0).length;e.set(n,i)})),ensureIsArray(t.eventDefinitionRef).forEach((t=>{const n=this.convertedElements.findEventDefinitionOfDefinition(t);e.set(n,e.get(n)+1)})),Array.from(e.keys()).map((t=>({kind:t,counter:e.get(t)}))).filter((t=>t.counter>0))}buildShapeBpmnSubProcess(t,e,n){return this.buildSubProcessInnerElements(t),t.triggeredByEvent?new ShapeBpmnSubProcess(t.id,t.name,exports.ShapeBpmnSubProcessKind.EVENT,e,n):new ShapeBpmnSubProcess(t.id,t.name,exports.ShapeBpmnSubProcessKind.EMBEDDED,e,n)}buildSubProcessInnerElements(t){this.buildProcessInnerElements(t)}buildLaneSetBpmnElements(t,e){ensureIsArray(e).forEach((e=>this.buildLaneBpmnElements(t,e.lane)))}buildLaneBpmnElements(t,e){ensureIsArray(e).forEach((e=>{var n;this.convertedElements.registerLane(new ShapeBpmnElement(e.id,e.name,exports.ShapeBpmnElementKind.LANE,t)),this.assignParentOfLaneFlowNodes(e),(null===(n=e.childLaneSet)||void 0===n?void 0:n.lane)&&this.buildLaneBpmnElements(e.id,e.childLaneSet.lane)}))}assignParentOfLaneFlowNodes(t){ensureIsArray(t.flowNodeRef).forEach((e=>{const n=this.convertedElements.findFlowNode(e),i=t.id;n?ShapeUtil.isBoundaryEvent(n.kind)||(n.parentId=i):this.parsingMessageCollector.warning(new LaneUnknownFlowNodeRefWarning(i,e))}))}buildSequenceFlows(t){ensureIsArray(t).forEach((t=>{const e=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new SequenceFlow(t.id,t.name,t.sourceRef,t.targetRef,e))}))}buildAssociationFlows(t){ensureIsArray(t).forEach((t=>{const e=t.associationDirection;this.convertedElements.registerAssociationFlow(new AssociationFlow(t.id,void 0,t.sourceRef,t.targetRef,e))}))}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return exports.SequenceFlowKind.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&ShapeUtil.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return ShapeUtil.isActivity(e.kind)?exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY:exports.SequenceFlowKind.CONDITIONAL_FROM_GATEWAY}return exports.SequenceFlowKind.NORMAL}}class Bounds{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}}class Edge{constructor(t,e,n,i,s=exports.MessageVisibleKind.NONE){this.id=t,this.bpmnElement=e,this.waypoints=n,this.label=i,this.messageVisibleKind=s}}class Waypoint{constructor(t,e){this.x=t,this.y=e}}class Label{constructor(t,e){this.font=t,this.bounds=e}}class Font{constructor(t,e,n,i,s,r){this.name=t,this.size=e,this.isBold=n,this.isItalic=i,this.isUnderline=s,this.isStrikeThrough=r}}class DiagramConverter{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e,this.convertedFonts=new Map}deserialize(t){const e=[],n=[],i=[],s=[],r=ensureIsArray(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const t=r.BPMNPlane,o=this.deserializeEdges(t.BPMNEdge),l=this.deserializeShapes(t.BPMNShape);e.push(...l.flowNodes),n.push(...l.lanes),i.push(...l.pools),s.push(...o)}return{flowNodes:e,lanes:n,pools:i,edges:s}}deserializeFonts(t){this.convertedFonts=new Map,ensureIsArray(t).forEach((t=>ensureIsArray(t.Font).forEach((e=>this.convertedFonts.set(t.id,new Font(e.name,e.size,e.isBold,e.isItalic,e.isUnderline,e.isStrikeThrough))))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return ensureIsArray(t).forEach((t=>{this.deserializeShapeAndStoreIfFound(t,e.flowNodes,(t=>this.convertedElements.findFlowNode(t)))||this.deserializeShapeAndStoreIfFound(t,e.lanes,(t=>this.convertedElements.findLane(t)))||this.deserializeShapeAndStoreIfFound(t,e.pools,(t=>this.convertedElements.findProcess(t)))||this.parsingMessageCollector.warning(new ShapeUnknownBpmnElementWarning(t.bpmnElement))})),e}deserializeShapeAndStoreIfFound(t,e,n){const i=this.deserializeShape(t,n);return!!i&&(e.push(i),!0)}deserializeShape(t,e){const n=e(t.bpmnElement);if(n){const e=DiagramConverter.deserializeBounds(t);if(n.parentId){const t=this.convertedElements.findParticipantByProcessRef(n.parentId);t&&(n.parentId=t.id)}let i;(n instanceof ShapeBpmnSubProcess||n instanceof ShapeBpmnCallActivity&&n.callActivityKind===exports.ShapeBpmnCallActivityKind.CALLING_PROCESS)&&!t.isExpanded&&n.markers.push(exports.ShapeBpmnMarkerKind.EXPAND),ShapeUtil.isPoolOrLane(n.kind)&&(i=void 0===t.isHorizontal||t.isHorizontal);const s=this.deserializeLabel(t.BPMNLabel,t.id);return new Shape(t.id,n,e,s,i)}}static deserializeBounds(t){const e=t.Bounds;if(e)return new Bounds(e.x,e.y,e.width,e.height)}deserializeEdges(t){return ensureIsArray(t).map((t=>{const e=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!e)return void this.parsingMessageCollector.warning(new EdgeUnknownBpmnElementWarning(t.bpmnElement));const n=this.deserializeWaypoints(t.waypoint),i=this.deserializeLabel(t.BPMNLabel,t.id),s=t.messageVisibleKind?t.messageVisibleKind:exports.MessageVisibleKind.NONE;return new Edge(t.id,e,n,i,s)})).filter(Boolean)}deserializeWaypoints(t){return ensureIsArray(t).map((t=>new Waypoint(t.x,t.y)))}deserializeLabel(t,e){if(t&&"object"==typeof t){const n=this.findFont(t.labelStyle,e),i=DiagramConverter.deserializeBounds(t);if(n||i)return new Label(n,i)}}findFont(t,e){let n;return t&&(n=this.convertedFonts.get(t),n||this.parsingMessageCollector.warning(new LabelStyleMissingFontWarning(e,t))),n}}class EventDefinitionConverter{constructor(t){this.convertedElements=t}deserialize(t){eventDefinitionKinds.forEach((e=>{ensureIsArray(t[e+"EventDefinition"],!0).forEach((t=>this.convertedElements.registerEventDefinitionsOfDefinition(t.id,e)))}))}}class GlobalTaskConverter{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,exports.ShapeBpmnElementKind.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){ensureIsArray(t).forEach((t=>this.convertedElements.registerGlobalTask(t.id,e)))}}class ConvertedElements{constructor(t){this.parsingMessageCollector=t,this.participantsById=new Map,this.participantsByProcessRef=new Map,this.processes=new Map,this.messageFlows=new Map,this.flowNodes=new Map,this.lanes=new Map,this.sequenceFlows=new Map,this.associationFlows=new Map,this.eventDefinitionsOfDefinitions=new Map,this.globalTasks=new Map,this.categoryValues=new Map}findParticipantById(t){return this.participantsById.get(t)}findParticipantByProcessRef(t){return this.participantsByProcessRef.get(t)}registerParticipant(t){this.participantsById.set(t.id,t),t.processRef&&this.participantsByProcessRef.set(t.processRef,t)}_findProcess(t){return this.processes.get(t)}registerProcess(t){this.processes.set(t.id,t)}findProcess(t){const e=this.findParticipantById(t);if(e){const t=this._findProcess(e.processRef);if(t){const n=e.name||t.name;return new ShapeBpmnElement(e.id,n,t.kind,t.parentId)}return new ShapeBpmnElement(e.id,e.name,exports.ShapeBpmnElementKind.POOL)}}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}registerCategoryValues(t,e){this.categoryValues.set(t,{value:e})}buildShapeBpmnGroup(t,e){const n=this.categoryValues.get(t.categoryValueRef);if(n)return new ShapeBpmnElement(t.id,n.value,exports.ShapeBpmnElementKind.GROUP,e);this.parsingMessageCollector.warning(new GroupUnknownCategoryValueWarning(t.id,t.categoryValueRef))}}class CategoryConverter{constructor(t){this.convertedElements=t}deserialize(t){ensureIsArray(t.category).forEach((t=>ensureIsArray(t.categoryValue).forEach((t=>this.convertedElements.registerCategoryValues(t.id,t.value)))))}}class BpmnJsonParser{constructor(t,e,n,i,s,r){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=n,this.globalTaskConverter=i,this.processConverter=s,this.diagramConverter=r}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function newBpmnJsonParser(t){const e=new ConvertedElements(t);return new BpmnJsonParser(new CategoryConverter(e),new CollaborationConverter(e),new EventDefinitionConverter(e),new GlobalTaskConverter(e),new ProcessConverter(e,t),new DiagramConverter(e,t))}class BpmnParser{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function newBpmnParser(){return new BpmnParser(newBpmnJsonParser(new ParsingMessageCollector),new BpmnXmlParser)}class CssRegistry{constructor(){this.classNamesByBPMNId=new Map}clear(){this.classNamesByBPMNId.clear()}getClassNames(t){var e;return Array.from(null!==(e=this.classNamesByBPMNId.get(t))&&void 0!==e?e:[])}addClassNames(t,e){return this.updateClassNames(t,e,((t,e)=>t.add(e)))}removeClassNames(t,e){return this.updateClassNames(t,e,((t,e)=>t.delete(e)))}toggleClassNames(t,e){return this.updateClassNames(t,e,((t,e)=>t.has(e)?t.delete(e):t.add(e))),e&&e.length>0}updateClassNames(t,e,n){const i=this.getOrInitializeClassNames(t),s=i.size;return ensureIsArray(e).forEach((t=>n(i,t))),i.size!=s}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return null==e&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class OverlayConverter{constructor(){this.overlayPositions=new Map([["start",{horizontalAlign:"left",verticalAlign:"top"}],["middle",{horizontalAlign:"center",verticalAlign:"top"}],["end",{horizontalAlign:"right",verticalAlign:"top"}],["top-left",{horizontalAlign:"left",verticalAlign:"top"}],["top-right",{horizontalAlign:"right",verticalAlign:"top"}],["top-center",{horizontalAlign:"center",verticalAlign:"top"}],["bottom-left",{horizontalAlign:"left",verticalAlign:"bottom"}],["bottom-right",{horizontalAlign:"right",verticalAlign:"bottom"}],["bottom-center",{horizontalAlign:"center",verticalAlign:"bottom"}],["middle-left",{horizontalAlign:"left",verticalAlign:"middle"}],["middle-right",{horizontalAlign:"right",verticalAlign:"middle"}]])}convert(t){return{position:this.convertPosition(t),style:OverlayConverter.convertStyle(t)}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:exports.StyleDefault.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:exports.StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:exports.StyleDefault.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:exports.StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:exports.StyleDefault.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:exports.StyleDefault.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},n=t.style,i=Object.assign({},e);return n?(this.convertFill(i,n.fill),this.convertStroke(i,n.stroke),this.convertFont(i,n.font),i):i}static convertFill(t,e){var n,i;e&&(t.fill.color=null!==(n=e.color)&&void 0!==n?n:t.fill.color,t.fill.opacity=null!==(i=e.opacity)&&void 0!==i?i:t.fill.opacity)}static convertStroke(t,e){var n,i;e&&(t.stroke.color=null!==(n=e.color)&&void 0!==n?n:t.stroke.color,t.stroke.width=null!==(i=e.width)&&void 0!==i?i:t.stroke.width)}static convertFont(t,e){var n,i;e&&(t.font.color=null!==(n=e.color)&&void 0!==n?n:t.font.color,t.font.size=null!==(i=e.size)&&void 0!==i?i:t.font.size)}}function newGraphCellUpdater(t){return new GraphCellUpdater(t,new OverlayConverter)}class GraphCellUpdater{constructor(t,e){this.graph=t,this.overlayConverter=e}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(messageFowIconId(t),e)}updateAndRefreshCssClassesOfElement(t,e){var n;const i=this.graph.getModel().getCell(t);if(!i)return;const s=this.graph.getView().getState(i);s.style[BpmnStyleIdentifier.EXTRA_CSS_CLASSES]=e,s.shape.redraw(),null===(n=s.text)||void 0===n||n.redraw()}addOverlays(t,e){const n=this.graph.getModel().getCell(t);n&&ensureIsArray(e).forEach((t=>{const e=new MxGraphCustomOverlay(t.label,this.overlayConverter.convert(t));this.graph.addCellOverlay(n,e)}))}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);e&&this.graph.removeCellOverlays(e)}}class BpmnQuerySelectors{constructor(t){this.containerId=t}element(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function newBpmnElementsRegistry(t,e){var n;return new BpmnElementsRegistry(t,new HtmlElementRegistry(new BpmnQuerySelectors(null===(n=e.container)||void 0===n?void 0:n.id)),new CssRegistry,newGraphCellUpdater(e))}class BpmnElementsRegistry{constructor(t,e,n,i){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=n,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(this.cssRegistry.clear.bind(this.cssRegistry))}getElementsByIds(t){return ensureIsArray(t).map((t=>this.bpmnModelRegistry.getBpmnSemantic(t))).filter(Boolean).map((t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)})))}getElementsByKinds(t){return ensureIsArray(t).map((t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map((t=>({htmlElement:t,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(t.getAttribute("data-bpmn-id"))}))))).reduce(((t,e)=>(t.push(...e),t)),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,n){const i=ensureIsArray(e);ensureIsArray(t).forEach((t=>this.updateCellIfChanged(n(t,i),t)))}updateCellIfChanged(t,e){if(t){const t=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,t)}}addOverlays(t,e){this.graphCellUpdater.addOverlays(t,e)}removeAllOverlays(t){this.graphCellUpdater.removeAllOverlays(t)}}class HtmlElementRegistry{constructor(t){this.querySelectors=t}getBpmnHtmlElement(t){return document.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(computeBpmnBaseClassName(t));return[...document.querySelectorAll(e)]}}class BpmnModelRegistry{load(t){var e;return this.searchableModel=new SearchableModel(t),null===(e=this.onLoadCallback)||void 0===e||e.call(this),toRenderedModel(t)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const n=e.bpmnElement,i=n instanceof ShapeBpmnElement;return{id:t,name:n.name,isShape:i,kind:n.kind}}}function toRenderedModel(t){const e=t.flowNodes.filter((t=>{const e=t.bpmnElement;return ShapeUtil.isSubProcess(e.kind)&&e.markers.includes(exports.ShapeBpmnMarkerKind.EXPAND)})).map((t=>t.bpmnElement.id)),n=[],i=[],s=[];return t.flowNodes.forEach((t=>{const r=t.bpmnElement.kind;ShapeUtil.isSubProcess(r)?n.push(t):ShapeUtil.isBoundaryEvent(r)?i.push(t):e.includes(t.bpmnElement.parentId)||s.push(t)})),{boundaryEvents:i,edges:t.edges,lanes:t.lanes,otherFlowNodes:s,pools:t.pools,subprocesses:n}}class SearchableModel{constructor(t){this.elements=new Map,[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach((t=>this.elements.set(t.bpmnElement.id,t)))}elementById(t){return this.elements.get(t)}}function htmlElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}const libVersion="0.23.0",version=()=>({lib:libVersion,dependencies:new Map([["mxGraph",mxgraph.mxClient.VERSION]])});class BpmnVisualization{constructor(t){const e=new GraphConfigurator(htmlElement(null==t?void 0:t.container));this.graph=e.configure(t),this.bpmnModelRegistry=new BpmnModelRegistry,this.bpmnElementsRegistry=newBpmnElementsRegistry(this.bpmnModelRegistry,this.graph)}load(t,e){const n=newBpmnParser().parse(t),i=this.bpmnModelRegistry.load(n);newBpmnRenderer(this.graph).render(i,e)}fit(t){this.graph.customFit(t)}getVersion(){return version()}}return exports.BpmnCanvas=BpmnCanvas,exports.BpmnElementsRegistry=BpmnElementsRegistry,exports.BpmnStyleIdentifier=BpmnStyleIdentifier,exports.BpmnVisualization=BpmnVisualization,exports.IconPainter=IconPainter,exports.IconPainterProvider=IconPainterProvider,exports.MarkerIdentifier=MarkerIdentifier,exports.ShapeUtil=ShapeUtil,exports.StyleConfigurator=StyleConfigurator,exports.StyleUtils=StyleUtils,Object.defineProperty(exports,"__esModule",{value:!0}),exports}({});
+var bpmnvisu=function(exports){"use strict";var FitType,ShapeBpmnElementKind,ShapeBpmnCallActivityKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventDefinitionKind,ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind;function convertEmptyStringAndObject(t,e){return""===t?e?{}:void 0:t}function ensureIsArray(t,e=!1){if(null==t)return[];let n;return n=Array.isArray(t)?t.map((t=>convertEmptyStringAndObject(t,e))):[convertEmptyStringAndObject(t,e)],n.filter(Boolean)}function filter(t,e,n){let i="";return(null==n?void 0:n.startingWith)?i=i.concat(`^(${n.startingWith}).*`):(null==n?void 0:n.notStartingWith)&&(i=i.concat(`^(?!(${n.notStartingWith})).*`)),i=i.concat(`${e}$`),t.filter((t=>(null==n?void 0:n.ignoreCase)?new RegExp(i,"i").test(t):new RegExp(i).test(t)))}exports.FitType=void 0,FitType=exports.FitType||(exports.FitType={}),FitType.None="None",FitType.HorizontalVertical="HorizontalVertical",FitType.Horizontal="Horizontal",FitType.Vertical="Vertical",FitType.Center="Center",exports.ShapeBpmnElementKind=void 0,ShapeBpmnElementKind=exports.ShapeBpmnElementKind||(exports.ShapeBpmnElementKind={}),ShapeBpmnElementKind.LANE="lane",ShapeBpmnElementKind.POOL="pool",ShapeBpmnElementKind.CALL_ACTIVITY="callActivity",ShapeBpmnElementKind.SUB_PROCESS="subProcess",ShapeBpmnElementKind.TASK="task",ShapeBpmnElementKind.TASK_USER="userTask",ShapeBpmnElementKind.TASK_SERVICE="serviceTask",ShapeBpmnElementKind.TASK_RECEIVE="receiveTask",ShapeBpmnElementKind.TASK_SEND="sendTask",ShapeBpmnElementKind.TASK_MANUAL="manualTask",ShapeBpmnElementKind.TASK_SCRIPT="scriptTask",ShapeBpmnElementKind.TASK_BUSINESS_RULE="businessRuleTask",ShapeBpmnElementKind.GLOBAL_TASK="globalTask",ShapeBpmnElementKind.GLOBAL_TASK_USER="globalUserTask",ShapeBpmnElementKind.GLOBAL_TASK_MANUAL="globalManualTask",ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT="globalScriptTask",ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",ShapeBpmnElementKind.GROUP="group",ShapeBpmnElementKind.TEXT_ANNOTATION="textAnnotation",ShapeBpmnElementKind.GATEWAY_PARALLEL="parallelGateway",ShapeBpmnElementKind.GATEWAY_EXCLUSIVE="exclusiveGateway",ShapeBpmnElementKind.GATEWAY_INCLUSIVE="inclusiveGateway",ShapeBpmnElementKind.GATEWAY_EVENT_BASED="eventBasedGateway",ShapeBpmnElementKind.EVENT_START="startEvent",ShapeBpmnElementKind.EVENT_END="endEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",ShapeBpmnElementKind.EVENT_BOUNDARY="boundaryEvent",exports.ShapeBpmnCallActivityKind=void 0,ShapeBpmnCallActivityKind=exports.ShapeBpmnCallActivityKind||(exports.ShapeBpmnCallActivityKind={}),ShapeBpmnCallActivityKind.CALLING_PROCESS="process",ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK="global task",exports.ShapeBpmnEventBasedGatewayKind=void 0,ShapeBpmnEventBasedGatewayKind=exports.ShapeBpmnEventBasedGatewayKind||(exports.ShapeBpmnEventBasedGatewayKind={}),ShapeBpmnEventBasedGatewayKind.Exclusive="Exclusive",ShapeBpmnEventBasedGatewayKind.None="None",ShapeBpmnEventBasedGatewayKind.Parallel="Parallel",exports.ShapeBpmnEventDefinitionKind=void 0,ShapeBpmnEventDefinitionKind=exports.ShapeBpmnEventDefinitionKind||(exports.ShapeBpmnEventDefinitionKind={}),ShapeBpmnEventDefinitionKind.NONE="none",ShapeBpmnEventDefinitionKind.TERMINATE="terminate",ShapeBpmnEventDefinitionKind.CANCEL="cancel",ShapeBpmnEventDefinitionKind.COMPENSATION="compensate",ShapeBpmnEventDefinitionKind.CONDITIONAL="conditional",ShapeBpmnEventDefinitionKind.ERROR="error",ShapeBpmnEventDefinitionKind.ESCALATION="escalation",ShapeBpmnEventDefinitionKind.LINK="link",ShapeBpmnEventDefinitionKind.MESSAGE="message",ShapeBpmnEventDefinitionKind.SIGNAL="signal",ShapeBpmnEventDefinitionKind.TIMER="timer",exports.ShapeBpmnMarkerKind=void 0,ShapeBpmnMarkerKind=exports.ShapeBpmnMarkerKind||(exports.ShapeBpmnMarkerKind={}),ShapeBpmnMarkerKind.ADHOC="adhoc",ShapeBpmnMarkerKind.COMPENSATION="compensation",ShapeBpmnMarkerKind.EXPAND="expand",ShapeBpmnMarkerKind.LOOP="loop",ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL="parallel multi instance",ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",exports.ShapeBpmnSubProcessKind=void 0,ShapeBpmnSubProcessKind=exports.ShapeBpmnSubProcessKind||(exports.ShapeBpmnSubProcessKind={}),ShapeBpmnSubProcessKind.EMBEDDED="embedded",ShapeBpmnSubProcessKind.EVENT="event";class ShapeUtil{static isEvent(t){return isKindOf(EVENT_KINDS,t)}static eventKinds(){return[...EVENT_KINDS]}static isBoundaryEvent(t){return exports.ShapeBpmnElementKind.EVENT_BOUNDARY===t}static isStartEvent(t){return exports.ShapeBpmnElementKind.EVENT_START===t}static isCallActivity(t){return exports.ShapeBpmnElementKind.CALL_ACTIVITY===t}static isSubProcess(t){return exports.ShapeBpmnElementKind.SUB_PROCESS===t}static canHaveNoneEvent(t){return exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW===t||exports.ShapeBpmnElementKind.EVENT_END===t||exports.ShapeBpmnElementKind.EVENT_START===t}static isActivity(t){return isKindOf(ACTIVITY_KINDS,t)}static activityKinds(){return[...ACTIVITY_KINDS]}static isWithDefaultSequenceFlow(t){return FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS.includes(t)}static isTask(t){return isKindOf(TASK_KINDS,t)}static taskKinds(){return[...TASK_KINDS]}static gatewayKinds(){return[...GATEWAY_KINDS]}static isGateway(t){return isKindOf(GATEWAY_KINDS,t)}static flowNodeKinds(){return Object.values(exports.ShapeBpmnElementKind).filter((t=>!ShapeUtil.isPoolOrLane(t)))}static isPoolOrLane(t){return t==exports.ShapeBpmnElementKind.POOL||t==exports.ShapeBpmnElementKind.LANE}}function filterKind(t,e){return filter(Object.values(exports.ShapeBpmnElementKind),t,e)}function isKindOf(t,e){return Object.values(t).map((t=>t)).includes(e)}const EVENT_KINDS=filterKind("Event"),GATEWAY_KINDS=filterKind("Gateway"),TASK_KINDS=filterKind("Task",{ignoreCase:!0,notStartingWith:"global"}),ACTIVITY_KINDS=[...TASK_KINDS,exports.ShapeBpmnElementKind.CALL_ACTIVITY,exports.ShapeBpmnElementKind.SUB_PROCESS],FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS=[...ACTIVITY_KINDS,exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE],eventDefinitionKinds=Object.values(exports.ShapeBpmnEventDefinitionKind).filter((t=>t!=exports.ShapeBpmnEventDefinitionKind.NONE));var AssociationDirectionKind,FlowKind,MessageVisibleKind,SequenceFlowKind;exports.AssociationDirectionKind=void 0,AssociationDirectionKind=exports.AssociationDirectionKind||(exports.AssociationDirectionKind={}),AssociationDirectionKind.NONE="None",AssociationDirectionKind.ONE="One",AssociationDirectionKind.BOTH="Both",exports.FlowKind=void 0,FlowKind=exports.FlowKind||(exports.FlowKind={}),FlowKind.SEQUENCE_FLOW="sequenceFlow",FlowKind.MESSAGE_FLOW="messageFlow",FlowKind.ASSOCIATION_FLOW="association",exports.MessageVisibleKind=void 0,MessageVisibleKind=exports.MessageVisibleKind||(exports.MessageVisibleKind={}),MessageVisibleKind.NONE="none",MessageVisibleKind.INITIATING="initiating",MessageVisibleKind.NON_INITIATING="non_initiating",exports.SequenceFlowKind=void 0,SequenceFlowKind=exports.SequenceFlowKind||(exports.SequenceFlowKind={}),SequenceFlowKind.NORMAL="normal",SequenceFlowKind.DEFAULT="default",SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",SequenceFlowKind.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}var build=createCommonjsModule((function(module){!function(t,e){module.exports?module.exports=e():t.mxgraph=e()}(commonjsGlobal,(function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.2.2",IS_IE:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:null!=navigator.userAgent&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:null!=navigator.userAgent&&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:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:"undefined"!=typeof InstallTrigger,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:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||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:null!=window.PointerEvent&&!(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,n,i){if(n=n||document,mxClient.IS_IE6)n.write('<link rel="'+t+'" href="'+e+'" charset="UTF-8" type="text/css"/>');else{var s=n.createElement("link");s.setAttribute("rel",t),s.setAttribute("href",e),s.setAttribute("charset","UTF-8"),s.setAttribute("type","text/css"),i&&s.setAttribute("id",i),n.getElementsByTagName("head")[0].appendChild(s)}},loadResources:function(t,e){var n=mxClient.defaultBundles.length;function i(){0==--n&&t()}for(var s=0;s<mxClient.defaultBundles.length;s++)mxResources.add(mxClient.defaultBundles[s],e,i)},include:function(t){document.write('<script src="'+t+'"><\/script>')}},node;"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&mxBasePath.length>0?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&mxImageBasePath.length>0?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(null!=document.namespaces&&(8==document.documentMode?(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")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?(node=document.createElement("style"),node.type="text/css",node.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(node)):document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||null==module.exports)&&(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=void 0!==mxClient?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var n=document.createElement("tbody"),i=document.createElement("tr"),s=document.createElement("td");s.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",s.appendChild(mxLog.textarea),i.appendChild(s),n.appendChild(i),i=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),i.appendChild(mxLog.td),n.appendChild(i),e.appendChild(n),mxLog.addButton("Info",(function(t){mxLog.info()})),mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)})),mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")})),mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var r=0,o=0;if("number"==typeof window.innerWidth?(r=window.innerHeight,o=window.innerWidth):(r=document.documentElement.clientHeight||document.body.clientHeight,o=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,o-320),Math.max(0,r-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var l=mxLog.window.getElement(),a=function(t,e){mxLog.textarea.style.height=Math.max(0,l.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a),mxLog.window.addListener(mxEvent.MAXIMIZE,a),mxLog.window.addListener(mxEvent.NORMALIZE,a),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var n=document.createElement("button");mxUtils.write(n,t),mxEvent.addListener(n,"click",e),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var n=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");null!=mxLog.textarea?(mxLog.textarea.value=mxLog.textarea.value+t,null!=navigator.userAgent&&navigator.userAgent.indexOf("Presto/2.5")>=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");mxLog.write(t+"\n")}};__mxOutput.mxLog=void 0!==mxLog?mxLog:void 0;var mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(t){if(null!=t){if(null==t[mxObjectIdentity.FIELD_NAME])if("object"==typeof t){var e=mxUtils.getFunctionName(t.constructor);t[mxObjectIdentity.FIELD_NAME]=e+"#"+mxObjectIdentity.counter++}else"function"==typeof t&&(t[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return t[mxObjectIdentity.FIELD_NAME]}return null},clear:function(t){"object"!=typeof t&&"function"!=typeof t||delete t[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}__mxOutput.mxObjectIdentity=void 0!==mxObjectIdentity?mxObjectIdentity:void 0,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 n=mxObjectIdentity.get(t),i=this.map[n];return this.map[n]=e,i},mxDictionary.prototype.remove=function(t){var e=mxObjectIdentity.get(t),n=this.map[e];return delete this.map[e],n},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=void 0!==mxDictionary?mxDictionary:void 0;var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(t){return null==mxClient.languages||mxUtils.indexOf(mxClient.languages,t)>=0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var n=e.indexOf("-");n>0&&(e=e.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,n){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){var i=mxResources.getDefaultBundle(t,e),s=mxResources.getSpecialBundle(t,e),r=function(){if(null!=s)if(n)mxUtils.get(s,(function(t){mxResources.parse(t.getText()),n()}),(function(){n()}));else try{var t=mxUtils.load(s);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=n&&n()};if(null!=i)if(n)mxUtils.get(i,(function(t){mxResources.parse(t.getText()),r()}),(function(){r()}));else try{var o=mxUtils.load(i);o.isReady()&&mxResources.parse(o.getText()),r()}catch(t){}else r()}},parse:function(t){if(null!=t)for(var e=t.split("\n"),n=0;n<e.length;n++)if("#"!=e[n].charAt(0)){var i=e[n].indexOf("=");if(i>0){var s=e[n].substring(0,i),r=e[n].length;13==e[n].charCodeAt(r-1)&&r--;var o=e[n].substring(i+1,r);this.resourcesEncoded?(o=o.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[s]=unescape(o)):mxResources.resources[s]=o}}},get:function(t,e,n){var i=mxResources.resources[t];return null==i&&(i=n),null!=i&&null!=e&&(i=mxResources.replacePlaceholders(i,e)),i},replacePlaceholders:function(t,e){for(var n=[],i=null,s=0;s<t.length;s++){var r=t.charAt(s);"{"==r?i="":null!=i&&"}"==r?((i=parseInt(i)-1)>=0&&i<e.length&&n.push(e[i]),i=null):null!=i?i+=r:n.push(r)}return n.join("")},loadResources:function(t){mxResources.add(mxClient.basePath+"/resources/editor",null,(function(){mxResources.add(mxClient.basePath+"/resources/graph",null,t)}))}};function mxPoint(t,e){this.x=null!=t?t:0,this.y=null!=e?e:0}function mxRectangle(t,e,n,i){mxPoint.call(this,t,e),this.width=null!=n?n:0,this.height=null!=i?i:0}__mxOutput.mxResources=void 0!==mxResources?mxResources:void 0,mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},__mxOutput.mxPoint=void 0!==mxPoint?mxPoint:void 0,mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(t){if(null!=t){var e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width),s=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.y=n,this.width=i-e,this.height=s-n}},mxRectangle.prototype.intersect=function(t){if(null!=t){var e=this.x+this.width,n=t.x+t.width,i=this.y+this.height,s=t.y+t.height;this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.width=Math.min(e,n)-this.x,this.height=Math.min(i,s)-this.y}},mxRectangle.prototype.grow=function(t){return this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t,this},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.rotate90=function(){var t=(this.width-this.height)/2;this.x+=t,this.y-=t;var e=this.width;this.width=this.height,this.height=e},mxRectangle.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y&&t.width==this.width&&t.height==this.height},mxRectangle.fromRectangle=function(t){return new mxRectangle(t.x,t.y,t.width,t.height)},__mxOutput.mxRectangle=void 0!==mxRectangle?mxRectangle:void 0;var mxEffects={animateChanges:function(t,e,n){var i=10,s=0,r=function(){for(var l=!1,a=0;a<e.length;a++){var h=e[a];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,!1);if(null!=u)if(l=!0,h.constructor!=mxGeometryChange||t.model.isEdge(h.cell))mxUtils.setOpacity(u.shape.node,100*s/i);else{var d=t.getView().scale,p=(h.geometry.x-h.previous.x)*d,m=(h.geometry.y-h.previous.y)*d,c=(h.geometry.width-h.previous.width)*d,x=(h.geometry.height-h.previous.height)*d;0==s?(u.x-=p,u.y-=m,u.width-=c,u.height-=x):(u.x+=p/i,u.y+=m/i,u.width+=c/i,u.height+=x/i),t.cellRenderer.redraw(u),mxEffects.cascadeOpacity(t,h.cell,100*s/i)}}}s<i&&l?(s++,window.setTimeout(r,o)):null!=n&&n()},o=30;r()},cascadeOpacity:function(t,e,n){for(var i=t.model.getChildCount(e),s=0;s<i;s++){var r=t.model.getChildAt(e,s),o=t.getView().getState(r);null!=o&&(mxUtils.setOpacity(o.shape.node,n),mxEffects.cascadeOpacity(t,r,n))}var l=t.model.getEdges(e);if(null!=l)for(s=0;s<l.length;s++){var a=t.getView().getState(l[s]);null!=a&&mxUtils.setOpacity(a.shape.node,n)}},fadeOut:function(t,e,n,i,s,r){i=i||40,s=s||30;var o=e||100;if(mxUtils.setOpacity(t,o),r||null==r){var l=function(){o=Math.max(o-i,0),mxUtils.setOpacity(t,o),o>0?window.setTimeout(l,s):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(l,s)}else t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=void 0!==mxEffects?mxEffects:void 0;var mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxUtils.removeCursors(e[i])},getCurrentStyle:mxClient.IS_IE&&(null==document.documentMode||document.documentMode<9)?function(t){return null!=t?t.currentStyle:null}:function(t){return null!=t?window.getComputedStyle(t,""):null},parseCssNumber:function(t){return"thin"==t?t="2":"medium"==t?t="4":"thick"==t&&(t="6"),t=parseFloat(t),isNaN(t)&&(t=0),t},setPrefixedStyle:(prefix=null,mxClient.IS_OT?prefix="O":mxClient.IS_SF||mxClient.IS_GC?prefix="Webkit":mxClient.IS_MT?prefix="Moz":mxClient.IS_IE&&document.documentMode>=9&&document.documentMode<10&&(prefix="ms"),function(t,e,n){t[e]=n,null!=prefix&&e.length>0&&(t[e=prefix+e.substring(0,1).toUpperCase()+e.substring(1)]=n)}),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return null!=e&&("scroll"==e.overflow||"auto"==e.overflow)},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(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,n){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=t.getAttribute(e);if(null!=i&&i==n)return t}for(t=t.firstChild;null!=t;){var s=mxUtils.findNode(t,e,n);if(null!=s)return s;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(null!=t)if(null!=t.name)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){var n=(e=mxUtils.ltrim(e.substring(9))).indexOf("(");n>0&&(e=e.substring(0,n))}return e},indexOf:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(t[n]==e)return n;return-1},forEach:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)e(t[n]);return t},remove:function(t,e){var n=null;if("object"==typeof e)for(var i=mxUtils.indexOf(e,t);i>=0;)e.splice(i,1),n=t,i=mxUtils.indexOf(e,t);for(var s in e)e[s]==t&&(delete e[s],n=t);return n},isNode:function(t,e,n,i){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==n||t.getAttribute(n)==i)},isAncestorNode:function(t,e){for(var n=e;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var n=[],i=t.firstChild;null!=i;)i.nodeType==e&&n.push(i),i=i.nextSibling;return n},importNode:function(t,e,n){return mxClient.IS_IE&&(null==document.documentMode||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,n):t.importNode(e,n)},importNodeImplementation:function(t,e,n){switch(e.nodeType){case 1:var i=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var s=0;s<e.attributes.length;s++)i.setAttribute(e.attributes[s].nodeName,e.getAttribute(e.attributes[s].nodeName));if(n&&e.childNodes&&e.childNodes.length>0)for(s=0;s<e.childNodes.length;s++)i.appendChild(mxUtils.importNodeImplementation(t,e.childNodes[s],n));return i;case 3:case 4:case 8:return t.createTextNode(null!=e.nodeValue?e.nodeValue:e.value)}},createXmlDocument:function(){var t=null;return document.implementation&&document.implementation.createDocument?t=document.implementation.createDocument("","",null):"ActiveXObject"in window&&(t=mxUtils.createMsXmlDocument()),t},createMsXmlDocument:function(){var t=new ActiveXObject("Microsoft.XMLDOM");return t.async=!1,t.validateOnParse=!1,t.resolveExternals=!1,t},parseXml:window.DOMParser?function(t){return(new DOMParser).parseFromString(t,"text/xml")}:function(t){var e=mxUtils.createMsXmlDocument();return e.loadXML(t),e},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){},removeWhitespace:function(t,e){for(var n=e?t.previousSibling:t.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var i=e?n.previousSibling:n.nextSibling,s=mxUtils.getTextContent(n);0==mxUtils.trim(s).length&&n.parentNode.removeChild(n),n=i}},htmlEntities:function(t,e){return t=(t=(t=(t=(t=(t=String(t||"")).replace(/&/g,"&amp;")).replace(/"/g,"&quot;")).replace(/\'/g,"&#39;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),(null==e||e)&&(t=t.replace(/\n/g,"&#xa;")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var n="";if(mxClient.IS_IE||mxClient.IS_IE11)n=mxUtils.getPrettyXml(t,"","","");else if(null!=window.XMLSerializer){n=(new XMLSerializer).serializeToString(t)}else null!=t.xml&&(n=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return e=e||"&#xa;",n=n.replace(/\n/g,e)},getPrettyXml:function(t,e,n,i,s){var r=[];if(null!=t)if(e=null!=e?e:"  ",n=null!=n?n:"",i=null!=i?i:"\n",null!=t.namespaceURI&&t.namespaceURI!=s&&(s=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)r.push(mxUtils.getPrettyXml(t.documentElement,e,n,i,s));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){if(null!=(l=t.firstChild))for(;null!=l;)r.push(mxUtils.getPrettyXml(l,e,n,i,s)),l=l.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){(o=mxUtils.getTextContent(t)).length>0&&r.push(n+"\x3c!--"+o+"--\x3e"+i)}else if(t.nodeType==mxConstants.NODETYPE_TEXT){(o=mxUtils.trim(mxUtils.getTextContent(t))).length>0&&r.push(n+mxUtils.htmlEntities(o,!1)+i)}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var o;(o=mxUtils.getTextContent(t)).length>0&&r.push(n+"<![CDATA["+o+"]]"+i)}else{r.push(n+"<"+t.nodeName);var l,a=t.attributes;if(null!=a)for(var h=0;h<a.length;h++){var u=mxUtils.htmlEntities(a[h].value);r.push(" "+a[h].nodeName+'="'+u+'"')}if(null!=(l=t.firstChild)){for(r.push(">"+i);null!=l;)r.push(mxUtils.getPrettyXml(l,e,n+e,i,s)),l=l.nextSibling;r.push(n+"</"+t.nodeName+">"+i)}else r.push(" />"+i)}return r.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],n=[];return function t(i){if(1!=i.length||"BR"!=i[0].nodeName&&"\n"!=i[0].innerHTML)for(var s=0;s<i.length;s++){var r=i[s];"BR"==r.nodeName||"\n"==r.innerHTML||(1==i.length||0==s)&&"DIV"==r.nodeName&&"<br>"==r.innerHTML.toLowerCase()?n.push("\n"):(3===r.nodeType||4===r.nodeType?r.nodeValue.length>0&&n.push(r.nodeValue):8!==r.nodeType&&r.childNodes.length>0&&t(r.childNodes),s<i.length-1&&mxUtils.indexOf(e,i[s+1].nodeName)>=0&&n.push("\n"))}}(t),n.join("")},replaceTrailingNewlines:function(t,e){for(var n="";t.length>0&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),n+=e;return t+n},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},getOuterHtml:mxClient.IS_IE?function(t){if(null!=t){if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var n=t.attributes;if(null!=n)for(var i=0;i<n.length;i++){var s=n[i].value;null!=s&&s.length>0&&(e.push(" "),e.push(n[i].nodeName),e.push('="'),e.push(s),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("</"+t.nodeName+">")),e.join("")}return""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},write:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(n),n},writeln:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var n=null,i=0;i<e;i++)null!=t&&(n=t.ownerDocument.createElement("br"),t.appendChild(n));return n},button:function(t,e,n){var i=(n=null!=n?n:document).createElement("button");return mxUtils.write(i,t),mxEvent.addListener(i,"click",(function(t){e(t)})),i},para:function(t,e){var n=document.createElement("p");return mxUtils.write(n,e),null!=t&&t.appendChild(n),n},addTransparentBackgroundFilter:function(t){t.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(t,e,n,i,s){return mxUtils.link(t,e,(function(){n.execute(i)}),s)},linkInvoke:function(t,e,n,i,s,r){return mxUtils.link(t,e,(function(){n[i](s)}),r)},link:function(t,e,n,i){var s=document.createElement("span");return s.style.color="blue",s.style.textDecoration="underline",s.style.cursor="pointer",null!=i&&(s.style.paddingLeft=i+"px"),mxEvent.addListener(s,"click",n),mxUtils.write(s,e),null!=t&&t.appendChild(s),s},getDocumentSize:function(){var t=document.body,e=document.documentElement;try{return new mxRectangle(0,0,t.clientWidth||e.clientWidth,Math.max(t.clientHeight||0,e.clientHeight))}catch(t){return new mxRectangle}},fit:function(t){var e=mxUtils.getDocumentSize(),n=parseInt(t.offsetLeft),i=parseInt(t.offsetWidth),s=mxUtils.getDocumentScrollOrigin(t.ownerDocument),r=s.x,o=s.y,l=r+e.width;n+i>l&&(t.style.left=Math.max(r,l-i)+"px");var a=parseInt(t.offsetTop),h=parseInt(t.offsetHeight),u=o+e.height;a+h>u&&(t.style.top=Math.max(o,u-h)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,n,i,s,r,o){var l=new mxXmlRequest(t,null,"GET"),a=l.setRequestHeaders;return o&&(l.setRequestHeaders=function(t,e){for(var n in a.apply(this,arguments),o)t.setRequestHeader(n,o[n])}),null!=i&&l.setBinary(i),l.send(e,n,s,r),l},getAll:function(t,e,n){for(var i=t.length,s=[],r=0,o=function(){0==r&&null!=n&&n(),r++},l=0;l<t.length;l++)!function(t,n){mxUtils.get(t,(function(t){var r=t.getStatus();r<200||r>299?o():(s[n]=t,0==--i&&e(s))}),o)}(t[l],l);0==i&&e(s)},post:function(t,e,n,i){return new mxXmlRequest(t,e).send(n,i)},submit:function(t,e,n,i){return new mxXmlRequest(t,e).simulate(n,i)},loadInto:function(t,e,n){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&n()}:e.addEventListener("load",n,!1),e.load(t)},getValue:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n),i},getNumber:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n||0),Number(i)},getColor:function(t,e,n){var i=null!=t?t[e]:null;return null==i?i=n:i==mxConstants.NONE&&(i=null),i},clone:function(t,e,n){n=null!=n&&n;var i=null;if(null!=t&&"function"==typeof t.constructor)for(var s in i=new t.constructor,t)s!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,s)<0)&&(n||"object"!=typeof t[s]?i[s]=t[s]:i[s]=mxUtils.clone(t[s]));return i},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(null!=t[n]&&null==e[n]||null==t[n]&&null!=e[n]||null!=t[n]&&null!=e[n]&&(t[n].x!=e[n].x||t[n].y!=e[n].y))return!1;return!0},equalEntries:function(t,e){var n=0;if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e){for(var i in e)n++;for(var i in t)if(n--,!(mxUtils.isNaN(t[i])&&mxUtils.isNaN(e[i])||t[i]==e[i]))return!1}return 0==n},removeDuplicates:function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.get(t[i])||(n.push(t[i]),e.put(t[i],!0));return n},isNaN:function(t){return"number"==typeof t&&isNaN(t)},extend:function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},toString:function(t){var e="";for(var n in t)try{if(null==t[n])e+=n+" = [null]\n";else if("function"==typeof t[n])e+=n+" => [Function]\n";else if("object"==typeof t[n]){e+=n+" => ["+mxUtils.getFunctionName(t[n].constructor)+"]\n"}else e+=n+" = "+t[n]+"\n"}catch(t){e+=n+"="+t.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,n,i,s,r,o,l,a){if(l-=t,a-=e,0===n||0===i)return j;var h=o,u=s;n=Math.abs(n),i=Math.abs(i);var d,p=-l/2,m=-a/2,c=Math.cos(u*Math.PI/180),x=Math.sin(u*Math.PI/180),g=c*p+x*m,y=-1*x*p+c*m,f=g*g,v=y*y,C=n*n,E=i*i,S=f/C+v/E;if(S>1)n=Math.sqrt(S)*n,i=Math.sqrt(S)*i,d=0;else{var T=1;r===h&&(T=-1),d=T*Math.sqrt((C*E-C*v-E*f)/(C*v+E*f))}var b=d*n*y/i,w=-1*d*i*g/n,L=c*b-x*w+l/2,I=x*b+c*w+a/2,A=Math.atan2((y-w)/i,(g-b)/n)-Math.atan2(0,1),O=A>=0?A:2*Math.PI+A,_=(A=Math.atan2((-y-w)/i,(-g-b)/n)-Math.atan2((y-w)/i,(g-b)/n))>=0?A:2*Math.PI+A;0==h&&_>0?_-=2*Math.PI:0!=h&&_<0&&(_+=2*Math.PI);for(var P=2*_/Math.PI,M=Math.ceil(P<0?-1*P:P),R=_/M,N=8/3*Math.sin(R/4)*Math.sin(R/4)/Math.sin(R/2),D=c*n,H=c*i,G=x*n,U=x*i,V=Math.cos(O),B=Math.sin(O),F=-N*(D*B+U*V),k=-N*(G*B-H*V),Y=0,z=0,j=[],W=0;W<M;++W){O+=R,Y=D*(V=Math.cos(O))-U*(B=Math.sin(O))+L,z=G*V+H*B+I;var K=-N*(D*B+U*V),X=-N*(G*B-H*V),Z=6*W;j[Z]=Number(F+t),j[Z+1]=Number(k+e),j[Z+2]=Number(Y-K+t),j[Z+3]=Number(z-X+e),j[Z+4]=Number(Y+t),j[Z+5]=Number(z+e),F=Y+K,k=z+X}return j},getBoundingBox:function(t,e,n){var i=null;if(null!=t&&null!=e&&0!=e){var s=mxUtils.toRadians(e),r=Math.cos(s),o=Math.sin(s);n=null!=n?n:new mxPoint(t.x+t.width/2,t.y+t.height/2);var l=new mxPoint(t.x,t.y),a=new mxPoint(t.x+t.width,t.y),h=new mxPoint(a.x,t.y+t.height),u=new mxPoint(t.x,h.y);l=mxUtils.getRotatedPoint(l,r,o,n),a=mxUtils.getRotatedPoint(a,r,o,n),h=mxUtils.getRotatedPoint(h,r,o,n),u=mxUtils.getRotatedPoint(u,r,o,n),(i=new mxRectangle(l.x,l.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),i.add(new mxRectangle(h.x,h.y,0,0)),i.add(new mxRectangle(u.x,u.y,0,0))}return i},getRotatedPoint:function(t,e,n,i){i=null!=i?i:new mxPoint;var s=t.x-i.x,r=t.y-i.y,o=r*e+s*n;return new mxPoint(s*e-r*n+i.x,o+i.y)},getPortConstraints:function(t,e,n,i){var s=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==s)return i;var r=s.toString(),o=mxConstants.DIRECTION_MASK_NONE,l=0;1==mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0));var a=0;if(l>45?(a=1,l>=135&&(a=2)):l<-45&&(a=3,l<=-135&&(a=2)),r.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:o|=mxConstants.DIRECTION_MASK_EAST;break;case 2:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:o|=mxConstants.DIRECTION_MASK_WEST}if(r.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_WEST;break;case 1:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:o|=mxConstants.DIRECTION_MASK_EAST;break;case 3:o|=mxConstants.DIRECTION_MASK_SOUTH}if(r.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:o|=mxConstants.DIRECTION_MASK_WEST;break;case 2:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:o|=mxConstants.DIRECTION_MASK_EAST}if(r.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_EAST;break;case 1:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:o|=mxConstants.DIRECTION_MASK_WEST;break;case 3:o|=mxConstants.DIRECTION_MASK_NORTH}return o},reversePortConstraints:function(t){var e=0;return 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},findNearestSegment:function(t,e,n){var i=-1;if(t.absolutePoints.length>0)for(var s=t.absolutePoints[0],r=null,o=1;o<t.absolutePoints.length;o++){var l=t.absolutePoints[o],a=mxUtils.ptSegDistSq(s.x,s.y,l.x,l.y,e,n);(null==r||a<r)&&(r=a,i=o-1),s=l}return i},getDirectedBounds:function(t,e,n,i,s){var r=mxUtils.getValue(n,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);if(i=null!=i?i:mxUtils.getValue(n,mxConstants.STYLE_FLIPH,!1),s=null!=s?s:mxUtils.getValue(n,mxConstants.STYLE_FLIPV,!1),e.x=Math.round(Math.max(0,Math.min(t.width,e.x))),e.y=Math.round(Math.max(0,Math.min(t.height,e.y))),e.width=Math.round(Math.max(0,Math.min(t.width,e.width))),e.height=Math.round(Math.max(0,Math.min(t.height,e.height))),s&&(r==mxConstants.DIRECTION_SOUTH||r==mxConstants.DIRECTION_NORTH)||i&&(r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST)){var o=e.x;e.x=e.width,e.width=o}if(i&&(r==mxConstants.DIRECTION_SOUTH||r==mxConstants.DIRECTION_NORTH)||s&&(r==mxConstants.DIRECTION_EAST||r==mxConstants.DIRECTION_WEST)){o=e.y;e.y=e.height,e.height=o}var l=mxRectangle.fromRectangle(e);return r==mxConstants.DIRECTION_SOUTH?(l.y=e.x,l.x=e.height,l.width=e.y,l.height=e.width):r==mxConstants.DIRECTION_WEST?(l.y=e.height,l.x=e.width,l.width=e.x,l.height=e.y):r==mxConstants.DIRECTION_NORTH&&(l.y=e.width,l.x=e.y,l.width=e.height,l.height=e.x),new mxRectangle(t.x+l.x,t.y+l.y,t.width-l.width-l.x,t.height-l.height-l.y)},getPerimeterPoint:function(t,e,n){for(var i=null,s=0;s<t.length-1;s++){var r=mxUtils.intersection(t[s].x,t[s].y,t[s+1].x,t[s+1].y,e.x,e.y,n.x,n.y);if(null!=r){var o=n.x-r.x,l=n.y-r.y,a={p:r,distSq:l*l+o*o};null!=a&&(null==i||i.distSq>a.distSq)&&(i=a)}}return null!=i?i.p:null},rectangleIntersectsSegment:function(t,e,n){var i=t.y,s=t.x,r=i+t.height,o=s+t.width,l=e.x,a=n.x;if(e.x>n.x&&(l=n.x,a=e.x),a>o&&(a=o),l<s&&(l=s),l>a)return!1;var h=e.y,u=n.y,d=n.x-e.x;if(Math.abs(d)>1e-7){var p=(n.y-e.y)/d,m=e.y-p*e.x;h=p*l+m,u=p*a+m}if(h>u){var c=u;u=h,h=c}return u>r&&(u=r),h<i&&(h=i),!(h>u)},contains:function(t,e,n){return t.x<=e&&t.x+t.width>=e&&t.y<=n&&t.y+t.height>=n},intersects:function(t,e){var n=t.width,i=t.height,s=e.width,r=e.height;if(s<=0||r<=0||n<=0||i<=0)return!1;var o=t.x,l=t.y,a=e.x,h=e.y;return r+=h,n+=o,i+=l,((s+=a)<a||s>o)&&(r<h||r>l)&&(n<o||n>a)&&(i<l||i>h)},intersectsHotspot:function(t,e,n,i,s,r){if(s=null!=s?s:0,r=null!=r?r:0,(i=null!=i?i:1)>0){var o=t.getCenterX(),l=t.getCenterY(),a=t.width,h=t.height,u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;u>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(l=t.y+u/2,h=u):(o=t.x+u/2,a=u)),a=Math.max(s,a*i),h=Math.max(s,h*i),r>0&&(a=Math.min(a,r),h=Math.min(h,r));var d=new mxRectangle(o-a/2,l-h/2,a,h),p=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=p){var m=Math.cos(-p),c=Math.sin(-p),x=(o=new mxPoint(t.getCenterX(),t.getCenterY()),mxUtils.getRotatedPoint(new mxPoint(e,n),m,c,o));e=x.x,n=x.y}return mxUtils.contains(d,e,n)}return!0},getOffset:function(t,e){for(var n=0,i=0,s=!1,r=t,o=document.body,l=document.documentElement;null!=r&&r!=o&&r!=l&&!s;){var a=mxUtils.getCurrentStyle(r);null!=a&&(s=s||"fixed"==a.position),r=r.parentNode}if(!e&&!s){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);n+=h.x,i+=h.y}var u=t.getBoundingClientRect();return null!=u&&(n+=u.left,i+=u.top),new mxPoint(n,i)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow;return new mxPoint(null!=e&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=e&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,n){e=null!=e&&e,n=null==n||n;for(var i=null!=t?t.ownerDocument:document,s=i.body,r=i.documentElement,o=new mxPoint,l=!1;null!=t&&t!=s&&t!=r;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(o.x+=t.scrollLeft,o.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(l=l||"fixed"==a.position),t=e?t.parentNode:null}if(!l&&n){var h=mxUtils.getDocumentScrollOrigin(i);o.x+=h.x,o.y+=h.y}return o},convertPoint:function(t,e,n){var i=mxUtils.getScrollOrigin(t,!1),s=mxUtils.getOffset(t);return s.x-=i.x,s.y-=i.y,new mxPoint(e-s.x,n-s.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?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)&&("string"!=typeof t||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,n,i,s,r,o,l){var a=(l-r)*(n-t)-(o-s)*(i-e),h=((o-s)*(e-r)-(l-r)*(t-s))/a,u=((n-t)*(e-r)-(i-e)*(t-s))/a;return h>=0&&h<=1&&u>=0&&u<=1?new mxPoint(t+h*(n-t),e+h*(i-e)):null},ptSegDistSq:function(t,e,n,i,s,r){var o,l=(s-=t)*(n-=t)+(r-=e)*(i-=e);o=l<=0||(l=(s=n-s)*n+(r=i-r)*i)<=0?0:l*l/(n*n+i*i);var a=s*s+r*r-o;return a<0&&(a=0),a},ptLineDist:function(t,e,n,i,s,r){return Math.abs((i-e)*s-(n-t)*r+n*e-i*t)/Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))},relativeCcw:function(t,e,n,i,s,r){var o=(s-=t)*(i-=e)-(r-=e)*(n-=t);return 0==o&&(o=s*n+r*i)>0&&(o=(s-=n)*n+(r-=i)*i)<0&&(o=0),o<0?-1:o>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,n,i,s,r){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=e>=100?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=e>=100?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=null==e||e;var n=new mxDictionary;return t.sort((function(t,i){var s=n.get(t);null==s&&(s=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),n.put(t,s));var r=n.get(i);null==r&&(r=mxCellPath.create(i).split(mxCellPath.PATH_SEPARATOR),n.put(i,r));var o=mxCellPath.compare(s,r);return 0==o?0:o>0==e?1:-1})),t},getStylename:function(t){if(null!=t){var e=t.split(";")[0];if(e.indexOf("=")<0)return e}return""},getStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)n[i].indexOf("=")<0&&e.push(n[i]);return e},indexOfStylename:function(t,e){if(null!=t&&null!=e)for(var n=t.split(";"),i=0,s=0;s<n.length;s++){if(n[s]==e)return i;i+=n[s].length+1}return-1},addStylename:function(t,e){return mxUtils.indexOfStylename(t,e)<0&&(null==t?t="":t.length>0&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var n=[];if(null!=t)for(var i=t.split(";"),s=0;s<i.length;s++)i[s]!=e&&n.push(i[s]);return n.join(";")},removeAllStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)n[i].indexOf("=")>=0&&e.push(n[i]);return e.join(";")},setCellStyles:function(t,e,n,i){if(null!=e&&e.length>0){t.beginUpdate();try{for(var s=0;s<e.length;s++)if(null!=e[s]){var r=mxUtils.setStyle(t.getStyle(e[s]),n,i);t.setStyle(e[s],r)}}finally{t.endUpdate()}}},setStyle:function(t,e,n){var i=null!=n&&(void 0===n.length||n.length>0);if(null==t||0==t.length)i&&(t=e+"="+n+";");else if(t.substring(0,e.length+1)==e+"="){var s=t.indexOf(";");t=i?e+"="+n+(s<0?";":t.substring(s)):s<0||s==t.length-1?"":t.substring(s+1)}else{var r=t.indexOf(";"+e+"=");if(r<0){if(i){var o=";"==t.charAt(t.length-1)?"":";";t=t+o+e+"="+n+";"}}else{s=t.indexOf(";",r+1);t=i?t.substring(0,r+1)+e+"="+n+(s<0?";":t.substring(s)):t.substring(0,r)+(s<0?";":t.substring(s))}}return t},setCellStyleFlags:function(t,e,n,i,s){if(null!=e&&e.length>0){t.beginUpdate();try{for(var r=0;r<e.length;r++)if(null!=e[r]){var o=mxUtils.setStyleFlag(t.getStyle(e[r]),n,i,s);t.setStyle(e[r],o)}}finally{t.endUpdate()}}},setStyleFlag:function(t,e,n,i){if(null==t||0==t.length)t=i||null==i?e+"="+n:e+"=0";else{var s=t.indexOf(e+"=");if(s<0){var r=";"==t.charAt(t.length-1)?"":";";t=i||null==i?t+r+e+"="+n:t+r+e+"=0"}else{var o=t.indexOf(";",s),l="";l=o<0?t.substring(s+e.length+1):t.substring(s+e.length+1,o),l=null==i?parseInt(l)^n:i?parseInt(l)|n:parseInt(l)&~n,t=t.substring(0,s)+e+"="+l+(o>=0?t.substring(o):"")}}return t},getAlignmentAsPoint:function(t,e){var n=-.5,i=-.5;return t==mxConstants.ALIGN_LEFT?n=0:t==mxConstants.ALIGN_RIGHT&&(n=-1),e==mxConstants.ALIGN_TOP?i=0:e==mxConstants.ALIGN_BOTTOM&&(i=-1),new mxPoint(n,i)},getSizeForString:function(t,e,n,i,s){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var r=document.createElement("div");if(r.style.fontFamily=n,r.style.fontSize=Math.round(e)+"px",r.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=s){(s&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(r.style.fontWeight="bold"),(s&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(r.style.fontStyle="italic");var o=[];(s&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&o.push("underline"),(s&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&o.push("line-through"),o.length>0&&(r.style.textDecoration=o.join(" "))}r.style.position="absolute",r.style.visibility="hidden",r.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",r.style.zoom="1",null!=i?(r.style.width=i+"px",r.style.whiteSpace="normal"):r.style.whiteSpace="nowrap",r.innerHTML=t,document.body.appendChild(r);var l=new mxRectangle(0,0,r.offsetWidth,r.offsetHeight);return document.body.removeChild(r),l},getViewXml:function(t,e,n,i,s){(i=null!=i?i:0,s=null!=s?s:0,e=null!=e?e:1,null==n)&&(n=[t.getModel().getRoot()]);var r=t.getView(),o=null,l=r.isEventsEnabled();r.setEventsEnabled(!1);var a=r.drawPane,h=r.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(r.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.drawPane),r.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.overlayPane)):(r.drawPane=r.drawPane.cloneNode(!1),r.canvas.appendChild(r.drawPane),r.overlayPane=r.overlayPane.cloneNode(!1),r.canvas.appendChild(r.overlayPane));var u=r.getTranslate();r.translate=new mxPoint(i,s);var d=new mxTemporaryCellStates(t.getView(),e,n);try{o=(new mxCodec).encode(t.getView())}finally{d.destroy(),r.translate=u,r.canvas.removeChild(r.drawPane),r.canvas.removeChild(r.overlayPane),r.drawPane=a,r.overlayPane=h,r.setEventsEnabled(l)}return o},getScaleForPageCount:function(t,e,n,i){if(t<1)return 1;i=null!=i?i:0;var s=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*i,r=n.height-2*i,o=e.getGraphBounds().clone(),l=e.getView().getScale();o.width/=l,o.height/=l;var a=o.width,h=a/o.height/(s/r),u=Math.sqrt(t),d=Math.sqrt(h),p=u*d,m=u/d;if(p<1&&m>t){var c=m/t;m=t,p/=c}if(m<1&&p>t){c=p/t;p=t,m/=c}for(var x=Math.ceil(p)*Math.ceil(m),g=0;x>t;){var y=Math.floor(p)/p,f=Math.floor(m)/m;1==y&&(y=Math.floor(p-1)/p),1==f&&(f=Math.floor(m-1)/m);c=1;if(p*=c=y>f?y:f,m*=c,x=Math.ceil(p)*Math.ceil(m),++g>10)break}return.99999*(s*p/a)},show:function(t,e,n,i,s,r){(n=null!=n?n:0,i=null!=i?i:0,null==e)?e=window.open().document:e.open();9==document.documentMode&&e.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var o=t.getGraphBounds(),l=Math.ceil(n-o.x),a=Math.ceil(i-o.y);if(null==s&&(s=Math.ceil(o.width+n)+Math.ceil(Math.ceil(o.x)-o.x)),null==r&&(r=Math.ceil(o.height+i)+Math.ceil(Math.ceil(o.y)-o.y)),mxClient.IS_IE||11==document.documentMode){for(var h="<html><head>",u=document.getElementsByTagName("base"),d=0;d<u.length;d++)h+=u[d].outerHTML;h+="<style>";for(d=0;d<document.styleSheets.length;d++)try{h+=document.styleSheets[d].cssText}catch(t){}h+='</style></head><body style="margin:0px;">',h+='<div style="position:absolute;overflow:hidden;width:'+s+"px;height:"+r+'px;"><div style="position:relative;left:'+l+"px;top:"+a+'px;">',h+=t.container.innerHTML,h+="</div></div></body><html>",e.writeln(h),e.close()}else{e.writeln("<html><head>");for(u=document.getElementsByTagName("base"),d=0;d<u.length;d++)e.writeln(mxUtils.getOuterHtml(u[d]));var p=document.getElementsByTagName("link");for(d=0;d<p.length;d++)e.writeln(mxUtils.getOuterHtml(p[d]));var m=document.getElementsByTagName("style");for(d=0;d<m.length;d++)e.writeln(mxUtils.getOuterHtml(m[d]));e.writeln('</head><body style="margin:0px;"></body></html>'),e.close();var c=e.createElement("div");c.position="absolute",c.overflow="hidden",c.style.width=s+"px",c.style.height=r+"px";var x=e.createElement("div");x.style.position="absolute",x.style.left=l+"px",x.style.top=a+"px";for(var g=t.container.firstChild,y=null;null!=g;){var f=g.cloneNode(!0);g==t.view.drawPane.ownerSVGElement?(c.appendChild(f),y=f):x.appendChild(f),g=g.nextSibling}e.body.appendChild(c),null!=x.firstChild&&e.body.appendChild(x),null!=y&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+l+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var n=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(n,500):n()},popup:function(t,e){if(e){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px",(s=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),n.appendChild(s),(i=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),i.setVisible(!0)}else{var i,s;if(mxClient.IS_NS)(i=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(t)+"</pre"),i.document.close();else(s=(i=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),i.document.body.appendChild(s)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,n,i){var s=document.createElement("div");s.style.padding="20px";var r=document.createElement("img");r.setAttribute("src",i||mxUtils.errorImage),r.setAttribute("valign","bottom"),r.style.verticalAlign="middle",s.appendChild(r),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),mxUtils.write(s,t);var o=document.body.clientWidth,l=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,s,(o-e)/2,l/4,e,null,!1,!0);if(n){mxUtils.br(s);var h=document.createElement("p"),u=document.createElement("button");mxClient.IS_IE?u.style.cssText="float:right":u.setAttribute("style","float:right"),mxEvent.addListener(u,"click",(function(t){a.destroy()})),mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),h.appendChild(u),s.appendChild(h),mxUtils.br(s),a.setClosable(!0)}return a.setVisible(!0),a},makeDraggable:function(t,e,n,i,s,r,o,l,a,h){var u=new mxDragSource(t,n);return u.dragOffset=new mxPoint(null!=s?s:0,null!=r?r:mxConstants.TOOLTIP_VERTICAL_OFFSET),u.autoscroll=o,u.setGuidesEnabled(!1),null!=a&&(u.highlightDropTargets=a),null!=h&&(u.getDropTarget=h),u.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=i&&(u.createDragElement=function(){return i.cloneNode(!0)},l&&(u.createPreviewElement=function(t){var e=i.cloneNode(!0),n=parseInt(e.style.width),s=parseInt(e.style.height);return e.style.width=Math.round(n*t.view.scale)+"px",e.style.height=Math.round(s*t.view.scale)+"px",e})),u}},prefix;__mxOutput.mxUtils=void 0!==mxUtils?mxUtils:void 0;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:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_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"};function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e<arguments.length;e+=2)null!=arguments[e+1]&&(this.properties[arguments[e]]=arguments[e+1])}function mxMouseEvent(t,e){this.evt=t,this.state=e,this.sourceState=e}function mxEventSource(t){this.setEventSource(t)}__mxOutput.mxConstants=void 0!==mxConstants?mxConstants:void 0,mxEventObject.prototype.name=null,mxEventObject.prototype.properties=null,mxEventObject.prototype.consumed=!1,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=!0},__mxOutput.mxEventObject=void 0!==mxEventObject?mxEventObject:void 0,mxMouseEvent.prototype.consumed=!1,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){return null!=t&&mxUtils.isAncestorNode(t.node,this.getSource())},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();return null!=t?t.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(t){(t=null!=t?t:null!=this.evt.touches||mxEvent.isMouseEvent(this.evt))&&this.evt.preventDefault&&this.evt.preventDefault(),mxClient.IS_IE&&(this.evt.returnValue=!0),this.consumed=!0},__mxOutput.mxMouseEvent=void 0!==mxMouseEvent?mxMouseEvent:void 0,mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,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){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(t),this.eventListeners.push(e)},mxEventSource.prototype.removeListener=function(t){if(null!=this.eventListeners)for(var e=0;e<this.eventListeners.length;)this.eventListeners[e+1]==t?this.eventListeners.splice(e,2):e+=2},mxEventSource.prototype.fireEvent=function(t,e){if(null!=this.eventListeners&&this.isEventsEnabled()){null==t&&(t=new mxEventObject),null==e&&(e=this.getEventSource()),null==e&&(e=this);for(var n=[e,t],i=0;i<this.eventListeners.length;i+=2){var s=this.eventListeners[i];null!=s&&s!=t.getName()||this.eventListeners[i+1].apply(this,n)}}},__mxOutput.mxEventSource=void 0!==mxEventSource?mxEventSource:void 0;var mxEvent={addListener:(updateListenerList=function(t,e,n){null==t.mxListenerList&&(t.mxListenerList=[]);var i={name:e,f:n};t.mxListenerList.push(i)},window.addEventListener?function(t,e,n){t.addEventListener(e,n,!1),updateListenerList(t,e,n)}:function(t,e,n){t.attachEvent("on"+e,n),updateListenerList(t,e,n)}),removeListener:(updateListener=function(t,e,n){if(null!=t.mxListenerList){for(var i=t.mxListenerList.length,s=0;s<i;s++)if(t.mxListenerList[s].f==n){t.mxListenerList.splice(s,1);break}0==t.mxListenerList.length&&(t.mxListenerList=null)}},window.removeEventListener?function(t,e,n){t.removeEventListener(e,n,!1),updateListener(t,0,n)}:function(t,e,n){t.detachEvent("on"+e,n),updateListener(t,0,n)}),removeAllListeners:function(t){var e=t.mxListenerList;if(null!=e)for(;e.length>0;){var n=e[0];mxEvent.removeListener(t,n.name,n.f)}},addGestureListeners:function(t,e,n,i){null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=n&&mxEvent.addListener(t,"touchmove",n),null!=i&&mxEvent.addListener(t,"touchend",i))},removeGestureListeners:function(t,e,n,i){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=n&&mxEvent.removeListener(t,"touchmove",n),null!=i&&mxEvent.removeListener(t,"touchend",i))},redirectMouseEvents:function(t,e,n,i,s,r,o){var l=function(t){return"function"==typeof n?n(t):n};mxEvent.addGestureListeners(t,(function(t){null!=i?i(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,l(t)))}),(function(t){null!=s?s(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,l(t)))}),(function(t){null!=r?r(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,l(t)))})),mxEvent.addListener(t,"dblclick",(function(t){if(null!=o)o(t);else if(!mxEvent.isConsumed(t)){var n=l(t);e.dblClick(t,null!=n?n.cell:null)}}))},release:function(t){try{if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxEvent.release(e[i])}}catch(t){}},addMouseWheelListener:function(t,e){if(null!=t){if(e=null!=e?e:window,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;Math.abs(i)>.2&&(t(e,i<0,!0),n=e.scale)})),mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}else{var i=[],s=0,r=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(t){mxEvent.isMouseEvent(t)||null==t.pointerId||i.push(t)})),mxUtils.bind(this,(function(e){if(!mxEvent.isMouseEvent(e)&&2==i.length){for(var n=0;n<i.length;n++)if(e.pointerId==i[n].pointerId){i[n]=e;break}var o=Math.abs(i[0].clientX-i[1].clientX),l=Math.abs(i[0].clientY-i[1].clientY),a=Math.abs(o-s),h=Math.abs(l-r);if(a>mxEvent.PINCH_THRESHOLD||h>mxEvent.PINCH_THRESHOLD){var u=i[0].clientX+(i[1].clientX-i[0].clientX)/2,d=i[0].clientY+(i[1].clientY-i[0].clientY)/2;t(i[0],a>h?o>s:l>r,!0,u,d),s=o,r=l}}})),mxUtils.bind(this,(function(t){i=[],s=0,r=0})))}mxEvent.addListener(e,"wheel",(function(e){null==e&&(e=window.event),e.ctrlKey&&e.preventDefault(),e.deltaY,(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5)&&t(e,0==e.deltaY?-e.deltaX>0:-e.deltaY>0)}))}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){return t.preventDefault&&t.preventDefault(),!1}))},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&t.touches.length>1},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return!("buttons"in t)||"mousedown"!=t.type&&"mousemove"!=t.type?"which"in t?1===t.which:1===t.button:1==t.buttons},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},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 null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,n){n=null==n||n,(e=null==e||e)&&(t.preventDefault?(n&&t.stopPropagation(),t.preventDefault()):n&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},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},updateListener,updateListenerList;function mxXmlRequest(t,e,n,i,s,r){this.url=t,this.params=e,this.method=n||"POST",this.async=null==i||i,this.username=s,this.password=r}__mxOutput.mxEvent=void 0!==mxEvent?mxEvent:void 0,mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,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 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,n,i){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,(function(){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),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(null==document.documentMode||document.documentMode>9)&&window.XMLHttpRequest&&null!=n&&null!=i&&(this.request.timeout=n,this.request.ontimeout=i),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){var n=null;(t=t||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var i=t.createElement("form");i.setAttribute("method",this.method),i.setAttribute("action",this.url),null!=e&&i.setAttribute("target",e),i.style.display="none",i.style.visibility="hidden";for(var s=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),r=0;r<s.length;r++){var o=s[r].indexOf("=");if(o>0){var l=s[r].substring(0,o),a=s[r].substring(o+1);this.decodeSimulateValues&&(a=decodeURIComponent(a));var h=t.createElement("textarea");h.setAttribute("wrap","off"),h.setAttribute("name",l),mxUtils.write(h,a),i.appendChild(h)}}t.body.appendChild(i),i.submit(),null!=i.parentNode&&i.parentNode.removeChild(i),null!=n&&(window.onbeforeunload=n)},__mxOutput.mxXmlRequest=void 0!==mxXmlRequest?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var n=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(n)),n},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var n=mxClipboard.insertCount*mxClipboard.STEPSIZE,i=t.getDefaultParent();e=t.importCells(e,n,n,i),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};function mxWindow(t,e,n,i,s,r,o,l,a,h){null!=e&&(o=null==o||o,this.content=e,this.init(n,i,s,r,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(t),(null==l||l)&&this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,n){this.src=t,this.width=e,this.height=n}function mxDivResizer(t,e){if("div"==t.nodeName.toLowerCase()){null==e&&(e=window),this.div=t;var n=mxUtils.getCurrentStyle(t);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)}))),this.resize()}}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 n=e.getProperty("eventName"),i=e.getProperty("event");n!=mxEvent.MOUSE_DOWN&&i.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}__mxOutput.mxClipboard=void 0!==mxClipboard?mxClipboard:void 0,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=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,n,i,s){s=null!=s?s:"mxWindow",this.div=document.createElement("div"),this.div.className=s,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=s,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.height=i+"px"),this.table.style.height=i+"px");var r=document.createElement("tbody"),o=document.createElement("tr");this.title=document.createElement("td"),this.title.className=s+"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),o.appendChild(this.title),r.appendChild(o),o=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=s+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=s+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),o.appendChild(this.td),r.appendChild(o),this.table.appendChild(r),this.div.appendChild(this.table);var l=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,l),mxEvent.addGestureListeners(this.table,l),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var n=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=n}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(null==navigator.userAgent||navigator.userAgent.indexOf("Presto/2.5")<0)&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=null!=t?t.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}var i=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",i))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){if(t)if(null==this.resize){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,n=null,i=null,s=null,r=mxUtils.bind(this,(function(t){this.activate(),e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.div.offsetWidth,s=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){if(null!=e&&null!=n){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setSize(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t)}})),l=mxUtils.bind(this,(function(t){null!=e&&null!=n&&(e=null,n=null,mxEvent.removeGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))}));mxEvent.addGestureListeners(this.resize,r,o,l),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(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),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",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=!1,e=null,n=null,i=mxUtils.bind(this,(function(i){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=n),this.table.style.height=n,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",i));else{t=!0,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",n=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",i))}mxEvent.consume(i)}));mxEvent.addGestureListeners(this.minimize,i)},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=!1,e=null,n=null,i=null,s=null,r=null,o=mxUtils.bind(this,(function(o){if(this.activate(),"none"!=this.maximize.style.display){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=r,this.div.style.left=e+"px",this.div.style.top=n+"px",!mxClient.IS_QUIRKS)this.div.style.height=i,this.div.style.width=s,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.table.style.height=i,this.table.style.width=s,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",o))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",r=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),n=parseInt(this.div.style.top),i=this.table.style.height,s=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var l=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=l-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=l-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS)"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",o))}mxEvent.consume(o)}}));mxEvent.addGestureListeners(this.maximize,o),mxEvent.addListener(this.title,"dblclick",o)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.getX(),s=this.getY(),r=mxUtils.bind(this,(function(t){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setLocation(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)}))),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)),this.destroyOnClose?this.destroy():this.setVisible(!1),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(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(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)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=void 0!==mxWindow?mxWindow:void 0,mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");n.appendChild(i),i=document.createElement("td");var s=document.createElement("button");mxUtils.write(s,mxResources.get("ok")||"OK"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){t()})),s=document.createElement("button"),mxUtils.write(s,mxResources.get("cancel")||"Cancel"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){e()})),n.appendChild(i),this.body.appendChild(n)},mxForm.prototype.addText=function(t,e,n){var i=document.createElement("input");return i.setAttribute("type",n||"text"),i.value=e,this.addField(t,i)},mxForm.prototype.addCheckbox=function(t,e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(t,n),e&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(t,e,n){var i=document.createElement("textarea");return mxClient.IS_NS&&n--,i.setAttribute("rows",n||2),i.value=e,this.addField(t,i)},mxForm.prototype.addCombo=function(t,e,n){var i=document.createElement("select");return null!=n&&i.setAttribute("size",n),e&&i.setAttribute("multiple","true"),this.addField(t,i)},mxForm.prototype.addOption=function(t,e,n,i){var s=document.createElement("option");mxUtils.writeln(s,e),s.setAttribute("value",n),i&&s.setAttribute("selected",i),t.appendChild(s)},mxForm.prototype.addField=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");return mxUtils.write(i,t),n.appendChild(i),(i=document.createElement("td")).appendChild(e),n.appendChild(i),this.body.appendChild(n),e},__mxOutput.mxForm=void 0!==mxForm?mxForm:void 0,mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=void 0!==mxImage?mxImage:void 0,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),n=parseInt(this.div.style.left),i=parseInt(this.div.style.right),s=parseInt(this.div.style.top),r=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(i)&&n>=0&&i>=0&&t-i-n>0&&(this.div.style.width=t-i-n+"px"),this.resizeHeight&&!isNaN(s)&&!isNaN(r)&&s>=0&&r>=0&&e-s-r>0&&(this.div.style.height=e-s-r+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=void 0!==mxDivResizer?mxDivResizer:void 0,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=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,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,n,i){return t.getCellAt(e,n)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(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),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),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&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 n=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=mxUtils.getOffset(t.container),r=mxUtils.getScrollOrigin(),o=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=o&&o!=t.container;)o=o.parentNode;return null!=o&&n>=s.x-r.x&&i>=s.y-r.y&&n<=s.x-r.x+t.container.offsetWidth&&i<=s.y-r.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(null==e||this.graphContainsEvent(e,t)||(e=null),e!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=e,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,i+=this.dragOffset.y);var s=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=n+s.x+"px",this.dragElement.style.top=i+s.y+"px"}mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var e=this.currentGraph.view.scale,n=this.currentGraph.view.translate,i=this.currentPoint.x/e-n.x,s=this.currentPoint.y/e-n.y;this.drop(this.currentGraph,t,this.currentDropTarget,i,s)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(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=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),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=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var n=mxUtils.getOffset(t.container),i=mxUtils.getScrollOrigin(t.container),s=mxEvent.getClientX(e)-n.x+i.x-t.panDx,r=mxEvent.getClientY(e)-n.y+i.y-t.panDy;if(t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(s,r,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,s,r,e);var o=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(o)}if(null!=this.previewElement){null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var l=this.isGridEnabled()&&t.isGridEnabledEvent(e),a=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)){var h=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),u=new mxPoint(s,r);a=!1,s=(u=this.currentGuide.move(h,u,l,!0)).x,r=u.y}else if(l){var d=t.view.scale,p=t.view.translate,m=t.gridSize/2;s=(t.snap(s/d-p.x-m)+p.x)*d,r=(t.snap(r/d-p.y-m)+p.y)*d}null!=this.currentGuide&&a&&this.currentGuide.hide(),null!=this.previewOffset&&(s+=this.previewOffset.x,r+=this.previewOffset.y),this.previewElement.style.left=Math.round(s)+"px",this.previewElement.style.top=Math.round(r)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(s,r)},mxDragSource.prototype.drop=function(t,e,n,i,s){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},__mxOutput.mxDragSource=void 0!==mxDragSource?mxDragSource:void 0,mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,n,i,s,r){var o=document.createElement(null!=e?"img":"button"),l=s||(null!=r?"mxToolbarMode":"mxToolbarItem");o.className=l,o.setAttribute("src",e),null!=t&&(null!=e?o.setAttribute("title",t):mxUtils.write(o,t)),this.container.appendChild(o),null!=n&&(mxEvent.addListener(o,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",n));var a=mxUtils.bind(this,(function(t){null!=i?o.setAttribute("src",e):o.style.backgroundColor=""}));return mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){if(null!=i?o.setAttribute("src",i):o.style.backgroundColor="gray",null!=r){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var e=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=o){this.currentImg=o,this.menu.factoryMethod=r;var n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight);this.menu.popup(n.x,n.y,null,t),this.menu.isMenuShowing()&&(o.className=l+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=l,this.currentImg=null})}}})),null,a),mxEvent.addListener(o,"mouseout",a),o},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=t||"mxToolbarCombo",e.appendChild(n),this.container.appendChild(e),n},mxToolbar.prototype.addActionCombo=function(t,e){var n=document.createElement("select");return n.className=e||"mxToolbarCombo",this.addOption(n,t,null),mxEvent.addListener(n,"change",(function(t){var e=n.options[n.selectedIndex];n.selectedIndex=0,null!=e.funct&&e.funct(t)})),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(t,e,n){var i=document.createElement("option");return mxUtils.writeln(i,e),"function"==typeof n?i.funct=n:i.setAttribute("value",n),t.appendChild(i),i},mxToolbar.prototype.addSwitchMode=function(t,e,n,i,s){var r=document.createElement("img");return r.initialClassName=s||"mxToolbarMode",r.className=r.initialClassName,r.setAttribute("src",e),r.altIcon=i,null!=t&&r.setAttribute("title",t),mxEvent.addListener(r,"click",mxUtils.bind(this,(function(t){var e;null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=r),this.selectedMode=r,null!=(e=r.altIcon)?(r.altIcon=r.getAttribute("src"),r.setAttribute("src",e)):r.className=r.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()}))),this.container.appendChild(r),null==this.defaultMode&&(this.defaultMode=r,this.selectMode(r),n()),r},mxToolbar.prototype.addMode=function(t,e,n,i,s,r){r=null==r||r;var o=document.createElement(null!=e?"img":"button");return o.initialClassName=s||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",e),o.altIcon=i,null!=t&&o.setAttribute("title",t),this.enabled&&r&&(mxEvent.addListener(o,"click",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!1}))),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!0}))),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=n,this.selectMode(o,n))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){var n;if(null!=this.selectedMode)null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName;this.selectedMode=t,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){!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,null!=this.menu&&this.menu.destroy()},__mxOutput.mxToolbar=void 0!==mxToolbar?mxToolbar:void 0,mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},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));for(var t=this.changes.length-1;t>=0;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}this.undone=!0,this.redone=!1,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));for(var t=this.changes.length,e=0;e<t;e++){var n=this.changes[e];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},__mxOutput.mxUndoableEdit=void 0!==mxUndoableEdit?mxUndoableEdit:void 0,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 0==this.history.length},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(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),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(){for(var t=this.history.length;this.indexOfNextAdd<t;){var e=this.history[this.indexOfNextAdd++];if(e.redo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",e));break}}},mxUndoManager.prototype.undoableEditHappened=function(t){this.trim(),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)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e<t.length;e++)t[e].die()},__mxOutput.mxUndoManager=void 0!==mxUndoManager?mxUndoManager:void 0;var mxUrlConverter=function(){};function mxPanningManager(t){this.thread=null,this.active=!1,this.tdx=0,this.tdy=0,this.t0x=0,this.t0y=0,this.dx=0,this.dy=0,this.scrollbars=!1,this.scrollLeft=0,this.scrollTop=0,this.mouseListener={mouseDown:function(t,e){},mouseMove:function(t,e){},mouseUp:mxUtils.bind(this,(function(t,e){this.active&&this.stop()}))},t.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,(function(){this.active&&this.stop()})),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var e=mxUtils.bind(this,(function(){return this.scrollbars=mxUtils.hasScrollbars(t.container),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,window.setInterval(mxUtils.bind(this,(function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var e=-t.container.scrollLeft-Math.ceil(this.dx),n=-t.container.scrollTop-Math.ceil(this.dy);t.panGraph(e,n),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=!0},this.panTo=function(n,i,s,r){this.active||this.start(),this.scrollLeft=t.container.scrollLeft,this.scrollTop=t.container.scrollTop,s=null!=s?s:0,r=null!=r?r:0;var o=t.container;this.dx=n+s-o.scrollLeft-o.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.handleMouseOut?this.dx=Math.max(this.dx,0):this.dx=0,0==this.dx&&(this.dx=n-o.scrollLeft,this.dx>0&&this.dx<this.border?this.dx=this.dx-this.border:this.handleMouseOut?this.dx=Math.min(0,this.dx):this.dx=0),this.dy=i+r-o.scrollTop-o.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.handleMouseOut?this.dy=Math.max(this.dy,0):this.dy=0,0==this.dy&&(this.dy=i-o.scrollTop,this.dy>0&&this.dy<this.border?this.dy=this.dy-this.border:this.handleMouseOut?this.dy=Math.min(0,this.dy):this.dy=0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=e())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)},this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdx=0,this.tdy=0,this.scrollbars)t.panDx=0,t.panDy=0,t.fireEvent(new mxEventObject(mxEvent.PAN));else{var e=t.panDx,n=t.panDy;0==e&&0==n||(t.panGraph(0,0),t.view.setTranslate(this.t0x+e/t.view.scale,this.t0y+n/t.view.scale))}},this.destroy=function(){t.removeMouseListener(this.mouseListener),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}function mxPopupMenu(t){this.factoryMethod=t,null!=t&&this.init()}function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.graphModelChanged(e.getProperty("edit").changes)})),this.setGraph(t)}function mxAnimation(t){this.delay=null!=t?t:20}function mxMorphing(t,e,n,i){mxAnimation.call(this,i),this.graph=t,this.steps=null!=e?e:6,this.ease=null!=n?n:1.5}function mxImageBundle(t){this.images=[],this.alt=null!=t&&t}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(t){mxAbstractCanvas2D.call(this),this.root=t,this.writeDefaults()}function mxSvgCanvas2D(t,e){mxAbstractCanvas2D.call(this),this.root=t,this.gradients=[],this.defs=null,this.styleEnabled=null!=e&&e;var n=null;if(t.ownerDocument!=document){for(var i=t;null!=i&&"svg"!=i.nodeName;)i=i.parentNode;n=i}null!=n&&(n.getElementsByTagName("defs").length>0&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUrlConverter.prototype.enabled=!0,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("/");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 null!=t&&"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=void 0!==mxUrlConverter?mxUrlConverter:void 0,mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,__mxOutput.mxPanningManager=void 0!==mxPanningManager?mxPanningManager:void 0,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=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,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,n,i,s,r,o,l){i=i||this,this.itemCount++,i.willAddSeparator&&(i.containsItems&&this.addSeparator(i,!0),i.willAddSeparator=!1),i.containsItems=!0;var a=document.createElement("tr");a.className="mxPopupMenuItem";var h=document.createElement("td");if(h.className="mxPopupMenuIcon",null!=e){var u=document.createElement("img");u.src=e,h.appendChild(u)}else if(null!=s){var d=document.createElement("div");d.className=s,h.appendChild(d)}if(a.appendChild(h),this.labels){var p=document.createElement("td");p.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),mxUtils.write(p,t),p.align="left",a.appendChild(p);var m=document.createElement("td");m.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),m.style.paddingRight="6px",m.style.textAlign="right",a.appendChild(m),null==i.div&&this.createSubmenu(i)}if(i.tbody.appendChild(a),0!=o&&0!=r){var c=null;mxEvent.addGestureListeners(a,mxUtils.bind(this,(function(t){this.eventReceiver=a,i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),null==document.selection||!mxClient.IS_QUIRKS&&8!=document.documentMode||(c=document.selection.createRange()),mxEvent.consume(t)})),mxUtils.bind(this,(function(t){i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),this.autoExpand&&null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),l||(a.className="mxPopupMenuItemHover")})),mxUtils.bind(this,(function(t){if(this.eventReceiver==a){if(i.activeRow!=a&&this.hideMenu(),null!=c){try{c.select()}catch(t){}c=null}null!=n&&n(t)}this.eventReceiver=null,mxEvent.consume(t)}))),l||mxEvent.addListener(a,"mouseout",mxUtils.bind(this,(function(t){a.className="mxPopupMenuItem"})))}return a},mxPopupMenu.prototype.addCheckmark=function(t,e){var n=t.firstChild.nextSibling;n.style.backgroundImage="url('"+e+"')",n.style.backgroundRepeat="no-repeat",n.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(null!=e.div){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 n=parseInt(e.div.offsetLeft),i=parseInt(e.div.offsetWidth),s=mxUtils.getDocumentScrollOrigin(document),r=document.body,o=document.documentElement;n+i>s.x+(r.clientWidth||o.clientWidth)&&(e.div.style.left=Math.max(0,t.div.offsetLeft-i+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(null!=t.tbody){t.willAddSeparator=!1;var n=document.createElement("tr"),i=document.createElement("td");i.className="mxPopupMenuIcon",i.style.padding="0 0 0 0px",n.appendChild(i);var s=document.createElement("td");s.style.padding="0 0 0 0px",s.setAttribute("colSpan","2");var r=document.createElement("hr");r.setAttribute("size","1"),s.appendChild(r),n.appendChild(s),t.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(t,e,n,i){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,i),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=void 0!==mxPopupMenu?mxPopupMenu:void 0,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=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=void 0!==mxAutoSaveManager?mxAutoSaveManager:void 0,mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(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(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=void 0!==mxAnimation?mxAnimation:void 0,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(null!=this.cells)for(var e=0;e<this.cells.length;e++)this.animateCell(this.cells[e],t,!1);else this.animateCell(this.graph.getModel().getRoot(),t,!0);this.show(t),(t.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,n){var i=this.graph.getView().getState(t),s=null;if(null!=i&&(s=this.getDelta(i),this.graph.getModel().isVertex(t)&&(0!=s.x||0!=s.y))){var r=this.graph.view.getTranslate(),o=this.graph.view.getScale();s.x+=r.x*o,s.y+=r.y*o,e.moveState(i,-s.x/this.ease,-s.y/this.ease)}if(n&&!this.stopRecursion(i,s))for(var l=this.graph.getModel().getChildCount(t),a=0;a<l;a++)this.animateCell(this.graph.getModel().getChildAt(t,a),e,n)},mxMorphing.prototype.stopRecursion=function(t,e){return null!=e&&(0!=e.x||0!=e.y)},mxMorphing.prototype.getDelta=function(t){var e=this.getOriginForCell(t.cell),n=this.graph.getView().getTranslate(),i=this.graph.getView().getScale(),s=t.x/i-n.x,r=t.y/i-n.y;return new mxPoint((e.x-s)*i,(e.y-r)*i)},mxMorphing.prototype.getOriginForCell=function(t){var e=null;if(null!=t){var n=this.graph.getModel().getParent(t),i=this.graph.getCellGeometry(t);if(e=this.getOriginForCell(n),null!=i)if(i.relative){var s=this.graph.getCellGeometry(n);null!=s&&(e.x+=i.x*s.width,e.y+=i.y*s.height)}else e.x+=i.x,e.y+=i.y}if(null==e){var r=this.graph.view.getTranslate();e=new mxPoint(-r.x,-r.y)}return e},__mxOutput.mxMorphing=void 0!==mxMorphing?mxMorphing:void 0,mxImageBundle.prototype.images=null,mxImageBundle.prototype.alt=null,mxImageBundle.prototype.putImage=function(t,e,n){this.images[t]={value:e,fallback:n}},mxImageBundle.prototype.getImage=function(t){var e=null;if(null!=t){var n=this.images[t];null!=n&&(e=this.alt?n.fallback:n.value)}return e},__mxOutput.mxImageBundle=void 0!==mxImageBundle?mxImageBundle:void 0,mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(t,e){null!=t&&(this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawCellState.apply(this,arguments)}))),this.includeOverlays&&this.visitStatesRecursive(t,e,mxUtils.bind(this,(function(){this.drawOverlays.apply(this,arguments)}))))},mxImageExport.prototype.visitStatesRecursive=function(t,e,n){if(null!=t){n(t,e);for(var i=t.view.graph,s=i.model.getChildCount(t.cell),r=0;r<s;r++){var o=i.view.getState(i.model.getChildAt(t.cell,r));this.visitStatesRecursive(o,e,n)}}},mxImageExport.prototype.getLinkForCellState=function(t,e){return null},mxImageExport.prototype.drawCellState=function(t,e){var n=this.getLinkForCellState(t,e);null!=n&&e.setLink(n),this.drawShape(t,e),this.drawText(t,e),null!=n&&e.setLink(null)},mxImageExport.prototype.drawShape=function(t,e){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){null!=t.text&&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){null!=t.overlays&&t.overlays.visit((function(t,n){n instanceof mxShape&&n.paint(e)}))},__mxOutput.mxImageExport=void 0!==mxImageExport?mxImageExport:void 0,mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,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=!1,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:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,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(null!=this.path&&(this.path.push(arguments[0]),arguments.length>2))for(var t=this.state,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,n,i,s){var r=n*(Math.PI/180);return mxUtils.getRotatedPoint(new mxPoint(t,e),Math.cos(r),Math.sin(r),new mxPoint(i,s))},mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state),this.state=mxUtils.clone(this.state)},mxAbstractCanvas2D.prototype.restore=function(){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,n,i,s){},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){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,n,i,s,r,o,l,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=l?l:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){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){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){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){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){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,n,i){this.addOp(this.quadOp,t,e,n,i)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,n,i,s,r){this.addOp(this.curveOp,t,e,n,i,s,r)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,n,i,s,r,o){var l=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,n,i,s,r,o);if(null!=l)for(var a=0;a<l.length;a+=6)this.curveTo(l[a],l[a+1],l[a+2],l[a+3],l[a+4],l[a+5])},mxAbstractCanvas2D.prototype.close=function(t,e,n,i,s,r){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},__mxOutput.mxAbstractCanvas2D=void 0!==mxAbstractCanvas2D?mxAbstractCanvas2D:void 0,mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var t;(t=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(t),(t=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(t),(t=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(t),(t=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(t),(t=this.createElement("shadowoffset")).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(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){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 n=this.createElement("translate");n.setAttribute("dx",this.format(t)),n.setAttribute("dy",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(t,e,n,i,s){var r=this.createElement("rotate");(0!=t||e||n)&&(r.setAttribute("theta",this.format(t)),r.setAttribute("flipH",e?"1":"0"),r.setAttribute("flipV",n?"1":"0"),r.setAttribute("cx",this.format(i)),r.setAttribute("cy",this.format(s)),this.root.appendChild(r))},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),this.compressed){if(this.state.fillColor==t)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var e=this.createElement("fillcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setGradient=function(t,e,n,i,s,r,o,l,a){if(null!=t&&null!=e){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var h=this.createElement("gradient");h.setAttribute("c1",t),h.setAttribute("c2",e),h.setAttribute("x",this.format(n)),h.setAttribute("y",this.format(i)),h.setAttribute("w",this.format(s)),h.setAttribute("h",this.format(r)),null!=o&&h.setAttribute("direction",o),null!=l&&h.setAttribute("alpha1",l),null!=a&&h.setAttribute("alpha2",a),this.root.appendChild(h)}},mxXmlCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.strokeColor==t)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var e=this.createElement("strokecolor");e.setAttribute("color",null!=t?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 n=this.createElement("dashed");n.setAttribute("dashed",t?"1":"0"),null!=e&&n.setAttribute("fixDash",e?"1":"0"),this.root.appendChild(n)},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),this.compressed){if(this.state.fontColor==t)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var e=this.createElement("fontcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBackgroundColor==t)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var e=this.createElement("fontbackgroundcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBorderColor==t)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var e=this.createElement("fontbordercolor");e.setAttribute("color",null!=t?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(null==t&&(t=0),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),this.state.shadowColor==t)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var e=this.createElement("shadowcolor");e.setAttribute("color",null!=t?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 n=this.createElement("shadowoffset");n.setAttribute("dx",t),n.setAttribute("dy",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(t,e,n,i){var s=this.createElement("rect");s.setAttribute("x",this.format(t)),s.setAttribute("y",this.format(e)),s.setAttribute("w",this.format(n)),s.setAttribute("h",this.format(i)),this.root.appendChild(s)},mxXmlCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){var o=this.createElement("roundrect");o.setAttribute("x",this.format(t)),o.setAttribute("y",this.format(e)),o.setAttribute("w",this.format(n)),o.setAttribute("h",this.format(i)),o.setAttribute("dx",this.format(s)),o.setAttribute("dy",this.format(r)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.ellipse=function(t,e,n,i){var s=this.createElement("ellipse");s.setAttribute("x",this.format(t)),s.setAttribute("y",this.format(e)),s.setAttribute("w",this.format(n)),s.setAttribute("h",this.format(i)),this.root.appendChild(s)},mxXmlCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){s=this.converter.convert(s);var a=this.createElement("image");a.setAttribute("x",this.format(t)),a.setAttribute("y",this.format(e)),a.setAttribute("w",this.format(n)),a.setAttribute("h",this.format(i)),a.setAttribute("src",s),a.setAttribute("aspect",r?"1":"0"),a.setAttribute("flipH",o?"1":"0"),a.setAttribute("flipV",l?"1":"0"),this.root.appendChild(a)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastX=0,this.lastY=0},mxXmlCanvas2D.prototype.moveTo=function(t,e){var n=this.createElement("move");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.lineTo=function(t,e){var n=this.createElement("line");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.quadTo=function(t,e,n,i){var s=this.createElement("quad");s.setAttribute("x1",this.format(t)),s.setAttribute("y1",this.format(e)),s.setAttribute("x2",this.format(n)),s.setAttribute("y2",this.format(i)),this.root.appendChild(s),this.lastX=n,this.lastY=i},mxXmlCanvas2D.prototype.curveTo=function(t,e,n,i,s,r){var o=this.createElement("curve");o.setAttribute("x1",this.format(t)),o.setAttribute("y1",this.format(e)),o.setAttribute("x2",this.format(n)),o.setAttribute("y2",this.format(i)),o.setAttribute("x3",this.format(s)),o.setAttribute("y3",this.format(r)),this.root.appendChild(o),this.lastX=s,this.lastY=r},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s){mxUtils.isNode(s)&&(s=mxUtils.getOuterHtml(s));var m=this.createElement("text");m.setAttribute("x",this.format(t)),m.setAttribute("y",this.format(e)),m.setAttribute("w",this.format(n)),m.setAttribute("h",this.format(i)),m.setAttribute("str",s),null!=r&&m.setAttribute("align",r),null!=o&&m.setAttribute("valign",o),m.setAttribute("wrap",l?"1":"0"),null==a&&(a=""),m.setAttribute("format",a),null!=h&&m.setAttribute("overflow",h),null!=u&&m.setAttribute("clip",u?"1":"0"),null!=d&&m.setAttribute("rotation",d),null!=p&&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=void 0!==mxXmlCanvas2D?mxXmlCanvas2D:void 0,mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"==typeof DOMParser&&"function"==typeof XMLSerializer,mxSvgCanvas2D.prototype.useDomParser)try{var t=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=t}catch(t){mxSvgCanvas2D.prototype.useDomParser=!1}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=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,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=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return e>0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var n=this.root.ownerDocument.createElement(t);return null!=e&&n.setAttribute("xmlns",e),n},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,n,i,s,r,o,l,a,h,u,d,p){return null!=r?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m=this.getAlternateText(t,e,n,i,s,r,o,l,a,h,u,d,p),c=this.state;if(null!=m&&c.fontSize>0){var x=l==mxConstants.ALIGN_TOP?1:l==mxConstants.ALIGN_BOTTOM?0:.3,g=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_LEFT?"start":"middle",y=this.createElement("text");y.setAttribute("x",Math.round(e+c.dx)),y.setAttribute("y",Math.round(n+c.dy+x*c.fontSize)),y.setAttribute("fill",c.fontColor||"black"),y.setAttribute("font-family",c.fontFamily),y.setAttribute("font-size",Math.round(c.fontSize)+"px"),"start"!=g&&y.setAttribute("text-anchor",g),(c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold"),(c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");var f=[];return(c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&f.push("underline"),(c.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&f.push("line-through"),f.length>0&&y.setAttribute("text-decoration",f.join(" ")),mxUtils.write(y,m),y}return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,n,i,s){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+n,e=e.toLowerCase()+"-"+i;var r=null;if(null==s||s==mxConstants.DIRECTION_SOUTH)r="s";else if(s==mxConstants.DIRECTION_EAST)r="e";else{var o=t;t=e,e=o,s==mxConstants.DIRECTION_NORTH?r="s":s==mxConstants.DIRECTION_WEST&&(r="e")}return"mx-gradient-"+t+"-"+e+"-"+r},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,n,i,s){var r=this.createGradientId(t,e,n,i,s),o=this.gradients[r];if(null==o){var l=this.root.ownerSVGElement,a=0,h=r+"-"+a;if(null!=l)for(o=l.ownerDocument.getElementById(h);null!=o&&o.ownerSVGElement!=l;)h=r+"-"+a++,o=l.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(t,e,n,i,s)).setAttribute("id",h),null!=this.defs?this.defs.appendChild(o):l.appendChild(o)),this.gradients[r]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,n,i,s){var r=this.createElement("linearGradient");r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2","0%"),r.setAttribute("y2","0%"),null==s||s==mxConstants.DIRECTION_SOUTH?r.setAttribute("y2","100%"):s==mxConstants.DIRECTION_EAST?r.setAttribute("x2","100%"):s==mxConstants.DIRECTION_NORTH?r.setAttribute("y1","100%"):s==mxConstants.DIRECTION_WEST&&r.setAttribute("x1","100%");var o=n<1?";stop-opacity:"+n:"",l=this.createElement("stop");return l.setAttribute("offset","0%"),l.setAttribute("style","stop-color:"+t+o),r.appendChild(l),o=i<1?";stop-opacity:"+i:"",(l=this.createElement("stop")).setAttribute("offset","100%"),l.setAttribute("style","stop-color:"+e+o),r.appendChild(l),r},mxSvgCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.setAttribute("d",this.path.join(" "))}t&&null!=i.fillColor?this.updateFill():this.styleEnabled||("ellipse"==n.nodeName&&mxClient.IS_FF?n.setAttribute("fill","transparent"):n.setAttribute("fill","none"),t=!1),e&&null!=i.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=i.transform&&i.transform.length>0&&n.setAttribute("transform",i.transform),i.shadow&&this.root.appendChild(this.createShadow(n)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents?n.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||n.setAttribute("pointer-events","none"),("rect"!=n.nodeName&&"path"!=n.nodeName&&"ellipse"!=n.nodeName||"none"!=n.getAttribute("fill")&&"transparent"!=n.getAttribute("fill")||"none"!=n.getAttribute("stroke")||"none"!=n.getAttribute("pointer-events"))&&this.root.appendChild(n),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),null!=t.fillColor)if(null!=t.gradientColor){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var n=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+n+"#"+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()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),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(null!=t.lineJoin&&"miter"!=t.lineJoin&&this.node.setAttribute("stroke-linejoin",t.lineJoin),null!=t.lineCap){var e=t.lineCap;"flat"==e&&(e="butt"),"butt"!=e&&this.node.setAttribute("stroke-linecap",e)}null==t.miterLimit||this.styleEnabled&&10==t.miterLimit||this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var n=this.state.dashPattern.split(" ");if(n.length>0)for(var i=0;i<n.length;i++)e[i]=Number(n[i])*t}return e.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(t){var e=t.cloneNode(!0),n=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OT?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(t){var e=t.cloneNode(!0),n=this.state;return"none"==e.getAttribute("fill")||mxClient.IS_FF&&"transparent"==e.getAttribute("fill")||e.setAttribute("fill",n.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",n.shadowColor),e.setAttribute("transform","translate("+this.format(n.shadowDx*n.scale)+","+this.format(n.shadowDy*n.scale)+")"+(n.transform||"")),e.setAttribute("opacity",n.shadowAlpha),e},mxSvgCanvas2D.prototype.setLink=function(t){if(null==t)this.root=this.originalRoot;else{this.originalRoot=this.root;var e=this.createElement("a");null==e.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?e.setAttribute("xlink:href",t):e.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",t),this.root.appendChild(e),this.root=e}},mxSvgCanvas2D.prototype.rotate=function(t,e,n,i,s){if(0!=t||e||n){var r=this.state;if(i+=r.dx,s+=r.dy,i*=r.scale,s*=r.scale,r.transform=r.transform||"",e&&n)t+=180;else if(e!=n){var o=e?i:0,l=e?-1:1,a=n?s:0,h=n?-1:1;r.transform+="translate("+this.format(o)+","+this.format(a)+")scale("+this.format(l)+","+this.format(h)+")translate("+this.format(-o)+","+this.format(-a)+")"}(e?!n:n)&&(t*=-1),0!=t&&(r.transform+="rotate("+this.format(t)+","+this.format(i)+","+this.format(s)+")"),r.rotation=r.rotation+t,r.rotationCx=i,r.rotationCy=s}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(t,e,n,i){var s=this.state,r=this.createElement("rect");r.setAttribute("x",this.format((t+s.dx)*s.scale)),r.setAttribute("y",this.format((e+s.dy)*s.scale)),r.setAttribute("width",this.format(n*s.scale)),r.setAttribute("height",this.format(i*s.scale)),this.node=r},mxSvgCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){this.rect(t,e,n,i),s>0&&this.node.setAttribute("rx",this.format(s*this.state.scale)),r>0&&this.node.setAttribute("ry",this.format(r*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,n,i){var s=this.state,r=this.createElement("ellipse");r.setAttribute("cx",this.format((t+n/2+s.dx)*s.scale)),r.setAttribute("cy",this.format((e+i/2+s.dy)*s.scale)),r.setAttribute("rx",n/2*s.scale),r.setAttribute("ry",i/2*s.scale),this.node=r},mxSvgCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){s=this.converter.convert(s),r=null==r||r,o=null!=o&&o,l=null!=l&&l;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",s):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",s),r||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var u=this.state.transform||"";if(o||l){var d=1,p=1,m=0,c=0;o&&(d=-1,m=-n-2*t),l&&(p=-1,c=-i-2*e),u+="scale("+d+","+p+")translate("+m*a.scale+","+c*a.scale+")"}u.length>0&&h.setAttribute("transform",u),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");null!=e&&("<body"==(t=(new XMLSerializer).serializeToString(e.body)).substring(0,5)&&(t=t.substring(t.indexOf(">",5)+1)),"</body>"==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var n=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),i=n.createElement("body");n.documentElement.appendChild(i);var s=document.createElement("div");s.innerHTML=t;for(var r=s.firstChild;null!=r;){var o=r.nextSibling;i.appendChild(n.adoptNode(r)),r=o}return i.innerHTML}var l=document.createElement("textarea");l.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=l.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>"),mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(e)&&(e="<div><div>"+mxUtils.getXml(e)+"</div></div>"),e='<div xmlns="http://www.w3.org/1999/xhtml">'+e+"</div>",mxUtils.parseXml(e).documentElement;var n=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var i=document.createElement("div"),s=i.cloneNode(!1);this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e),s.appendChild(i),n.appendChild(s)}else n.innerHTML=e;return n},mxSvgCanvas2D.prototype.updateText=function(t,e,n,i,s,r,o,l,a,h,u){null!=u&&null!=u.firstChild&&null!=u.firstChild.firstChild&&this.updateTextNodes(t,e,n,i,s,r,o,l,a,h,u.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c){var x=this.createElement("g"),g=this.createElement("foreignObject");if(g.setAttribute("style","overflow: visible; text-align: left;"),g.setAttribute("pointer-events","none"),m.ownerDocument!=document&&(m=mxUtils.importNodeImplementation(g.ownerDocument,m,!0)),g.appendChild(m),x.appendChild(g),this.updateTextNodes(t,e,n,i,r,o,l,h,u,d,x),this.root.ownerDocument!=document){var y=this.createAlternateContent(g,t,e,n,i,s,r,o,l,a,h,u,d);if(null!=y){g.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var f=this.createElement("switch");f.appendChild(g),f.appendChild(y),x.appendChild(f)}}c.appendChild(x)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,n,i,s,r,o,l,a,h,u){var d=this.state.scale;mxSvgCanvas2D.createCss(n+2,i,s,r,o,l,a,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(r==mxConstants.ALIGN_TOP?"flex-start":r==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(s==mxConstants.ALIGN_LEFT?"flex-start":s==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),d,mxUtils.bind(this,(function(n,i,s,r,o){t+=this.state.dx,e+=this.state.dy;var l=u.firstChild,a=l.firstChild,p=a.firstChild,m=p.firstChild,c=(this.rotateHtml?this.state.rotation:0)+(null!=h?h:0),x=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=d?"scale("+d+")":"");m.setAttribute("style",o),p.setAttribute("style",r),l.setAttribute("width",Math.ceil(1/Math.min(1,d)*100)+"%"),l.setAttribute("height",Math.ceil(1/Math.min(1,d)*100)+"%");var g=Math.round(e+i);g<0?l.setAttribute("y",g):(l.removeAttribute("y"),s+="padding-top: "+g+"px; "),a.setAttribute("style",s+"margin-left: "+Math.round(t+n)+"px;"),""!=(x+=0!=c?"rotate("+c+" "+t+" "+e+")":"")?u.setAttribute("transform",x):u.removeAttribute("transform"),1!=this.state.alpha?u.setAttribute("opacity",this.state.alpha):u.removeAttribute("opacity")})))},mxSvgCanvas2D.createCss=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m="box-sizing: border-box; font-size: 0; text-align: "+(n==mxConstants.ALIGN_LEFT?"left":n==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",c=mxUtils.getAlignmentAsPoint(n,i),x="overflow: hidden; ",g="width: 1px; ",y="height: 1px; ",f=c.x*t,v=c.y*e;o?(g="width: "+Math.round(t)+"px; ",m+="max-height: "+Math.round(e)+"px; ",v=0):"fill"==r?(u+="width: 100%; height: 100%; ",m+=(g="width: "+Math.round(t)+"px; ")+(y="height: "+Math.round(e)+"px; ")):"width"==r?(u+="width: 100%; ",m+=g="width: "+Math.round(t)+"px; ",v=0,e>0&&(m+="max-height: "+Math.round(e)+"px; ")):(x="",v=0);var C="";null!=l&&(C+="background-color: "+l+"; "),null!=a&&(C+="border: 1px solid "+a+"; "),""==x||o?u+=C:m+=C,s&&t>0?(u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",g="width: "+Math.round(t)+"px; ",""!=x&&"fill"!=r&&(v=0)):(u+="white-space: nowrap; ",""==x&&(f=0)),p(f,v,h+g+y,m+x,u,x)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,n="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")+"; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(n+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(n+="font-style: italic; ");var i=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(n+="text-decoration: "+i.join(" ")+"; "),n},mxSvgCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s)if(d=null!=d?d:0,this.foEnabled&&"html"==a){var m=this.createDiv(s);null!=m&&(null!=p&&m.setAttribute("dir",p),this.addForeignObject(t,e,n,i,s,r,o,l,a,h,u,d,p,m,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,n,i,s,r,o,l,h,u,d,p)},mxSvgCanvas2D.prototype.createClip=function(t,e,n,i){for(var s="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(i=Math.round(i)),r=0,o=s+"-"+r;null!=document.getElementById(o);)o=s+"-"+ ++r;clip=this.createElement("clipPath"),clip.setAttribute("id",o);var l=this.createElement("rect");return l.setAttribute("x",t),l.setAttribute("y",e),l.setAttribute("width",n),l.setAttribute("height",i),clip.appendChild(l),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,h,u,d){u=null!=u?u:0;var p=this.state,m=p.fontSize,c=this.createElement("g"),x=p.transform||"";if(this.updateFont(c),this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none"),0!=u&&(x+="rotate("+u+","+this.format(t*p.scale)+","+this.format(e*p.scale)+")"),null!=d&&c.setAttribute("direction",d),h&&n>0&&i>0){var g=t,y=e;r==mxConstants.ALIGN_CENTER?g-=n/2:r==mxConstants.ALIGN_RIGHT&&(g-=n),"fill"!=a&&(o==mxConstants.ALIGN_MIDDLE?y-=i/2:o==mxConstants.ALIGN_BOTTOM&&(y-=i));var f=this.createClip(g*p.scale-2,y*p.scale-2,n*p.scale+4,i*p.scale+4);if(null!=this.defs?this.defs.appendChild(f):this.root.appendChild(f),mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)c.setAttribute("clip-path","url(#"+f.getAttribute("id")+")");else{var v=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c.setAttribute("clip-path","url("+v+"#"+f.getAttribute("id")+")")}}var C=r==mxConstants.ALIGN_RIGHT?"end":r==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=C&&c.setAttribute("text-anchor",C),this.styleEnabled&&m==mxConstants.DEFAULT_FONTSIZE||c.setAttribute("font-size",m*p.scale+"px"),x.length>0&&c.setAttribute("transform",x),p.alpha<1&&c.setAttribute("opacity",p.alpha);var E=s.split("\n"),S=Math.round(m*mxConstants.LINE_HEIGHT),T=m+(E.length-1)*S;y=e+m-1;if(o==mxConstants.ALIGN_MIDDLE)y-="fill"==a?i/2:(this.matchHtmlAlignment&&h&&i>0?Math.min(T,i):T)/2;else if(o==mxConstants.ALIGN_BOTTOM){if("fill"==a)y-=i;else y-=(this.matchHtmlAlignment&&h&&i>0?Math.min(T,i):T)+1}for(var b=0;b<E.length;b++){if(E[b].length>0&&mxUtils.trim(E[b]).length>0){var w=this.createElement("text");w.setAttribute("x",this.format(t*p.scale)+this.textOffset),w.setAttribute("y",this.format(y*p.scale)+this.textOffset),mxUtils.write(w,E[b]),c.appendChild(w)}y+=S}this.root.appendChild(c),this.addTextBackground(c,s,t,e,n,"fill"==a?i:T,r,o,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&e.fontFamily==mxConstants.DEFAULT_FONTFAMILY||t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var n=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&t.setAttribute("text-decoration",n.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,n,i,s,r,o,l,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var u=null;if("fill"==a||"width"==a)o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,i*h.scale,(s-2)*h.scale,(r+2)*h.scale);else if(null!=t.getBBox&&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(t){}if(null==u||0==u.width||0==u.height){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",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(p.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(p.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),p.innerHTML=e.replace(/\n/g,"<br/>"),document.body.appendChild(p);s=p.offsetWidth,r=p.offsetHeight;p.parentNode.removeChild(p),o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,(i+2)*h.scale,s*h.scale,(r+1)*h.scale)}if(null!=u){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=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0;m.setAttribute("stroke-width",c),this.root.ownerDocument==document&&1==mxUtils.mod(c,2)&&m.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(m,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=void 0!==mxSvgCanvas2D?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxShape(t){this.stencil=t,this.initStyles()}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,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 n=this.node,i=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,i.strokeWidth*i.scale/this.vmlScale))+"px",i.shadow&&this.root.appendChild(this.createShadow(n,t&&null!=i.fillColor,e&&null!=i.strokeColor)),e&&null!=i.strokeColor?(n.stroked="true",n.strokecolor=i.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),t&&null!=i.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,null!=t.gradientColor){e.type="gradient",e.method="none",e.color2=t.gradientColor;var n=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?n-=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?n+=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?n-=180+("y"==this.root.style.flip?-180:0):n+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),e.angle=mxUtils.mod(n,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if("string"==typeof this.state.dashPattern){var e=this.state.dashPattern.split(" ");e.length>0&&1==e[0]&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,n){var i=this.state,s=-i.rotation*(Math.PI/180),r=Math.cos(s),o=Math.sin(s),l=i.shadowDx*i.scale,a=i.shadowDy*i.scale;"x"==this.root.style.flip?l*=-1:"y"==this.root.style.flip&&(a*=-1);var h=t.cloneNode(!0);return h.style.marginLeft=Math.round(l*r-a*o)+"px",h.style.marginTop=Math.round(l*o+a*r)+"px",8==document.documentMode&&(h.strokeweight=t.strokeweight,"shape"==t.nodeName&&(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))),n?(h.strokecolor=i.shadowColor,h.appendChild(this.createShadowStroke())):h.stroked="false",e?h.appendChild(this.createShadowFill()):h.filled="false",h},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,n,i,s){e&&n?t+=180:e?this.root.style.flip="x":n&&(this.root.style.flip="y"),(e?!n:n)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=i,this.state.rotationCy=s},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,n,i){var s=this.state,r=(this.lastX+s.dx)*s.scale,o=(this.lastY+s.dy)*s.scale,l=(t+s.dx)*s.scale,a=(e+s.dy)*s.scale,h=(n+s.dx)*s.scale,u=(i+s.dy)*s.scale,d=r+2/3*(l-r),p=o+2/3*(a-o),m=h+2/3*(l-h),c=u+2/3*(a-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/s.scale-s.dx,this.lastY=u/s.scale-s.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,n,i,s){var r=this.state,o=this.createVmlElement(t);return o.style.position="absolute",o.style.left=this.format((e+r.dx)*r.scale)+"px",o.style.top=this.format((n+r.dy)*r.scale)+"px",o.style.width=this.format(i*r.scale)+"px",o.style.height=this.format(s*r.scale)+"px",o},mxVmlCanvas2D.prototype.rect=function(t,e,n,i){this.node=this.createRect("rect",t,e,n,i)},mxVmlCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){this.node=this.createRect("roundrect",t,e,n,i),this.node.setAttribute("arcsize",Math.max(100*s/n,100*r/i)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,n,i){this.node=this.createRect("oval",t,e,n,i)},mxVmlCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){var a=null;if(r){(a=this.createRect("rect",t,e,n,i)).stroked="false";var h=this.createVmlElement("fill");h.aspect=r?"atmost":"ignore",h.rotate="true",h.type="frame",h.src=s,a.appendChild(h)}else(a=this.createRect("image",t,e,n,i)).src=s;o&&l?a.style.rotation="180":o?a.style.flip="x":l&&(a.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(a.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(a)},mxVmlCanvas2D.prototype.createDiv=function(t,e,n,i){var s=this.createElement("div"),r=this.state,o="";if(null!=r.fontBackgroundColor&&(o+="background-color:"+mxUtils.htmlEntities(r.fontBackgroundColor)+";"),null!=r.fontBorderColor&&(o+="border:1px solid "+mxUtils.htmlEntities(r.fontBorderColor)+";"),mxUtils.isNode(t))s.appendChild(t);else if("fill"!=i&&"width"!=i){var l=this.createElement("div");l.style.cssText=o,l.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",l.style.zoom="1",l.style.textDecoration="inherit",l.innerHTML=t,s.appendChild(l)}else s.style.cssText=o,s.innerHTML=t;var a=s.style;return a.fontSize=r.fontSize/this.vmlScale+"px",a.fontFamily=r.fontFamily,a.color=r.fontColor,a.verticalAlign="top",a.textAlign=e||"left",a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?r.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(r.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold"),(r.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic"),(r.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a.textDecoration="underline"),s},mxVmlCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s){var m=this.state;if("html"==a){if(null!=m.rotation){var c=this.rotatePoint(t,e,m.rotation,m.rotationCx,m.rotationCy);t=c.x,e=c.y}8!=document.documentMode||mxClient.IS_EM?(t*=m.scale,e*=m.scale):(t+=m.dx,e+=m.dy,"fill"!=h&&o==mxConstants.ALIGN_TOP&&(e-=1));var x=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group");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 g=this.createElement("div");g.style.position="relative",g.style.display="inline";var y=mxUtils.getAlignmentAsPoint(r,o),f=y.x,v=y.y,C=this.createDiv(s,r,o,h),E=this.createElement("div");if(null!=p&&C.setAttribute("dir",p),l&&n>0){if(u||(C.style.width=Math.round(n)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal","break-word"==C.style.wordWrap)null!=(_=C).firstChild&&"DIV"==_.firstChild.nodeName&&(_.firstChild.style.width="100%")}else C.style.whiteSpace="nowrap";var S=m.rotation+(d||0);if(this.rotateHtml&&0!=S?(E.style.display="inline",E.style.zoom="1",E.appendChild(C),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?x.appendChild(E):(g.appendChild(E),x.appendChild(g))):8!=document.documentMode||mxClient.IS_EM?(C.style.display="inline",x.appendChild(C)):(g.appendChild(C),x.appendChild(g)),"DIV"!=this.root.nodeName){var T=this.createVmlElement("rect");T.stroked="false",T.filled="false",T.appendChild(x),this.root.appendChild(T)}else this.root.appendChild(x);if(u?(C.style.overflow="hidden",C.style.width=Math.round(n)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(i)+"px")):"fill"==h?(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.height=Math.max(0,i)+1+"px"):"width"==h&&(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.maxHeight=Math.max(0,i)+1+"px"),this.rotateHtml&&0!=S){var b=S*(Math.PI/180),w=parseFloat(parseFloat(Math.cos(b)).toFixed(8)),L=parseFloat(parseFloat(Math.sin(-b)).toFixed(8));(b%=2*Math.PI)<0&&(b+=2*Math.PI),(b%=Math.PI)>Math.PI/2&&(b=Math.PI-b);var I=Math.cos(b),A=Math.sin(b);8!=document.documentMode||mxClient.IS_EM||(C.style.display="inline-block",E.style.display="inline-block",g.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var O=C;null!=O.firstChild&&"DIV"==O.firstChild.nodeName&&(O=O.firstChild);var _=O.offsetWidth+3,P=O.offsetHeight;u?(n=Math.min(n,_),P=Math.min(P,i)):n=_,l&&(C.style.width=n+"px"),mxClient.IS_QUIRKS&&(u||"width"==h)&&P>i&&(P=i,C.style.height=P+"px");var M=((i=P)-i*I+n*-A)/2-L*n*(f+.5)+w*i*(v+.5),R=(n-n*I+i*-A)/2+w*n*(f+.5)+L*i*(v+.5);if("group"==x.nodeName&&"DIV"==this.root.nodeName){var N=this.createElement("div");N.style.display="inline-block",N.style.position="absolute",N.style.left=this.format(t+(R-n/2)*m.scale)+"px",N.style.top=this.format(e+(M-i/2)*m.scale)+"px",x.parentNode.appendChild(N),N.appendChild(x)}else{var D=8!=document.documentMode||mxClient.IS_EM?m.scale:1;x.style.left=this.format(t+(R-n/2)*D)+"px",x.style.top=this.format(e+(M-i/2)*D)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+w+", M12="+L+", M21="+-L+", M22="+w+", sizingMethod='auto expand')",E.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(E.style.filter+="alpha(opacity="+100*this.state.alpha+")"),E.appendChild(C),C.style.position="",C.style.visibility=""}else if(8!=document.documentMode||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(x.style.filter="alpha(opacity="+100*this.state.alpha+")");var H=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),n=C.offsetWidth;P=C.offsetHeight;mxClient.IS_QUIRKS&&u&&P>i&&(P=i,C.style.height=P+"px"),i=P,C.style.visibility="",H.appendChild(C),x.style.left=this.format(t+n*f*this.state.scale)+"px",x.style.top=this.format(e+i*v*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+100*this.state.alpha+")"),g.style.left=100*f+"%",g.style.top=100*v+"%"}else this.plainText(t,e,n,i,mxUtils.htmlEntities(s,!1),r,o,l,a,h,u,d,p)}},mxVmlCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,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=100*m.alpha+"%",c.appendChild(x);var g=this.createVmlElement("path");g.textpathok="true",g.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),c.appendChild(g);var y=this.createVmlElement("textpath");y.style.cssText="v-text-align:"+r,y.style.align=r,y.style.fontFamily=m.fontFamily,y.string=s,y.on="true";var f=m.fontSize*m.scale/this.vmlScale;y.style.fontSize=f+"px",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(y.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(y.style.fontStyle="italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(y.style.textDecoration="underline");var v=f+(s.split("\n").length-1)*f*mxConstants.LINE_HEIGHT,C=0,E=0;if(o==mxConstants.ALIGN_BOTTOM?E=-v/2:o!=mxConstants.ALIGN_MIDDLE&&(E=v/2),null!=d){c.style.rotation=d;var S=d*(Math.PI/180);C=Math.sin(S)*E,E=Math.cos(S)*E}c.appendChild(y),c.style.left=this.format(t-C)+"px",c.style.top=this.format(e+E)+"px",this.root.appendChild(c)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=void 0!==mxVmlCanvas2D?mxVmlCanvas2D:void 0,mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},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);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,n,i){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=t&&null!=e){var s=this.graph.getView().scale,r=this.getGuideTolerance(n)*s,o=t.clone();o.x+=e.x,o.y+=e.y;var l=!1,a=null,h=null,u=!1,d=null,p=null,m=r,c=r,x=o.x,g=o.x+o.width,y=o.getCenterX(),f=o.y,v=o.y+o.height,C=o.getCenterY();function i(n,i,s){var r=!1;s&&Math.abs(n-y)<m?(e.x=n-t.getCenterX(),m=Math.abs(n-y),r=!0):s||(Math.abs(n-x)<m?(e.x=n-t.x,m=Math.abs(n-x),r=!0):Math.abs(n-g)<m&&(e.x=n-t.x-t.width,m=Math.abs(n-g),r=!0)),r&&(a=i,h=n,null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()))),l=l||r}function A(n,i,s){var r=!1;s&&Math.abs(n-C)<c?(e.y=n-t.getCenterY(),c=Math.abs(n-C),r=!0):s||(Math.abs(n-f)<c?(e.y=n-t.y,c=Math.abs(n-f),r=!0):Math.abs(n-v)<c&&(e.y=n-t.y-t.height,c=Math.abs(n-v),r=!0)),r&&(d=i,p=n,null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))),u=u||r}for(var E=0;E<this.states.length;E++){var S=this.states[E];null==S||this.isStateIgnored(S)||(this.horizontal&&(i.call(this,S.getCenterX(),S,!0),i.call(this,S.x,S,!1),i.call(this,S.x+S.width,S,!1),null==S.cell&&i.call(this,S.getCenterX(),S,!1)),this.vertical&&(A.call(this,S.getCenterY(),S,!0),A.call(this,S.y,S,!1),A.call(this,S.y+S.height,S,!1),null==S.cell&&A.call(this,S.getCenterY(),S,!1)))}this.graph.snapDelta(e,t,!n,l,u),e=this.getDelta(t,a,e.x,d,e.y);var T=this.graph.container;if(l||null==this.guideX){if(null!=this.guideX){var b=null,w=null;null!=a&&null!=t&&(b=Math.min(t.y+e.y-this.graph.panDy,a.y),w=Math.max(t.y+t.height+e.y-this.graph.panDy,a.y+a.height)),this.guideX.points=null!=b&&null!=w?[new mxPoint(h,b),new mxPoint(h,w)]:[new mxPoint(h,-this.graph.panDy),new mxPoint(h,T.scrollHeight-3-this.graph.panDy)],this.guideX.stroke=this.getGuideColor(a,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw()}}else this.guideX.node.style.visibility="hidden";if(u||null==this.guideY){if(null!=this.guideY){var L=null,I=null;null!=d&&null!=t&&(L=Math.min(t.x+e.x-this.graph.panDx,d.x),I=Math.max(t.x+t.width+e.x-this.graph.panDx,d.x+d.width)),this.guideY.points=null!=L&&null!=I?[new mxPoint(L,p),new mxPoint(I,p)]:[new mxPoint(-this.graph.panDx,p),new mxPoint(T.scrollWidth-3-this.graph.panDx,p)],this.guideY.stroke=this.getGuideColor(d,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()}}else this.guideY.node.style.visibility="hidden"}return e},mxGuide.prototype.getDelta=function(t,e,n,i,s){var r=this.graph.view.scale;return(this.rounded||null!=e&&null==e.cell)&&(n=Math.round((t.x+n)/r)*r-t.x),(this.rounded||null!=i&&null==i.cell)&&(s=Math.round((t.y+s)/r)*r-t.y),new mxPoint(n,s)},mxGuide.prototype.getGuideColor=function(t,e){return mxConstants.GUIDE_COLOR},mxGuide.prototype.hide=function(){this.setVisible(!1)},mxGuide.prototype.setVisible=function(t){null!=this.guideX&&(this.guideX.node.style.visibility=t?"visible":"hidden"),null!=this.guideY&&(this.guideY.node.style.visibility=t?"visible":"hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},__mxOutput.mxGuide=void 0!==mxGuide?mxGuide:void 0,mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.antiAlias=!0,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=!0,mxShape.prototype.svgPointerEvents="all",mxShape.prototype.shapePointerEvents=!1,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.outline=!1,mxShape.prototype.visible=!0,mxShape.prototype.useSvgBoundingBox=!1,mxShape.prototype.init=function(t){null==this.node&&(this.node=this.create(t),null!=t&&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=!1,this.flipV=!1},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){var t=this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth;return 1==mxUtils.mod(Math.max(1,Math.round(t*this.scale)),2)?.5:0},mxShape.prototype.create=function(t){return null!=t&&null!=t.ownerSVGElement?this.createSvg(t):8==document.documentMode||!mxClient.IS_VML||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(t):this.createVml(t)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t},mxShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxShape.prototype.reconfigure=function(){this.redraw()},mxShape.prototype.redraw=function(){this.updateBoundsFromPoints(),this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML?this.redrawShape():this.redrawHtmlShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)},mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerHTML=""},mxShape.prototype.updateBoundsFromPoints=function(){var t=this.points;if(null!=t&&t.length>0&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e<this.points.length;e++)null!=t[e]&&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),n=t;if(e!=mxConstants.DIRECTION_SOUTH&&e!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()){var i=(n=n.clone()).width;n.width=n.height,n.height=i}var s=this.getLabelMargins(n);if(null!=s){var r="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),o="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);if(null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()){i=s.x;s.x=s.height,s.height=s.width,s.width=s.y,s.y=i,i=r,r=o,o=i}return mxUtils.getDirectedBounds(t,s,this.style,r,o)}return t},mxShape.prototype.getLabelMargins=function(t){return null},mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!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");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);if(""!=t.tagUrn){var n=Math.max(1,Math.round(this.bounds.width)),i=Math.max(1,Math.round(this.bounds.height));t.coordsize=n*this.vmlScale+","+i*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var s=this.scale;return e.translate(-Math.round(this.bounds.x/s),-Math.round(this.bounds.y/s)),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)),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+")"),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+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var n=this.fill,i=this.gradient,s="0",r={east:0,south:1,west:2,north:3},o=null!=this.direction?r[this.direction]:0;if(null!=this.gradientDirection&&(o=mxUtils.mod(o+r[this.gradientDirection]-1,4)),1==o){s="1";var l=n;n=i,i=l}else if(2==o){l=n;n=i,i=l}else 3==o&&(s="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+i+"', gradientType='"+s+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):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","CSS1Compat"==document.compatMode&&(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 n=t.gradients[e];null!=n&&(n.mxRefCount=(n.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=!1;if(null!=t&&this.outline){var n=t.stroke;t.stroke=function(){e=!0,n.apply(this,arguments)};var i=t.fillAndStroke;t.fillAndStroke=function(){e=!0,i.apply(this,arguments)}}var s=this.scale,r=this.bounds.x/s,o=this.bounds.y/s,l=this.bounds.width/s,a=this.bounds.height/s;if(this.isPaintBoundsInverted()){var h=(l-a)/2;r+=h,o-=h;var u=l;l=a,a=u}this.updateTransform(t,r,o,l,a),this.configureCanvas(t,r,o,l,a);var d=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&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/s,p.y/s,p.width/s,p.height/s);m.appendChild(t.createTransparentFill()),m.stroked="false",t.root.appendChild(m)}}if(null!=this.stencil)this.stencil.drawShape(t,this,r,o,l,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var c=[],x=0;x<this.points.length;x++)null!=this.points[x]&&c.push(new mxPoint(this.points[x].x/s,this.points[x].y/s));this.paintEdgeShape(t,c)}else this.paintVertexShape(t,r,o,l,a);null!=d&&null!=t.state&&null!=t.state.transform&&d.setAttribute("transform",t.state.transform),null!=t&&this.outline&&!e&&(t.rect(r,o,l,a),t.stroke())},mxShape.prototype.configureCanvas=function(t,e,n,i,s){var r=null;if(null!=this.style&&(r=this.style.dashPattern),t.setAlpha(this.opacity/100),t.setFillAlpha(this.fillOpacity/100),t.setStrokeAlpha(this.strokeOpacity/100),null!=this.isShadow&&t.setShadow(this.isShadow),null!=this.isDashed&&t.setDashed(this.isDashed,null!=this.style&&1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1)),null!=r&&t.setDashPattern(r),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var o=this.getGradientBounds(t,e,n,i,s);t.setGradient(this.fill,this.gradient,o.x,o.y,o.width,o.height,this.gradientDirection)}else t.setFillColor(this.fill);t.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(t,e,n,i,s){return new mxRectangle(e,n,i,s)},mxShape.prototype.updateTransform=function(t,e,n,i,s){t.scale(this.scale),t.rotate(this.getShapeRotation(),this.flipH,this.flipV,e+i/2,n+s/2)},mxShape.prototype.paintVertexShape=function(t,e,n,i,s){this.paintBackground(t,e,n,i,s),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),this.paintForeground(t,e,n,i,s))},mxShape.prototype.paintBackground=function(t,e,n,i,s){},mxShape.prototype.paintForeground=function(t,e,n,i,s){},mxShape.prototype.paintEdgeShape=function(t,e){},mxShape.prototype.getArcSize=function(t,e){var n=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))n=Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;n=Math.min(t*i,e*i)}return n},mxShape.prototype.paintGlassEffect=function(t,e,n,i,s,r){var o=Math.ceil(this.strokewidth/2),l=.4;t.setGradient("#ffffff","#ffffff",e,n,i,.6*s,"south",.9,.1),t.begin(),r+=2*o,this.isRounded?(t.moveTo(e-o+r,n-o),t.quadTo(e-o,n-o,e-o,n-o+r),t.lineTo(e-o,n+s*l),t.quadTo(e+.5*i,n+.7*s,e+i+o,n+s*l),t.lineTo(e+i+o,n-o+r),t.quadTo(e+i+o,n-o,e+i+o-r,n-o)):(t.moveTo(e-o,n-o),t.lineTo(e-o,n+s*l),t.quadTo(e+.5*i,n+.7*s,e+i+o,n+s*l),t.lineTo(e+i+o,n-o)),t.close(),t.fill()},mxShape.prototype.addPoints=function(t,e,n,i,s,r,o){if(null!=e&&e.length>0){o=null==o||o;var l=e[e.length-1];if(s&&n){var a=(e=e.slice())[0],h=new mxPoint(l.x+(a.x-l.x)/2,l.y+(a.y-l.y)/2);e.splice(0,0,h)}var u=e[0],d=1;for(o?t.moveTo(u.x,u.y):t.lineTo(u.x,u.y);d<(s?e.length:e.length-1);){var p=e[mxUtils.mod(d,e.length)],m=u.x-p.x,c=u.y-p.y;if(n&&(0!=m||0!=c)&&(null==r||mxUtils.indexOf(r,d-1)<0)){var x=Math.sqrt(m*m+c*c),g=m*Math.min(i,x/2)/x,y=c*Math.min(i,x/2)/x,f=p.x+g,v=p.y+y;t.lineTo(f,v);for(var C=e[mxUtils.mod(d+1,e.length)];d<e.length-2&&0==Math.round(C.x-p.x)&&0==Math.round(C.y-p.y);)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(i,x/2)/x,S=c*Math.min(i,x/2)/x,T=p.x+E,b=p.y+S;t.quadTo(p.x,p.y,T,b),p=new mxPoint(T,b)}else t.lineTo(p.x,p.y);u=p,d++}s?t.close():t.lineTo(l.x,l.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){if(this.state=t,this.style=t.style,null!=this.style){if(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=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV),this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var e=this.flipH;this.flipH=this.flipV,this.flipV=e}this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow),this.isDashed=1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed),this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded),this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass),this.fill==mxConstants.NONE&&(this.fill=null),this.gradient==mxConstants.NONE&&(this.gradient=null),this.stroke==mxConstants.NONE&&(this.stroke=null)}},mxShape.prototype.setCursor=function(t){null==t&&(t=""),this.cursor=t,null!=this.node&&(this.node.style.cursor=t)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.isRoundable=function(){return!1},mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&null!=this.node&&null!=this.node.ownerSVGElement)try{var t=this.node.getBBox();if(t.width>0&&t.height>0)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){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 null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,n,i){var s=document.createElementNS(mxConstants.NS_SVG,"rect");return s.setAttribute("x",t),s.setAttribute("y",e),s.setAttribute("width",n),s.setAttribute("height",i),s.setAttribute("fill","none"),s.setAttribute("stroke","none"),s.setAttribute("pointer-events","all"),s},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var n=t[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n))}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=void 0!==mxShape?mxShape:void 0,mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,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=null!=t?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&e.length>0){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}}},mxStencil.prototype.parseConstraint=function(t){var e=Number(t.getAttribute("x")),n=Number(t.getAttribute("y")),i="1"==t.getAttribute("perimeter"),s=t.getAttribute("name");return new mxConnectionConstraint(new mxPoint(e,n),i,s)},mxStencil.prototype.evaluateTextAttribute=function(t,e,n){var i=this.evaluateAttribute(t,e,n),s=t.getAttribute("localized");return(mxStencil.defaultLocalized&&null==s||"1"==s)&&(i=mxResources.get(i)),i},mxStencil.prototype.evaluateAttribute=function(t,e,n){var i=t.getAttribute(e);if(null==i){var s=mxUtils.getTextContent(t);if(null!=s&&mxStencil.allowEval){var r=mxUtils.eval(s);"function"==typeof r&&(i=r(n))}}return i},mxStencil.prototype.drawShape=function(t,e,n,i,s,r){var o=t.states.slice(),l=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,null),a=this.computeAspect(e.style,n,i,s,r,l),h=Math.min(a.width,a.height),u="inherit"==this.strokewidth?Number(mxUtils.getNumber(e.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*h;t.setStrokeWidth(u),null!=e.style&&"1"==mxUtils.getValue(e.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(t.setStrokeColor(mxConstants.NONE),t.rect(n,i,s,r),t.stroke(),t.setStrokeColor(e.stroke)),this.drawChildren(t,e,n,i,s,r,this.bgNode,a,!1,!0),this.drawChildren(t,e,n,i,s,r,this.fgNode,a,!0,!e.outline||null==e.style||0==mxUtils.getValue(e.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)),t.states.length!=o.length&&(t.states=o)},mxStencil.prototype.drawChildren=function(t,e,n,i,s,r,o,l,a,h){if(null!=o&&s>0&&r>0)for(var u=o.firstChild;null!=u;)u.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,u,l,a,h),u=u.nextSibling},mxStencil.prototype.computeAspect=function(t,e,n,i,s,r){var o=e,l=n,a=i/this.w0,h=s/this.h0,u=r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH;if(u){h=i/this.h0,a=s/this.w0;var d=(i-s)/2;o+=d,l-=d}return"fixed"==this.aspect&&(a=h=Math.min(a,h),u?(o+=(s-this.w0*a)/2,l+=(i-this.h0*h)/2):(o+=(i-this.w0*a)/2,l+=(s-this.h0*h)/2)),new mxRectangle(o,l,a,h)},mxStencil.prototype.drawNode=function(t,e,n,i,s,r){var o=n.nodeName,l=i.x,a=i.y,h=i.width,u=i.height,d=Math.min(h,u);if("save"==o)t.save();else if("restore"==o)t.restore();else if(r){if("path"==o){t.begin();var p=!0;if("1"==n.getAttribute("rounded")){p=!1;for(var m=Number(n.getAttribute("arcSize")),c=0,x=[],g=n.firstChild;null!=g;){if(g.nodeType==mxConstants.NODETYPE_ELEMENT){var y=g.nodeName;if("move"!=y&&"line"!=y){p=!0;break}"move"!=y&&0!=x.length||x.push([]),x[x.length-1].push(new mxPoint(l+Number(g.getAttribute("x"))*h,a+Number(g.getAttribute("y"))*u)),c++}g=g.nextSibling}if(!p&&c>0)for(var f=0;f<x.length;f++){var v=!1,C=x[f][0],E=x[f][x[f].length-1];C.x==E.x&&C.y==E.y&&(x[f].pop(),v=!0),this.addPoints(t,x[f],!0,m,v)}else p=!0}if(p)for(g=n.firstChild;null!=g;)g.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,g,i,s,r),g=g.nextSibling}else if("close"==o)t.close();else if("move"==o)t.moveTo(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u);else if("line"==o)t.lineTo(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u);else if("quad"==o)t.quadTo(l+Number(n.getAttribute("x1"))*h,a+Number(n.getAttribute("y1"))*u,l+Number(n.getAttribute("x2"))*h,a+Number(n.getAttribute("y2"))*u);else if("curve"==o)t.curveTo(l+Number(n.getAttribute("x1"))*h,a+Number(n.getAttribute("y1"))*u,l+Number(n.getAttribute("x2"))*h,a+Number(n.getAttribute("y2"))*u,l+Number(n.getAttribute("x3"))*h,a+Number(n.getAttribute("y3"))*u);else if("arc"==o)t.arcTo(Number(n.getAttribute("rx"))*h,Number(n.getAttribute("ry"))*u,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u);else if("rect"==o)t.rect(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*u);else if("roundrect"==o){var S=Number(n.getAttribute("arcsize"));0==S&&(S=100*mxConstants.RECTANGLE_ROUNDING_FACTOR);var T=Number(n.getAttribute("w"))*h,b=Number(n.getAttribute("h"))*u,w=Number(S)/100,L=Math.min(T*w,b*w);t.roundrect(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,T,b,L,L)}else if("ellipse"==o)t.ellipse(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*u);else if("image"==o){if(!e.outline){var I=this.evaluateAttribute(n,"src",e);t.image(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*u,I,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV"))}}else if("text"==o){if(!e.outline){var A=this.evaluateTextAttribute(n,"str",e),O="1"==n.getAttribute("vertical")?-90:0;if("0"==n.getAttribute("align-shape")){var _=e.rotation,P=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPH,0),M=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPV,0);P&&M?O-=_:P||M?O+=_:O-=_}O-=n.getAttribute("rotation"),t.text(l+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*u,0,0,A,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",null,!1,O)}}else if("include-shape"==o){var R=mxStencilRegistry.getStencil(n.getAttribute("name"));if(null!=R){var N=l+Number(n.getAttribute("x"))*h,D=a+Number(n.getAttribute("y"))*u;T=Number(n.getAttribute("w"))*h,b=Number(n.getAttribute("h"))*u;R.drawShape(t,e,N,D,T,b)}}else if("fillstroke"==o)t.fillAndStroke();else if("fill"==o)t.fill();else if("stroke"==o)t.stroke();else if("strokewidth"==o){var H="1"==n.getAttribute("fixed")?1:d;t.setStrokeWidth(Number(n.getAttribute("width"))*H)}else if("dashed"==o)t.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==o){var G=n.getAttribute("pattern");if(null!=G){var U=G.split(" "),V=[];for(f=0;f<U.length;f++)U[f].length>0&&V.push(Number(U[f])*d);G=V.join(" "),t.setDashPattern(G)}}else"strokecolor"==o?t.setStrokeColor(n.getAttribute("color")):"linecap"==o?t.setLineCap(n.getAttribute("cap")):"linejoin"==o?t.setLineJoin(n.getAttribute("join")):"miterlimit"==o?t.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==o?t.setFillColor(n.getAttribute("color")):"alpha"==o||"fillalpha"==o||"strokealpha"==o?t.setAlpha(n.getAttribute("alpha")):"fontcolor"==o?t.setFontColor(n.getAttribute("color")):"fontstyle"==o?t.setFontStyle(n.getAttribute("style")):"fontfamily"==o?t.setFontFamily(n.getAttribute("family")):"fontsize"==o&&t.setFontSize(Number(n.getAttribute("size"))*d);!s||"fillstroke"!=o&&"fill"!=o&&"stroke"!=o||(s=!1,t.setShadow(!1))}},__mxOutput.mxStencil=void 0!==mxStencil?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=void 0!==mxStencilRegistry?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,n,i,s,r,o,l,a,h){var u=mxMarker.markers[n];return null!=u?u(t,e,n,i,s,r,o,l,a,h):null}};function mxActor(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxCloud(t,e,n,i){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRectangleShape(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxDoubleEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRhombus(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxPolyline(t,e,n){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxArrow(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.spacing=null!=r?r:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=r?r:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c,x,g,y,f,v,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=s?s:"black",this.align=null!=n?n:mxConstants.ALIGN_CENTER,this.valign=null!=i?i:mxConstants.ALIGN_MIDDLE,this.family=null!=r?r:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=l?l:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||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=null==m||m,this.background=c,this.border=x,this.wrap=null!=g&&g,this.clipped=null!=y&&y,this.overflow=null!=f?f:"visible",this.labelPadding=null!=v?v:0,this.textDirection=C,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,n,i){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=n?n:1,this.vertical=null!=i?i:this.vertical}function mxImageShape(t,e,n,i,s){mxShape.call(this),this.bounds=t,this.image=e,this.fill=n,this.stroke=i,this.strokewidth=null!=s?s:1,this.shadow=!1}function mxLabel(t,e,n,i){mxRectangleShape.call(this,t,e,n,i)}function mxCylinder(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxConnector(t,e,n){mxPolyline.call(this,t,e,n)}function mxSwimlane(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,n,i,s,r){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=n?n:0,this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.border=null!=r?r:0}function mxPartitionLayout(t,e,n,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=n||0,this.border=i||0}function mxCompactTreeLayout(t,e,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=n&&n}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,n){mxGraphLayout.call(this,t),this.layouts=e,this.master=n}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}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]))}function mxGraphHierarchyModel(t,e,n,i,s){t.getGraph(),this.tightenToSource=s,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var r=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,r);for(var o=0;o<e.length;o++){for(var l=r[o].connectsAsSource,a=0;a<l.length;a++){var h=l[a],u=h.edges;if(null!=u&&u.length>0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxSwimlaneModel(t,e,n,i,s){t.getGraph(),this.tightenToSource=s,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var r=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,r);for(var o=0;o<e.length;o++){for(var l=r[o].connectsAsSource,a=0;a<l.length;a++){var h=l[a],u=h.edges;if(null!=u&&u.length>0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,n,i,s,r){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=n,this.orientation=i,this.initialX=s,this.parallelEdgeSpacing=r}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}!function(){function t(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();m.x-=d,m.y-=p;var c=i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return s.x+=-r*c-d,s.y+=-o*c-p,function(){e.begin(),e.moveTo(m.x,m.y),e.lineTo(m.x-r-o/t,m.y-o+r/t),i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(m.x-3*r/4,m.y-3*o/4),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.close(),u?e.fillAndStroke():e.stroke()}}}function e(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();return m.x-=d,m.y-=p,s.x+=2*-d,s.y+=2*-p,function(){e.begin(),e.moveTo(m.x-r-o/t,m.y-o+r/t),e.lineTo(m.x,m.y),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.stroke()}}}function n(t,e,n,i,s,r,o,l,a,h){var u=n==mxConstants.ARROW_DIAMOND?.7071:.9862,d=s*a*u,p=r*a*u;s*=o+a,r*=o+a;var m=i.clone();m.x-=d,m.y-=p,i.x+=-s-d,i.y+=-r-p;var c=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(m.x,m.y),t.lineTo(m.x-s/2-r/c,m.y+s/c-r/2),t.lineTo(m.x-s,m.y-r),t.lineTo(m.x-s/2+r/c,m.y-r/2-s/c),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",(function(t,e,n,i,s,r,o,l,a,h){var u=o/2,d=i.clone();return i.x-=s*u,i.y-=r*u,function(){t.ellipse(d.x-u,d.y-u,o,o),h?t.fillAndStroke():t.stroke()}})),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),__mxOutput.mxMarker=void 0!==mxMarker?mxMarker:void 0,mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,n,i,s){var r=i/3;t.moveTo(0,s),t.curveTo(0,3*s/5,0,2*s/5,i/2,2*s/5),t.curveTo(i/2-r,2*s/5,i/2-r,0,i/2,0),t.curveTo(i/2+r,0,i/2+r,2*s/5,i/2,2*s/5),t.curveTo(i,2*s/5,i,3*s/5,i,s),t.close()},__mxOutput.mxActor=void 0!==mxActor?mxActor:void 0,mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,n,i,s){t.moveTo(.25*i,.25*s),t.curveTo(.05*i,.25*s,0,.5*s,.16*i,.55*s),t.curveTo(0,.66*s,.18*i,.9*s,.31*i,.8*s),t.curveTo(.4*i,s,.7*i,s,.8*i,.8*s),t.curveTo(i,.8*s,i,.6*s,.875*i,.5*s),t.curveTo(i,.3*s,.8*i,.1*s,.625*i,.2*s),t.curveTo(.5*i,.05*s,.3*i,.05*s,.25*i,.25*s),t.close()},__mxOutput.mxCloud=void 0!==mxCloud?mxCloud:void 0,mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,n,i,s){var r=!0;if(null!=this.style&&(r="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),r||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(r||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded){var o=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))o=Math.min(i/2,Math.min(s/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(i*l,s*l)}t.roundrect(e,n,i,s,o,o)}else t.rect(e,n,i,s);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,n,i,s){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,n,i,s){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,n,i,s,this.getArcSize(i+this.strokewidth,s+this.strokewidth))},__mxOutput.mxRectangleShape=void 0!==mxRectangleShape?mxRectangleShape:void 0,mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},__mxOutput.mxEllipse=void 0!==mxEllipse?mxEllipse:void 0,mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,n,i,s){if(!this.outline){var r=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(i/5,s/5)));e+=r,n+=r,s-=2*r,(i-=2*r)>0&&s>0&&t.ellipse(e,n,i,s),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=void 0!==mxDoubleEllipse?mxDoubleEllipse:void 0,mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,n,i,s){var r=i/2,o=s/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+r,n),new mxPoint(e+i,n+o),new mxPoint(e+r,n+s),new mxPoint(e,n+o)],this.isRounded,l,!0),t.fillAndStroke()},__mxOutput.mxRhombus=void 0!==mxRhombus?mxRhombus:void 0,mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var n=t.pointerEventsValue;t.pointerEventsValue="stroke",null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=n},mxPolyline.prototype.paintLine=function(t,e,n){var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,n,i,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var n=e[0],i=e.length;t.moveTo(n.x,n.y);for(var s=1;s<i-2;s++){var r=e[s],o=e[s+1],l=(r.x+o.x)/2,a=(r.y+o.y)/2;t.quadTo(r.x,r.y,l,a)}r=e[i-2],o=e[i-1];t.quadTo(r.x,r.y,o.x,o.y),t.stroke()},__mxOutput.mxPolyline=void 0!==mxPolyline?mxPolyline:void 0,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 n=mxConstants.ARROW_SPACING,i=mxConstants.ARROW_WIDTH,s=mxConstants.ARROW_SIZE,r=e[0],o=e[e.length-1],l=o.x-r.x,a=o.y-r.y,h=Math.sqrt(l*l+a*a),u=h-2*n-s,d=l/h,p=a/h,m=u*d,c=u*p,x=i*p/3,g=-i*d/3,y=r.x-x/2+n*d,f=r.y-g/2+n*p,v=y+x,C=f+g,E=v+m,S=C+c,T=E+x,b=S+g,w=T-3*x,L=b-3*g;t.begin(),t.moveTo(y,f),t.lineTo(v,C),t.lineTo(E,S),t.lineTo(T,b),t.lineTo(o.x-n*d,o.y-n*p),t.lineTo(w,L),t.lineTo(w+x,L+g),t.close(),t.fillAndStroke()},__mxOutput.mxArrow=void 0!==mxArrow?mxArrow:void 0,mxUtils.extend(mxArrowConnector,mxShape),mxArrowConnector.prototype.useSvgBoundingBox=!0,mxArrowConnector.prototype.isRoundable=function(){return!0},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),null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))},mxArrowConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=this.getEdgeWidth();this.isMarkerStart()&&(e=Math.max(e,this.getStartArrowWidth())),this.isMarkerEnd()&&(e=Math.max(e,this.getEndArrowWidth())),t.grow((e/2+this.strokewidth)*this.scale)},mxArrowConnector.prototype.paintEdgeShape=function(t,e){var n=this.strokewidth;this.outline&&(n=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));for(var i=this.getStartArrowWidth()+n,s=this.getEndArrowWidth()+n,r=this.outline?this.getEdgeWidth()+n:this.getEdgeWidth(),o=this.isOpenEnded(),l=this.isMarkerStart(),a=this.isMarkerEnd(),h=o?0:this.arrowSpacing+n/2,u=this.startSize+n,d=this.endSize+n,p=this.isArrowRounded(),m=e[e.length-1],c=1;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,g=e[c].y-e[0].y,y=Math.sqrt(x*x+g*g);if(0!=y){var f,v,C=x/y,E=C,S=g/y,T=S,b=r*S,w=-r*C,L=[];p?t.setLineJoin("round"):e.length>2&&t.setMiterLimit(1.42),t.begin();var I=C,A=S;if(l&&!o)this.paintMarker(t,e[0].x,e[0].y,C,S,u,i,r,h,!0);else{var O=e[0].x+b/2+h*C,_=e[0].y+w/2+h*S,P=e[0].x-b/2+h*C,M=e[0].y-w/2+h*S;o?(t.moveTo(O,_),L.push((function(){t.lineTo(P,M)}))):(t.moveTo(P,M),t.lineTo(O,_))}for(var R=0,N=0,D=0,H=0;H<e.length-2;H++){var G=mxUtils.relativeCcw(e[H].x,e[H].y,e[H+1].x,e[H+1].y,e[H+2].x,e[H+2].y);if(R=e[H+2].x-e[H+1].x,N=e[H+2].y-e[H+1].y,0!=(D=Math.sqrt(R*R+N*N))){var U=C*(E=R/D)+S*(T=N/D),V=Math.max(Math.sqrt((U+1)/2),.04);f=C+E,v=S+T;var B=Math.sqrt(f*f+v*v);if(0!=B){f/=B,v/=B;var F=Math.max(V,Math.min(this.strokewidth/200+.04,.35)),k=0!=G&&p?Math.max(.1,F):Math.max(V,.06),Y=e[H+1].x+v*r/2/k,z=e[H+1].y-f*r/2/k,j=e[H+1].x-v*r/2/k,W=e[H+1].y+f*r/2/k;if(0!=G&&p)if(-1==G){var K=j+S*r,X=W-C*r,Z=j+T*r,q=W-E*r;t.lineTo(K,X),t.quadTo(Y,z,Z,q),function(e,n){L.push((function(){t.lineTo(e,n)}))}(j,W)}else t.lineTo(Y,z),function(e,n){var i=Y-S*r,s=z+C*r,o=Y-T*r,l=z+E*r;L.push((function(){t.quadTo(e,n,i,s)})),L.push((function(){t.lineTo(o,l)}))}(j,W);else t.lineTo(Y,z),function(e,n){L.push((function(){t.lineTo(e,n)}))}(j,W);C=E,S=T}}}if(b=r*T,w=-r*E,a&&!o)this.paintMarker(t,m.x,m.y,-C,-S,d,s,r,h,!1);else{t.lineTo(m.x-h*E+b/2,m.y-h*T+w/2);var $=m.x-h*E-b/2,Q=m.y-h*T-w/2;o?(t.moveTo($,Q),L.splice(0,0,(function(){t.moveTo($,Q)}))):t.lineTo($,Q)}for(H=L.length-1;H>=0;H--)L[H]();o?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),p&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),l&&!o&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,I,A,u,i,r,h,!0),t.stroke(),t.end()),a&&!o&&(t.begin(),this.paintMarker(t,m.x,m.y,-C,-S,d,s,r,h,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,n,i,s,r,o,l,a,h){var u=l/o,d=l*s/2,p=-l*i/2,m=(a+r)*i,c=(a+r)*s;h?t.moveTo(e-d+m,n-p+c):t.lineTo(e-d+m,n-p+c),t.lineTo(e-d/u+m,n-p/u+c),t.lineTo(e+a*i,n+a*s),t.lineTo(e+d/u+m,n+p/u+c),t.lineTo(e+d+m,n+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!1},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=void 0!==mxArrowConnector?mxArrowConnector:void 0,mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var n=this.scale,i=this.bounds.x/n,s=this.bounds.y/n,r=this.bounds.width/n,o=this.bounds.height/n;if(this.updateTransform(t,i,s,r,o),this.configureCanvas(t,i,s,r,o),e)t.updateText(i,s,r,o,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var l=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,a=l||t instanceof mxVmlCanvas2D?"html":"",h=this.value;l||"html"!=a||(h=mxUtils.htmlEntities(h,!1)),"html"!=a||mxUtils.isNode(this.value)||(h=mxUtils.replaceTrailingNewlines(h,"<div><br></div>")),h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==a?h.replace(/\n/g,"<br/>"):h;var u=this.textDirection;u!=mxConstants.TEXT_DIRECTION_AUTO||l||(u=this.getAutoDirection()),u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL&&(u=null),t.text(i,s,r,o,h,this.align,this.valign,this.wrap,a,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("DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML){var t=this.createCanvas();null!=t&&null!=t.updateText?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value: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=!0,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),null!=this.style&&(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 null!=t&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return null!=t&&(t=null==t.ownerSVGElement?this.node.firstChild.firstChild:t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&n==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_MIDDLE)){var s=null,r=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)r=(t=t.firstChild.firstChild.firstChild.firstChild).offsetHeight*this.scale,s="width"==this.overflow?this.boundingBox.width:t.offsetWidth*this.scale;else try{var o=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)||0==o.width&&0==o.height?this.boundingBox=null:this.boundingBox=new mxRectangle(o.x,o.y,o.width,o.height))}catch(t){}else{var l=null!=this.state?this.state.view.textDiv:null;if(null!=this.offsetWidth&&null!=this.offsetHeight)s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale;else{null!=l&&(this.updateFont(l),this.updateSize(l,!1),this.updateInnerHtml(l),t=l);var a=t;if(8!=document.documentMode||mxClient.IS_EM)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild);else{var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap){var u=a.getElementsByTagName("div");u.length>0&&(a=u[u.length-1]),s=a.offsetWidth+2,u=this.node.getElementsByTagName("div"),this.clipped&&(s=Math.min(h,s)),u.length>1&&(u[u.length-2].style.width=s+"px")}}else t.style.whiteSpace="nowrap"}this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight,s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale}}null!=s&&null!=r&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,s,r))}if(null!=this.boundingBox)if(0!=e){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 null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,n,i,s){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;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>"),t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,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")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var n=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(e+="text-decoration: "+n.join(" ")+"; "),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,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),n="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",i=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):null,n,i,this.scale,mxUtils.bind(this,(function(t,e,n,i,s,r){var o=this.getTextRotation(),l=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=o?"rotate("+o+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=l&&(l="transform-origin: 0 0; transform: "+l+"; "),""==r?(n+=i,i="display:inline-block; min-width: 100%; "+l):(i+=l,mxClient.IS_SF&&(i+="-webkit-clip-path: content-box;")),this.opacity<100&&(s+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",n);var a=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="<div><div>"+a+"</div></div>"),this.node.firstChild.firstChild.setAttribute("style",s),this.node.firstChild.setAttribute("style",i)})))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,n=this.margin.x,i=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-n+"% "+100*-i+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*n+"%,"+100*i+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+100*n+"%,"+100*i+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(n*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-i*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"<div>&nbsp;</div>"),e='<div style="display:inline-block;_display:inline;">'+(e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e)+"</div>",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,n=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var s=0,r=0,o=null!=this.state?this.state.view.textDiv:null,l=this.node;if(null!=o){o.style.overflow="",o.style.height="",o.style.width="",this.updateFont(o),this.updateSize(o,!1),this.updateInnerHtml(o);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(o.style.whiteSpace="normal",o.style.wordWrap=mxConstants.WORD_WRAP,s=a,this.clipped&&(s=Math.min(s,this.bounds.width)),o.style.width=s+"px"):o.style.whiteSpace="nowrap",null!=(l=o).firstChild&&"DIV"==l.firstChild.nodeName&&(l=l.firstChild,this.wrap&&"break-word"==o.style.wordWrap&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(s=l.offsetWidth+this.textWidthPadding,o.style.width=s+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(r+=3)}else null!=l.firstChild&&"DIV"==l.firstChild.nodeName&&(r=(l=l.firstChild).offsetHeight);s=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));a=this.bounds.width/i;var h=this.bounds.height/i;"fill"==this.overflow?(r=h,s=a):"width"==this.overflow&&(r=l.scrollHeight,s=a),this.offsetWidth=s,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&h>0)?(h=Math.min(h,r),t.height=Math.round(h)+"px"):h=r,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(s=Math.min(a,s)),a=s,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),d=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),p=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));(u%=2*Math.PI)<0&&(u+=2*Math.PI),(u%=Math.PI)>Math.PI/2&&(u=Math.PI-u);var m=Math.cos(u),c=Math.sin(-u),x=a*-(e+.5),g=h*-(n+.5),y=(h-h*m+a*c)/2+p*x-d*g,f=(a-a*m+h*c)/2-d*x-p*g;if(0!=u){var v="progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12="+p+", M21="+-p+", M22="+d+", sizingMethod='auto expand')";null!=t.filter&&t.filter.length>0?t.filter+=" "+v:t.filter=v}n=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?n-=1:this.valign==mxConstants.ALIGN_BOTTOM?n+=2:n+=1),t.zoom=i,t.left=Math.round(this.bounds.x+f-a/2)+"px",t.top=Math.round(this.bounds.y+y-h/2+n)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"<div><br></div>"),t=this.replaceLinefeeds?t.replace(/\n/g,"<br/>"):t;var e=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||"width"==this.overflow)null!=e&&(this.node.style.backgroundColor=e),null!=n&&(this.node.style.border="1px solid "+n);else{var i="";null!=e&&(i+="background-color:"+mxUtils.htmlEntities(e)+";"),null!=n&&(i+="border:1px solid "+mxUtils.htmlEntities(n)+";"),t='<div style="zoom:1;'+i+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'">'+t+"</div>"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var r=this.textDirection;r==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(r=this.getAutoDirection()),r==mxConstants.TEXT_DIRECTION_LTR||r==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",r):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,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var n=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),e.textDecoration=n.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var n=Math.max(0,Math.round(this.bounds.width/this.scale)),i=Math.max(0,Math.round(this.bounds.height/this.scale)),s=t.style;if(this.clipped?(s.overflow="hidden",mxClient.IS_QUIRKS?s.width=n+"px":(s.maxHeight=i+"px",s.maxWidth=n+"px")):"fill"==this.overflow?(s.width=n+1+"px",s.height=i+1+"px",s.overflow="hidden"):"width"==this.overflow&&(s.width=n+1+"px",s.maxHeight=i+1+"px",s.overflow="hidden"),this.wrap&&n>0){if(s.wordWrap=mxConstants.WORD_WRAP,s.whiteSpace="normal",s.width=n+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow){var r=t;null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild,"break-word"==t.style.wordWrap&&(r.style.width="100%"));var o=r.offsetWidth;if(0==o){var l=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),o=r.offsetWidth,t.style.visibility="",l.appendChild(t)}o+=3,this.clipped&&(o=Math.min(o,n)),s.width=o+"px"}}else s.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},__mxOutput.mxText=void 0!==mxText?mxText:void 0,mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,.5*s),new mxPoint(0,s)],this.isRounded,r,!0)},__mxOutput.mxTriangle=void 0!==mxTriangle?mxTriangle:void 0,mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*i,0),new mxPoint(.75*i,0),new mxPoint(i,.5*s),new mxPoint(.75*i,s),new mxPoint(.25*i,s),new mxPoint(0,.5*s)],this.isRounded,r,!0)},__mxOutput.mxHexagon=void 0!==mxHexagon?mxHexagon:void 0,mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,n,i,s){if(t.begin(),this.vertical){var r=e+i/2;t.moveTo(r,n),t.lineTo(r,n+s)}else{r=n+s/2;t.moveTo(e,r),t.lineTo(e+i,r)}t.stroke()},__mxOutput.mxLine=void 0!==mxLine?mxLine:void 0,mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,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,null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,n,i,s){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,n,i,s){if(null!=this.image){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=r&&(t.setFillColor(r),t.setStrokeColor(o),t.rect(e,n,i,s),t.fillAndStroke()),t.image(e,n,i,s,this.image,this.preserveImageAspect,!1,!1),null!=(o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(o),t.rect(e,n,i,s),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(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="",null!=this.image){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var n=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,i=document.createElement(n?mxClient.VML_PREFIX+":image":"img");i.setAttribute("border","0"),i.style.position="absolute",i.src=this.image;var s=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=s,this.flipH&&this.flipV?s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?s+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),i.style.filter!=s&&(i.style.filter=s),"image"==i.nodeName?i.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(i.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(i.style,"transform",""),i.style.width=this.node.style.width,i.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(i)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=void 0!==mxImageShape?mxImageShape:void 0,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),null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(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)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(t,e,n,i,s){this.paintImage(t,e,n,i,s),this.paintIndicator(t,e,n,i,s),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,n,i,s){if(null!=this.image){var r=this.getImageBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:s==mxConstants.ALIGN_RIGHT?t+=n-o-a:t+=a,r==mxConstants.ALIGN_TOP?e+=a:r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.paintIndicator=function(t,e,n,i,s){if(null!=this.indicator)this.indicator.bounds=this.getIndicatorBounds(e,n,i,s),this.indicator.paint(t);else if(null!=this.indicatorImage){var r=this.getIndicatorBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return s==mxConstants.ALIGN_RIGHT?t+=n-o-a:s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:t+=a,r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:r==mxConstants.ALIGN_TOP?e+=a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){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=void 0!==mxLabel?mxLabel:void 0,mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,n,i,s,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,n,i){return Math.min(this.maxHeight,Math.round(i/5))},mxCylinder.prototype.redrawPath=function(t,e,n,i,s,r){var o=this.getCylinderSize(e,n,i,s);(r&&null!=this.fill||!r&&null==this.fill)&&(t.moveTo(0,o),t.curveTo(0,2*o,i,2*o,i,o),r||(t.stroke(),t.begin())),r||(t.moveTo(0,o),t.curveTo(0,-o/3,i,-o/3,i,o),t.lineTo(i,s-o),t.curveTo(i,s+o/3,0,s+o/3,0,s-o),t.close())},__mxOutput.mxCylinder=void 0!==mxCylinder?mxCylinder:void 0,mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED],mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=n&&n(),null!=i&&i()},mxConnector.prototype.createMarker=function(t,e,n){var i=null,s=e.length,r=mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),o=n?e[1]:e[s-2],l=n?e[0]:e[s-1];if(null!=r&&null!=o&&null!=l){for(var a=1;a<s-1&&0==Math.round(o.x-l.x)&&0==Math.round(o.y-l.y);)o=n?e[1+a]:e[s-2-a],a++;var h=l.x-o.x,u=l.y-o.y,d=Math.max(1,Math.sqrt(h*h+u*u)),p=h/d,m=u/d,c=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),x=0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL];i=mxMarker.createMarker(t,this,r,l,p,m,c,n,this.strokewidth,x)}return i},mxConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(e=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),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=void 0!==mxConnector?mxConnector:void 0,mxUtils.extend(mxSwimlane,mxShape),mxSwimlane.prototype.imageSize=16,mxSwimlane.prototype.isRoundable=function(t,e,n,i,s){return!0},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(),n=new mxRectangle(t.x,t.y,t.width,t.height),i=this.isHorizontal(),s=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),o=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH,l=i==!o,a=!l&&s!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST),h=l&&r!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(o){u=Math.min(n.width,e*this.scale);(a||h)&&(n.x+=n.width-u),n.width=u}else{var u=Math.min(n.height,e*this.scale);(a||h)&&(n.y+=n.height-u),n.height=u}return n},mxSwimlane.prototype.getGradientBounds=function(t,e,n,i,s){var r=this.getTitleSize();return this.isHorizontal()?new mxRectangle(e,n,i,r=Math.min(r,s)):new mxRectangle(e,n,r=Math.min(r,i),s)},mxSwimlane.prototype.getSwimlaneArcSize=function(t,e,n){return"1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)*3},mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.paintVertexShape=function(t,e,n,i,s){var r=this.getTitleSize(),o=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),l=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),a=0;r=this.isHorizontal()?Math.min(r,s):Math.min(r,i),t.translate(e,n),this.isRounded?(a=this.getSwimlaneArcSize(i,s,r),a=Math.min((this.isHorizontal()?s:i)-r,Math.min(r,a)),this.paintRoundedSwimlane(t,e,n,i,s,r,a,o,l)):this.paintSwimlane(t,e,n,i,s,r,o,l);var h=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);if(this.paintSeparator(t,e,n,i,s,r,h),null!=this.image){var u=this.getImageBounds(e,n,i,s);t.image(u.x-e,u.y-n,u.width,u.height,this.image,!1,!1,!1)}this.glass&&(t.setShadow(!1),this.paintGlassEffect(t,0,0,i,r,a))},mxSwimlane.prototype.paintSwimlane=function(t,e,n,i,s,r,o,l){t.begin();var a=!0;null!=this.style&&(a="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),a||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isHorizontal()?(t.moveTo(0,r),t.lineTo(0,0),t.lineTo(i,0),t.lineTo(i,r),t.fillAndStroke(),r<s&&(o!=mxConstants.NONE&&a||(t.pointerEvents=!1),o!=mxConstants.NONE&&t.setFillColor(o),t.begin(),t.moveTo(0,r),t.lineTo(0,s),t.lineTo(i,s),t.lineTo(i,r),o==mxConstants.NONE?t.stroke():t.fillAndStroke())):(t.moveTo(r,0),t.lineTo(0,0),t.lineTo(0,s),t.lineTo(r,s),t.fillAndStroke(),r<i&&(o!=mxConstants.NONE&&a||(t.pointerEvents=!1),o!=mxConstants.NONE&&t.setFillColor(o),t.begin(),t.moveTo(r,0),t.lineTo(i,0),t.lineTo(i,s),t.lineTo(r,s),o==mxConstants.NONE?t.stroke():t.fillAndStroke())),l&&this.paintDivider(t,e,n,i,s,r,o==mxConstants.NONE)},mxSwimlane.prototype.paintRoundedSwimlane=function(t,e,n,i,s,r,o,l,a){t.begin();var h=!0;null!=this.style&&(h="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),h||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isHorizontal()?(t.moveTo(i,r),t.lineTo(i,o),t.quadTo(i,0,i-Math.min(i/2,o),0),t.lineTo(Math.min(i/2,o),0),t.quadTo(0,0,0,o),t.lineTo(0,r),t.fillAndStroke(),r<s&&(l!=mxConstants.NONE&&h||(t.pointerEvents=!1),l!=mxConstants.NONE&&t.setFillColor(l),t.begin(),t.moveTo(0,r),t.lineTo(0,s-o),t.quadTo(0,s,Math.min(i/2,o),s),t.lineTo(i-Math.min(i/2,o),s),t.quadTo(i,s,i,s-o),t.lineTo(i,r),l==mxConstants.NONE?t.stroke():t.fillAndStroke())):(t.moveTo(r,0),t.lineTo(o,0),t.quadTo(0,0,0,Math.min(s/2,o)),t.lineTo(0,s-Math.min(s/2,o)),t.quadTo(0,s,o,s),t.lineTo(r,s),t.fillAndStroke(),r<i&&(l!=mxConstants.NONE&&h||(t.pointerEvents=!1),l!=mxConstants.NONE&&t.setFillColor(l),t.begin(),t.moveTo(r,s),t.lineTo(i-o,s),t.quadTo(i,s,i,s-Math.min(s/2,o)),t.lineTo(i,Math.min(s/2,o)),t.quadTo(i,0,i-o,0),t.lineTo(r,0),l==mxConstants.NONE?t.stroke():t.fillAndStroke())),a&&this.paintDivider(t,e,n,i,s,r,l==mxConstants.NONE)},mxSwimlane.prototype.paintDivider=function(t,e,n,i,s,r,o){o||t.setShadow(!1),t.begin(),this.isHorizontal()?(t.moveTo(0,r),t.lineTo(i,r)):(t.moveTo(r,0),t.lineTo(r,s)),t.stroke()},mxSwimlane.prototype.paintSeparator=function(t,e,n,i,s,r,o){o!=mxConstants.NONE&&(t.setStrokeColor(o),t.setDashed(!0),t.begin(),this.isHorizontal()?(t.moveTo(i,r),t.lineTo(i,s)):(t.moveTo(r,0),t.lineTo(i,0)),t.stroke(),t.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(t,e,n,i){return this.isHorizontal()?new mxRectangle(t+n-this.imageSize,e,this.imageSize,this.imageSize):new mxRectangle(t,e,this.imageSize,this.imageSize)},__mxOutput.mxSwimlane=void 0!==mxSwimlane?mxSwimlane:void 0,mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(t,e,n){},mxGraphLayout.prototype.resizeCell=function(t,e){},mxGraphLayout.prototype.execute=function(t){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(t,e,n,i){return this.graph.getCurrentCellStyle(e)[t]},mxGraphLayout.traverse=function(t,e,n,i,s){if(null!=n&&null!=t&&(e=null==e||e,!(s=s||new mxDictionary).get(t))){s.put(t,!0);var r=n(t,i);if(null==r||r){var o=this.graph.model.getEdgeCount(t);if(o>0)for(var l=0;l<o;l++){var a=this.graph.model.getEdgeAt(t,l),h=this.graph.model.getTerminal(a,!0)==t;if(!e||h){var u=this.graph.view.getVisibleTerminal(a,!h);this.traverse(u,e,n,a,s)}}}}},mxGraphLayout.prototype.isAncestor=function(t,e,n){if(!n)return this.graph.model.getParent(e)==t;if(e==t)return!1;for(;null!=e&&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)||null==e.getTerminal(t,!0)||null==e.getTerminal(t,!1)},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(null!=t&&t!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,t))for(var i=n.getGeometry(t);t!=this.parent;)e.x=e.x+i.x,e.y=e.y+i.y,t=n.getParent(t),i=n.getGeometry(t)}return e},mxGraphLayout.prototype.setEdgePoints=function(t,e){if(null!=t){var n=this.graph.model,i=n.getGeometry(t);if(null==i?(i=new mxGeometry).setRelative(!0):i=i.clone(),null!=this.parent&&null!=e)for(var s=n.getParent(t),r=this.getParentOffset(s),o=0;o<e.length;o++)e[o].x=e[o].x-r.x,e[o].y=e[o].y-r.y;i.points=e,n.setGeometry(t,i)}},mxGraphLayout.prototype.setVertexLocation=function(t,e,n){var i=this.graph.getModel(),s=i.getGeometry(t),r=null;if(null!=s){if(r=new mxRectangle(e,n,s.width,s.height),this.useBoundingBox){var o=this.graph.getView().getState(t);if(null!=o&&null!=o.text&&null!=o.text.boundingBox){var l=this.graph.getView().scale,a=o.text.boundingBox;o.text.boundingBox.x<o.x&&(e+=(o.x-a.x)/l,r.width=a.width),o.text.boundingBox.y<o.y&&(n+=(o.y-a.y)/l,r.height=a.height)}}if(null!=this.parent){var h=i.getParent(t);if(null!=h&&h!=this.parent){var u=this.getParentOffset(h);e-=u.x,n-=u.y}}s.x==e&&s.y==n||((s=s.clone()).x=e,s.y=n,i.setGeometry(t,s))}return r},mxGraphLayout.prototype.getVertexBounds=function(t){var e=this.graph.getModel().getGeometry(t);if(this.useBoundingBox){var n=this.graph.getView().getState(t);if(null!=n&&null!=n.text&&null!=n.text.boundingBox){var i=this.graph.getView().scale,s=n.text.boundingBox,r=Math.max(n.x-s.x,0)/i,o=Math.max(n.y-s.y,0)/i,l=Math.max(s.x+s.width-(n.x+n.width),0)/i,a=Math.max(s.y+s.height-(n.y+n.height),0)/i;e=new mxRectangle(e.x-r,e.y-o,e.width+r+l,e.height+o+a)}}if(null!=this.parent){var h=this.graph.getModel().getParent(t);if(e=e.clone(),null!=h&&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,n,i,s,r){return this.graph.updateGroupBounds(t,e,!0,n,i,s,r)},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.weightedValue>t.weightedValue?-1:e.weightedValue<t.weightedValue?1:e.nudge?-1:1:0},__mxOutput.mxGraphLayout=void 0!==mxGraphLayout?mxGraphLayout:void 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=!1,mxStackLayout.prototype.fill=!1,mxStackLayout.prototype.resizeParent=!1,mxStackLayout.prototype.resizeParentMax=!1,mxStackLayout.prototype.resizeLast=!1,mxStackLayout.prototype.wrap=null,mxStackLayout.prototype.borderCollapse=!0,mxStackLayout.prototype.allowGaps=!1,mxStackLayout.prototype.gridSize=0,mxStackLayout.prototype.isHorizontal=function(){return this.horizontal},mxStackLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),s=i.getParent(t),r=this.isHorizontal();if(null!=t&&null!=s){var o=0,l=0,a=i.getChildCount(s),h=r?e:n,u=this.graph.getView().getState(s);for(null!=u&&(h-=r?u.x:u.y),h/=this.graph.view.scale,o=0;o<a;o++){var d=i.getChildAt(s,o);if(d!=t){var p=i.getGeometry(d);if(null!=p){var m=r?p.x+p.width/2:p.y+p.height/2;if(l<=h&&m>h)break;l=m}}}var c=s.getIndex(t);c=Math.max(0,o-(o>c?1:0)),i.add(s,t,c)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),n=e.getGeometry(t);null!=this.graph.container&&(null==n&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return n},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),n=e.getChildCount(t),i=[],s=0;s<n;s++){var r=e.getChildAt(t,s);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&i.push(r)}return this.allowGaps&&i.sort(mxUtils.bind(this,(function(t,e){var n=this.graph.getCellGeometry(t),i=this.graph.getCellGeometry(e);return this.horizontal?n.x==i.x?0:n.x>i.x>0?1:-1:n.y==i.y?0:n.y>i.y>0?1:-1}))),i},mxStackLayout.prototype.snap=function(t){if(null!=this.gridSize&&this.gridSize>0&&(t=Math.max(t,this.gridSize))/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(null!=t){var e=this.getParentSize(t),n=this.isHorizontal(),i=this.graph.getModel(),s=null;null!=e&&(s=n?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),s-=2*this.border;var r=this.x0+this.border+this.marginLeft,o=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var l=this.graph.getCellStyle(t),a=mxUtils.getNumber(l,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(l,mxConstants.STYLE_HORIZONTAL,!0);null!=e&&(a=h?Math.min(a,e.height):Math.min(a,e.width)),n==h&&(s-=a),h?o+=a:r+=a}i.beginUpdate();try{for(var u=0,d=null,p=0,m=null,c=this.getLayoutCells(t),x=0;x<c.length;x++){var g=c[x],y=i.getGeometry(g);if(null!=y){y=y.clone(),null!=this.wrap&&null!=d&&(n&&d.x+d.width+y.width+2*this.spacing>this.wrap||!n&&d.y+d.height+y.height+2*this.spacing>this.wrap)&&(d=null,n?o+=u+this.spacing:r+=u+this.spacing,u=0),u=Math.max(u,n?y.height:y.width);var f=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(g);f=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=d){var C=p+this.spacing+Math.floor(f/2);n?y.x=this.snap((this.allowGaps?Math.max(C,y.x):C)-this.marginLeft)+this.marginLeft:y.y=this.snap((this.allowGaps?Math.max(C,y.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(n?y.x=this.allowGaps&&y.x>r?Math.max(this.snap(y.x-this.marginLeft)+this.marginLeft,r):r:y.y=this.allowGaps&&y.y>o?Math.max(this.snap(y.y-this.marginTop)+this.marginTop,o):o);n?y.y=o:y.x=r,this.fill&&null!=s&&(n?y.height=s:y.width=s),n?y.width=this.snap(y.width):y.height=this.snap(y.height),this.setChildGeometry(g,y),m=g,d=y,p=n?d.x+d.width+Math.floor(f/2):d.y+d.height+Math.floor(f/2)}}this.resizeParent&&null!=e&&null!=d&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,d):this.resizeLast&&null!=e&&null!=d&&null!=m&&(n?d.width=e.width-d.x-this.spacing-this.marginRight-this.marginLeft:d.height=e.height-d.y-this.spacing-this.marginBottom,this.setChildGeometry(m,d))}finally{i.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var n=this.graph.getCellGeometry(t);null!=n&&e.x==n.x&&e.y==n.y&&e.width==n.width&&e.height==n.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,n){var i=this.isHorizontal(),s=this.graph.getModel(),r=e.clone();if(i){var o=n.x+n.width+this.marginRight+this.border;this.resizeParentMax?r.width=Math.max(r.width,o):r.width=o}else{o=n.y+n.height+this.marginBottom+this.border;this.resizeParentMax?r.height=Math.max(r.height,o):r.height=o}e.x==r.x&&e.y==r.y&&e.width==r.width&&e.height==r.height||s.setGeometry(t,r)},__mxOutput.mxStackLayout=void 0!==mxStackLayout?mxStackLayout:void 0,mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),s=i.getParent(t);if(null!=t&&null!=s){var r=0,o=0,l=i.getChildCount(s);for(r=0;r<l;r++){var a=i.getChildAt(s,r),h=this.getVertexBounds(a);if(null!=h){var u=h.x+h.width/2;if(o<e&&u>e)break;o=u}}var d=s.getIndex(t);d=Math.max(0,r-(r>d?1:0)),i.add(s,t,d)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),n=this.graph.getModel(),i=n.getGeometry(t);null!=this.graph.container&&(null==i&&n.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=i){for(var s=[],r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o);!this.isVertexIgnored(l)&&this.isVertexMovable(l)&&s.push(l)}var a=s.length;if(a>0){var h=this.border,u=this.border,d=e?i.height:i.width;d-=2*this.border;var p=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;d-=e?p.height:p.width,h+=p.width,u+=p.height;var m=this.border+(a-1)*this.spacing,c=e?(i.width-h-m)/a:(i.height-u-m)/a;if(c>0){n.beginUpdate();try{for(o=0;o<a;o++){l=s[o];var x=n.getGeometry(l);null!=x&&((x=x.clone()).x=h,x.y=u,e?(this.resizeVertices&&(x.width=c,x.height=d),h+=c+this.spacing):(this.resizeVertices&&(x.height=c,x.width=d),u+=c+this.spacing),n.setGeometry(l,x))}}finally{n.endUpdate()}}}}},__mxOutput.mxPartitionLayout=void 0!==mxPartitionLayout?mxPartitionLayout:void 0,mxCompactTreeLayout.prototype=new mxGraphLayout,mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout,mxCompactTreeLayout.prototype.horizontal=null,mxCompactTreeLayout.prototype.invert=null,mxCompactTreeLayout.prototype.resizeParent=!0,mxCompactTreeLayout.prototype.maintainParentLocation=!1,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=!1,mxCompactTreeLayout.prototype.visited=null,mxCompactTreeLayout.prototype.levelDistance=10,mxCompactTreeLayout.prototype.nodeDistance=20,mxCompactTreeLayout.prototype.resetEdges=!0,mxCompactTreeLayout.prototype.prefHozEdgeSep=5,mxCompactTreeLayout.prototype.prefVertEdgeOff=4,mxCompactTreeLayout.prototype.minEdgeJetty=8,mxCompactTreeLayout.prototype.channelBuffer=4,mxCompactTreeLayout.prototype.edgeRouting=!0,mxCompactTreeLayout.prototype.sortEdges=!1,mxCompactTreeLayout.prototype.alignRanks=!1,mxCompactTreeLayout.prototype.maxRankHeight=null,mxCompactTreeLayout.prototype.root=null,mxCompactTreeLayout.prototype.node=null,mxCompactTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(t,e){this.parent=t;var n=this.graph.getModel();if(null==e)if(this.graph.getEdges(t,n.getParent(t),this.invert,!this.invert,!1).length>0)this.root=t;else{var i=this.graph.findTreeRoots(t,!0,this.invert);if(i.length>0)for(var s=0;s<i.length;s++)if(!this.isVertexIgnored(i[s])&&this.graph.getEdges(i[s],null,this.invert,!this.invert,!1).length>0){this.root=i[s];break}}else this.root=e;if(null!=this.root){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(a=this.graph.getCellGeometry(t))&&(this.parentX=a.x,this.parentY=a.y);n.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var r=this.graph.gridSize,o=r;if(!this.moveTree){var l=this.getVertexBounds(this.root);null!=l&&(r=l.x,o=l.y)}var a,h=null;if(null!=(h=this.isHorizontal()?this.horizontalLayout(this.node,r,o):this.verticalLayout(this.node,null,r,o))){var u=0,d=0;h.x<0&&(u=Math.abs(r-h.x)),h.y<0&&(d=Math.abs(o-h.y)),0==u&&0==d||this.moveNode(this.node,u,d),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(null!=this.parentX&&null!=this.parentY)null!=(a=this.graph.getCellGeometry(t))&&((a=a.clone()).x=this.parentX,a.y=this.parentY,n.setGeometry(t,a))}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,n){t.x+=e,t.y+=n,this.apply(t);for(var i=t.child;null!=i;)this.moveNode(i,e,n),i=i.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var n=new mxDictionary;e.sort((function(e,i){var s=e.getTerminal(e.getTerminal(!1)==t),r=n.get(s);null==r&&(r=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),n.put(s,r));var o=i.getTerminal(i.getTerminal(!1)==t),l=n.get(o);return null==l&&(l=mxCellPath.create(o).split(mxCellPath.PATH_SEPARATOR),n.put(o,l)),mxCellPath.compare(r,l)}))},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]<t.height)&&(this.maxRankHeight[e]=t.height);for(var n=t.child;null!=n;)this.findRankHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.setCellHeights=function(t,e){null!=this.maxRankHeight[e]&&this.maxRankHeight[e]>t.height&&(t.height=this.maxRankHeight[e]);for(var n=t.child;null!=n;)this.setCellHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var n=mxCellPath.create(t),i=null;if(null!=t&&null==this.visited[n]&&!this.isVertexIgnored(t)){this.visited[n]=t,i=this.createNode(t);var s=this.graph.getModel(),r=null,o=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),l=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,o);for(var a=0;a<o.length;a++){var h=o[a];if(!this.isEdgeIgnored(h)){this.resetEdges&&this.setEdgePoints(h,null),this.edgeRouting&&(this.setEdgeStyleEnabled(h,!1),this.setEdgePoints(h,null));var u=l.getState(h),d=null!=u?u.getVisibleTerminal(this.invert):l.getVisibleTerminal(h,this.invert),p=this.dfs(d,e);null!=p&&null!=s.getGeometry(d)&&(null==r?i.child=p:r.next=p,r=p)}}}return i},mxCompactTreeLayout.prototype.layout=function(t){if(null!=t){for(var e=t.child;null!=e;)this.layout(e),e=e.next;null!=t.child?this.attachParent(t,this.join(t)):this.layoutLeaf(t)}},mxCompactTreeLayout.prototype.horizontalLayout=function(t,e,n,i){t.x+=e+t.offsetX,t.y+=n+t.offsetY,i=this.apply(t,i);var s=t.child;if(null!=s){i=this.horizontalLayout(s,t.x,t.y,i);for(var r=t.y+s.offsetY,o=s.next;null!=o;)i=this.horizontalLayout(o,t.x+s.offsetX,r,i),r+=o.offsetY,o=o.next}return i},mxCompactTreeLayout.prototype.verticalLayout=function(t,e,n,i,s){t.x+=n+t.offsetY,t.y+=i+t.offsetX,s=this.apply(t,s);var r=t.child;if(null!=r){s=this.verticalLayout(r,t,t.x,t.y,s);for(var o=t.x+r.offsetY,l=r.next;null!=l;)s=this.verticalLayout(l,t,o,t.y+r.offsetX,s),o+=l.offsetY,l=l.next}return s},mxCompactTreeLayout.prototype.attachParent=function(t,e){var n=this.nodeDistance+this.levelDistance,i=(e-t.width)/2-this.nodeDistance,s=i+t.width+2*this.nodeDistance-e;t.child.offsetX=n+t.height,t.child.offsetY=s,t.contour.upperHead=this.createLine(t.height,0,this.createLine(n,s,t.contour.upperHead)),t.contour.lowerHead=this.createLine(t.height,0,this.createLine(n,i,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,n=t.child;t.contour=n.contour;var i=n.width+e,s=i;for(n=n.next;null!=n;){var r=this.merge(t.contour,n.contour);n.offsetY=r+i,n.offsetX=0,s+=r+(i=n.width+e),n=n.next}return s},mxCompactTreeLayout.prototype.merge=function(t,e){for(var n=0,i=0,s=0,r=t.lowerHead,o=e.upperHead;null!=o&&null!=r;){var l=this.offset(n,i,o.dx,o.dy,r.dx,r.dy);i+=l,s+=l,n+o.dx<=r.dx?(n+=o.dx,i+=o.dy,o=o.next):(n-=r.dx,i-=r.dy,r=r.next)}if(null!=o){var a=this.bridge(t.upperTail,0,0,o,n,i);t.upperTail=null!=a.next?e.upperTail:a,t.lowerTail=e.lowerTail}else{null==(a=this.bridge(e.lowerTail,n,i,r,0,0)).next&&(t.lowerTail=a)}return t.lowerHead=e.lowerHead,s},mxCompactTreeLayout.prototype.offset=function(t,e,n,i,s,r){var o=0;if(s<=t||t+n<=0)return 0;if(s*i-n*r>0)if(t<0)o=t*i/n-e;else if(t>0){o=t*r/s-e}else o=-e;else if(s<t+n){o=r-(e+(s-t)*i/n)}else if(s>t+n){o=(n+t)*r/s-(e+i)}else o=r-(e+i);return o>0?o:0},mxCompactTreeLayout.prototype.bridge=function(t,e,n,i,s,r){var o=s+i.dx-e,l=0;l=0==i.dx?i.dy:o*i.dy/i.dx;var a=this.createLine(o,l,i.next);return t.next=this.createLine(0,r+i.dy-l-n,a),a},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 n=this.getVertexBounds(t);return null!=n&&(this.isHorizontal()?(e.width=n.height,e.height=n.width):(e.width=n.width,e.height=n.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var n=this.graph.getModel(),i=t.cell,s=n.getGeometry(i);if(null!=i&&null!=s){if(this.isVertexMovable(i)&&(s=this.setVertexLocation(i,t.x,t.y),this.resizeParent)){var r=n.getParent(i),o=mxCellPath.create(r);null==this.parentsChanged[o]&&(this.parentsChanged[o]=r)}e=null==e?new mxRectangle(s.x,s.y,s.width,s.height):new mxRectangle(Math.min(e.x,s.x),Math.min(e.y,s.y),Math.max(e.x+e.width,s.x+s.width),Math.max(e.y+e.height,s.y+s.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,n){var i=new Object;return i.dx=t,i.dy=e,i.next=n,i},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,n=t.cell,i=0,s=[];null!=e;){i++;var r=e.x;this.horizontal&&(r=e.y),s.push(new WeightedCellSorter(e,r)),e=e.next}s.sort(WeightedCellSorter.prototype.compare);var o=t.width,l=(i+1)*this.prefHozEdgeSep;o>l+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep);var a=o/i,h=a/2;o>l+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);var u=this.minEdgeJetty-this.prefVertEdgeOff,d=this.getVertexBounds(n);e=t.child;for(var p=0;p<s.length;p++){for(var m=s[p].cell.cell,c=this.getVertexBounds(m),x=this.graph.getEdgesBetween(n,m,!1),g=[],y=0,f=0,v=0;v<x.length;v++)this.horizontal?(y=d.x+d.width,f=d.y+h,g.push(new mxPoint(y,f)),y=d.x+d.width+u,g.push(new mxPoint(y,f)),f=c.y+c.height/2,g.push(new mxPoint(y,f)),this.setEdgePoints(x[v],g)):(y=d.x+h,f=d.y+d.height,g.push(new mxPoint(y,f)),f=d.y+d.height+u,g.push(new mxPoint(y,f)),y=c.x+c.width/2,g.push(new mxPoint(y,f)),this.setEdgePoints(x[v],g));p<i/2?u+=this.prefVertEdgeOff:p>i/2&&(u-=this.prefVertEdgeOff),h+=a}},__mxOutput.mxCompactTreeLayout=void 0!==mxCompactTreeLayout?mxCompactTreeLayout:void 0,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=!1,mxRadialTreeLayout.prototype.sortEdges=!1,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)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var n=null,i=this.getVertexBounds(this.root);for(var s in this.centerX=i.x+i.width/2,this.centerY=i.y+i.height/2,this.visited){var r=this.getVertexBounds(this.visited[s]);(n=null!=n?n:r.clone()).add(r)}this.calcRowDims([this.node],0);for(var o=0,l=0,a=0;a<this.row.length;a++){var h=(this.centerX-this.rowMinX[a]-this.nodeDistance)/this.rowRadi[a],u=(this.rowMaxX[a]-this.centerX-this.nodeDistance)/this.rowRadi[a];o=Math.max(o,h),l=Math.max(l,u)}for(a=0;a<this.row.length;a++)for(var d=this.centerX-this.nodeDistance-o*this.rowRadi[a],p=this.centerX+this.nodeDistance+l*this.rowRadi[a],m=p-d,c=0;c<this.row[a].length;c++){var x=(f=this.row[a])[c],g=((r=this.getVertexBounds(x.cell)).x+r.width/2-d)/m,y=2*Math.PI*g;x.theta=y}for(a=this.row.length-2;a>=0;a--){var f=this.row[a];for(c=0;c<f.length;c++){for(var v=(x=f[c]).child,C=0,E=0;null!=v;)E+=v.theta,C++,v=v.next;if(C>0){var S=E/C;if(S>x.theta&&c<f.length-1){var T=f[c+1].theta;x.theta=Math.min(S,T-Math.PI/10)}else if(S<x.theta&&c>0){var b=f[c-1].theta;x.theta=Math.max(S,b+Math.PI/10)}}}}for(a=0;a<this.row.length;a++)for(c=0;c<this.row[a].length;c++){x=(f=this.row[a])[c],r=this.getVertexBounds(x.cell);this.setVertexLocation(x.cell,this.centerX-r.width/2+this.rowRadi[a]*Math.cos(x.theta),this.centerY-r.height/2+this.rowRadi[a]*Math.sin(x.theta))}},mxRadialTreeLayout.prototype.calcRowDims=function(t,e){if(null!=t&&0!=t.length){this.rowMinX[e]=this.centerX,this.rowMaxX[e]=this.centerX,this.rowMinCenX[e]=this.centerX,this.rowMaxCenX[e]=this.centerX,this.row[e]=[];for(var n=!1,i=0;i<t.length;i++)for(var s=null!=t[i]?t[i].child:null;null!=s;){var r=s.cell,o=this.getVertexBounds(r);this.rowMinX[e]=Math.min(o.x,this.rowMinX[e]),this.rowMaxX[e]=Math.max(o.x+o.width,this.rowMaxX[e]),this.rowMinCenX[e]=Math.min(o.x+o.width/2,this.rowMinCenX[e]),this.rowMaxCenX[e]=Math.max(o.x+o.width/2,this.rowMaxCenX[e]),this.rowRadi[e]=o.y-this.getVertexBounds(this.root).y,null!=s.child&&(n=!0),this.row[e].push(s),s=s.next}n&&this.calcRowDims(this.row[e],e+1)}},__mxOutput.mxRadialTreeLayout=void 0!==mxRadialTreeLayout?mxRadialTreeLayout:void 0,mxFastOrganicLayout.prototype=new mxGraphLayout,mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout,mxFastOrganicLayout.prototype.useInputOrigin=!0,mxFastOrganicLayout.prototype.resetEdges=!0,mxFastOrganicLayout.prototype.disableEdgeStyle=!0,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.vertexArray,mxFastOrganicLayout.prototype.dispX,mxFastOrganicLayout.prototype.dispY,mxFastOrganicLayout.prototype.cellLocation,mxFastOrganicLayout.prototype.radius,mxFastOrganicLayout.prototype.radiusSquared,mxFastOrganicLayout.prototype.isMoveable,mxFastOrganicLayout.prototype.neighbours,mxFastOrganicLayout.prototype.indices,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxFastOrganicLayout.prototype.execute=function(t){var e=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(t),i=0;i<n.length;i++)this.isVertexIgnored(n[i])||this.vertexArray.push(n[i]);var s=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,r=this.vertexArray.length;this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant;for(i=0;i<this.vertexArray.length;i++){var o=this.vertexArray[i];this.cellLocation[i]=[];var l=mxObjectIdentity.get(o);this.indices[l]=i;var a=(y=this.getVertexBounds(o)).width,h=y.height,u=y.x,d=y.y;this.cellLocation[i][0]=u+a/2,this.cellLocation[i][1]=d+h/2,this.radius[i]=Math.min(a,h),this.radiusSquared[i]=this.radius[i]*this.radius[i]}e.beginUpdate();try{for(i=0;i<r;i++){this.dispX[i]=0,this.dispY[i]=0,this.isMoveable[i]=this.isVertexMovable(this.vertexArray[i]);var p=this.graph.getConnections(this.vertexArray[i],t);n=this.graph.getOpposites(p,this.vertexArray[i]);this.neighbours[i]=[];for(var m=0;m<n.length;m++){this.resetEdges&&this.graph.resetEdge(p[m]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[m],!1);l=mxObjectIdentity.get(n[m]);var c=this.indices[l];this.neighbours[i][m]=null!=c?c:i}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(r)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}var x=null,g=null;for(i=0;i<this.vertexArray.length;i++){var y;o=this.vertexArray[i];if(this.isVertexMovable(o))if(null!=(y=this.getVertexBounds(o))){this.cellLocation[i][0]-=y.width/2,this.cellLocation[i][1]-=y.height/2;u=this.graph.snap(Math.round(this.cellLocation[i][0])),d=this.graph.snap(Math.round(this.cellLocation[i][1]));this.setVertexLocation(o,u,d),x=null==x?u:Math.min(x,u),g=null==g?d:Math.min(g,d)}}var f=1-(x||0),v=1-(g||0);null!=s&&(f+=s.x,v+=s.y),this.graph.moveCells(this.vertexArray,f,v)}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]);e<.001&&(e=.001);var n=this.dispX[t]/e*Math.min(e,this.temperature),i=this.dispY[t]/e*Math.min(e,this.temperature);this.dispX[t]=0,this.dispY[t]=0,this.cellLocation[t][0]+=n,this.cellLocation[t][1]+=i}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var t=0;t<this.vertexArray.length;t++)for(var e=0;e<this.neighbours[t].length;e++){var n=this.neighbours[t][e];if(t!=n&&this.isMoveable[t]&&this.isMoveable[n]){var i=this.cellLocation[t][0]-this.cellLocation[n][0],s=this.cellLocation[t][1]-this.cellLocation[n][1],r=i*i+s*s-this.radiusSquared[t]-this.radiusSquared[n];r<this.minDistanceLimitSquared&&(r=this.minDistanceLimitSquared);var o=Math.sqrt(r),l=r/this.forceConstant,a=i/o*l,h=s/o*l;this.dispX[t]-=a,this.dispY[t]-=h,this.dispX[n]+=a,this.dispY[n]+=h}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var t=this.vertexArray.length,e=0;e<t;e++)for(var n=e;n<t;n++){if(!this.allowedToRun)return;if(n!=e&&this.isMoveable[e]&&this.isMoveable[n]){var i=this.cellLocation[e][0]-this.cellLocation[n][0],s=this.cellLocation[e][1]-this.cellLocation[n][1];0==i&&(i=.01+Math.random()),0==s&&(s=.01+Math.random());var r=Math.sqrt(i*i+s*s),o=r-this.radius[e]-this.radius[n];if(o>this.maxDistanceLimit)continue;o<this.minDistanceLimit&&(o=this.minDistanceLimit);var l=this.forceConstantSquared/o,a=i/r*l,h=s/r*l;this.dispX[e]+=a,this.dispY[e]+=h,this.dispX[n]-=a,this.dispY[n]-=h}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},__mxOutput.mxFastOrganicLayout=void 0!==mxFastOrganicLayout?mxFastOrganicLayout:void 0,mxCircleLayout.prototype=new mxGraphLayout,mxCircleLayout.prototype.constructor=mxCircleLayout,mxCircleLayout.prototype.radius=null,mxCircleLayout.prototype.moveCircle=!1,mxCircleLayout.prototype.x0=0,mxCircleLayout.prototype.y0=0,mxCircleLayout.prototype.resetEdges=!0,mxCircleLayout.prototype.disableEdgeStyle=!0,mxCircleLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0,i=null,s=null,r=[],o=e.getChildCount(t),l=0;l<o;l++){var a=e.getChildAt(t,l);if(this.isVertexIgnored(a))this.isEdgeIgnored(a)||(this.resetEdges&&this.graph.resetEdge(a),this.disableEdgeStyle&&this.setEdgeStyleEnabled(a,!1));else{r.push(a);var h=this.getVertexBounds(a);i=null==i?h.y:Math.min(i,h.y),s=null==s?h.x:Math.min(s,h.x),n=Math.max(n,Math.max(h.width,h.height))}}var u=this.getRadius(r.length,n);this.moveCircle&&(s=this.x0,i=this.y0),this.circle(r,u,s,i)}finally{e.endUpdate()}},mxCircleLayout.prototype.getRadius=function(t,e){return Math.max(t*e/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(t,e,n,i){for(var s=t.length,r=2*Math.PI/s,o=0;o<s;o++)this.isVertexMovable(t[o])&&this.setVertexLocation(t[o],Math.round(n+e+e*Math.sin(o*r)),Math.round(i+e+e*Math.cos(o*r)))},__mxOutput.mxCircleLayout=void 0!==mxCircleLayout?mxCircleLayout:void 0,mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.checkOverlap=!1,mxParallelEdgeLayout.prototype.execute=function(t,e){var n=this.findParallels(t,e);this.graph.model.beginUpdate();try{for(var i in n){var s=n[i];s.length>1&&this.layout(s)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var n=[],i=mxUtils.bind(this,(function(t){if(!this.isEdgeIgnored(t)){var e=this.getEdgeId(t);null!=e&&(null==n[e]&&(n[e]=[]),n[e].push(t))}}));if(null!=e)for(var s=0;s<e.length;s++)i(e[s]);else{var r=this.graph.getModel(),o=r.getChildCount(t);for(s=0;s<o;s++)i(r.getChildAt(t,s))}return n},mxParallelEdgeLayout.prototype.getEdgeId=function(t){var e=this.graph.getView(),n=e.getVisibleTerminal(t,!0),i=e.getVisibleTerminal(t,!1),s="";if(null!=n&&null!=i){if(n=mxObjectIdentity.get(n),i=mxObjectIdentity.get(i),this.checkOverlap){var r=this.graph.view.getState(t);if(null!=r&&null!=r.absolutePoints){for(var o=[],l=0;l<r.absolutePoints.length;l++){var a=r.absolutePoints[l];null!=a&&o.push(a.x,a.y)}s=o.join(",")}}return(n>i?i+"-"+n:n+"-"+i)+s}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],n=this.graph.getView(),i=this.graph.getModel(),s=i.getGeometry(n.getVisibleTerminal(e,!0)),r=i.getGeometry(n.getVisibleTerminal(e,!1));if(s==r)for(var o=s.x+s.width+this.spacing,l=s.y+s.height/2,a=0;a<t.length;a++)this.route(t[a],o,l),o+=this.spacing;else if(null!=s&&null!=r){var h=s.x+s.width/2,u=s.y+s.height/2,d=r.x+r.width/2-h,p=r.y+r.height/2-u,m=Math.sqrt(d*d+p*p);if(m>0){o=h+d/2,l=u+p/2;var c=p*this.spacing/m,x=d*this.spacing/m;o+=c*(t.length-1)/2,l-=x*(t.length-1)/2;for(a=0;a<t.length;a++)this.route(t[a],o,l),o-=c,l+=x}}},mxParallelEdgeLayout.prototype.route=function(t,e,n){this.graph.isCellMovable(t)&&this.setEdgePoints(t,[new mxPoint(e,n)])},__mxOutput.mxParallelEdgeLayout=void 0!==mxParallelEdgeLayout?mxParallelEdgeLayout:void 0,mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(t,e,n){null!=this.master?this.master.moveCell.apply(this.master,arguments):this.layouts[0].moveCell.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{e.endUpdate()}},__mxOutput.mxCompositeLayout=void 0!==mxCompositeLayout?mxCompositeLayout:void 0,mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(t){for(var e=this.graph.view,n=this.graph.getModel(),i=[],s=[],r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o),a=e.getState(l);null!=a&&(this.isVertexIgnored(l)?this.isEdgeIgnored(l)||i.push(a):s.push(a))}this.placeLabels(s,i)},mxEdgeLabelLayout.prototype.placeLabels=function(t,e){var n=this.graph.getModel();n.beginUpdate();try{for(var i=0;i<e.length;i++){var s=e[i];if(null!=s&&null!=s.text&&null!=s.text.boundingBox)for(var r=0;r<t.length;r++){var o=t[r];null!=o&&this.avoid(s,o)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(t,e){var n=this.graph.getModel(),i=t.text.boundingBox;if(mxUtils.intersects(i,e)){var s=-i.y-i.height+e.y,r=-i.y+e.y+e.height,o=Math.abs(s)<Math.abs(r)?s:r,l=-i.x-i.width+e.x,a=-i.x+e.x+e.width,h=Math.abs(l)<Math.abs(a)?l:a;Math.abs(h)<Math.abs(o)?o=0:h=0;var u=n.getGeometry(t.cell);null!=u&&(null!=(u=u.clone()).offset?(u.offset.x+=h,u.offset.y+=o):u.offset=new mxPoint(h,o),n.setGeometry(t.cell,u))}},__mxOutput.mxEdgeLabelLayout=void 0!==mxEdgeLabelLayout?mxEdgeLabelLayout:void 0,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!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(t){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(t,e){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(t,e){this.isVertex()?this.x[0]=e:this.isEdge()&&(this.x[t-this.minRank-1]=e)},mxGraphAbstractHierarchyCell.prototype.getX=function(t){return this.isVertex()?this.x[0]:this.isEdge()?this.x[t-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(t,e){this.isVertex()?this.y[0]=e:this.isEdge()&&(this.y[t-this.minRank-1]=e)},__mxOutput.mxGraphAbstractHierarchyCell=void 0!==mxGraphAbstractHierarchyCell?mxGraphAbstractHierarchyCell:void 0,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=!1,mxGraphHierarchyNode.prototype.getRankValue=function(t){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(t){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsTarget.length;e++){var n=this.connectsAsTarget[e];-1==n.maxRank||n.maxRank==t+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsSource.length;e++){var n=this.connectsAsSource[e];-1==n.minRank||n.minRank==t-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},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(null!=t&&null!=this.hashCode&&null!=t.hashCode&&this.hashCode.length<t.hashCode.length){if(this.hashCode==t.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var e=0;e<this.hashCode.length;e++)if(this.hashCode[e]!=t.hashCode[e])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},__mxOutput.mxGraphHierarchyNode=void 0!==mxGraphHierarchyNode?mxGraphHierarchyNode:void 0,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=!1,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(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.nextLayerConnectedCells[e]=[],e==this.temp.length-1?this.nextLayerConnectedCells[e].push(this.source):this.nextLayerConnectedCells[e].push(this)}return this.nextLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.previousLayerConnectedCells[e]=[],0==e?this.previousLayerConnectedCells[e].push(this.target):this.previousLayerConnectedCells[e].push(this)}return this.previousLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},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(){return null!=this.edges&&this.edges.length>0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=void 0!==mxGraphHierarchyEdge?mxGraphHierarchyEdge:void 0,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=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),s=0;s<e.length;s++){n[s]=new mxGraphHierarchyNode(e[s]),this.vertexMapper.put(e[s],n[s]);var r=t.getEdges(e[s]);n[s].connectsAsSource=[];for(var o=0;o<r.length;o++){var l=t.getVisibleTerminal(r[o],!1);if(l!=e[s]&&t.graph.model.isVertex(l)&&!t.isVertexIgnored(l)){var a=t.getEdgesBetween(e[s],l,!1),h=t.getEdgesBetween(e[s],l,!0);if(null!=a&&a.length>0&&null==this.edgeMapper.get(a[0])&&2*h.length>=a.length){for(var u=new mxGraphHierarchyEdge(a),d=0;d<a.length;d++){var p=a[d];this.edgeMapper.put(p,u),i.resetEdge(p),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(p,!1),t.setOrthogonalEdge(p,!0))}u.source=n[s],mxUtils.indexOf(n[s].connectsAsSource,u)<0&&n[s].connectsAsSource.push(u)}}}n[s].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var t=[];if(null!=this.roots)for(var e=0;e<this.roots.length;e++){null!=(h=this.vertexMapper.get(this.roots[e]))&&t.push(h)}var n=this.vertexMapper.getValues();for(e=0;e<n.length;e++)n[e].temp[0]=-1;for(var i=t.slice();t.length>0;){var s;d=(h=t[0]).connectsAsTarget,s=h.connectsAsSource;var r=!0,o=this.SOURCESCANSTARTRANK;for(e=0;e<d.length;e++){if(5270620!=(m=d[e]).temp[0]){r=!1;break}var l=m.source;o=Math.min(o,l.temp[0]-1)}if(r){if(h.temp[0]=o,this.maxRank=Math.min(this.maxRank,o),null!=s)for(e=0;e<s.length;e++){(m=s[e]).temp[0]=5270620,-1==(l=m.target).temp[0]&&(t.push(l),l.temp[0]=-2)}t.shift()}else{var a=t.shift();if(t.push(h),a==h&&1==t.length)break}}for(e=0;e<n.length;e++)n[e].temp[0]-=this.maxRank;for(e=0;e<i.length;e++)for(var h,u=0,d=(h=i[e]).connectsAsSource,p=0;p<d.length;p++){var m;l=(m=d[p]).target;h.temp[0]=Math.max(u,l.temp[0]+1),u=h.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 n=null;if(null!=this.roots){var i=this.roots;n=[];for(e=0;e<i.length;e++){var s=i[e],r=this.vertexMapper.get(s);n[e]=r}}this.visit((function(e,n,i,s,r){if((0==r&&n.maxRank<0&&n.minRank<0&&(t[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=t[n.maxRank].length-1),null!=e&&null!=i)&&e.maxRank-n.maxRank>1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o<i.maxRank;o++)t[o].push(i),i.setGeneralPurposeVariable(o,t[o].length-1)}}),n,!1,null)},mxGraphHierarchyModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var s=0;s<e.length;s++){var r=e[s];null!=r&&(null==i&&(i=new Object),n?(r.hashCode=[],r.hashCode[0]=this.dfsCount,r.hashCode[1]=s,this.extendedDfs(null,r,null,t,i,r.hashCode,s,0)):this.dfs(null,r,null,t,i,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(t,e,n,i,s,r){if(null!=e){var o=e.id;if(null==s[o]){s[o]=e,i(t,e,n,r,0);for(var l=e.connectsAsSource.slice(),a=0;a<l.length;a++){var h=l[a],u=h.target;this.dfs(e,u,h,i,s,r+1)}}else i(t,e,n,r,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(t,e,n,i,s,r,o,l){if(null!=e){if(null!=t&&(null==e.hashCode||e.hashCode[0]!=t.hashCode[0])){var a=t.hashCode.length+1;e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=o}var h=e.id;if(null==s[h]){s[h]=e,i(t,e,n,l,0);for(var u=e.connectsAsSource.slice(),d=0;d<u.length;d++){var p=u[d],m=p.target;this.extendedDfs(e,m,p,i,s,e.hashCode,d,l+1)}}else i(t,e,n,l,1)}},__mxOutput.mxGraphHierarchyModel=void 0!==mxGraphHierarchyModel?mxGraphHierarchyModel:void 0,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=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),s=t.swimlanes,r=0;r<e.length;r++){n[r]=new mxGraphHierarchyNode(e[r]),this.vertexMapper.put(e[r],n[r]),n[r].swimlaneIndex=-1;for(var o=0;o<s.length;o++)if(i.model.getParent(e[r])==s[o]){n[r].swimlaneIndex=o;break}var l=t.getEdges(e[r]);n[r].connectsAsSource=[];for(var a=0;a<l.length;a++){var h=t.getVisibleTerminal(l[a],!1);if(h!=e[r]&&t.graph.model.isVertex(h)&&!t.isVertexIgnored(h)){var u=t.getEdgesBetween(e[r],h,!1),d=t.getEdgesBetween(e[r],h,!0);if(null!=u&&u.length>0&&null==this.edgeMapper.get(u[0])&&2*d.length>=u.length){for(var p=new mxGraphHierarchyEdge(u),m=0;m<u.length;m++){var c=u[m];this.edgeMapper.put(c,p),i.resetEdge(c),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(c,!1),t.setOrthogonalEdge(c,!0))}p.source=n[r],mxUtils.indexOf(n[r].connectsAsSource,p)<0&&n[r].connectsAsSource.push(p)}}}n[r].temp[0]=0}},mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var t=[],e=new Object;if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var i=this.vertexMapper.get(this.roots[n]);this.maxChainDfs(null,i,null,e,0),null!=i&&t.push(i)}var s=[],r=[];for(n=this.ranksPerGroup.length-1;n>=0;n--)n==this.ranksPerGroup.length-1?s[n]=0:s[n]=r[n+1]+1,r[n]=s[n]+this.ranksPerGroup[n];this.maxRank=r[0];var o=this.vertexMapper.getValues();for(n=0;n<o.length;n++)o[n].temp[0]=-1;for(;t.length>0;){var l,a;l=(i=t[0]).connectsAsTarget,a=i.connectsAsSource;var h=!0,u=r[0];for(n=0;n<l.length;n++){if(5270620!=(p=l[n]).temp[0]){h=!1;break}var d=p.source;u=Math.min(u,d.temp[0]-1)}if(h){if(u>r[i.swimlaneIndex]&&(u=r[i.swimlaneIndex]),i.temp[0]=u,null!=a)for(n=0;n<a.length;n++){var p;(p=a[n]).temp[0]=5270620,-1==(d=p.target).temp[0]&&(t.push(d),d.temp[0]=-2)}t.shift()}else{var m=t.shift();if(t.push(i),m==i&&1==t.length)break}}},mxSwimlaneModel.prototype.maxChainDfs=function(t,e,n,i,s){if(null!=e){var r=mxCellPath.create(e.cell);if(null==i[r]){i[r]=e;var o=e.swimlaneIndex;(null==this.ranksPerGroup[o]||this.ranksPerGroup[o]<s)&&(this.ranksPerGroup[o]=s);for(var l=e.connectsAsSource.slice(),a=0;a<l.length;a++){var h=l[a],u=h.target;e.swimlaneIndex<u.swimlaneIndex?this.maxChainDfs(e,u,h,mxUtils.clone(i,null,!0),0):e.swimlaneIndex==u.swimlaneIndex&&this.maxChainDfs(e,u,h,mxUtils.clone(i,null,!0),s+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 n=null;if(null!=this.roots){var i=this.roots;n=[];for(e=0;e<i.length;e++){var s=i[e],r=this.vertexMapper.get(s);n[e]=r}}this.visit((function(e,n,i,s,r){if((0==r&&n.maxRank<0&&n.minRank<0&&(t[n.temp[0]].push(n),n.maxRank=n.temp[0],n.minRank=n.temp[0],n.temp[0]=t[n.maxRank].length-1),null!=e&&null!=i)&&e.maxRank-n.maxRank>1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o<i.maxRank;o++)t[o].push(i),i.setGeneralPurposeVariable(o,t[o].length-1)}}),n,!1,null)},mxSwimlaneModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var s=0;s<e.length;s++){var r=e[s];null!=r&&(null==i&&(i=new Object),n?(r.hashCode=[],r.hashCode[0]=this.dfsCount,r.hashCode[1]=s,this.extendedDfs(null,r,null,t,i,r.hashCode,s,0)):this.dfs(null,r,null,t,i,0))}this.dfsCount++}},mxSwimlaneModel.prototype.dfs=function(t,e,n,i,s,r){if(null!=e){var o=e.id;if(null==s[o]){s[o]=e,i(t,e,n,r,0);for(var l=e.connectsAsSource.slice(),a=0;a<l.length;a++){var h=l[a],u=h.target;this.dfs(e,u,h,i,s,r+1)}}else i(t,e,n,r,1)}},mxSwimlaneModel.prototype.extendedDfs=function(t,e,n,i,s,r,o,l){if(null!=e){if(null!=t&&(null==e.hashCode||e.hashCode[0]!=t.hashCode[0])){var a=t.hashCode.length+1;e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=o}var h=e.id;if(null==s[h]){s[h]=e,i(t,e,n,l,0);for(var u=e.connectsAsSource.slice(),d=e.connectsAsTarget.slice(),p=0;p<u.length;p++){var m=(c=u[p]).target;e.swimlaneIndex<=m.swimlaneIndex&&this.extendedDfs(e,m,c,i,s,e.hashCode,p,l+1)}for(p=0;p<d.length;p++){var c;m=(c=d[p]).source;e.swimlaneIndex<m.swimlaneIndex&&this.extendedDfs(e,m,c,i,s,e.hashCode,p,l+1)}}else i(t,e,n,l,1)}},__mxOutput.mxSwimlaneModel=void 0!==mxSwimlaneModel?mxSwimlaneModel:void 0,mxHierarchicalLayoutStage.prototype.execute=function(t){},__mxOutput.mxHierarchicalLayoutStage=void 0!==mxHierarchicalLayoutStage?mxHierarchicalLayoutStage:void 0,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 n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();var i=0,s=this.calculateCrossings(e);for(n=0;n<this.maxIterations&&i<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var r=this.calculateCrossings(e);if(r<s){s=r,i=0;for(var o=0;o<this.nestedBestRanks.length;o++)for(var l=e.ranks[o],a=0;a<l.length;a++){var h=l[a];this.nestedBestRanks[o][h.getGeneralPurposeVariable(o)]=h}}else{i++;for(o=0;o<this.nestedBestRanks.length;o++)for(l=e.ranks[o],a=0;a<l.length;a++){(h=l[a]).setGeneralPurposeVariable(o,a)}}if(0==s)break}var u=[],d=[];for(n=0;n<e.maxRank+1;n++)d[n]=[],u[n]=d[n];for(n=0;n<this.nestedBestRanks.length;n++)for(o=0;o<this.nestedBestRanks[n].length;o++)d[n].push(this.nestedBestRanks[n][o]);e.ranks=u},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(t){for(var e=t.ranks.length,n=0,i=1;i<e;i++)n+=this.calculateRankCrossing(i,t);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(t,e){for(var n=0,i=e.ranks[t],s=e.ranks[t-1],r=[],o=0;o<i.length;o++){for(var l=i[o],a=l.getGeneralPurposeVariable(t),h=l.getPreviousLayerConnectedCells(t),u=[],d=0;d<h.length;d++){var p=h[d].getGeneralPurposeVariable(t-1);u.push(p)}u.sort((function(t,e){return t-e})),r[a]=u}var m=[];for(o=0;o<r.length;o++)m=m.concat(r[o]);for(var c=1;c<s.length;)c<<=1;var x=2*c-1;c-=1;var g=[];for(o=0;o<x;++o)g[o]=0;for(o=0;o<m.length;o++){var y=m[o]+c;for(++g[y];y>0;)y%2&&(n+=g[y+1]),++g[y=y-1>>1]}return n},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var n=!0,i=0;n&&i++<10;){var s=t%2==1&&i%2==1;n=!1;for(var r=0;r<e.ranks.length;r++){for(var o=e.ranks[r],l=[],a=0;a<o.length;a++){var h=o[a],u=h.getGeneralPurposeVariable(r);u<0&&(u=a),l[u]=h}var d=null,p=null,m=null,c=null,x=null,g=null,y=null,f=null,v=null,C=null;for(a=0;a<o.length-1;a++){if(0==a){d=(v=l[a]).getNextLayerConnectedCells(r),p=v.getPreviousLayerConnectedCells(r),x=[],g=[];for(var E=0;E<d.length;E++)x[E]=d[E].getGeneralPurposeVariable(r+1);for(E=0;E<p.length;E++)g[E]=p[E].getGeneralPurposeVariable(r-1)}else d=m,p=c,x=y,g=f,v=C;m=(C=l[a+1]).getNextLayerConnectedCells(r),c=C.getPreviousLayerConnectedCells(r),y=[],f=[];for(E=0;E<m.length;E++)y[E]=m[E].getGeneralPurposeVariable(r+1);for(E=0;E<c.length;E++)f[E]=c[E].getGeneralPurposeVariable(r-1);var S=0,T=0;for(E=0;E<x.length;E++)for(var b=0;b<y.length;b++)x[E]>y[b]&&S++,x[E]<y[b]&&T++;for(E=0;E<g.length;E++)for(b=0;b<f.length;b++)g[E]>f[b]&&S++,g[E]<f[b]&&T++;if(T<S||T==S&&s){var w=v.getGeneralPurposeVariable(r);v.setGeneralPurposeVariable(r,C.getGeneralPurposeVariable(r)),C.setGeneralPurposeVariable(r,w),m=d,c=p,y=x,f=g,C=v,s||(n=!0)}}}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(t,e){var n=t%2==0;if(n)for(var i=e.maxRank-1;i>=0;i--)this.medianRank(i,n);else for(i=1;i<e.maxRank;i++)this.medianRank(i,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(t,e){for(var n=this.nestedBestRanks[t].length,i=[],s=[],r=0;r<n;r++){var o,l,a=this.nestedBestRanks[t][r],h=new MedianCellSorter;h.cell=a,l=e?t+1:t-1,null!=(o=e?a.getNextLayerConnectedCells(t):a.getPreviousLayerConnectedCells(t))&&0!=o.length?(h.medianValue=this.medianValue(o,l),i.push(h)):s[a.getGeneralPurposeVariable(t)]=!0}i.sort(MedianCellSorter.prototype.compare);for(r=0;r<n;r++){if(null==s[r])(a=i.shift().cell).setGeneralPurposeVariable(t,r)}},mxMedianHybridCrossingReduction.prototype.medianValue=function(t,e){for(var n=[],i=0,s=0;s<t.length;s++){var r=t[s];n[i++]=r.getGeneralPurposeVariable(e)}if(n.sort((function(t,e){return t-e})),i%2==1)return n[Math.floor(i/2)];if(2==i)return(n[0]+n[1])/2;var o=i/2,l=n[o-1]-n[0],a=n[i-1]-n[o];return(n[o-1]*a+n[o]*l)/(l+a)},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.medianValue>t.medianValue?-1:e.medianValue<t.medianValue?1:0:0},__mxOutput.mxMedianHybridCrossingReduction=void 0!==mxMedianHybridCrossingReduction?mxMedianHybridCrossingReduction:void 0,mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(t){for(var e=this.layout.getModel(),n=new Object,i=e.vertexMapper.getValues(),s=new Object,r=0;r<i.length;r++)s[i[r].id]=i[r];var o=null;if(null!=e.roots){var l=e.roots;o=[];for(r=0;r<l.length;r++)o[r]=e.vertexMapper.get(l[r])}e.visit((function(t,e,i,r,o){e.isAncestor(t)&&(i.invert(),mxUtils.remove(i,t.connectsAsSource),t.connectsAsTarget.push(i),mxUtils.remove(i,e.connectsAsTarget),e.connectsAsSource.push(i)),n[e.id]=e,delete s[e.id]}),o,!0,null);var a=mxUtils.clone(n,null,!0);e.visit((function(t,e,i,r,o){e.isAncestor(t)&&(i.invert(),mxUtils.remove(i,t.connectsAsSource),e.connectsAsSource.push(i),t.connectsAsTarget.push(i),mxUtils.remove(i,e.connectsAsTarget)),n[e.id]=e,delete s[e.id]}),s,!0,a)},__mxOutput.mxMinimumCycleRemover=void 0!==mxMinimumCycleRemover?mxMinimumCycleRemover:void 0,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=!0,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," : ");for(var n=t.ranks[e],i=0;i<n.length;i++){var s=n[i];mxLog.write(s.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),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var i=0;i<this.maxIterations;i++){if(0!=i&&(this.medianPos(i,e),this.minNode(e)),this.currentXDelta<n){for(var s=0;s<e.ranks.length;s++)for(var r=e.ranks[s],o=0;o<r.length;o++){(l=r[o]).setX(s,l.getGeneralPurposeVariable(s))}n=this.currentXDelta}else for(s=0;s<e.ranks.length;s++)for(r=e.ranks[s],o=0;o<r.length;o++){var l;(l=r[o]).setGeneralPurposeVariable(s,l.getX(s))}this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(t){for(var e=[],n=new mxDictionary,i=[],s=0;s<=t.maxRank;s++){i[s]=t.ranks[s];for(var r=0;r<i[s].length;r++){var o=i[s][r],l=new WeightedCellSorter(o,s);l.rankIndex=r,l.visited=!0,e.push(l),n.put(o,l)}}for(var a=10*e.length,h=0;e.length>0&&h<=a;){var u=e.shift(),d=u.cell,p=u.weightedValue,m=parseInt(u.rankIndex),c=d.getNextLayerConnectedCells(p),x=d.getPreviousLayerConnectedCells(p),g=c.length,y=x.length,f=this.medianXValue(c,p+1),v=this.medianXValue(x,p-1),C=g+y,E=d.getGeneralPurposeVariable(p),S=E;C>0&&(S=(f*g+v*y)/C);var T=!1;if(S<E-1)if(0==m)d.setGeneralPurposeVariable(p,S),T=!0;else{var b=i[p][m-1],w=b.getGeneralPurposeVariable(p);(w=w+b.width/2+this.intraCellSpacing+d.width/2)<S?(d.setGeneralPurposeVariable(p,S),T=!0):w<d.getGeneralPurposeVariable(p)-1&&(d.setGeneralPurposeVariable(p,w),T=!0)}else if(S>E+1){if(m==i[p].length-1)d.setGeneralPurposeVariable(p,S),T=!0;else{var L=i[p][m+1],I=L.getGeneralPurposeVariable(p);(I=I-L.width/2-this.intraCellSpacing-d.width/2)>S?(d.setGeneralPurposeVariable(p,S),T=!0):I>d.getGeneralPurposeVariable(p)+1&&(d.setGeneralPurposeVariable(p,I),T=!0)}}if(T){for(s=0;s<c.length;s++){var A=c[s];null!=(O=n.get(A))&&0==O.visited&&(O.visited=!0,e.push(O))}for(s=0;s<x.length;s++){var O;A=x[s];null!=(O=n.get(A))&&0==O.visited&&(O.visited=!0,e.push(O))}}u.visited=!1,h++}},mxCoordinateAssignment.prototype.medianPos=function(t,e){if(t%2==0)for(var n=e.maxRank;n>0;n--)this.rankMedianPosition(n-1,e,n);else for(n=0;n<e.maxRank-1;n++)this.rankMedianPosition(n+1,e,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(t,e,n){for(var i=e.ranks[t],s=[],r=new Object,o=0;o<i.length;o++){var l=i[o];s[o]=new WeightedCellSorter,s[o].cell=l,s[o].rankIndex=o,r[l.id]=s[o];var a=null;a=n<t?l.getPreviousLayerConnectedCells(t):l.getNextLayerConnectedCells(t),s[o].weightedValue=this.calculatedWeightedValue(l,a)}s.sort(WeightedCellSorter.prototype.compare);for(o=0;o<s.length;o++){var h=s[o].cell,u=(a=null,0);null!=(a=n<t?h.getPreviousLayerConnectedCells(t).slice():h.getNextLayerConnectedCells(t).slice())&&(u=a.length>0?this.medianXValue(a,n):h.getGeneralPurposeVariable(t));for(var d=0,p=-1e8,m=s[o].rankIndex-1;m>=0;){if(null!=(y=r[i[m].id])){var c=y.cell;y.visited?(p=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+h.width/2,m=-1):(d+=c.width+this.intraCellSpacing,m--)}}var x=0,g=1e8;for(m=s[o].rankIndex+1;m<s.length;){var y;if(null!=(y=r[i[m].id])){var f=y.cell;y.visited?(g=f.getGeneralPurposeVariable(t)-f.width/2-this.intraCellSpacing-x-h.width/2,m=s.length):(x+=f.width+this.intraCellSpacing,m++)}}u>=p&&u<=g?h.setGeneralPurposeVariable(t,u):u<p?(h.setGeneralPurposeVariable(t,p),this.currentXDelta+=p-u):u>g&&(h.setGeneralPurposeVariable(t,g),this.currentXDelta+=u-g),s[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var n=0,i=0;i<e.length;i++){var s=e[i];t.isVertex()&&s.isVertex()?n++:t.isEdge()&&s.isEdge()?n+=8:n+=2}return n},mxCoordinateAssignment.prototype.medianXValue=function(t,e){if(0==t.length)return 0;for(var n=[],i=0;i<t.length;i++)n[i]=t[i].getGeneralPurposeVariable(e);if(n.sort((function(t,e){return t-e})),t.length%2==1)return n[Math.floor(t.length/2)];var s=t.length/2;return(n[s-1]+n[s])/2},mxCoordinateAssignment.prototype.initialCoords=function(t,e){this.calculateWidestRank(t,e);for(var n=this.widestRank;n>=0;n--)n<e.maxRank&&this.rankCoordinates(n,t,e);for(n=this.widestRank+1;n<=e.maxRank;n++)n>0&&this.rankCoordinates(n,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,n){for(var i=n.ranks[t],s=0,r=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,o=!1,l=0;l<i.length;l++){var a=i[l];if(a.isVertex()){var h=this.layout.getVertexBounds(a.cell);null!=h?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(a.width=h.width,a.height=h.height):(a.width=h.height,a.height=h.width):o=!0,s=Math.max(s,a.height)}else if(a.isEdge()){var u=1;null!=a.edges?u=a.edges.length:mxLog.warn("edge.edges is null"),a.width=(u-1)*this.parallelEdgeSpacing}r+=a.width/2,a.setX(t,r),a.setGeneralPurposeVariable(t,r),r+=a.width/2,r+=this.intraCellSpacing}1==o&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(t,e){var n=-this.interRankCellSpacing,i=0;this.rankWidths=[],this.rankY=[];for(var s=e.maxRank;s>=0;s--){for(var r=0,o=e.ranks[s],l=this.initialX,a=!1,h=0;h<o.length;h++){var u=o[h];if(u.isVertex()){var d=this.layout.getVertexBounds(u.cell);null!=d?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(u.width=d.width,u.height=d.height):(u.width=d.height,u.height=d.width):a=!0,r=Math.max(r,u.height)}else if(u.isEdge()){var p=1;null!=u.edges?p=u.edges.length:mxLog.warn("edge.edges is null"),u.width=(p-1)*this.parallelEdgeSpacing}l+=u.width/2,u.setX(s,l),u.setGeneralPurposeVariable(s,l),l+=u.width/2,(l+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=l,this.widestRank=s),this.rankWidths[s]=l}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[s]=n;var m=r/2+i/2+this.interRankCellSpacing;i=r,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+=m:n-=m;for(h=0;h<o.length;h++){o[h].setY(s,n)}}},mxCoordinateAssignment.prototype.minPath=function(t,e){for(var n=e.edgeMapper.getValues(),i=0;i<n.length;i++){var s=n[i];if(!(s.maxRank-s.minRank-1<1)){for(var r=s.getGeneralPurposeVariable(s.minRank+1),o=!0,l=0,a=s.minRank+2;a<s.maxRank;a++){var h=s.getGeneralPurposeVariable(a);r!=h?(o=!1,r=h):l++}if(!o){var u=0,d=0,p=[],m=[],c=s.getGeneralPurposeVariable(s.minRank+1);for(a=s.minRank+1;a<s.maxRank-1;a++){c==(x=s.getX(a+1))||this.repositionValid(e,s,a+1,c)?(p[a-s.minRank-1]=c,u++):(p[a-s.minRank-1]=x,c=x)}c=s.getX(a);for(a=s.maxRank-1;a>s.minRank+1;a--){var x;c==(x=s.getX(a-1))||this.repositionValid(e,s,a-1,c)?(m[a-s.minRank-2]=c,d++):(m[a-s.minRank-2]=s.getX(a-1),c=x)}if(d>l||u>l)if(d>=u)for(a=s.maxRank-2;a>s.minRank;a--)s.setX(a,m[a-s.minRank-1]);else if(u>d)for(a=s.minRank+2;a<s.maxRank;a++)s.setX(a,p[a-s.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(t,e,n,i){for(var s=t.ranks[n],r=-1,o=0;o<s.length;o++)if(e==s[o]){r=o;break}if(r<0)return!1;var l=e.getGeneralPurposeVariable(n);if(i<l){if(0==r)return!0;var a=s[r-1],h=a.getGeneralPurposeVariable(n);return(h=h+a.width/2+this.intraCellSpacing+e.width/2)<=i}if(i>l){if(r==s.length-1)return!0;var u=s[r+1],d=u.getGeneralPurposeVariable(n);return(d=d-u.width/2-this.intraCellSpacing-e.width/2)>=i}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<e.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=-Number.MAX_VALUE;var i=e.vertexMapper.getValues();for(n=0;n<i.length;n++)this.setVertexLocation(i[n]);this.layout.edgeStyle!=mxHierarchicalEdgeStyle.ORTHOGONAL&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.POLYLINE&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.CURVE||this.localEdgeProcessing(e);var s=e.edgeMapper.getValues();for(n=0;n<s.length;n++)this.setEdgePosition(s[n])},mxCoordinateAssignment.prototype.localEdgeProcessing=function(t){for(var e=0;e<t.ranks.length;e++)for(var n=t.ranks[e],i=0;i<n.length;i++){var s=n[i];if(s.isVertex())for(var r=s.getPreviousLayerConnectedCells(e),o=e-1,l=0;l<2;l++){if(o>-1&&o<t.ranks.length&&null!=r&&r.length>0){for(var a=[],h=0;h<r.length;h++){var u=new WeightedCellSorter(r[h],r[h].getX(o));a.push(u)}a.sort(WeightedCellSorter.prototype.compare);var d=s.x[0]-s.width/2,p=d+s.width,m=0,c=[];for(h=0;h<a.length;h++){var x,g=a[h].cell;if(g.isVertex()){x=0==l?s.connectsAsSource:s.connectsAsTarget;for(var y=0;y<x.length;y++)x[y].source!=g&&x[y].target!=g||(m+=x[y].edges.length,c.push(x[y]))}else m+=g.edges.length,c.push(g)}var f=(m+1)*this.prefHozEdgeSep;s.width>f+2*this.prefHozEdgeSep&&(d+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);var v=(p-d)/m,C=d+v/2,E=this.minEdgeJetty-this.prefVertEdgeOff;for(h=0;h<c.length;h++){var S=c[h].edges.length,T=this.jettyPositions[c[h].ids[0]];null==T&&(T=[],this.jettyPositions[c[h].ids[0]]=T),h<m/2?E+=this.prefVertEdgeOff:h>m/2&&(E-=this.prefVertEdgeOff);for(var b=0;b<S;b++)T[4*b+2*l]=C,C+=v,T[4*b+2*l+1]=E}}r=s.getNextLayerConnectedCells(e),o=e+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(t){var e=0;if(101207!=t.temp[0]){var n=t.maxRank,i=t.minRank;n==i&&(n=t.source.maxRank,i=t.target.minRank);for(var s=0,r=this.jettyPositions[t.ids[0]],o=t.isReversed?t.target.cell:t.source.cell,l=this.layout.graph,a=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,h=0;h<t.edges.length;h++){var u=t.edges[h],d=this.layout.getVisibleTerminal(u,!0),p=[],m=t.isReversed;if(d!=o&&(m=!m),null!=r){var c=m?2:0,x=m?a?this.rankBottomY[i]:this.rankTopY[i]:a?this.rankTopY[n]:this.rankBottomY[n],g=r[4*s+1+c];m!=a&&(g=-g),x+=g;var y=r[4*s+c],f=l.model.getTerminal(u,!0);if(this.layout.isPort(f)&&l.model.getParent(f)==d)y=null!=(O=l.view.getState(f))?O.x:d.geometry.x+t.source.width*f.geometry.x;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(y,x)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(y,x+g))):(p.push(new mxPoint(x,y)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(x+g,y)))}var v=t.x.length-1,C=-1,E=-1,S=t.maxRank-1;m&&(v=0,C=t.x.length,E=1,S=t.minRank+1);for(var T=v;t.maxRank!=t.minRank&&T!=C;T+=E){var b=t.x[T]+e,w=(this.rankTopY[S]+this.rankBottomY[S+1])/2,L=(this.rankTopY[S-1]+this.rankBottomY[S])/2;if(m){var I=w;w=L,L=I}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(b,w)),p.push(new mxPoint(b,L))):(p.push(new mxPoint(w,b)),p.push(new mxPoint(L,b))),this.limitX=Math.max(this.limitX,b),S+=E}if(null!=r){c=m?2:0;var A=m?a?this.rankTopY[n]:this.rankBottomY[n]:a?this.rankBottomY[i]:this.rankTopY[i];g=r[4*s+3-c];m!=a&&(g=-g);x=A-g,y=r[4*s+2-c];var O,_=l.model.getTerminal(u,!1),P=this.layout.getVisibleTerminal(u,!1);if(this.layout.isPort(_)&&l.model.getParent(_)==P)y=null!=(O=l.view.getState(_))?O.x:P.geometry.x+t.target.width*_.geometry.x;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(y,x-g)),p.push(new mxPoint(y,x))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(x-g,y)),p.push(new mxPoint(x,y)))}t.isReversed&&this.processReversedEdge(t,u),this.layout.setEdgePoints(u,p),e=0==e?this.parallelEdgeSpacing:e>0?-e:-e+this.parallelEdgeSpacing,s++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,n=t.x[0]-t.width/2,i=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],i),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],i+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,n,i):this.layout.setVertexLocation(e,i,n),this.limitX=Math.max(this.limitX,n+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=void 0!==mxCoordinateAssignment?mxCoordinateAssignment:void 0,mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),n=new Object,i=mxUtils.clone(e.vertexMapper,null,!0),s=null;if(null!=e.roots){var r=e.roots;s=[];for(var o=0;o<r.length;o++)s[o]=e.vertexMapper.get(r[o])}e.visit((function(t,e,s,r,o){var l=null!=t&&t.swimlaneIndex==e.swimlaneIndex&&e.isAncestor(t),a=null!=t&&null!=s&&t.swimlaneIndex<e.swimlaneIndex&&s.source==e;l?(s.invert(),mxUtils.remove(s,t.connectsAsSource),e.connectsAsSource.push(s),t.connectsAsTarget.push(s),mxUtils.remove(s,e.connectsAsTarget)):a&&(s.invert(),mxUtils.remove(s,t.connectsAsTarget),e.connectsAsTarget.push(s),t.connectsAsSource.push(s),mxUtils.remove(s,e.connectsAsSource));var h=mxCellPath.create(e.cell);n[h]=e,delete i[h]}),s,!0,null)},__mxOutput.mxSwimlaneOrdering=void 0!==mxSwimlaneOrdering?mxSwimlaneOrdering:void 0;var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function mxSwimlaneLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(t){this.currentEdit=this.createUndoableEdit(),null!=t?this.setRoot(t):this.clear()}function mxRootChange(t,e){this.model=t,this.root=e,this.previous=e}function mxChildChange(t,e,n,i){this.model=t,this.parent=e,this.previous=e,this.child=n,this.index=i,this.previousIndex=i}function mxTerminalChange(t,e,n,i){this.model=t,this.cell=e,this.terminal=n,this.previous=n,this.source=i}function mxValueChange(t,e,n){this.model=t,this.cell=e,this.value=n,this.previous=n}function mxStyleChange(t,e,n){this.model=t,this.cell=e,this.style=n,this.previous=n}function mxGeometryChange(t,e,n){this.model=t,this.cell=e,this.geometry=n,this.previous=n}function mxCollapseChange(t,e,n){this.model=t,this.cell=e,this.collapsed=n,this.previous=n}function mxVisibleChange(t,e,n){this.model=t,this.cell=e,this.visible=n,this.previous=n}function mxCellAttributeChange(t,e,n){this.cell=t,this.attribute=e,this.value=n,this.previous=n}function mxCell(t,e,n){this.value=t,this.setGeometry(e),this.setStyle(n),null!=this.onInit&&this.onInit()}function mxGeometry(t,e,n,i){mxRectangle.call(this,t,e,n,i)}mxHierarchicalLayout.prototype=new mxGraphLayout,mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout,mxHierarchicalLayout.prototype.roots=null,mxHierarchicalLayout.prototype.resizeParent=!1,mxHierarchicalLayout.prototype.maintainParentLocation=!1,mxHierarchicalLayout.prototype.moveParent=!1,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=!0,mxHierarchicalLayout.prototype.tightenToSource=!0,mxHierarchicalLayout.prototype.disableEdgeStyle=!0,mxHierarchicalLayout.prototype.traverseAncestors=!0,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 n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,null==e||e instanceof Array||(e=[e]),null!=e||null!=t){if(this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(r=this.graph.getCellGeometry(t))&&(this.parentX=r.x,this.parentY=r.y);if(null!=e){for(var i=[],s=0;s<e.length;s++){(null==t||n.isAncestor(t,e[s]))&&n.isVertex(e[s])&&i.push(e[s])}this.roots=i}n.beginUpdate();try{var r;if(this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY)null!=(r=this.graph.getCellGeometry(t))&&((r=r.clone()).x=this.parentX,r.y=this.parentY,n.setGeometry(t,r))}finally{n.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i=this.graph.model,s=null,r=-1e5;for(var o in e){var l=e[o];if(i.isVertex(l)&&this.graph.isCellVisible(l)){for(var a=this.getEdges(l),h=0,u=0,d=0;d<a.length;d++){this.getVisibleTerminal(a[d],!0)==l?h++:u++}0==u&&h>0&&n.push(l);var p=h-u;p>r&&(r=p,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o);this.isPort(l)?i=i.concat(n.getEdges(l,!0,!0)):!s&&this.graph.isCellVisible(l)||(i=i.concat(n.getEdges(l,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));var a=[];for(o=0;o<i.length;o++){var h=this.getVisibleTerminal(i[o],!0),u=this.getVisibleTerminal(i[o],!1);(h==u||h!=u&&(u==t&&(null==this.parent||this.isAncestor(this.parent,h,this.traverseAncestors))||h==t&&(null==this.parent||this.isAncestor(this.parent,u,this.traverseAncestors))))&&a.push(i[o])}return this.edgesCache.put(t,a),a},mxHierarchicalLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var s=this.graph.view.getState(t),r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==r&&(r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=r&&(this.isPort(r)&&(r=this.graph.model.getParent(r)),n.put(t,r)),r},mxHierarchicalLayout.prototype.run=function(t){var e=[],n=[];if(null==this.roots&&null!=t){var i=Object();this.filterDescendants(t,i),this.roots=[];var s=!0;for(var r in i)if(null!=i[r]){s=!1;break}for(;!s;){for(var o=this.findRoots(t,i),l=0;l<o.length;l++){var a=Object();e.push(a),this.traverse(o[l],!0,null,n,a,e,i)}for(l=0;l<o.length;l++)this.roots.push(o[l]);for(var r in s=!0,i)if(null!=i[r]){s=!1;break}}}else for(l=0;l<this.roots.length;l++){a=Object();e.push(a),this.traverse(this.roots[l],!0,null,n,a,e,null)}var h=0;for(l=0;l<e.length;l++){a=e[l];var u=[];for(var r in a)u.push(a[r]);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 n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),s=0;s<i;s++){var r=n.getChildAt(t,s);this.isPort(r)||this.filterDescendants(r,e)}},mxHierarchicalLayout.prototype.isPort=function(t){return null!=t&&null!=t.geometry&&t.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),s=[],r=0;r<i.length;r++){var o=this.getVisibleTerminal(i[r],!0),l=this.getVisibleTerminal(i[r],!1);(o==t&&l==e||!n&&o==e&&l==t)&&s.push(i[r])}return s},mxHierarchicalLayout.prototype.traverse=function(t,e,n,i,s,r,o){if(null!=t&&null!=i){var l=mxObjectIdentity.get(t);if(null!=i[l]||null!=o&&null==o[l]){if(null==s[l])for(p=0;p<r.length;p++){var a=r[p];if(null!=a[l]){for(var h in a)s[h]=a[h];return r.splice(p,1),s}}}else{null==s[l]&&(s[l]=t),null==i[l]&&(i[l]=t),null!==o&&delete o[l];for(var u=this.getEdges(t),d=[],p=0;p<u.length;p++)d[p]=this.getVisibleTerminal(u[p],!0)==t;for(var p=0;p<u.length;p++)if(!e||d[p]){for(var m=this.getVisibleTerminal(u[p],!d[p]),c=1,x=0;x<u.length;x++)if(x!=p){var g=d[x];this.getVisibleTerminal(u[x],!g)==m&&(g?c++:c--)}c>=0&&(s=this.traverse(m,e,u[p],i,s,r,o))}}}return s},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxHierarchicalLayout=void 0!==mxHierarchicalLayout?mxHierarchicalLayout:void 0,mxSwimlaneLayout.prototype=new mxGraphLayout,mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout,mxSwimlaneLayout.prototype.roots=null,mxSwimlaneLayout.prototype.swimlanes=null,mxSwimlaneLayout.prototype.dummyVertexWidth=50,mxSwimlaneLayout.prototype.resizeParent=!1,mxSwimlaneLayout.prototype.maintainParentLocation=!1,mxSwimlaneLayout.prototype.moveParent=!1,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=!0,mxSwimlaneLayout.prototype.tightenToSource=!0,mxSwimlaneLayout.prototype.disableEdgeStyle=!0,mxSwimlaneLayout.prototype.traverseAncestors=!0,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 n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){if(null==t&&(t=n.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(l=this.graph.getCellGeometry(t))&&(this.parentX=l.x,this.parentY=l.y);this.swimlanes=e;for(var i=[],s=0;s<e.length;s++){var r=this.graph.getChildCells(e[s]);if(null==r||0==r.length){var o=this.graph.insertVertex(e[s],null,null,0,0,this.dummyVertexWidth,0);i.push(o)}}n.beginUpdate();try{var l;if(this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY)null!=(l=this.graph.getCellGeometry(t))&&((l=l.clone()).x=this.parentX,l.y=this.parentY,n.setGeometry(t,l));this.graph.removeCells(i)}finally{n.endUpdate()}}},mxSwimlaneLayout.prototype.updateGroupBounds=function(){var t=[],e=this.model;for(var n in e.edgeMapper)for(var i=e.edgeMapper[n],s=0;s<i.edges.length;s++)t.push(i.edges[s]);var r=this.graph.getBoundingBoxFromGeometry(t,!0),o=[];for(s=0;s<this.swimlanes.length;s++){var l=this.swimlanes[s];if(null!=(c=this.graph.getCellGeometry(l))){var a=this.graph.getChildCells(l),h=this.graph.isSwimlane(l)?this.graph.getStartSize(l):new mxRectangle,u=this.graph.getBoundingBoxFromGeometry(a);o[s]=u;var d=u.y+c.y-h.height-this.parentBorder,p=u.y+c.y+u.height;if(null==r)r=new mxRectangle(0,d,0,p-d);else{r.y=Math.min(r.y,d);var m=Math.max(r.y+r.height,p);r.height=m-r.y}}}for(s=0;s<this.swimlanes.length;s++){var c;l=this.swimlanes[s];if(null!=(c=this.graph.getCellGeometry(l))){a=this.graph.getChildCells(l),h=this.graph.isSwimlane(l)?this.graph.getStartSize(l):new mxRectangle;var x=c.clone(),g=0==s?this.parentBorder:this.interRankCellSpacing/2,y=h.width+g,f=o[s].x-y,v=r.y-this.parentBorder;x.x+=f,x.y=v,x.width=o[s].width+y+this.interRankCellSpacing/2,x.height=r.height+h.height+2*this.parentBorder,this.graph.model.setGeometry(l,x),this.graph.moveCells(a,-f,c.y-v)}}},mxSwimlaneLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i=this.graph.model,s=null,r=-1e5;for(var o in e){var l=e[o];if(null!=l&&i.isVertex(l)&&this.graph.isCellVisible(l)&&i.isAncestor(t,l)){for(var a=this.getEdges(l),h=0,u=0,d=0;d<a.length;d++){var p=this.getVisibleTerminal(a[d],!0);if(p==l){var m=this.getVisibleTerminal(a[d],!1);i.isAncestor(t,m)&&h++}else i.isAncestor(t,p)&&u++}0==u&&h>0&&n.push(l);var c=h-u;c>r&&(r=c,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o<r;o++){var l=n.getChildAt(t,o);this.isPort(l)?i=i.concat(n.getEdges(l,!0,!0)):!s&&this.graph.isCellVisible(l)||(i=i.concat(n.getEdges(l,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));var a=[];for(o=0;o<i.length;o++){var h=this.getVisibleTerminal(i[o],!0),u=this.getVisibleTerminal(i[o],!1);(h==u||h!=u&&(u==t&&(null==this.parent||this.graph.isValidAncestor(h,this.parent,this.traverseAncestors))||h==t&&(null==this.parent||this.graph.isValidAncestor(u,this.parent,this.traverseAncestors))))&&a.push(i[o])}return this.edgesCache.put(t,a),a},mxSwimlaneLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var s=this.graph.view.getState(t),r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==r&&(r=null!=s?s.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=r&&(this.isPort(r)&&(r=this.graph.model.getParent(r)),n.put(t,r)),r},mxSwimlaneLayout.prototype.run=function(t){var e=[],n=Object();if(null!=this.swimlanes&&this.swimlanes.length>0&&null!=t){for(var i=Object(),s=0;s<this.swimlanes.length;s++)this.filterDescendants(this.swimlanes[s],i);this.roots=[];var r=!0;for(var o in i)if(null!=i[o]){r=!1;break}for(var l=0;!r&&l<this.swimlanes.length;){var a=this.findRoots(this.swimlanes[l],i);if(0!=a.length){for(s=0;s<a.length;s++){var h=Object();e.push(h),this.traverse(a[s],!0,null,n,h,e,i,l)}for(s=0;s<a.length;s++)this.roots.push(a[s]);for(var o in r=!0,i)if(null!=i[o]){r=!1;break}}else l++}}else for(s=0;s<this.roots.length;s++){h=Object();e.push(h),this.traverse(this.roots[s],!0,null,n,h,e,null)}var u=[];for(var o in n)u.push(n[o]);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 n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&n.getParent(t)!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),s=0;s<i;s++){var r=n.getChildAt(t,s);this.isPort(r)||this.filterDescendants(r,e)}},mxSwimlaneLayout.prototype.isPort=function(t){return!!t.geometry.relative},mxSwimlaneLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),s=[],r=0;r<i.length;r++){var o=this.getVisibleTerminal(i[r],!0),l=this.getVisibleTerminal(i[r],!1);(o==t&&l==e||!n&&o==e&&l==t)&&s.push(i[r])}return s},mxSwimlaneLayout.prototype.traverse=function(t,e,n,i,s,r,o,l){if(null!=t&&null!=i){var a=mxObjectIdentity.get(t);if(null!=i[a]||null!=o&&null==o[a]){if(null==s[a])for(m=0;m<r.length;m++){var h=r[m];if(null!=h[a]){for(var u in h)s[u]=h[u];return r.splice(m,1),s}}}else{null==s[a]&&(s[a]=t),null==i[a]&&(i[a]=t),null!==o&&delete o[a];for(var d=this.getEdges(t),p=this.graph.model,m=0;m<d.length;m++){var c=this.getVisibleTerminal(d[m],!0),x=c==t;x&&(c=this.getVisibleTerminal(d[m],!1));var g=0;for(g=0;g<this.swimlanes.length&&!p.isAncestor(this.swimlanes[g],c);g++);g>=this.swimlanes.length||(g>l||(!e||x)&&g==l)&&(s=this.traverse(c,e,d[m],i,s,r,o,g))}}}return s},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxSwimlaneLayout=void 0!==mxSwimlaneLayout?mxSwimlaneLayout:void 0,mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.ignoreRelativeEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,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;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var n=null;if(null!=t){n=[];for(var i=0;i<t.length;i++)e(t[i])&&n.push(t[i])}return n},mxGraphModel.prototype.getDescendants=function(t){return this.filterDescendants(null,t)},mxGraphModel.prototype.filterDescendants=function(t,e){var n=[];e=e||this.getRoot(),(null==t||t(e))&&n.push(e);for(var i=this.getChildCount(e),s=0;s<i;s++){var r=this.getChildAt(e,s);n=n.concat(this.filterDescendants(t,r))}return n},mxGraphModel.prototype.getRoot=function(t){var e=t||this.root;if(null!=t)for(;null!=t;)e=t,t=this.getParent(t);return e},mxGraphModel.prototype.setRoot=function(t){return this.execute(new mxRootChange(this,t)),t},mxGraphModel.prototype.rootChanged=function(t){var e=this.root;return this.root=t,this.nextId=0,this.cells=null,this.cellAdded(t),e},mxGraphModel.prototype.isRoot=function(t){return null!=t&&this.root==t},mxGraphModel.prototype.isLayer=function(t){return this.isRoot(this.getParent(t))},mxGraphModel.prototype.isAncestor=function(t,e){for(;null!=e&&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 null!=t?t.getParent():null},mxGraphModel.prototype.add=function(t,e,n){if(e!=t&&null!=t&&null!=e){null==n&&(n=this.getChildCount(t));var i=t!=this.getParent(e);this.execute(new mxChildChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParents(e)}return e},mxGraphModel.prototype.cellAdded=function(t){if(null!=t){if(null==t.getId()&&this.createIds&&t.setId(this.createId(t)),null!=t.getId()){var e=this.getCell(t.getId());if(e!=t){for(;null!=e;)t.setId(this.createId(t)),e=this.getCell(t.getId());null==this.cells&&(this.cells=new Object),this.cells[t.getId()]=t}}mxUtils.isNumeric(t.getId())&&(this.nextId=Math.max(this.nextId,t.getId()));for(var n=this.getChildCount(t),i=0;i<n;i++)this.cellAdded(this.getChildAt(t,i))}},mxGraphModel.prototype.createId=function(t){var e=this.nextId;return this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(t,e){e=e||this.getRoot(t);for(var n=this.getChildCount(t),i=0;i<n;i++){var s=this.getChildAt(t,i);this.updateEdgeParents(s,e)}var r=this.getEdgeCount(t),o=[];for(i=0;i<r;i++)o.push(this.getEdgeAt(t,i));for(i=0;i<o.length;i++){var l=o[i];this.isAncestor(e,l)&&this.updateEdgeParent(l,e)}},mxGraphModel.prototype.updateEdgeParent=function(t,e){for(var n=this.getTerminal(t,!0),i=this.getTerminal(t,!1),s=null;null!=n&&!this.isEdge(n)&&null!=n.geometry&&n.geometry.relative;)n=this.getParent(n);for(;null!=i&&this.ignoreRelativeEdgeParent&&!this.isEdge(i)&&null!=i.geometry&&i.geometry.relative;)i=this.getParent(i);if(this.isAncestor(e,n)&&this.isAncestor(e,i)&&null!=(s=n==i?this.getParent(n):this.getNearestCommonAncestor(n,i))&&(this.getParent(s)!=this.root||this.isAncestor(s,t))&&this.getParent(t)!=s){var r=this.getGeometry(t);if(null!=r){var o=this.getOrigin(this.getParent(t)),l=this.getOrigin(s),a=l.x-o.x,h=l.y-o.y;(r=r.clone()).translate(-a,-h),this.setGeometry(t,r)}this.add(s,t,this.getChildCount(s))}},mxGraphModel.prototype.getOrigin=function(t){var e=null;if(null!=t){if(e=this.getOrigin(this.getParent(t)),!this.isEdge(t)){var n=this.getGeometry(t);null!=n&&(e.x+=n.x,e.y+=n.y)}}else e=new mxPoint;return e},mxGraphModel.prototype.getNearestCommonAncestor=function(t,e){if(null!=t&&null!=e){var n=mxCellPath.create(e);if(null!=n&&n.length>0){var i=t,s=mxCellPath.create(i);if(n.length<s.length){i=e;var r=s;s=n,n=r}for(;null!=i;){var o=this.getParent(i);if(0==n.indexOf(s+mxCellPath.PATH_SEPARATOR)&&null!=o)return i;s=mxCellPath.getParentPath(s),i=o}}}return null},mxGraphModel.prototype.remove=function(t){return t==this.root?this.setRoot(null):null!=this.getParent(t)&&this.execute(new mxChildChange(this,null,t)),t},mxGraphModel.prototype.cellRemoved=function(t){if(null!=t&&null!=this.cells){for(var e=this.getChildCount(t)-1;e>=0;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,n){var i=this.getParent(t);if(null!=e)e==i&&i.getIndex(t)==n||e.insert(t,n);else if(null!=i){var s=i.getIndex(t);i.remove(s)}var r=this.contains(e),o=this.contains(i);return r&&!o?this.cellAdded(t):o&&!r&&this.cellRemoved(t),i},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,n){e=null!=e&&e,n=null!=n&&n;for(var i=this.getChildCount(t),s=[],r=0;r<i;r++){var o=this.getChildAt(t,r);(!n&&!e||n&&this.isEdge(o)||e&&this.isVertex(o))&&s.push(o)}return s},mxGraphModel.prototype.getTerminal=function(t,e){return null!=t?t.getTerminal(e):null},mxGraphModel.prototype.setTerminal=function(t,e,n){var i=e!=this.getTerminal(t,n);return this.execute(new mxTerminalChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParent(t,this.getRoot()),e},mxGraphModel.prototype.setTerminals=function(t,e,n){this.beginUpdate();try{this.setTerminal(t,e,!0),this.setTerminal(t,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(t,e,n){var i=this.getTerminal(t,n);return null!=e?e.insertEdge(t,n):null!=i&&i.removeEdge(t,n),i},mxGraphModel.prototype.getEdgeCount=function(t){return null!=t?t.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(t,e){return null!=t?t.getEdgeAt(e):null},mxGraphModel.prototype.getDirectedEdgeCount=function(t,e,n){for(var i=0,s=this.getEdgeCount(t),r=0;r<s;r++){var o=this.getEdgeAt(t,r);o!=n&&this.getTerminal(o,e)==t&&i++}return i},mxGraphModel.prototype.getConnections=function(t){return this.getEdges(t,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(t){return this.getEdges(t,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(t){return this.getEdges(t,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(t,e,n,i){e=null==e||e,n=null==n||n,i=null==i||i;for(var s=this.getEdgeCount(t),r=[],o=0;o<s;o++){var l=this.getEdgeAt(t,o),a=this.getTerminal(l,!0),h=this.getTerminal(l,!1);(i&&a==h||a!=h&&(e&&h==t||n&&a==t))&&r.push(l)}return r},mxGraphModel.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;var i=this.getEdgeCount(t),s=this.getEdgeCount(e),r=t,o=i;s<i&&(o=s,r=e);for(var l=[],a=0;a<o;a++){var h=this.getEdgeAt(r,a),u=this.getTerminal(h,!0),d=this.getTerminal(h,!1);(u==t&&d==e||!n&&(d==t&&u==e))&&l.push(h)}return l},mxGraphModel.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var s=[];if(null!=t)for(var r=0;r<t.length;r++){var o=this.getTerminal(t[r],!0),l=this.getTerminal(t[r],!1);o==e&&null!=l&&l!=e&&i?s.push(l):l==e&&null!=o&&o!=e&&n&&s.push(o)}return s},mxGraphModel.prototype.getTopmostCells=function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.put(t[i],!0);for(i=0;i<t.length;i++){for(var s=t[i],r=!0,o=this.getParent(s);null!=o;){if(e.get(o)){r=!1;break}o=this.getParent(o)}r&&n.push(s)}return n},mxGraphModel.prototype.isVertex=function(t){return null!=t&&t.isVertex()},mxGraphModel.prototype.isEdge=function(t){return null!=t&&t.isEdge()},mxGraphModel.prototype.isConnectable=function(t){return null!=t&&t.isConnectable()},mxGraphModel.prototype.getValue=function(t){return null!=t?t.getValue():null},mxGraphModel.prototype.setValue=function(t,e){return this.execute(new mxValueChange(this,t,e)),e},mxGraphModel.prototype.valueForCellChanged=function(t,e){return t.valueChanged(e)},mxGraphModel.prototype.getGeometry=function(t){return null!=t?t.getGeometry():null},mxGraphModel.prototype.setGeometry=function(t,e){return e!=this.getGeometry(t)&&this.execute(new mxGeometryChange(this,t,e)),e},mxGraphModel.prototype.geometryForCellChanged=function(t,e){var n=this.getGeometry(t);return t.setGeometry(e),n},mxGraphModel.prototype.getStyle=function(t){return null!=t?t.getStyle():null},mxGraphModel.prototype.setStyle=function(t,e){return e!=this.getStyle(t)&&this.execute(new mxStyleChange(this,t,e)),e},mxGraphModel.prototype.styleForCellChanged=function(t,e){var n=this.getStyle(t);return t.setStyle(e),n},mxGraphModel.prototype.isCollapsed=function(t){return null!=t&&t.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(t,e){return e!=this.isCollapsed(t)&&this.execute(new mxCollapseChange(this,t,e)),e},mxGraphModel.prototype.collapsedStateForCellChanged=function(t,e){var n=this.isCollapsed(t);return t.setCollapsed(e),n},mxGraphModel.prototype.isVisible=function(t){return null!=t&&t.isVisible()},mxGraphModel.prototype.setVisible=function(t,e){return e!=this.isVisible(t)&&this.execute(new mxVisibleChange(this,t,e)),e},mxGraphModel.prototype.visibleStateForCellChanged=function(t,e){var n=this.isVisible(t);return t.setVisible(e),n},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)),1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))},mxGraphModel.prototype.endUpdate=function(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!this.endingUpdate){this.endingUpdate=0==this.updateLevel,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=!1}}},mxGraphModel.prototype.createUndoableEdit=function(t){var e=new mxUndoableEdit(this,null==t||t);return 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))},e},mxGraphModel.prototype.mergeChildren=function(t,e,n){n=null==n||n,this.beginUpdate();try{var i=new Object;for(var s in this.mergeChildrenImpl(t,e,n,i),i){var r=i[s],o=this.getTerminal(r,!0);null!=o&&(o=i[mxCellPath.create(o)],this.setTerminal(r,o,!0)),null!=(o=this.getTerminal(r,!1))&&(o=i[mxCellPath.create(o)],this.setTerminal(r,o,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(t,e,n,i){this.beginUpdate();try{for(var s=t.getChildCount(),r=0;r<s;r++){var o=t.getChildAt(r);if("function"==typeof o.getId){var l=o.getId(),a=null==l||this.isEdge(o)&&n?null:this.getCell(l);if(null==a){var h=o.clone();h.setId(l),h.setTerminal(o.getTerminal(!0),!0),h.setTerminal(o.getTerminal(!1),!1),a=e.insert(h),this.cellAdded(a)}i[mxCellPath.create(o)]=a,this.mergeChildrenImpl(o,a,n,i)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(t){var e=[];if(null!=t)for(var n=new mxDictionary,i=0;i<t.length;i++){var s=this.getParent(t[i]);null==s||n.get(s)||(n.put(s,!0),e.push(s))}return e},mxGraphModel.prototype.cloneCell=function(t,e){return null!=t?this.cloneCells([t],e)[0]:null},mxGraphModel.prototype.cloneCells=function(t,e,n){e=null==e||e,n=null!=n?n:new Object;for(var i=[],s=0;s<t.length;s++)null!=t[s]?i.push(this.cloneCellImpl(t[s],n,e)):i.push(null);for(s=0;s<i.length;s++)null!=i[s]&&this.restoreClone(i[s],t[s],n);return i},mxGraphModel.prototype.cloneCellImpl=function(t,e,n){var i=mxObjectIdentity.get(t),s=e[i];if(null==s&&(s=this.cellCloned(t),e[i]=s,n))for(var r=this.getChildCount(t),o=0;o<r;o++){var l=this.cloneCellImpl(this.getChildAt(t,o),e,!0);s.insert(l)}return s},mxGraphModel.prototype.cellCloned=function(t){return t.clone()},mxGraphModel.prototype.restoreClone=function(t,e,n){var i=this.getTerminal(e,!0);null!=i&&(null!=(s=n[mxObjectIdentity.get(i)])&&s.insertEdge(t,!0));var s,r=this.getTerminal(e,!1);null!=r&&(null!=(s=n[mxObjectIdentity.get(r)])&&s.insertEdge(t,!1));for(var o=this.getChildCount(t),l=0;l<o;l++)this.restoreClone(this.getChildAt(t,l),this.getChildAt(e,l),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){if(null!=this.child){var t=this.model.getParent(this.child),e=null!=t?t.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),t=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=t,this.index=this.previousIndex,this.previousIndex=e}},mxChildChange.prototype.connect=function(t,e){e=null==e||e;var n=t.getTerminal(!0),i=t.getTerminal(!1);null!=n&&(e?this.model.terminalForCellChanged(t,n,!0):this.model.terminalForCellChanged(t,null,!0)),null!=i&&(e?this.model.terminalForCellChanged(t,i,!1):this.model.terminalForCellChanged(t,null,!1)),t.setTerminal(n,!0),t.setTerminal(i,!1);for(var s=this.model.getChildCount(t),r=0;r<s;r++)this.connect(this.model.getChildAt(t,r),e)},mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))},mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))},mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))},mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))},mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))},mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))},mxCellAttributeChange.prototype.execute=function(){if(null!=this.cell){var t=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=t}},__mxOutput.mxGraphModel=void 0!==mxGraphModel?mxGraphModel:void 0,mxCell.prototype.id=null,mxCell.prototype.value=null,mxCell.prototype.geometry=null,mxCell.prototype.style=null,mxCell.prototype.vertex=!1,mxCell.prototype.edge=!1,mxCell.prototype.connectable=!0,mxCell.prototype.visible=!0,mxCell.prototype.collapsed=!1,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();return this.setValue(t),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 0!=this.vertex},mxCell.prototype.setVertex=function(t){this.vertex=t},mxCell.prototype.isEdge=function(){return 0!=this.edge},mxCell.prototype.setEdge=function(t){this.edge=t},mxCell.prototype.isConnectable=function(){return 0!=this.connectable},mxCell.prototype.setConnectable=function(t){this.connectable=t},mxCell.prototype.isVisible=function(){return 0!=this.visible},mxCell.prototype.setVisible=function(t){this.visible=t},mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed},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){return e?this.source=t:this.target=t,t},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(t){return mxUtils.indexOf(this.children,t)},mxCell.prototype.getChildAt=function(t){return null==this.children?null:this.children[t]},mxCell.prototype.insert=function(t,e){return null!=t&&(null==e&&(e=this.getChildCount(),t.getParent()==this&&e--),t.removeFromParent(),t.setParent(this),null==this.children?(this.children=[],this.children.push(t)):this.children.splice(e,0,t)),t},mxCell.prototype.remove=function(t){var e=null;return null!=this.children&&t>=0&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(null!=t){if(t.getTerminal(!e)!=this&&null!=this.edges){var n=this.getEdgeIndex(t);n>=0&&this.edges.splice(n,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var n=this.getValue(),i=null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(t):null;return null!=i?i:e},mxCell.prototype.setAttribute=function(t,e){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=void 0!==mxCell?mxCell:void 0,mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){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){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var n=mxUtils.toRadians(t),i=Math.cos(n),s=Math.sin(n);if(!this.relative){var r=new mxPoint(this.getCenterX(),this.getCenterY()),o=mxUtils.getRotatedPoint(r,i,s,e);this.x=Math.round(o.x-this.width/2),this.y=Math.round(o.y-this.height/2)}if(null!=this.sourcePoint){o=mxUtils.getRotatedPoint(this.sourcePoint,i,s,e);this.sourcePoint.x=Math.round(o.x),this.sourcePoint.y=Math.round(o.y)}if(null!=this.targetPoint){o=mxUtils.getRotatedPoint(this.targetPoint,i,s,e);this.targetPoint.x=Math.round(o.x),this.targetPoint.y=Math.round(o.y)}if(null!=this.points)for(var l=0;l<this.points.length;l++)if(null!=this.points[l]){o=mxUtils.getRotatedPoint(this.points[l],i,s,e);this.points[l].x=Math.round(o.x),this.points[l].y=Math.round(o.y)}},mxGeometry.prototype.translate=function(t,e){if(t=parseFloat(t),e=parseFloat(e),this.relative||(this.x=parseFloat(this.x)+t,this.y=parseFloat(this.y)+e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+t,this.targetPoint.y=parseFloat(this.targetPoint.y)+e),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=0;n<this.points.length;n++)null!=this.points[n]&&(this.points[n].x=parseFloat(this.points[n].x)+t,this.points[n].y=parseFloat(this.points[n].y)+e)},mxGeometry.prototype.scale=function(t,e,n){if(t=parseFloat(t),e=parseFloat(e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*t,this.targetPoint.y=parseFloat(this.targetPoint.y)*e),null!=this.points)for(var i=0;i<this.points.length;i++)null!=this.points[i]&&(this.points[i].x=parseFloat(this.points[i].x)*t,this.points[i].y=parseFloat(this.points[i].y)*e);this.relative||(this.x=parseFloat(this.x)*t,this.y=parseFloat(this.y)*e,n&&(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&&(null==this.sourcePoint&&null==t.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(t.sourcePoint))&&(null==this.targetPoint&&null==t.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(t.targetPoint))&&(null==this.points&&null==t.points||null!=this.points&&mxUtils.equalPoints(this.points,t.points))&&(null==this.alternateBounds&&null==t.alternateBounds||null!=this.alternateBounds&&this.alternateBounds.equals(t.alternateBounds))&&(null==this.offset&&null==t.offset||null!=this.offset&&this.offset.equals(t.offset))},__mxOutput.mxGeometry=void 0!==mxGeometry?mxGeometry:void 0;var mxCellPath={PATH_SEPARATOR:".",create:function(t){var e="";if(null!=t)for(var n=t.getParent();null!=n;){e=n.getIndex(t)+mxCellPath.PATH_SEPARATOR+e,n=(t=n).getParent()}var i=e.length;return i>1&&(e=e.substring(0,i-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var n=t;if(null!=e)for(var i=e.split(mxCellPath.PATH_SEPARATOR),s=0;s<i.length;s++)n=n.getChildAt(parseInt(i[s]));return n},compare:function(t,e){for(var n=Math.min(t.length,e.length),i=0,s=0;s<n;s++)if(t[s]!=e[s]){var r,o;if(0==t[s].length||0==e[s].length)i=t[s]==e[s]?0:t[s]>e[s]?1:-1;else i=(r=parseInt(t[s]))==(o=parseInt(e[s]))?0:r>o?1:-1;break}0==i&&((r=t.length)!=(o=e.length)&&(i=r>o?1:-1));return i}};__mxOutput.mxCellPath=void 0!==mxCellPath?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,n,i){var s=t.getCenterX(),r=t.getCenterY(),o=n.x-s,l=n.y-r,a=Math.atan2(l,o),h=new mxPoint(0,0),u=Math.PI,d=Math.PI/2-a,p=Math.atan2(t.height,t.width);return a<-u+p||a>u-p?(h.x=t.x,h.y=r-t.width*Math.tan(a)/2):a<-p?(h.y=t.y,h.x=s-t.height*Math.tan(d)/2):a<p?(h.x=t.x+t.width,h.y=r+t.width*Math.tan(a)/2):(h.y=t.y+t.height,h.x=s+t.height*Math.tan(d)/2),i&&(n.x>=t.x&&n.x<=t.x+t.width?h.x=n.x:n.y>=t.y&&n.y<=t.y+t.height&&(h.y=n.y),n.x<t.x?h.x=t.x:n.x>t.x+t.width&&(h.x=t.x+t.width),n.y<t.y?h.y=t.y:n.y>t.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width/2,l=t.height/2,a=s+o,h=r+l,u=n.x,d=n.y,p=parseInt(u-a),m=parseInt(d-h);if(0==p&&0!=m)return new mxPoint(a,h+l*m/Math.abs(m));if(0==p&&0==m)return new mxPoint(u,d);if(i){if(d>=r&&d<=r+t.height){var c=d-h,x=Math.sqrt(o*o*(1-c*c/(l*l)))||0;return u<=s&&(x=-x),new mxPoint(a+x,d)}if(u>=s&&u<=s+t.width){x=u-a,c=Math.sqrt(l*l*(1-x*x/(o*o)))||0;return d<=r&&(c=-c),new mxPoint(u,h+c)}}var g=m/p,y=h-g*a,f=o*o*g*g+l*l,v=-2*a*f,C=o*o*g*g*a*a+l*l*a*a-o*o*l*l,E=Math.sqrt(v*v-4*f*C),S=(-v+E)/(2*f),T=(-v-E)/(2*f),b=g*S+y,w=g*T+y,L=0,I=0;return Math.sqrt(Math.pow(S-u,2)+Math.pow(b-d,2))<Math.sqrt(Math.pow(T-u,2)+Math.pow(w-d,2))?(L=S,I=b):(L=T,I=w),new mxPoint(L,I)},RhombusPerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width,l=t.height,a=s+o/2,h=r+l/2,u=n.x,d=n.y;if(a==u)return new mxPoint(a,h>d?r:r+l);if(h==d)return new mxPoint(a>u?s:s+o,h);var p=a,m=h;return i&&(u>=s&&u<=s+o?p=u:d>=r&&d<=r+l&&(m=d)),u<a?d<h?mxUtils.intersection(u,d,p,m,a,r,s,h):mxUtils.intersection(u,d,p,m,a,r+l,s,h):d<h?mxUtils.intersection(u,d,p,m,a,r,s+o,h):mxUtils.intersection(u,d,p,m,a,r+l,s+o,h)},TrianglePerimeter:function(t,e,n,i){var s=null!=e?e.style[mxConstants.STYLE_DIRECTION]:null,r=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH,o=t.x,l=t.y,a=t.width,h=t.height,u=o+a/2,d=l+h/2,p=new mxPoint(o,l),m=new mxPoint(o+a,d),c=new mxPoint(o,l+h);s==mxConstants.DIRECTION_NORTH?(p=c,m=new mxPoint(u,l),c=new mxPoint(o+a,l+h)):s==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(u,l+h),c=new mxPoint(o+a,l)):s==mxConstants.DIRECTION_WEST&&(p=new mxPoint(o+a,l),m=new mxPoint(o,d),c=new mxPoint(o+a,l+h));var x=n.x-u,g=n.y-d,y=r?Math.atan2(x,g):Math.atan2(g,x),f=r?Math.atan2(a,h):Math.atan2(h,a),v=null;if(s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_WEST?y>-f&&y<f:y<-Math.PI+f||y>Math.PI-f)v=i&&(r&&n.x>=p.x&&n.x<=c.x||!r&&n.y>=p.y&&n.y<=c.y)?r?new mxPoint(n.x,p.y):new mxPoint(p.x,n.y):s==mxConstants.DIRECTION_NORTH?new mxPoint(o+a/2+h*Math.tan(y)/2,l+h):s==mxConstants.DIRECTION_SOUTH?new mxPoint(o+a/2-h*Math.tan(y)/2,l):s==mxConstants.DIRECTION_WEST?new mxPoint(o+a,l+h/2+a*Math.tan(y)/2):new mxPoint(o,l+h/2-a*Math.tan(y)/2);else{if(i){var C=new mxPoint(u,d);n.y>=l&&n.y<=l+h?(C.x=r?u:s==mxConstants.DIRECTION_WEST?o+a:o,C.y=n.y):n.x>=o&&n.x<=o+a&&(C.x=n.x,C.y=r?s==mxConstants.DIRECTION_NORTH?l+h:l:d),x=n.x-C.x,g=n.y-C.y,u=C.x,d=C.y}v=r&&n.x<=o+a/2||!r&&n.y<=l+h/2?mxUtils.intersection(n.x,n.y,u,d,p.x,p.y,m.x,m.y):mxUtils.intersection(n.x,n.y,u,d,m.x,m.y,c.x,c.y)}return null==v&&(v=new mxPoint(u,d)),v},HexagonPerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width,l=t.height,a=t.getCenterX(),h=t.getCenterY(),u=n.x,d=n.y,p=u-a,m=d-h,c=-Math.atan2(m,p),x=Math.PI,g=Math.PI/2,y=new mxPoint(a,h),f=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,v=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH,C=new mxPoint,E=new mxPoint;if((u<s&&d<r||u<s&&d>r+l||u>s+o&&d<r||u>s+o&&d>r+l)&&(i=!1),i){if(v){if(u==a){if(d<=r)return new mxPoint(a,r);if(d>=r+l)return new mxPoint(a,r+l)}else if(u<s){if(d==r+l/4)return new mxPoint(s,r+l/4);if(d==r+3*l/4)return new mxPoint(s,r+3*l/4)}else if(u>s+o){if(d==r+l/4)return new mxPoint(s+o,r+l/4);if(d==r+3*l/4)return new mxPoint(s+o,r+3*l/4)}else if(u==s){if(d<h)return new mxPoint(s,r+l/4);if(d>h)return new mxPoint(s,r+3*l/4)}else if(u==s+o){if(d<h)return new mxPoint(s+o,r+l/4);if(d>h)return new mxPoint(s+o,r+3*l/4)}if(d==r)return new mxPoint(a,r);if(d==r+l)return new mxPoint(a,r+l);u<a?d>r+l/4&&d<r+3*l/4?(C=new mxPoint(s,r),E=new mxPoint(s,r+l)):d<r+l/4?(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r-Math.floor(.25*l))):d>r+3*l/4&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l))):u>a&&(d>r+l/4&&d<r+3*l/4?(C=new mxPoint(s+o,r),E=new mxPoint(s+o,r+l)):d<r+l/4?(C=new mxPoint(s,r-Math.floor(.25*l)),E=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l))):d>r+3*l/4&&(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))))}else{if(d==h){if(u<=s)return new mxPoint(s,r+l/2);if(u>=s+o)return new mxPoint(s+o,r+l/2)}else if(d<r){if(u==s+o/4)return new mxPoint(s+o/4,r);if(u==s+3*o/4)return new mxPoint(s+3*o/4,r)}else if(d>r+l){if(u==s+o/4)return new mxPoint(s+o/4,r+l);if(u==s+3*o/4)return new mxPoint(s+3*o/4,r+l)}else if(d==r){if(u<a)return new mxPoint(s+o/4,r);if(u>a)return new mxPoint(s+3*o/4,r)}else if(d==r+l){if(u<a)return new mxPoint(s+o/4,r+l);if(d>h)return new mxPoint(s+3*o/4,r+l)}if(u==s)return new mxPoint(s,h);if(u==s+o)return new mxPoint(s+o,h);d<h?u>s+o/4&&u<s+3*o/4?(C=new mxPoint(s,r),E=new mxPoint(s+o,r)):u<s+o/4?(C=new mxPoint(s-Math.floor(.25*o),r+l),E=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l))):u>s+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r+l)):d>h&&(u>s+o/4&&u<s+3*o/4?(C=new mxPoint(s,r+l),E=new mxPoint(s+o,r+l)):u<s+o/4?(C=new mxPoint(s-Math.floor(.25*o),r),E=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l))):u>s+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)))}var S=a,T=h;u>=s&&u<=s+o?(S=u,T=d<h?r+l:r):d>=r&&d<=r+l&&(T=d,S=u<a?s+o:s),y=mxUtils.intersection(S,T,n.x,n.y,C.x,C.y,E.x,E.y)}else{if(v){if(c==(b=Math.atan2(l/4,o/2)))return new mxPoint(s+o,r+Math.floor(.25*l));if(c==g)return new mxPoint(s+Math.floor(.5*o),r);if(c==x-b)return new mxPoint(s,r+Math.floor(.25*l));if(c==-b)return new mxPoint(s+o,r+Math.floor(.75*l));if(c==-g)return new mxPoint(s+Math.floor(.5*o),r+l);if(c==-x+b)return new mxPoint(s,r+Math.floor(.75*l));c<b&&c>-b?(C=new mxPoint(s+o,r),E=new mxPoint(s+o,r+l)):c>b&&c<g?(C=new mxPoint(s,r-Math.floor(.25*l)),E=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l))):c>g&&c<x-b?(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r-Math.floor(.25*l))):c>x-b&&c<=x||c<-x+b&&c>=-x?(C=new mxPoint(s,r),E=new mxPoint(s,r+l)):c<-b&&c>-g?(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))):c<-g&&c>-x+b&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l)))}else{var b;if(c==(b=Math.atan2(l/2,o/4)))return new mxPoint(s+Math.floor(.75*o),r);if(c==x-b)return new mxPoint(s+Math.floor(.25*o),r);if(c==x||c==-x)return new mxPoint(s,r+Math.floor(.5*l));if(0==c)return new mxPoint(s+o,r+Math.floor(.5*l));if(c==-b)return new mxPoint(s+Math.floor(.75*o),r+l);if(c==-x+b)return new mxPoint(s+Math.floor(.25*o),r+l);c>0&&c<b?(C=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r+l)):c>b&&c<x-b?(C=new mxPoint(s,r),E=new mxPoint(s+o,r)):c>x-b&&c<x?(C=new mxPoint(s-Math.floor(.25*o),r+l),E=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l))):c<0&&c>-b?(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)):c<-b&&c>-x+b?(C=new mxPoint(s,r+l),E=new mxPoint(s+o,r+l)):c<-x+b&&c>-x&&(C=new mxPoint(s-Math.floor(.25*o),r),E=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)))}y=mxUtils.intersection(a,h,n.x,n.y,C.x,C.y,E.x,E.y)}return null==y?new mxPoint(a,h):y}};function mxPrintPreview(t,e,n,i,s,r,o,l,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=i?i:0,this.pageFormat=mxRectangle.fromRectangle(null!=n?n:t.pageFormat),this.title=null!=l?l:"Printer-friendly version",this.x0=null!=s?s:0,this.y0=null!=r?r:0,this.borderColor=o,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,n){this.view=t,this.cell=e,this.style=null!=n?n:{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,n){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(t){this.graph=t,this.zoomHandler=mxUtils.bind(this,(function(){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){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)})),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}__mxOutput.mxPerimeter=void 0!==mxPerimeter?mxPerimeter:void 0,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=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,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=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=5">':8==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=8">':document.documentMode>8&&(t='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e'),t},mxPrintPreview.prototype.appendGraph=function(t,e,n,i,s,r){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.x0=n,this.y0=i,this.open(null,null,s,r)},mxPrintPreview.prototype.open=function(t,e,n,i){var s=this.graph.cellRenderer.initializeOverlay,r=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(t,e){e.init(t.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(t,e,n,i){e.dialect=t.view.graph.dialect,e.init(t.view.getDrawPane())}),this.wnd=null!=e?e:this.wnd;var o=!1;null==this.wnd&&(o=!0,this.wnd=window.open());var l=this.wnd.document;if(o){var a=this.getDoctype();null!=a&&a.length>0&&l.writeln(a),mxClient.IS_VML?l.writeln('<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">'):("CSS1Compat"===document.compatMode&&l.writeln("<!DOCTYPE html>"),l.writeln("<html>")),l.writeln("<head>"),this.writeHead(l,t),l.writeln("</head>"),l.writeln('<body class="mxPage">')}var h=this.graph.getGraphBounds().clone(),u=this.graph.getView().getScale(),d=u/this.scale,p=this.graph.getView().getTranslate();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-2*this.border,c=this.pageFormat.height-2*this.border;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)),g=Math.max(1,Math.ceil((h.height+this.y0)/c));this.pageCount=x*g;var y=mxUtils.bind(this,(function(){if(this.pageSelector&&(g>1||x>1)){var t=this.createPageSelector(g,x);if(l.body.appendChild(t),mxClient.IS_IE&&null==l.documentMode||5==l.documentMode||8==l.documentMode||7==l.documentMode){t.style.position="absolute";var e=function(){t.style.top=(l.body.scrollTop||l.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()})),mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}})),f=mxUtils.bind(this,(function(t,e){if(null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(n||e)&&(t.style.pageBreakAfter="always"),o&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))l.writeln(t.outerHTML),t.parentNode.removeChild(t);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var i=l.createElement("div");i.innerHTML=t.outerHTML,i=i.getElementsByTagName("div")[0],l.body.appendChild(i),t.parentNode.removeChild(t)}else t.parentNode.removeChild(t),l.body.appendChild(t);(n||e)&&this.addPageBreak(l)})),v=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=v)for(var C=0;C<v.length;C++)f(v[C],!0);var E=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(C=0;C<g;C++)for(var S=C*c/this.scale-this.y0/this.scale+(h.y-p.y*u)/u,T=0;T<x;T++){if(null==this.wnd)return null;var b=T*m/this.scale-this.x0/this.scale+(h.x-p.x*u)/u,w=C*x+T+1,L=new mxRectangle(b,S,m,c);(r=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,(function(t){this.addGraphFragment(-b,-S,this.scale,w,t,L),this.printBackgroundImage&&this.insertBackgroundImage(t,-b,-S)})),w)).setAttribute("id","mxPage-"+w),f(r,null!=E||C<g-1||T<x-1)}if(null!=E)for(C=0;C<E.length;C++)f(E[C],C<E.length-1);o&&!i&&(this.closeDocument(),y()),this.wnd.focus()}catch(t){null!=r&&null!=r.parentNode&&r.parentNode.removeChild(r)}finally{this.graph.cellRenderer.initializeOverlay=s}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(null!=this.wnd&&null!=this.wnd.document){var t=this.wnd.document;this.writePostfix(t),t.writeln("</body>"),t.writeln("</html>"),t.close(),mxEvent.release(t.body)}}catch(t){}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln("<title>"+this.title+"</title>"),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("}"),null!=e&&t.writeln(e),t.writeln("</style>")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var n=this.wnd.document,i=n.createElement("table");i.className="mxPageSelector",i.setAttribute("border","0");for(var s=n.createElement("tbody"),r=0;r<t;r++){for(var o=n.createElement("tr"),l=0;l<e;l++){var a=r*e+l+1,h=n.createElement("td"),u=n.createElement("a");if(u.setAttribute("href","#mxPage-"+a),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var d="var page = document.getElementById('mxPage-"+a+"');page.scrollIntoView(true);event.preventDefault();";u.setAttribute("onclick",d)}mxUtils.write(u,a,n),h.appendChild(u),o.appendChild(h)}s.appendChild(o)}return i.appendChild(s),i},mxPrintPreview.prototype.renderPage=function(t,e,n,i,s,r){var o=this.wnd.document,l=document.createElement("div"),a=null;try{if(0!=n||0!=i){l.style.position="relative",l.style.width=t+"px",l.style.height=e+"px",l.style.pageBreakInside="avoid",(u=document.createElement("div")).style.position="relative",u.style.top=this.border+"px",u.style.left=this.border+"px",u.style.width=t-2*this.border+"px",u.style.height=e-2*this.border+"px",u.style.overflow="hidden";var h=document.createElement("div");h.style.position="relative",h.style.marginLeft=n+"px",h.style.marginTop=i+"px",8==o.documentMode&&(u.style.position="absolute",h.style.position="absolute"),10==o.documentMode&&(h.style.width="100%",h.style.height="100%"),u.appendChild(h),l.appendChild(u),document.body.appendChild(l),a=h}else{var u;l.style.width=t+"px",l.style.height=e+"px",l.style.overflow="hidden",l.style.pageBreakInside="avoid",8==o.documentMode&&(l.style.position="relative"),(u=document.createElement("div")).style.width=t-2*this.border+"px",u.style.height=e-2*this.border+"px",u.style.overflow="hidden",!mxClient.IS_IE||null!=o.documentMode&&5!=o.documentMode&&8!=o.documentMode&&7!=o.documentMode?(u.style.top=this.border+"px",u.style.left=this.border+"px"):(u.style.marginTop=this.border+"px",u.style.marginLeft=this.border+"px"),this.graph.dialect==mxConstants.DIALECT_VML&&(u.style.position="absolute"),l.appendChild(u),document.body.appendChild(l),a=u}}catch(t){throw l.parentNode.removeChild(l),l=null,t}return s(a),l},mxPrintPreview.prototype.getRoot=function(){var t=this.graph.view.currentRoot;return null==t&&(t=this.graph.getModel().getRoot()),t},mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF},mxPrintPreview.prototype.addGraphFragment=function(t,e,n,i,s,r){var o=this.graph.getView(),l=this.graph.container;this.graph.container=s;var a=o.getCanvas(),h=o.getBackgroundPane(),u=o.getDrawPane(),d=o.getOverlayPane(),p=n;if(this.graph.dialect==mxConstants.DIALECT_SVG){if(o.createSvg(),this.useCssTransforms()){var m=o.getDrawPane().parentNode;m.getAttribute("transform"),m.setAttribute("transformOrigin","0 0"),m.setAttribute("transform","scale("+n+","+n+")translate("+t+","+e+")"),n=1,t=0,e=0}}else this.graph.dialect==mxConstants.DIALECT_VML?o.createVml():o.createHtml();var c=o.isEventsEnabled();o.setEventsEnabled(!1);var x=this.graph.isEnabled();this.graph.setEnabled(!1);var g=o.getTranslate();o.translate=new mxPoint(t,e);var y=this.graph.cellRenderer.redraw,f=o.states,v=o.scale;if(this.clipping){var C=new mxRectangle((r.x+g.x)*v,(r.y+g.y)*v,r.width*v/p,r.height*v/p);this.graph.cellRenderer.redraw=function(t,e,n){if(null!=t){var i=f.get(t.cell);if(null!=i){var s=o.getBoundingBox(i,!1);if(null!=s&&s.width>0&&s.height>0&&!mxUtils.intersects(C,s))return}}y.apply(this,arguments)}}var E=null;try{var S=[this.getRoot()];E=new mxTemporaryCellStates(o,n,S,null,mxUtils.bind(this,(function(t){return this.getLinkForCellState(t)})))}finally{if(mxClient.IS_IE)o.overlayPane.innerHTML="",o.canvas.style.overflow="hidden",o.canvas.style.position="relative",o.canvas.style.top=this.marginTop+"px",o.canvas.style.width=r.width+"px",o.canvas.style.height=r.height+"px";else for(var T=s.firstChild;null!=T;){var b=T.nextSibling,w=T.nodeName.toLowerCase();"svg"==w?(T.style.overflow="hidden",T.style.position="relative",T.style.top=this.marginTop+"px",T.setAttribute("width",r.width),T.setAttribute("height",r.height),T.style.width="",T.style.height=""):"default"!=T.style.cursor&&"div"!=w&&T.parentNode.removeChild(T),T=b}if(this.printBackgroundImage){var L=s.getElementsByTagName("svg");L.length>0&&(L[0].style.position="absolute")}o.overlayPane.parentNode.removeChild(o.overlayPane),this.graph.setEnabled(x),this.graph.container=l,this.graph.cellRenderer.redraw=y,o.canvas=a,o.backgroundPane=h,o.drawPane=u,o.overlayPane=d,o.translate=g,E.destroy(),o.setEventsEnabled(c)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,n){var i=this.graph.backgroundImage;if(null!=i){var s=document.createElement("img");s.style.position="absolute",s.style.marginLeft=Math.round(e*this.scale)+"px",s.style.marginTop=Math.round(n*this.scale)+"px",s.setAttribute("width",Math.round(this.scale*i.width)),s.setAttribute("height",Math.round(this.scale*i.height)),s.src=i.src,t.insertBefore(s,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=void 0!==mxPrintPreview?mxPrintPreview:void 0,mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return 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",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return 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",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 n=e;if(null!=t&&t.length>0){var i=t.split(";");n=null!=n&&";"!=t.charAt(0)?mxUtils.clone(n):new Object;for(var s=0;s<i.length;s++){var r=i[s],o=r.indexOf("=");if(o>=0){var l=r.substring(0,o),a=r.substring(o+1);a==mxConstants.NONE?delete n[l]:mxUtils.isNumeric(a)?n[l]=parseFloat(a):n[l]=a}else{var h=this.styles[r];if(null!=h)for(var l in h)n[l]=h[l]}}}return n},__mxOutput.mxStylesheet=void 0!==mxStylesheet?mxStylesheet:void 0,mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,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){if(t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var n=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=n.x,e.y=n.y,e.width=this.shape.stencil.w0*n.width,e.height=this.shape.stencil.h0*n.height}return 0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return null!=e?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t: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,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),null!=this.shape&&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(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e<this.absolutePoints.length;e++)t.absolutePoints[e]=this.absolutePoints[e].clone()}return null!=this.origin&&(t.origin=this.origin.clone()),null!=this.absoluteOffset&&(t.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(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,t},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},__mxOutput.mxCellState=void 0!==mxCellState?mxCellState:void 0,mxGraphSelectionModel.prototype=new mxEventSource,mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel,mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"",mxGraphSelectionModel.prototype.graph=null,mxGraphSelectionModel.prototype.singleSelection=!1,mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection},mxGraphSelectionModel.prototype.setSingleSelection=function(t){this.singleSelection=t},mxGraphSelectionModel.prototype.isSelected=function(t){return null!=t&&mxUtils.indexOf(this.cells,t)>=0},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],n=0;n<t.length;n++)this.graph.isCellSelectable(t[n])&&e.push(t[n]);this.changeSelection(e,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(t){if(null!=t)for(var e=0;e<t.length;e++)if(this.graph.isCellSelectable(t[e]))return t[e];return null},mxGraphSelectionModel.prototype.addCell=function(t){null!=t&&this.addCells([t])},mxGraphSelectionModel.prototype.addCells=function(t){if(null!=t){var e=null;this.singleSelection&&(e=this.cells,t=[this.getFirstSelectableCell(t)]);for(var n=[],i=0;i<t.length;i++)!this.isSelected(t[i])&&this.graph.isCellSelectable(t[i])&&n.push(t[i]);this.changeSelection(n,e)}},mxGraphSelectionModel.prototype.removeCell=function(t){null!=t&&this.removeCells([t])},mxGraphSelectionModel.prototype.removeCells=function(t){if(null!=t){for(var e=[],n=0;n<t.length;n++)this.isSelected(t[n])&&e.push(t[n]);this.changeSelection(null,e)}},mxGraphSelectionModel.prototype.changeSelection=function(t,e){if(null!=t&&t.length>0&&null!=t[0]||null!=e&&e.length>0&&null!=e[0]){var n=new mxSelectionChange(this,t,e);n.execute();var i=new mxUndoableEdit(this,!1);i.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",i))}},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(null!=t){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e<this.removed.length;e++)this.selectionModel.cellRemoved(this.removed[e]);if(null!=this.added)for(e=0;e<this.added.length;e++)this.selectionModel.cellAdded(this.added[e]);var n=this.added;this.added=this.removed,this.removed=n,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=void 0!==mxGraphSelectionModel?mxGraphSelectionModel:void 0,mxCellEditor.prototype.graph=null,mxCellEditor.prototype.textarea=null,mxCellEditor.prototype.editingCell=null,mxCellEditor.prototype.trigger=null,mxCellEditor.prototype.modified=!1,mxCellEditor.prototype.autoSize=!0,mxCellEditor.prototype.selectText=!0,mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,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=!0,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){null!=this.textarea&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var n=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(n=mxUtils.replaceTrailingNewlines(n,"<div><br></div>")),n.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(!1),mxEvent.consume(t)}))),mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){this.blurEnabled&&this.focusLost(t)}))),mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))})));var e=mxUtils.bind(this,(function(e){null!=this.editingCell&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,t.innerHTML="")}));mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var n=mxUtils.bind(this,(function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)}));mxEvent.addListener(t,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",n),mxEvent.addListener(t,"cut",n),mxEvent.addListener(t,"paste",n);var i=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",s=mxUtils.bind(this,(function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null,this.resize()})),0))}));mxEvent.addListener(t,i,s),mxEvent.addListener(window,"resize",s),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",s),mxEvent.addListener(t,"DOMNodeInserted",s)):(mxEvent.addListener(t,"cut",s),mxEvent.addListener(t,"paste",s))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!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(null==t)this.stopEditing(!0);else if(null!=this.textarea){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=null;if(this.autoSize&&"fill"!=t.style[mxConstants.STYLE_OVERFLOW]){var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(null==(i=null!=t.text&&null==this.align?t.text.margin:null)&&(i=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))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),null!=s){var r=(parseFloat(s)+2)*n;this.bounds.width=r,this.bounds.x+=i.x*r}}else{var o=mxRectangle.fromRectangle(t),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&l==mxConstants.ALIGN_CENTER&&a==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,null!=s&&(o.width=parseFloat(s)*n),!t.view.graph.cellRenderer.legacySpacing||"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*n,u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+h,d=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+h,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+h,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+h;l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);o=new mxRectangle(o.x+m,o.y+u,o.width-(l==mxConstants.ALIGN_CENTER&&null==s?m+d:0),o.height-(a==mxConstants.ALIGN_MIDDLE?u+p:0))}this.bounds=new mxRectangle(o.x+t.absoluteOffset.x,o.y+t.absoluteOffset.y,o.width,o.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";r=Math.round(this.bounds.width/(document.documentMode,n))+this.wordWrapPadding;"relative"!=this.textarea.style.position?(this.textarea.style.width=r+"px",this.textarea.scrollWidth>r&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=r+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var c=this.textarea.scrollWidth,x=this.textarea.scrollHeight;8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5))/n))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-i.y*(this.bounds.height-(x+.5)*n)+x*(n-1)*0+1*Math.abs(i.y+.5))/n))+"px",this.textarea.style.width=Math.round(c*n)+"px",this.textarea.style.height=Math.round(x*n)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-i.y*(this.bounds.height-(x+.5)*n)+x*(n-1)*0+1*Math.abs(i.y+.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-i.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-i.y*(this.bounds.height-4)+(-1==i.y?3:0))+1)+"px")}else this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/n)+"px",this.textarea.style.height=Math.round(this.bounds.height/n)+"px",8==document.documentMode||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(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"),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","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/n)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxClient.IS_VML?this.textarea.style.zoom=n:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+n+","+n+")"+(null==i?"":" translate("+100*i.x+"%,"+100*i.y+"%)")))}},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!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(null!=e){var n=mxUtils.getCurrentStyle(e);null!=n&&(t="absolute"==n.position)}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,null==this.textarea&&this.init(),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var n=this.graph.getView().getState(t);if(null!=n){this.graph.getView().scale;var i=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),s=mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),r=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,a=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,h=[];(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&h.push("underline"),(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&h.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(i*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(n),this.textarea.style.textDecoration=h.join(" "),this.textarea.style.fontWeight=l?"bold":"normal",this.textarea.style.fontStyle=a?"italic":"",this.textarea.style.fontSize=Math.round(i)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=s,this.textarea.style.textAlign=o,this.textarea.style.outline="none",this.textarea.style.color=r;var u=this.textDirection=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);u==mxConstants.TEXT_DIRECTION_AUTO&&(null==n||null==n.text||n.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(n.text.value)||(u=n.text.getAutoDirection())),u==mxConstants.TEXT_DIRECTION_LTR||u==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",u):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(n,e)||"",this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,null!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(n.cell)||"fill"!=n.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(t){}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),n=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&(this.textarea.innerHTML!=n||null!=this.align)){this.prepareTextarea();var i=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{null!=i&&this.applyValue(e,i),null!=this.align&&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(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=this.getMinimumSize(t),s=i.width,r=i.height,o=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW])o=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var l=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*n,a=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+l,h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+l,u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+l,d=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+l;o=new mxRectangle(t.x,t.y,Math.max(s,t.width-d-h),Math.max(r,t.height-a-u));var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),m=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&p==mxConstants.ALIGN_CENTER&&m==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,e?(o.x=t.absoluteOffset.x,o.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(t.text.boundingBox.x>0&&(o.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(o.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(o.x=Math.min(o.x,t.text.boundingBox.x),o.y=Math.min(o.y,t.text.boundingBox.y)),o.x+=d,o.y+=a,null!=t.text&&null!=t.text.boundingBox&&(e?(o.width=Math.max(s,t.text.boundingBox.width),o.height=Math.max(r,t.text.boundingBox.height)):(o.width=Math.max(o.width,t.text.boundingBox.width),o.height=Math.max(o.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var c=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);c==mxConstants.ALIGN_LEFT?o.x-=t.width:c==mxConstants.ALIGN_RIGHT&&(o.x+=t.width);var x=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);x==mxConstants.ALIGN_TOP?o.y-=t.height:x==mxConstants.ALIGN_BOTTOM&&(o.y+=t.height)}}return new mxRectangle(Math.round(o.x),Math.round(o.y),Math.round(o.width),Math.round(o.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=void 0!==mxCellEditor?mxCellEditor:void 0,mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,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(null!=t.style){var n=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(null!=n)e=new mxShape(n);else e=new(this.getShapeConstructor(t))}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),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){null!=t.shape&&(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(null!=t.style)for(var e=["inherit","swimlane","indicated"],n=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],i=0;i<n.length;i++)if(mxUtils.indexOf(e,t.style[n[i]])>=0)return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,n){var i=n==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(null!=i){var s=t.view.graph,r=i[e],o=null;if("inherit"==r?o=s.model.getParent(t.cell):"swimlane"==r?(i[e]=n==mxConstants.STYLE_STROKECOLOR||n==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",o=null!=s.model.getTerminal(t.cell,!1)?s.model.getTerminal(t.cell,!1):t.cell,o=s.getSwimlane(o),n=s.swimlaneIndicatorColorAttribute):"indicated"==r&&null!=t.shape?i[e]=t.shape.indicatorColor:n!=mxConstants.STYLE_FILLCOLOR&&r==mxConstants.STYLE_FILLCOLOR&&null!=t.shape?i[e]=t.style[mxConstants.STYLE_FILLCOLOR]:n!=mxConstants.STYLE_STROKECOLOR&&r==mxConstants.STYLE_STROKECOLOR&&null!=t.shape&&(i[e]=t.style[mxConstants.STYLE_STROKECOLOR]),null!=o){var l=s.getView().getState(o);if(i[e]=null,null!=l){var a=n==mxConstants.STYLE_FONTCOLOR?l.text:l.shape;i[e]=null!=a&&"indicatorColor"!=e?a[e]:l.style[n]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var n=t.view.graph;if(n.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||null==t.style[mxConstants.STYLE_FONTSIZE]){var i=n.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,n.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],n.isWrapping(t.cell)&&n.isHtmlLabel(t.cell),n.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=i?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var s=!1,r=function(e){var i=t;if(mxClient.IS_TOUCH||s){var r=mxEvent.getClientX(e),o=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,o);i=n.view.getState(n.getCellAt(l.x,l.y))}return i};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),s=n.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e))),s=!1)}))),n.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.dblClick(e,t.cell),mxEvent.consume(e))})))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),n=null;if(null!=e){n=new mxDictionary;for(var i=0;i<e.length;i++){var s=null!=t.overlays?t.overlays.remove(e[i]):null;if(null==s){var r=new mxImageShape(new mxRectangle,e[i].image.src);r.dialect=t.view.graph.dialect,r.preserveImageAspect=!1,r.overlay=e[i],this.initializeOverlay(t,r),this.installCellOverlayListeners(t,e[i],r),null!=e[i].cursor&&(r.node.style.cursor=e[i].cursor),n.put(e[i],r)}else n.put(e[i],s)}}null!=t.overlays&&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,n){var i=t.view.graph;mxEvent.addListener(n.node,"click",(function(n){i.isEditing()&&i.stopEditing(!i.isInvokesStopCellEditing()),e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",n,"cell",t.cell))})),mxEvent.addGestureListeners(n.node,(function(t){mxEvent.consume(t)}),(function(e){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))})),mxClient.IS_TOUCH&&mxEvent.addListener(n.node,"touchend",(function(n){e.fireEvent(new mxEventObject(mxEvent.CLICK,"event",n,"cell",t.cell))}))},mxCellRenderer.prototype.createControl=function(t){var e=t.view.graph,n=e.getFoldingImage(t);if(e.foldingEnabled&&null!=n){if(null==t.control){var i=new mxRectangle(0,0,n.width,n.height);t.control=new mxImageShape(i,n.src),t.control.preserveImageAspect=!1,t.control.dialect=e.dialect,this.initControl(t,t.control,!0,this.createControlClickHandler(t))}}else null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.createControlClickHandler=function(t){var e=t.view.graph;return mxUtils.bind(this,(function(n){if(this.forceControlClickHandler||e.isEnabled()){var i=!e.isCellCollapsed(t.cell);e.foldCells(i,!1,[t.cell],null,n),mxEvent.consume(n)}}))},mxCellRenderer.prototype.initControl=function(t,e,n,i){var s=t.view.graph;s.isHtmlLabel(t.cell)&&mxClient.NO_FO&&s.dialect==mxConstants.DIALECT_SVG?(e.dialect=mxConstants.DIALECT_PREFERHTML,e.init(s.container),e.node.style.zIndex=1):e.init(t.view.getOverlayPane());var r=e.innerNode||e.node;if(null==i||mxClient.IS_IOS||(s.isEnabled()&&(r.style.cursor="pointer"),mxEvent.addListener(r,"click",i)),n){var o=null;mxEvent.addGestureListeners(r,(function(e){o=new mxPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)),s.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),mxEvent.consume(e)}),(function(e){s.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,t))}),(function(e){s.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,t)),mxEvent.consume(e)})),null!=i&&mxClient.IS_IOS&&r.addEventListener("touchend",(function(t){if(null!=o){var e=s.tolerance;Math.abs(o.x-mxEvent.getClientX(t))<e&&Math.abs(o.y-mxEvent.getClientY(t))<e&&(i.call(i,t),mxEvent.consume(t))}}),!0)}return r},mxCellRenderer.prototype.isShapeEvent=function(t,e){return!0},mxCellRenderer.prototype.isLabelEvent=function(t,e){return!0},mxCellRenderer.prototype.installListeners=function(t){var e=t.view.graph,n=function(n){var i=t;if(e.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(n).nodeName||mxClient.IS_TOUCH){var s=mxEvent.getClientX(n),r=mxEvent.getClientY(n),o=mxUtils.convertPoint(e.container,s,r);i=e.view.getState(e.getCellAt(o.x,o.y))}return i};mxEvent.addGestureListeners(t.shape.node,mxUtils.bind(this,(function(n){this.isShapeEvent(t,n)&&e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(n,t))})),mxUtils.bind(this,(function(i){this.isShapeEvent(t,i)&&e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(i,n(i)))})),mxUtils.bind(this,(function(i){this.isShapeEvent(t,i)&&e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(i,n(i)))}))),e.nativeDblClickEnabled&&mxEvent.addListener(t.shape.node,"dblclick",mxUtils.bind(this,(function(n){this.isShapeEvent(t,n)&&(e.dblClick(n,t.cell),mxEvent.consume(n))})))},mxCellRenderer.prototype.redrawLabel=function(t,e){var n=t.view.graph,i=this.getLabelValue(t),s=n.isWrapping(t.cell),r=n.isLabelClipped(t.cell),o=t.view.graph.isHtmlLabel(t.cell)||null!=i&&mxUtils.isNode(i)?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,l=t.style[mxConstants.STYLE_OVERFLOW]||"visible";if(null==t.text||t.text.wrap==s&&t.text.clipped==r&&t.text.overflow==l&&t.text.dialect==o||(t.text.destroy(),t.text=null),null==t.text&&null!=i&&(mxUtils.isNode(i)||i.length>0)?this.createLabel(t,i):null==t.text||null!=i&&0!=i.length||(t.text.destroy(),t.text=null),null!=t.text){e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=n.getVerticalAlign(t));var a=this.getLabelBounds(t),h=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=i||t.text.isWrapping!=s||t.text.overflow!=l||t.text.isClipping!=r||t.text.scale!=h||t.text.dialect!=o||null==t.text.bounds||!t.text.bounds.equals(a)){t.text.dialect=o,t.text.value=i,t.text.bounds=a,t.text.scale=h,t.text.wrap=s,t.text.clipped=r,t.text.overflow=l;var u=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=u}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function n(n,i,s){return"spacingTop"==i||"spacingRight"==i||"spacingBottom"==i||"spacingLeft"==i?parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[i]||s):e[n]!=(t.style[i]||s)}return n("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||n("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||n("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||n("color",mxConstants.STYLE_FONTCOLOR,"black")||n("align",mxConstants.STYLE_ALIGN,"")||n("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||n("spacing",mxConstants.STYLE_SPACING,2)||n("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||n("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||n("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||n("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||n("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||n("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||n("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||n("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||n("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,n=t.view.scale,i=e.getModel().isEdge(t.cell),s=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(i){var r=t.text.getSpacing();s.x+=r.x*n,s.y+=r.y*n;var o=e.getCellGeometry(t.cell);null!=o&&(s.width=Math.max(0,o.width*n),s.height=Math.max(0,o.height*n))}else{if(t.text.isPaintBoundsInverted()){var l=s.x;s.x=s.y,s.y=l}s.x+=t.x,s.y+=t.y,s.width=Math.max(1,t.width),s.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var a=(t.width-t.height)/2;s.x+=a,s.y-=a;l=s.width;s.width=s.height,s.height=l}if(null!=t.shape){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE&&(s=t.shape.getLabelBounds(s))}var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=d&&(s.width=parseFloat(d)*n),i||this.rotateLabelBounds(t,s),s},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||"fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var n=t.view.scale,i=t.text.getSpacing();e.x+=i.x*n,e.y+=i.y*n;var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),r=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(s==mxConstants.ALIGN_CENTER&&null==o?t.text.spacingLeft*n+t.text.spacingRight*n:0)),e.height=Math.max(0,e.height-(r==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*n+t.text.spacingBottom*n:0))}var l=t.text.getTextRotation();if(0!=l&&null!=t&&t.view.graph.model.isVertex(t.cell)){var a=t.getCenterX(),h=t.getCenterY();if(e.x!=a||e.y!=h){var u=l*(Math.PI/180),d=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(a,h));e.x=d.x,e.y=d.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),null!=t.overlays){var n=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),i=mxUtils.toRadians(n),s=Math.cos(i),r=Math.sin(i);t.overlays.visit((function(i,o){var l=o.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&null!=t.shape&&0!=n){var a=l.getCenterX(),h=l.getCenterY(),u=mxUtils.getRotatedPoint(new mxPoint(a,h),s,r,new mxPoint(t.getCenterX(),t.getCenterY()));a=u.x,h=u.y,l.x=Math.round(a-l.width/2),l.y=Math.round(h-l.height/2)}!e&&null!=o.bounds&&o.scale==t.view.scale&&o.bounds.equals(l)||(o.bounds=l,o.scale=t.view.scale,o.redraw())}))}},mxCellRenderer.prototype.redrawControl=function(t,e){var n=t.view.graph.getFoldingImage(t);if(null!=t.control&&null!=n){var i=this.getControlBounds(t,n.width,n.height),s=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),r=t.view.scale;!e&&t.control.scale==r&&t.control.bounds.equals(i)&&t.control.rotation==s||(t.control.rotation=s,t.control.bounds=i,t.control.scale=r,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,n){if(null!=t.control){var i=t.view.scale,s=t.getCenterX(),r=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(s=t.x+e*i,r=t.y+n*i,null!=t.shape)){var o=t.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var l=(t.width-t.height)/2;s+=l,r-=l}if(0!=o){var a=mxUtils.toRadians(o),h=Math.cos(a),u=Math.sin(a),d=mxUtils.getRotatedPoint(new mxPoint(s,r),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));s=d.x,r=d.y}}return t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(s-e/2*i),Math.round(r-n/2*i),Math.round(e*i),Math.round(n*i))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,n){for(var i=this.getShapesForState(t),s=0;s<i.length;s++)if(null!=i[s]&&null!=i[s].node){var r=i[s].node.parentNode!=t.view.getDrawPane()&&i[s].node.parentNode!=t.view.getOverlayPane(),o=r?n:e;if(null!=o&&o.nextSibling!=i[s].node)null==o.nextSibling?o.parentNode.appendChild(i[s].node):o.parentNode.insertBefore(i[s].node,o.nextSibling);else if(null==o)if(i[s].node.parentNode==t.view.graph.container){for(var l=t.view.canvas;null!=l&&l.parentNode!=t.view.graph.container;)l=l.parentNode;null!=l&&null!=l.nextSibling?l.nextSibling!=i[s].node&&i[s].node.parentNode.insertBefore(i[s].node,l.nextSibling):i[s].node.parentNode.appendChild(i[s].node)}else null!=i[s].node.parentNode&&null!=i[s].node.parentNode.firstChild&&i[s].node.parentNode.firstChild!=i[s].node&&i[s].node.parentNode.insertBefore(i[s].node,i[s].node.parentNode.firstChild);r?n=i[s].node:e=i[s].node}return[e,n]},mxCellRenderer.prototype.getShapesForState=function(t){return[t.shape,t.text,t.control]},mxCellRenderer.prototype.redraw=function(t,e,n){var i=this.redrawShape(t,e,n);null==t.shape||null!=n&&!n||(this.redrawLabel(t,i),this.redrawCellOverlays(t,i),this.redrawControl(t,i))},mxCellRenderer.prototype.redrawShape=function(t,e,n){var i=t.view.graph.model,s=!1;return null!=t.shape&&null!=t.shape.style&&null!=t.style&&t.shape.style[mxConstants.STYLE_SHAPE]!=t.style[mxConstants.STYLE_SHAPE]&&(t.shape.destroy(),t.shape=null),null==t.shape&&null!=t.view.graph.container&&t.cell!=t.view.currentRoot&&(i.isVertex(t.cell)||i.isEdge(t.cell))?(t.shape=this.createShape(t),null!=t.shape&&(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))):e||null==t.shape||mxUtils.equalEntries(t.shape.style,t.style)&&!this.checkPlaceholderStyles(t)||(t.shape.resetStyles(),this.configureShape(t),t.view.graph.selectionCellsHandler.updateHandler(t),e=!0),null!=t.shape&&t.shape.indicatorShape!=this.getShape(t.view.graph.getIndicatorShape(t))&&(null!=t.shape.indicator&&(t.shape.indicator.destroy(),t.shape.indicator=null),this.createIndicatorShape(t),null!=t.shape.indicatorShape&&(t.shape.indicator=new t.shape.indicatorShape,t.shape.indicator.dialect=t.shape.dialect,t.shape.indicator.init(t.node),e=!0)),null!=t.shape&&(this.createControl(t),(e||this.isShapeInvalid(t,t.shape))&&(null!=t.absolutePoints?(t.shape.points=t.absolutePoints.slice(),t.shape.bounds=null):(t.shape.points=null,t.shape.bounds=new mxRectangle(t.x,t.y,t.width,t.height)),t.shape.scale=t.view.scale,null==n||n?this.doRedrawShape(t):t.shape.updateBoundingBox(),s=!0)),s},mxCellRenderer.prototype.doRedrawShape=function(t){t.shape.redraw()},mxCellRenderer.prototype.isShapeInvalid=function(t,e){return null==e.bounds||e.scale!=t.view.scale||null==t.absolutePoints&&!e.bounds.equals(t)||null!=t.absolutePoints&&!mxUtils.equalPoints(e.points,t.absolutePoints)},mxCellRenderer.prototype.destroy=function(t){null!=t.shape&&(null!=t.text&&(t.text.destroy(),t.text=null),null!=t.overlays&&(t.overlays.visit((function(t,e){e.destroy()})),t.overlays=null),null!=t.control&&(t.control.destroy(),t.control=null),t.shape.destroy(),t.shape=null)},__mxOutput.mxCellRenderer=void 0!==mxCellRenderer?mxCellRenderer:void 0;var mxEdgeStyle={EntityRelation:function(t,e,n,i,s){var r=t.view,o=r.graph,l=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*r.scale,a=t.absolutePoints,h=a[0],u=a[a.length-1],d=!1;if(null!=e){var p=o.getCellGeometry(e.cell);p.relative?d=p.x<=.5:null!=n&&(d=(null!=u?u.x:n.x+n.width)<(null!=h?h.x:e.x))}if(null!=h)(e=new mxCellState).x=h.x,e.y=h.y;else{if(null==e)return;(x=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&x!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(d=x==mxConstants.DIRECTION_MASK_WEST)}var m=!0;if(null!=n){var c=o.getCellGeometry(n.cell);c.relative?m=c.x<=.5:null!=e&&(m=(null!=h?h.x:e.x+e.width)<(null!=u?u.x:n.x))}if(null!=u)(n=new mxCellState).x=u.x,n.y=u.y;else if(null!=n){var x;(x=mxUtils.getPortConstraints(n,t,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&x!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(m=x==mxConstants.DIRECTION_MASK_WEST)}if(null!=e&&null!=n){var g=d?e.x:e.x+e.width,y=r.getRoutingCenterY(e),f=m?n.x:n.x+n.width,v=r.getRoutingCenterY(n),C=l,E=d?-C:C,S=new mxPoint(g+E,y),T=new mxPoint(f+(E=m?-C:C),v);if(d==m){var b=d?Math.min(g,f)-l:Math.max(g,f)+l;s.push(new mxPoint(b,y)),s.push(new mxPoint(b,v))}else if(S.x<T.x==d){var w=y+(v-y)/2;s.push(S),s.push(new mxPoint(S.x,w)),s.push(new mxPoint(T.x,w)),s.push(T)}else s.push(S),s.push(T)}},Loop:function(t,e,n,i,s){var r=t.absolutePoints,o=r[0],l=r[r.length-1];if(null==o||null==l){if(null!=e){var a=t.view,h=a.graph;null!=(y=null!=i&&i.length>0?i[0]:null)&&(y=a.transformControlPoint(t,y),mxUtils.contains(e,y.x,y.y)&&(y=null));var u=0,d=0,p=0,m=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,h.gridSize)*a.scale,x=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);x==mxConstants.DIRECTION_NORTH||x==mxConstants.DIRECTION_SOUTH?(u=a.getRoutingCenterX(e),d=c):(p=a.getRoutingCenterY(e),m=c),null==y||y.x<e.x||y.x>e.x+e.width?null!=y?(u=y.x,m=Math.max(Math.abs(p-y.y),m)):x==mxConstants.DIRECTION_NORTH?p=e.y-2*d:x==mxConstants.DIRECTION_SOUTH?p=e.y+e.height+2*d:u=x==mxConstants.DIRECTION_EAST?e.x-2*m:e.x+e.width+2*m:null!=y&&(u=a.getRoutingCenterX(e),d=Math.max(Math.abs(u-y.x),m),p=y.y,m=0),s.push(new mxPoint(u-d,p-m)),s.push(new mxPoint(u+d,p+m))}}else if(null!=i&&i.length>0)for(var g=0;g<i.length;g++){var y=i[g];y=t.view.transformControlPoint(t,y),s.push(new mxPoint(y.x,y.y))}},ElbowConnector:function(t,e,n,i,s){var r=null!=i&&i.length>0?i[0]:null,o=!1,l=!1;if(null!=e&&null!=n)if(null!=r){var a=Math.min(e.x,n.x),h=Math.max(e.x+e.width,n.x+n.width),u=Math.min(e.y,n.y),d=Math.max(e.y+e.height,n.y+n.height);o=(r=t.view.transformControlPoint(t,r)).y<u||r.y>d,l=r.x<a||r.x>h}else{if(!(o=(a=Math.max(e.x,n.x))==(h=Math.min(e.x+e.width,n.x+n.width))))l=(u=Math.max(e.y,n.y))==(d=Math.min(e.y+e.height,n.y+n.height))}l||!o&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,n,i,s):mxEdgeStyle.TopToBottom(t,e,n,i,s)},SideToSide:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.x,n.x),d=Math.min(e.x+e.width,n.x+n.width),p=null!=o?o.x:Math.round(d+(u-d)/2),m=r.getRoutingCenterY(e),c=r.getRoutingCenterY(n);if(null!=o&&(o.y>=e.y&&o.y<=e.y+e.height&&(m=o.y),o.y>=n.y&&o.y<=n.y+n.height&&(c=o.y)),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),mxUtils.contains(n,p,c)||mxUtils.contains(e,p,c)||s.push(new mxPoint(p,c)),1==s.length)if(null!=o)mxUtils.contains(n,p,o.y)||mxUtils.contains(e,p,o.y)||s.push(new mxPoint(p,o.y));else{var x=Math.max(e.y,n.y),g=Math.min(e.y+e.height,n.y+n.height);s.push(new mxPoint(p,x+(g-x)/2))}}},TopToBottom:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.y,n.y),d=Math.min(e.y+e.height,n.y+n.height),p=r.getRoutingCenterX(e);null!=o&&o.x>=e.x&&o.x<=e.x+e.width&&(p=o.x);var m=null!=o?o.y:Math.round(d+(u-d)/2);if(mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),p=null!=o&&o.x>=n.x&&o.x<=n.x+n.width?o.x:r.getRoutingCenterX(n),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),1==s.length)if(null!=o&&1==s.length)mxUtils.contains(n,o.x,m)||mxUtils.contains(e,o.x,m)||s.push(new mxPoint(o.x,m));else{var c=Math.max(e.x,n.x),x=Math.min(e.x+e.width,n.x+n.width);s.push(new mxPoint(c+(x-c)/2,m))}}},SegmentConnector:function(t,e,n,i,s){var r=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),o=mxEdgeStyle.scaleCellState(e,t.view.scale),l=mxEdgeStyle.scaleCellState(n,t.view.scale),a=s.length>0?s[0]:null,h=!0,u=null;function d(e){return e.x=Math.round(e.x*t.view.scale*10)/10,e.y=Math.round(e.y*t.view.scale*10)/10,(null==a||Math.abs(a.x-e.x)>=1||Math.abs(a.y-e.y)>=Math.max(1,t.view.scale))&&(s.push(e),a=e),a}var p=r[0];null==p&&null!=o?p=new mxPoint(t.view.getRoutingCenterX(o),t.view.getRoutingCenterY(o)):null!=p&&(p=p.clone());var m=r.length-1;if(null!=i&&i.length>0){for(var c=[],x=0;x<i.length;x++){var g=t.view.transformControlPoint(t,i[x],!0);null!=g&&c.push(g)}if(0==c.length)return;null!=p&&null!=c[0]&&(Math.abs(c[0].x-p.x)<1&&(c[0].x=p.x),Math.abs(c[0].y-p.y)<1&&(c[0].y=p.y));var y=r[m];null!=y&&null!=c[c.length-1]&&(Math.abs(c[c.length-1].x-y.x)<1&&(c[c.length-1].x=y.x),Math.abs(c[c.length-1].y-y.y)<1&&(c[c.length-1].y=y.y)),u=c[0];var f=o,v=r[0],C=!1,E=!1,S=u;null!=v&&(f=null);for(x=0;x<2;x++){var T=null!=v&&v.x==S.x,b=null!=v&&v.y==S.y,w=null!=f&&S.y>=f.y&&S.y<=f.y+f.height,L=null!=f&&S.x>=f.x&&S.x<=f.x+f.width;if(C=b||null==v&&w,E=T||null==v&&L,0==x&&(C&&E||T&&b));else{if(null!=v&&!b&&!T&&(w||L)){h=!w;break}if(E||C){h=C,1==x&&(h=c.length%2==0?C:E);break}}f=l,null!=(v=r[m])&&(f=null),S=c[c.length-1],T&&b&&(c=c.slice(1))}h&&(null!=r[0]&&r[0].y!=u.y||null==r[0]&&null!=o&&(u.y<o.y||u.y>o.y+o.height))?d(new mxPoint(p.x,u.y)):!h&&(null!=r[0]&&r[0].x!=u.x||null==r[0]&&null!=o&&(u.x<o.x||u.x>o.x+o.width))&&d(new mxPoint(u.x,p.y)),h?p.y=u.y:p.x=u.x;for(x=0;x<c.length;x++)h=!h,u=c[x],h?p.y=u.y:p.x=u.x,d(p.clone())}else u=p,h=!0;if(null==(p=r[m])&&null!=l&&(p=new mxPoint(t.view.getRoutingCenterX(l),t.view.getRoutingCenterY(l))),null!=p&&null!=u&&(h&&(null!=r[m]&&r[m].y!=u.y||null==r[m]&&null!=l&&(u.y<l.y||u.y>l.y+l.height))?d(new mxPoint(p.x,u.y)):!h&&(null!=r[m]&&r[m].x!=u.x||null==r[m]&&null!=l&&(u.x<l.x||u.x>l.x+l.width))&&d(new mxPoint(u.x,p.y))),null==r[0]&&null!=o)for(;s.length>1&&null!=s[1]&&mxUtils.contains(o,s[1].x,s[1].y);)s.splice(1,1);if(null==r[m]&&null!=l)for(;s.length>1&&null!=s[s.length-1]&&mxUtils.contains(l,s[s.length-1].x,s[s.length-1].y);)s.splice(s.length-1,1);null!=y&&null!=s[s.length-1]&&Math.abs(y.x-s[s.length-1].x)<=1&&Math.abs(y.y-s[s.length-1].y)<=1&&(s.splice(s.length-1,1),null!=s[s.length-1]&&(Math.abs(s[s.length-1].x-y.x)<1&&(s[s.length-1].x=y.x),Math.abs(s[s.length-1].y-y.y)<1&&(s[s.length-1].y=y.y)))},orthBuffer:10,orthPointsFallback:!0,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 n=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("auto"==n)if(mxUtils.getValue(t.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE){var i=mxUtils.getNumber(t.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);n=Math.max(2,Math.ceil((i+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer}else n=2*mxEdgeStyle.orthBuffer;return n},scalePointArray:function(t,e){var n=[];if(null!=t)for(var i=0;i<t.length;i++)if(null!=t[i]){var s=new mxPoint(Math.round(t[i].x/e*10)/10,Math.round(t[i].y/e*10)/10);n[i]=s}else n[i]=null;else n=null;return n},scaleCellState:function(t,e){var n=null;return null!=t?(n=t.clone()).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):n=null,n},OrthConnector:function(t,e,n,i,s){var r=t.view.graph,o=null!=h&&r.getModel().isEdge(h.cell),l=null!=u&&r.getModel().isEdge(u.cell),a=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),h=mxEdgeStyle.scaleCellState(e,t.view.scale),u=mxEdgeStyle.scaleCellState(n,t.view.scale),d=a[0],p=a[a.length-1],m=null!=h?h.x:d.x,c=null!=h?h.y:d.y,x=null!=h?h.width:0,g=null!=h?h.height:0,y=null!=u?u.x:p.x,f=null!=u?u.y:p.y,v=null!=u?u.width:0,C=null!=u?u.height:0,E=mxEdgeStyle.getJettySize(t,!0),S=mxEdgeStyle.getJettySize(t,!1);null!=h&&u==h&&(E=S=Math.max(E,S));var T=S+E,b=!1;null!=d&&null!=p&&(b=(M=p.x-d.x)*M+(H=p.y-d.y)*H<T*T);if(b||mxEdgeStyle.orthPointsFallback&&null!=i&&i.length>0||o||l)mxEdgeStyle.SegmentConnector(t,e,n,i,s);else{var w,L=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],I=0;if(null!=h)if(L[0]=mxUtils.getPortConstraints(h,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(I=mxUtils.getValue(h.style,mxConstants.STYLE_ROTATION,0)))m=(w=mxUtils.getBoundingBox(new mxRectangle(m,c,x,g),I)).x,c=w.y,x=w.width,g=w.height;if(null!=u)if(L[1]=mxUtils.getPortConstraints(u,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(I=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0)))y=(w=mxUtils.getBoundingBox(new mxRectangle(y,f,v,C),I)).x,f=w.y,v=w.width,C=w.height;for(var A=[0,0],O=[[m,c,x,g],[y,f,v,C]],_=[E,S],P=0;P<2;P++)mxEdgeStyle.limits[P][1]=O[P][0]-_[P],mxEdgeStyle.limits[P][2]=O[P][1]-_[P],mxEdgeStyle.limits[P][4]=O[P][0]+O[P][2]+_[P],mxEdgeStyle.limits[P][8]=O[P][1]+O[P][3]+_[P];var M,R=O[0][0]+O[0][2]/2,N=O[0][1]+O[0][3]/2,D=O[1][0]+O[1][2]/2,H=N-(O[1][1]+O[1][3]/2),G=0;(M=R-D)<0?G=H<0?2:1:H<=0&&(G=3,0==M&&(G=2));var U=null;null!=h&&(U=d);var V=[[.5,.5],[.5,.5]];for(P=0;P<2;P++)null!=U&&(V[P][0]=(U.x-O[P][0])/O[P][2],Math.abs(U.x-O[P][0])<=1?A[P]=mxConstants.DIRECTION_MASK_WEST:Math.abs(U.x-O[P][0]-O[P][2])<=1&&(A[P]=mxConstants.DIRECTION_MASK_EAST),V[P][1]=(U.y-O[P][1])/O[P][3],Math.abs(U.y-O[P][1])<=1?A[P]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(U.y-O[P][1]-O[P][3])<=1&&(A[P]=mxConstants.DIRECTION_MASK_SOUTH)),U=null,null!=u&&(U=p);var B=O[0][1]-(O[1][1]+O[1][3]),F=O[0][0]-(O[1][0]+O[1][2]),k=O[1][1]-(O[0][1]+O[0][3]),Y=O[1][0]-(O[0][0]+O[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(F-T,0),mxEdgeStyle.vertexSeperations[2]=Math.max(B-T,0),mxEdgeStyle.vertexSeperations[4]=Math.max(k-T,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Y-T,0);var z=[],j=[],W=[];j[0]=F>=Y?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,W[0]=B>=k?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,j[1]=mxUtils.reversePortConstraints(j[0]),W[1]=mxUtils.reversePortConstraints(W[0]);var K=F>=Y?F:Y,X=B>=k?B:k,Z=[[0,0],[0,0]],q=!1;for(P=0;P<2;P++)0==A[P]&&(0==(j[P]&L[P])&&(j[P]=mxUtils.reversePortConstraints(j[P])),0==(W[P]&L[P])&&(W[P]=mxUtils.reversePortConstraints(W[P])),Z[P][0]=W[P],Z[P][1]=j[P]);X>0&&K>0&&((j[0]&L[0])>0&&(W[1]&L[1])>0?(Z[0][0]=j[0],Z[0][1]=W[0],Z[1][0]=W[1],Z[1][1]=j[1],q=!0):(W[0]&L[0])>0&&(j[1]&L[1])>0&&(Z[0][0]=W[0],Z[0][1]=j[0],Z[1][0]=j[1],Z[1][1]=W[1],q=!0)),X>0&&!q&&(Z[0][0]=W[0],Z[0][1]=j[0],Z[1][0]=W[1],Z[1][1]=j[1],q=!0),K>0&&!q&&(Z[0][0]=j[0],Z[0][1]=W[0],Z[1][0]=j[1],Z[1][1]=W[1],q=!0);for(P=0;P<2;P++)0==A[P]&&(0==(Z[P][0]&L[P])&&(Z[P][0]=Z[P][1]),z[P]=Z[P][0]&L[P],z[P]|=(Z[P][1]&L[P])<<8,z[P]|=(Z[1-P][P]&L[P])<<16,z[P]|=(Z[1-P][1-P]&L[P])<<24,0==(15&z[P])&&(z[P]=z[P]<<8),0==(3840&z[P])&&(z[P]=15&z[P]|z[P]>>8),0==(983040&z[P])&&(z[P]=65535&z[P]|(251658240&z[P])>>8),A[P]=15&z[P],L[P]!=mxConstants.DIRECTION_MASK_WEST&&L[P]!=mxConstants.DIRECTION_MASK_NORTH&&L[P]!=mxConstants.DIRECTION_MASK_EAST&&L[P]!=mxConstants.DIRECTION_MASK_SOUTH||(A[P]=L[P]));var $=A[0]==mxConstants.DIRECTION_MASK_EAST?3:A[0],Q=A[1]==mxConstants.DIRECTION_MASK_EAST?3:A[1];($-=G)<1&&($+=4),(Q-=G)<1&&(Q+=4);var J=mxEdgeStyle.routePatterns[$-1][Q-1];switch(mxEdgeStyle.wayPoints1[0][0]=O[0][0],mxEdgeStyle.wayPoints1[0][1]=O[0][1],A[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=E,mxEdgeStyle.wayPoints1[0][1]+=V[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=V[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]+=V[0][1]*O[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=V[0][0]*O[0][2],mxEdgeStyle.wayPoints1[0][1]-=E}var tt=0,et=(A[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,nt=et,it=0;for(P=0;P<J.length;P++){var st=15&J[P],rt=st==mxConstants.DIRECTION_MASK_EAST?3:st;(rt+=G)>4&&(rt-=4);var ot=mxEdgeStyle.dirVectors[rt-1];(it=rt%2>0?0:1)!=et&&(tt++,mxEdgeStyle.wayPoints1[tt][0]=mxEdgeStyle.wayPoints1[tt-1][0],mxEdgeStyle.wayPoints1[tt][1]=mxEdgeStyle.wayPoints1[tt-1][1]);var lt=(J[P]&mxEdgeStyle.TARGET_MASK)>0,at=(J[P]&mxEdgeStyle.SOURCE_MASK)>0,ht=(J[P]&mxEdgeStyle.SIDE_MASK)>>5;(ht<<=G)>15&&(ht>>=4);var ut=(J[P]&mxEdgeStyle.CENTER_MASK)>0;if((at||lt)&&ht<9){var dt=0,pt=at?0:1;if(dt=ut&&0==it?O[pt][0]+V[pt][0]*O[pt][2]:ut?O[pt][1]+V[pt][1]*O[pt][3]:mxEdgeStyle.limits[pt][ht],0==it){var mt=(dt-mxEdgeStyle.wayPoints1[tt][0])*ot[0];mt>0&&(mxEdgeStyle.wayPoints1[tt][0]+=ot[0]*mt)}else{var ct=(dt-mxEdgeStyle.wayPoints1[tt][1])*ot[1];ct>0&&(mxEdgeStyle.wayPoints1[tt][1]+=ot[1]*ct)}}else ut&&(mxEdgeStyle.wayPoints1[tt][0]+=ot[0]*Math.abs(mxEdgeStyle.vertexSeperations[rt]/2),mxEdgeStyle.wayPoints1[tt][1]+=ot[1]*Math.abs(mxEdgeStyle.vertexSeperations[rt]/2));tt>0&&mxEdgeStyle.wayPoints1[tt][it]==mxEdgeStyle.wayPoints1[tt-1][it]?tt--:et=it}for(P=0;P<=tt;P++){if(P==tt)if((((A[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1)==nt?0:1)!=(tt+1)%2)break;s.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[P][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[P][1]*t.view.scale*10)/10))}for(var xt=1;xt<s.length;)null==s[xt-1]||null==s[xt]||s[xt-1].x!=s[xt].x||s[xt-1].y!=s[xt].y?xt++:s.splice(xt,1)}},getRoutePattern:function(t,e,n,i){var s=t[0]==mxConstants.DIRECTION_MASK_EAST?3:t[0],r=t[1]==mxConstants.DIRECTION_MASK_EAST?3:t[1];(s-=e)<1&&(s+=4),(r-=e)<1&&(r+=4);var o=routePatterns[s-1][r-1];return 0!=n&&0!=i||null!=inlineRoutePatterns[s-1][r-1]&&(o=inlineRoutePatterns[s-1][r-1]),o}};__mxOutput.mxEdgeStyle=void 0!==mxEdgeStyle?mxEdgeStyle:void 0;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}};function mxGraphView(t){this.graph=t,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(t,e){if(this.view=t,this.root=e,this.previous=e,this.isUp=null==e,!this.isUp)for(var n=this.view.currentRoot,i=this.view.graph.getModel();null!=n;){if(n==e){this.isUp=!0;break}n=i.getParent(n)}}function mxGraph(t,e,n,i){this.mouseListeners=null,this.renderHint=n,mxClient.IS_SVG?this.dialect=mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?this.dialect=mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?this.dialect=mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?this.dialect=mxConstants.DIALECT_PREFERHTML:this.dialect=mxConstants.DIALECT_MIXEDHTML,this.model=null!=e?e:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=i?i: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(),null!=t&&this.init(t),this.view.revalidate()}function mxCellOverlay(t,e,n,i,s,r){this.image=t,this.tooltip=e,this.align=null!=n?n:this.align,this.verticalAlign=null!=i?i:this.verticalAlign,this.offset=null!=s?s:new mxPoint,this.cursor=null!=r?r:"help"}function mxOutline(t,e){this.source=t,null!=e&&this.init(e)}function mxMultiplicity(t,e,n,i,s,r,o,l,a,h){this.source=t,this.type=e,this.attr=n,this.value=i,this.min=null!=s?s:0,this.max=null!=r?r:"n",this.validNeighbors=o,this.countError=mxResources.get(l)||l,this.typeError=mxResources.get(a)||a,this.validNeighborsAllowed=null==h||h}function mxLayoutManager(t){this.undoHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.beforeUndo(e.getProperty("edit"))})),this.moveHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.cellsMoved(e.getProperty("cells"),e.getProperty("event"))})),this.resizeHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.cellsResized(e.getProperty("cells"),e.getProperty("bounds"),e.getProperty("previous"))})),this.setGraph(t)}function mxSwimlaneManager(t,e,n,i){this.horizontal=null==e||e,this.addEnabled=null==n||n,this.resizeEnabled=null==i||i,this.addHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(e.getProperty("cells"))})),this.resizeHandler=mxUtils.bind(this,(function(t,e){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(e.getProperty("cells"))})),this.setGraph(t)}function mxTemporaryCellStates(t,e,n,i,s){e=null!=e?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 r=this;if(null!=s&&(t.graph.cellRenderer.doRedrawShape=function(e){var n=e.shape.paint;e.shape.paint=function(t){var i=s(e);null!=i&&t.setLink(i),n.apply(this,arguments),null!=i&&t.setLink(null)},r.oldDoRedrawShape.apply(t.graph.cellRenderer,arguments),e.shape.paint=n}),t.validateCellState=function(e,n){return null==e||null==i||i(e)?r.oldValidateCellState.apply(t,arguments):null},t.setStates(new mxDictionary),t.setScale(e),null!=n){t.resetValidationState();for(var o=null,l=0;l<n.length;l++){var a=t.getBoundingBox(t.validateCellState(t.validateCell(n[l])));null==o?o=a:o.add(a)}t.setGraphBounds(o||new mxRectangle)}}function mxCellStatePreview(t){this.deltas=new mxDictionary,this.graph=t}function mxConnectionConstraint(t,e,n,i,s){this.point=t,this.perimeter=null==e||e,this.name=n,this.dx=i||0,this.dy=s||0}function mxGraphHandler(t){this.graph=t,this.graph.addMouseListener(this),this.panHandler=mxUtils.bind(this,(function(){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){this.refreshThread&&window.clearTimeout(this.refreshThread),this.refreshThread=window.setTimeout(mxUtils.bind(this,(function(){if(this.refreshThread=null,null!=this.first&&!this.suspended){var t=this.currentDx,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),null!=this.pBounds||this.livePreviewUsed?(this.currentDx=t,this.currentDy=e,this.updatePreview(),this.updateHint(),this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0),this.updatePreview())):this.reset()}})),0)})),this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler),this.graph.addListener(mxEvent.REFRESH,this.refreshHandler),this.keyHandler=mxUtils.bind(this,(function(t){if(null!=this.graph.container&&"hidden"!=this.graph.container.style.visibility&&null!=this.first&&!this.suspended){var e=this.graph.isCloneEvent(t)&&this.graph.isCellsCloneable()&&this.isCloneEnabled();e!=this.cloning&&(this.cloning=e,this.checkPreview(),this.updatePreview())}})),mxEvent.addListener(document,"keydown",this.keyHandler),mxEvent.addListener(document,"keyup",this.keyHandler)}function mxPanningHandler(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,(function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");n==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(i)&&(this.start(i),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",i)),i.consume())})),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,(function(t,e){if(this.isPinchEnabled()){var n=e.getProperty("event");mxEvent.isConsumed(n)||"gesturestart"!=n.type?"gestureend"==n.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale&&this.zoomGraph(n)}})),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,(function(){this.active&&this.reset()})),mxEvent.addListener(document,"mouseup",this.mouseUpListener))}function mxPopupMenuHandler(t,e){null!=t&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,(function(t,e){this.inTolerance=!1})),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}function mxCellMarker(t,e,n,i){mxEventSource.call(this),null!=t&&(this.graph=t,this.validColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=n?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=i?i:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}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){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)}function mxConnectionHandler(t,e){mxEventSource.call(this),null!=t&&(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))}function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,(function(t,e){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():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)}function mxRubberband(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,(function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");if(n==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(i)){var s=mxUtils.getOffset(this.graph.container),r=mxUtils.getScrollOrigin(this.graph.container);r.x-=s.x,r.y-=s.y,this.start(i.getX()+r.x,i.getY()+r.y),i.consume(!1)}})),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){null!=this.first&&this.reset()})),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()}))))}function mxHandle(t,e,n,i){this.graph=t.view.graph,this.state=t,this.cursor=null!=e?e:this.cursor,this.image=null!=n?n:this.image,this.shape=null!=i?i:null,this.init()}function mxVertexHandler(t){null!=t&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,(function(t,e){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate()),this.reset()})),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxEdgeHandler(t){null!=t&&null!=t.shape&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,(function(e,n){var i=null!=this.index;this.reset(),i&&this.graph.cellRenderer.redraw(this.state,!1,t.view.isRendering())})),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxElbowEdgeHandler(t){mxEdgeHandler.call(this,t)}function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}function mxKeyHandler(t,e){null!=t&&(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),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()}))))}function mxTooltipHandler(t,e){null!=t&&(this.graph=t,this.delay=e||500,this.graph.addMouseListener(this))}function mxCellTracker(t,e,n){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()})))}function mxCellHighlight(t,e,n,i){null!=t&&(this.graph=t,this.highlightColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=i&&i,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,(function(){if(null!=this.state){var t=this.graph.view.getState(this.state.cell);null==t?this.hide():(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))}function mxDefaultKeyHandler(t){if(null!=t){this.editor=t,this.handler=new mxKeyHandler(t.graph);var e=this.handler.escape;this.handler.escape=function(n){e.apply(this,arguments),t.hideProperties(),t.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",n))}}}function mxDefaultPopupMenu(t){this.config=t}function mxDefaultToolbar(t,e){this.editor=e,null!=t&&null!=e&&this.init(t)}function mxEditor(t){this.actions=[],this.addActions(),null!=document.body&&(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,null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,(function(){this.destroy()}))))}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=void 0!==mxStyleRegistry?mxStyleRegistry:void 0,mxGraphView.prototype=new mxEventSource,mxGraphView.prototype.constructor=mxGraphView,mxGraphView.prototype.EMPTY_POINT=new mxPoint,mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"",mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"",mxGraphView.prototype.allowEval=!1,mxGraphView.prototype.captureDocumentGesture=!0,mxGraphView.prototype.optimizeVmlReflows=!0,mxGraphView.prototype.rendering=!0,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=!1,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(null!=t&&t.length>0)for(var n=this.graph.getModel(),i=0;i<t.length;i++)if(n.isVertex(t[i])||n.isEdge(t[i])){var s=this.getState(t[i]);null!=s&&(null==e?e=mxRectangle.fromRectangle(s):e.add(s))}return e},mxGraphView.prototype.setCurrentRoot=function(t){if(this.currentRoot!=t){var e=new mxCurrentRootChange(this,t);e.execute();var n=new mxUndoableEdit(this,!0);n.add(e),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()}return t},mxGraphView.prototype.scaleAndTranslate=function(t,e,n){var i=this.scale,s=new mxPoint(this.translate.x,this.translate.y);this.scale==t&&this.translate.x==e&&this.translate.y==n||(this.scale=t,this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",t,"previousScale",i,"translate",this.translate,"previousTranslate",s))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(t){var e=this.scale;this.scale!=t&&(this.scale=t,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 n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==t&&this.translate.y==e||(this.translate.x=t,this.translate.y=e,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.viewStateChanged=function(){this.revalidate(),this.graph.sizeDidChange()},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(t,e,n){var i=this.graph.getModel();if(t=t||i.getRoot(),e=null!=e&&e,n=null==n||n,this.removeState(t),n&&(e||t!=this.currentRoot))for(var s=i.getChildCount(t),r=0;r<s;r++)this.clear(i.getChildAt(t,r),e);else this.invalidate(t)},mxGraphView.prototype.invalidate=function(t,e,n){var i=this.graph.getModel();t=t||i.getRoot(),e=null==e||e,n=null==n||n;var s=this.getState(t);if(null!=s&&(s.invalid=!0),!t.invalidating){if(t.invalidating=!0,e)for(var r=i.getChildCount(t),o=0;o<r;o++){var l=i.getChildAt(t,o);this.invalidate(l,e,n)}if(n){var a=i.getEdgeCount(t);for(o=0;o<a;o++)this.invalidate(i.getEdgeAt(t,o),e,n)}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 n=null;this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode&&!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),n=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 i=this.getBoundingBox(this.validateCellState(this.validateCell(t||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()))));this.setGraphBounds(null!=i?i:this.getEmptyBounds()),this.validateBackground(),null!=n&&(this.canvas.style.display=n,this.textDiv.parentNode.removeChild(this.textDiv),null!=this.placeholder&&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=null==e||e;var n=null;if(null!=t&&(null!=t.shape&&null!=t.shape.boundingBox&&(n=t.shape.boundingBox.clone()),null!=t.text&&null!=t.text.boundingBox&&(null!=n?n.add(t.text.boundingBox):n=t.text.boundingBox.clone()),e))for(var i=this.graph.getModel(),s=i.getChildCount(t.cell),r=0;r<s;r++){var o=this.getBoundingBox(this.getState(i.getChildAt(t.cell,r)));null!=o&&(null==n?n=o:n.add(o))}return n},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(null!=t){if(null==this.backgroundImage||this.backgroundImage.image!=t.src){null!=this.backgroundImage&&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(),8!=document.documentMode||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 null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null)},mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var t=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),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){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),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))})))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.graph.pageFormat,e=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,t.width*e,t.height*e)},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){if(e=null==e||e,null!=t)if(e=e&&this.graph.isCellVisible(t),null==this.getState(t,e)||e)for(var n=this.graph.getModel(),i=n.getChildCount(t),s=0;s<i;s++)this.validateCell(n.getChildAt(t,s),e&&(!this.isCellCollapsed(t)||t==this.currentRoot));else this.removeState(t);return t},mxGraphView.prototype.validateCellState=function(t,e){e=null==e||e;var n=null;if(null!=t&&null!=(n=this.getState(t))){var i=this.graph.getModel();if(n.invalid&&(n.invalid=!1,(null==n.style||n.invalidStyle)&&(n.style=this.graph.getCellStyle(n.cell),n.invalidStyle=!1),t!=this.currentRoot&&this.validateCellState(i.getParent(t),!1),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!0),!1),!0),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!1),!1),!1),this.updateCellState(n),t==this.currentRoot||n.invalid||(this.graph.cellRenderer.redraw(n,!1,this.isRendering()),n.updateCachedBounds())),e&&!n.invalid){null!=n.shape&&this.stateValidated(n);for(var s=i.getChildCount(t),r=0;r<s;r++)this.validateCellState(i.getChildAt(t,r))}}return n},mxGraphView.prototype.updateCellState=function(t){if(t.absoluteOffset.x=0,t.absoluteOffset.y=0,t.origin.x=0,t.origin.y=0,t.length=0,t.cell!=this.currentRoot){var e=this.graph.getModel(),n=this.getState(e.getParent(t.cell));null!=n&&n.cell!=this.currentRoot&&(t.origin.x+=n.origin.x,t.origin.y+=n.origin.y);var i=this.graph.getChildOffsetForCell(t.cell);null!=i&&(t.origin.x+=i.x,t.origin.y+=i.y);var s=this.graph.getCellGeometry(t.cell);if(null!=s){if(!e.isEdge(t.cell))if(i=null!=s.offset?s.offset:this.EMPTY_POINT,s.relative&&null!=n)if(e.isEdge(n.cell)){var r=this.getPoint(n,s);null!=r&&(t.origin.x+=r.x/this.scale-n.origin.x-this.translate.x,t.origin.y+=r.y/this.scale-n.origin.y-this.translate.y)}else t.origin.x+=s.x*n.unscaledWidth+i.x,t.origin.y+=s.y*n.unscaledHeight+i.y;else t.absoluteOffset.x=this.scale*i.x,t.absoluteOffset.y=this.scale*i.y,t.origin.x+=s.x,t.origin.y+=s.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*s.width,t.unscaledWidth=s.width,t.height=this.scale*s.height,t.unscaledHeight=s.height,e.isVertex(t.cell)&&this.updateVertexState(t,s),e.isEdge(t.cell)&&this.updateEdgeState(t,s)}}t.updateCachedBounds()},mxGraphView.prototype.isCellCollapsed=function(t){return this.graph.isCellCollapsed(t)},mxGraphView.prototype.updateVertexState=function(t,e){var n=this.graph.getModel(),i=this.getState(n.getParent(t.cell));if(e.relative&&null!=i&&!n.isEdge(i.cell)){var s=mxUtils.toRadians(i.style[mxConstants.STYLE_ROTATION]||"0");if(0!=s){var r=Math.cos(s),o=Math.sin(s),l=new mxPoint(t.getCenterX(),t.getCenterY()),a=new mxPoint(i.getCenterX(),i.getCenterY()),h=mxUtils.getRotatedPoint(l,r,o,a);t.x=h.x-t.width/2,t.y=h.y-t.height/2}}this.updateVertexLabelOffset(t)},mxGraphView.prototype.updateEdgeState=function(t,e){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1);if(null!=this.graph.model.getTerminal(t.cell,!0)&&null==n||null==n&&null==e.getTerminalPoint(!0)||null!=this.graph.model.getTerminal(t.cell,!1)&&null==i||null==i&&null==e.getTerminalPoint(!1))this.clear(t.cell,!0);else{this.updateFixedTerminalPoints(t,n,i),this.updatePoints(t,e.points,n,i),this.updateFloatingTerminalPoints(t,n,i);var s=t.absolutePoints;t.cell!=this.currentRoot&&(null==s||s.length<2||null==s[0]||null==s[s.length-1])?this.clear(t.cell,!0):(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)null!=(n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))?n*=this.scale:n=t.width,t.absoluteOffset.x-=n;else if(e==mxConstants.ALIGN_RIGHT)t.absoluteOffset.x+=t.width;else if(e==mxConstants.ALIGN_CENTER){var n;if(null!=(n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))){var i=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),s=0;i==mxConstants.ALIGN_CENTER?s=.5:i==mxConstants.ALIGN_RIGHT&&(s=1),0!=s&&(t.absoluteOffset.x-=(n*this.scale-t.width)*s)}}var r=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);r==mxConstants.ALIGN_TOP?t.absoluteOffset.y-=t.height:r==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,n=e&&this.lastForegroundHtmlNode||this.lastHtmlNode,i=e&&this.lastForegroundNode||this.lastNode,s=this.graph.cellRenderer.insertStateAfter(t,i,n);e?(this.lastForegroundHtmlNode=s[1],this.lastForegroundNode=s[0]):(this.lastHtmlNode=s[1],this.lastNode=s[0])},mxGraphView.prototype.updateFixedTerminalPoints=function(t,e,n){this.updateFixedTerminalPoint(t,e,!0,this.graph.getConnectionConstraint(t,e,!0)),this.updateFixedTerminalPoint(t,n,!1,this.graph.getConnectionConstraint(t,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(t,e,n,i),n)},mxGraphView.prototype.getFixedTerminalPoint=function(t,e,n,i){var s=null;if(null!=i&&(s=this.graph.getConnectionPoint(e,i,!1)),null==s&&null==e){var r=this.scale,o=this.translate,l=t.origin;null!=(s=this.graph.getCellGeometry(t.cell).getTerminalPoint(n))&&(s=new mxPoint(r*(o.x+s.x+l.x),r*(o.y+s.y+l.y)))}return s},mxGraphView.prototype.updateBoundsFromStencil=function(t){var e=null;if(null!=t&&null!=t.shape&&null!=t.shape.stencil&&"fixed"==t.shape.stencil.aspect){e=mxRectangle.fromRectangle(t);var n=t.shape.stencil.computeAspect(t.style,t.x,t.y,t.width,t.height);t.setRect(n.x,n.y,t.shape.stencil.w0*n.width,t.shape.stencil.h0*n.height)}return e},mxGraphView.prototype.updatePoints=function(t,e,n,i){if(null!=t){var s=[];s.push(t.absolutePoints[0]);var r=this.getEdgeStyle(t,e,n,i);if(null!=r){var o=this.getTerminalPort(t,n,!0),l=this.getTerminalPort(t,i,!1),a=this.updateBoundsFromStencil(o),h=this.updateBoundsFromStencil(l);r(t,o,l,e,s),null!=a&&o.setRect(a.x,a.y,a.width,a.height),null!=h&&l.setRect(h.x,h.y,h.width,h.height)}else if(null!=e)for(var u=0;u<e.length;u++)if(null!=e[u]){var d=mxUtils.clone(e[u]);s.push(this.transformControlPoint(t,d))}var p=t.absolutePoints;s.push(p[p.length-1]),t.absolutePoints=s}},mxGraphView.prototype.transformControlPoint=function(t,e,n){if(null!=t&&null!=e){var i=t.origin,s=n?1:this.scale;return new mxPoint(s*(e.x+this.translate.x+i.x),s*(e.y+this.translate.y+i.y))}return null},mxGraphView.prototype.isLoopStyleEnabled=function(t,e,n,i){var s=this.graph.getConnectionConstraint(t,n,!0),r=this.graph.getConnectionConstraint(t,i,!1);return!(!(null==e||e.length<2)||mxUtils.getValue(t.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=s&&null!=s.point||null!=r&&null!=r.point))&&(null!=n&&n==i)},mxGraphView.prototype.getEdgeStyle=function(t,e,n,i){var s=this.isLoopStyleEnabled(t,e,n,i)?mxUtils.getValue(t.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(t.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:t.style[mxConstants.STYLE_EDGE];if("string"==typeof s){var r=mxStyleRegistry.getValue(s);null==r&&this.isAllowEval()&&(r=mxUtils.eval(s)),s=r}return"function"==typeof s?s:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(t,e,n){var i=t.absolutePoints,s=i[0];null==i[i.length-1]&&null!=n&&this.updateFloatingTerminalPoint(t,n,e,!1),null==s&&null!=e&&this.updateFloatingTerminalPoint(t,e,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(t,e,n,i),i)},mxGraphView.prototype.getFloatingTerminalPoint=function(t,e,n,i){e=this.getTerminalPort(t,e,i);var s=this.getNextPoint(t,n,i),r=this.graph.isOrthogonal(t),o=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0")),l=new mxPoint(e.getCenterX(),e.getCenterY());if(0!=o){var a=Math.cos(-o),h=Math.sin(-o);s=mxUtils.getRotatedPoint(s,a,h,l)}var u=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0);u+=parseFloat(t.style[i?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);var d=this.getPerimeterPoint(e,s,0==o&&r,u);if(0!=o){a=Math.cos(o),h=Math.sin(o);d=mxUtils.getRotatedPoint(d,a,h,l)}return d},mxGraphView.prototype.getTerminalPort=function(t,e,n){var i=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,s=mxUtils.getValue(t.style,i);if(null!=s){var r=this.getState(this.graph.getModel().getCell(s));null!=r&&(e=r)}return e},mxGraphView.prototype.getPerimeterPoint=function(t,e,n,i){var s=null;if(null!=t){var r=this.getPerimeterFunction(t);if(null!=r&&null!=e){var o=this.getPerimeterBounds(t,i);if(o.width>0||o.height>0){s=new mxPoint(e.x,e.y);var l=!1,a=!1;this.graph.model.isVertex(t.cell)&&(l=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),a=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(l=1==mxUtils.getValue(t.style,"stencilFlipH",0)||l,a=1==mxUtils.getValue(t.style,"stencilFlipV",0)||a),l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y)),null!=(s=r(o,t,s,n))&&(l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y))}}null==s&&(s=this.getPoint(t))}return s},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if("string"==typeof e){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,n){var i=t.absolutePoints,s=null;if(null!=i&&i.length>=2){var r=i.length;s=i[n?Math.min(1,r-1):Math.max(0,r-2)]}return null==s&&null!=e&&(s=new mxPoint(e.getCenterX(),e.getCenterY())),s},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var n=this.graph.getModel(),i=n.getTerminal(t,e),s=i;null!=i&&i!=this.currentRoot;)this.graph.isCellVisible(s)&&!this.isCellCollapsed(i)||(s=i),i=n.getParent(i);return null==s||n.contains(s)&&n.getParent(s)!=n.getRoot()&&s!=this.currentRoot||(s=null),s},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,n=e[0],i=e[e.length-1];if(n.x!=i.x||n.y!=i.y){var s=i.x-n.x,r=i.y-n.y;t.terminalDistance=Math.sqrt(s*s+r*r)}else t.terminalDistance=0;var o=0,l=[],a=n;if(null!=a){for(var h=a.x,u=a.y,d=h,p=u,m=1;m<e.length;m++){var c=e[m];if(null!=c){s=a.x-c.x,r=a.y-c.y;var x=Math.sqrt(s*s+r*r);l.push(x),o+=x,a=c,h=Math.min(a.x,h),u=Math.min(a.y,u),d=Math.max(a.x,d),p=Math.max(a.y,p)}}t.length=o,t.segments=l;t.x=h,t.y=u,t.width=Math.max(1,d-h),t.height=Math.max(1,p-u)}},mxGraphView.prototype.getPoint=function(t,e){var n=t.getCenterX(),i=t.getCenterY();if(null==t.segments||null!=e&&!e.relative){if(null!=e){null!=(m=e.offset)&&(n+=m.x,i+=m.y)}}else{for(var s=null!=e?e.x/2:0,r=t.absolutePoints.length,o=Math.round((s+.5)*t.length),l=t.segments[0],a=0,h=1;o>=Math.round(a+l)&&h<r-1;)a+=l,l=t.segments[h++];var u=0==l?0:(o-a)/l,d=t.absolutePoints[h-1],p=t.absolutePoints[h];if(null!=d&&null!=p){var m,c=0,x=0,g=0;if(null!=e)c=e.y,null!=(m=e.offset)&&(x=m.x,g=m.y);var y=p.x-d.x,f=p.y-d.y,v=0==l?0:f/l,C=0==l?0:y/l;n=d.x+y*u+(v*c+x)*this.scale,i=d.y+f*u-(C*c-g)*this.scale}}return new mxPoint(n,i)},mxGraphView.prototype.getRelativePoint=function(t,e,n){var i=this.graph.getModel().getGeometry(t.cell);if(null!=i){var s=t.absolutePoints.length;if(i.relative&&s>1){for(var r=t.length,o=t.segments,l=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n),u=0,d=0,p=0,m=2;m<s;m++){d+=o[m-2],a=t.absolutePoints[m];var c=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n);c<=h&&(h=c,u=m-1,p=d),l=a}var x=o[u];l=t.absolutePoints[u],a=t.absolutePoints[u+1];var g=l.x,y=l.y,f=a.x,v=a.y,C=e,E=n,S=g-f,T=y-v,b=0,w=(C=S-(C-=f))*S+(E=T-(E-=v))*T;b=w<=0?0:w*w/(S*S+T*T);var L=Math.sqrt(b);L>x&&(L=x);var I=Math.sqrt(mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n));return-1==mxUtils.relativeCcw(l.x,l.y,a.x,a.y,e,n)&&(I=-I),new mxPoint((r/2-p-L)/r*-2,I/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=e&&e.length>0&&null!=t.segments){var n=this.graph.getCellGeometry(t.cell);if(n.relative){var i=this.getPoint(t,n);null!=i&&(t.absoluteOffset=i)}else{var s=e[0],r=e[e.length-1];if(null!=s&&null!=r){var o=r.x-s.x,l=r.y-s.y,a=0,h=0,u=n.offset;null!=u&&(a=u.x,h=u.y);var d=s.x+o/2+a*this.scale,p=s.y+l/2+h*this.scale;t.absoluteOffset.x=d,t.absoluteOffset.y=p}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var n=null;return null!=t&&(n=this.states.get(t),e&&(null==n||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==n?(n=this.createState(t),this.states.put(t,n)):n.style=this.graph.getCellStyle(t))),n},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(null==t)return this.states;for(var e=[],n=0;n<t.length;n++){var i=this.getState(t[n]);null!=i&&e.push(i)}return e},mxGraphView.prototype.removeState=function(t){var e=null;return null!=t&&null!=(e=this.states.remove(t))&&(this.graph.cellRenderer.destroy(e),e.invalid=!0,e.destroy()),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||null!=e.parentNode&&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),n=new mxPoint(t.clientX-e.x,t.clientY-e.y),i=this.graph.container.offsetWidth,s=this.graph.container.clientWidth;if(i>s&&n.x>s+2&&n.x<=i)return!0;var r=this.graph.container.offsetHeight,o=this.graph.container.clientHeight;return r>o&&n.y>o+2&&n.y<=r},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(null!=e){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 n=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){!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)),n=e.pointerId)})),mxUtils.bind(this,(function(e){!this.isContainerEvent(e)||null!=n&&e.pointerId!=n||t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e)),n=null}))),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.dblClick(e)})));t.addMouseListener({mouseDown:function(e,n){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,(function(n){null!=t.tooltipHandler&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(n)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&!mxEvent.isConsumed(n)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(n,function(n){var i=null;if(mxClient.IS_TOUCH){var s=mxEvent.getClientX(n),r=mxEvent.getClientY(n),o=mxUtils.convertPoint(e,s,r);i=t.view.getState(t.getCellAt(o.x,o.y))}return i}(n)))})),this.endHandler=mxUtils.bind(this,(function(e){this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(e)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&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(null!=t&&(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),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds(),n=e.x+e.width+this.graph.border,i=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(n,i)}));mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(null!=this.graph.container){var n=this.graph.container.offsetWidth,i=this.graph.container.offsetHeight;this.canvas.style.width=n<t?t+"px":"100%",this.canvas.style.height=i<e?e+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(t,e){var n=document.createElement("DIV");return null!=t&&null!=e?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t,n.style.height=e):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var t=this.graph.container;if(null!=t){var e=t.offsetWidth,n=t.offsetHeight;this.canvas=this.createVmlPane(e,n),this.canvas.style.overflow="hidden",this.backgroundPane=this.createVmlPane(e,n),this.drawPane=this.createVmlPane(e,n),this.overlayPane=this.createVmlPane(e,n),this.decoratorPane=this.createVmlPane(e,n),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 n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t+"px",n.style.height=e+"px",n.setAttribute("coordsize",t+","+e),n.setAttribute("coordorigin","0,0"),n},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),(mxClient.IS_IE||mxClient.IS_IE11)&&(e.style.overflow="hidden"),null!=t&&(t.appendChild(e),this.updateContainerStyle(t))},mxGraphView.prototype.updateContainerStyle=function(t){var e=mxUtils.getCurrentStyle(t);null!=e&&"static"==e.position&&(t.style.position="relative"),mxClient.IS_POINTER&&(t.style.touchAction="none")},mxGraphView.prototype.destroy=function(){var t=null!=this.canvas?this.canvas.ownerSVGElement:null;null==t&&(t=this.canvas),null!=t&&null!=t.parentNode&&(this.clear(this.currentRoot,!0),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)},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);null!=e&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();var n=this.isUp?mxEvent.UP:mxEvent.DOWN;this.view.fireEvent(new mxEventObject(n,"root",this.view.currentRoot,"previous",this.previous)),this.isUp=!this.isUp},__mxOutput.mxGraphView=void 0!==mxGraphView?mxGraphView:void 0,mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph"),mxGraph.prototype=new mxEventSource,mxGraph.prototype.constructor=mxGraph,mxGraph.prototype.mouseListeners=null,mxGraph.prototype.isMouseDown=!1,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=!0,mxGraph.prototype.portsEnabled=!0,mxGraph.prototype.nativeDblClickEnabled=!0,mxGraph.prototype.doubleTapEnabled=!0,mxGraph.prototype.doubleTapTimeout=500,mxGraph.prototype.doubleTapTolerance=25,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchY=0,mxGraph.prototype.lastTouchTime=0,mxGraph.prototype.tapAndHoldEnabled=!0,mxGraph.prototype.tapAndHoldDelay=500,mxGraph.prototype.tapAndHoldInProgress=!1,mxGraph.prototype.tapAndHoldValid=!1,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=!1,mxGraph.prototype.pageBreaksVisible=!1,mxGraph.prototype.pageBreakColor="gray",mxGraph.prototype.pageBreakDashed=!0,mxGraph.prototype.minPageBreakDist=20,mxGraph.prototype.preferPageSize=!1,mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT,mxGraph.prototype.pageScale=1.5,mxGraph.prototype.enabled=!0,mxGraph.prototype.escapeEnabled=!0,mxGraph.prototype.invokesStopCellEditing=!0,mxGraph.prototype.enterStopsCellEditing=!1,mxGraph.prototype.useScrollbarsForPanning=!0,mxGraph.prototype.exportEnabled=!0,mxGraph.prototype.importEnabled=!0,mxGraph.prototype.cellsLocked=!1,mxGraph.prototype.cellsCloneable=!0,mxGraph.prototype.foldingEnabled=!0,mxGraph.prototype.cellsEditable=!0,mxGraph.prototype.cellsDeletable=!0,mxGraph.prototype.cellsMovable=!0,mxGraph.prototype.edgeLabelsMovable=!0,mxGraph.prototype.vertexLabelsMovable=!1,mxGraph.prototype.dropEnabled=!1,mxGraph.prototype.splitEnabled=!0,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoSizeCellsOnAdd=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.translateToScrollPosition=!1,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!1,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.constrainRelativeChildren=!1,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.extendParentsOnMove=!1,mxGraph.prototype.recursiveResize=!1,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,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="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"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){null!=this.tooltipHandler&&null!=this.tooltipHandler.div&&this.tooltipHandler.div!=t.relatedTarget&&this.tooltipHandler.hide()}))),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)})))),8==document.documentMode&&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(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,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){for(var n=new mxDictionary,i=[],s=mxUtils.bind(this,(function(t){if(!n.get(t)&&this.model.contains(t))if(this.model.isEdge(t)||this.model.isVertex(t))n.put(t,!0),i.push(t);else for(var e=this.model.getChildCount(t),r=0;r<e;r++)s(this.model.getChildAt(t,r))})),r=0;r<t.length;r++){var o=t[r];if(o.constructor!=mxRootChange&&(null==e||!e(o))){var l=null;o instanceof mxChildChange?l=o.child:null!=o.cell&&o.cell instanceof mxCell&&(l=o.cell),null!=l&&s(l)}}return i},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(){for(var t=this.getSelectionCells(),e=[],n=0;n<t.length;n++)if(this.model.contains(t[n])&&this.isCellVisible(t[n]))for(var i=this.model.getParent(t[n]);null!=i&&i!=this.view.currentRoot;){if(this.isCellCollapsed(i)||!this.isCellVisible(i)){e.push(t[n]);break}i=this.model.getParent(i)}else e.push(t[n]);this.removeSelectionCells(e)},mxGraph.prototype.processChange=function(t){if(t instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(t.previous),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,!0,!0),this.model.contains(e)&&!this.isCellCollapsed(e)||(this.view.invalidate(t.child,!0,!0),this.removeStateForCell(t.child),this.view.currentRoot==t.child&&this.home()),e!=t.previous&&(null!=e&&this.view.invalidate(e,!1,!1),null!=t.previous&&this.view.invalidate(t.previous,!1,!1))}else if(t instanceof mxTerminalChange||t instanceof mxGeometryChange)(t instanceof mxTerminalChange||null==t.previous&&null!=t.geometry||null!=t.previous&&!t.previous.equals(t.geometry))&&this.view.invalidate(t.cell);else if(t instanceof mxValueChange)this.view.invalidate(t.cell,!1,!1);else if(t instanceof mxStyleChange){this.view.invalidate(t.cell,!0,!0);var n=this.view.getState(t.cell);null!=n&&(n.invalidStyle=!0)}else null!=t.cell&&t.cell instanceof mxCell&&this.removeStateForCell(t.cell)},mxGraph.prototype.removeStateForCell=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.removeStateForCell(this.model.getChildAt(t,n));this.view.invalidate(t,!1,!0),this.view.removeState(t)},mxGraph.prototype.addCellOverlay=function(t,e){null==t.overlays&&(t.overlays=[]),t.overlays.push(e);var n=this.view.getState(t);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",t,"overlay",e)),e},mxGraph.prototype.getCellOverlays=function(t){return t.overlays},mxGraph.prototype.removeCellOverlay=function(t,e){if(null==e)this.removeCellOverlays(t);else{var n=mxUtils.indexOf(t.overlays,e);if(n>=0){t.overlays.splice(n,1),0==t.overlays.length&&(t.overlays=null);var i=this.view.getState(t);null!=i&&this.cellRenderer.redraw(i),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(null!=e){t.overlays=null;var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n);for(var i=0;i<e.length;i++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e[i]))}return e},mxGraph.prototype.clearCellOverlays=function(t){t=null!=t?t:this.model.getRoot(),this.removeCellOverlays(t);for(var e=this.model.getChildCount(t),n=0;n<e;n++){var i=this.model.getChildAt(t,n);this.clearCellOverlays(i)}},mxGraph.prototype.setCellWarning=function(t,e,n,i){if(null!=e&&e.length>0){var s=new mxCellOverlay(n=null!=n?n:this.warningImage,"<font color=red>"+e+"</font>");return i&&s.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,n){this.isEnabled()&&this.setSelectionCell(t)}))),this.addCellOverlay(t,s)}return this.removeCellOverlays(t),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(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,n){this.model.beginUpdate();try{var i=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",i,"event",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,n){this.model.beginUpdate();try{this.model.setValue(t,e),n&&this.cellSizeUpdated(t,!1)}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(),n=t.getCell(),i=new mxEventObject(mxEvent.CLICK,"event",e,"cell",n);if(t.isConsumed()&&i.consume(),this.fireEvent(i),this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed()){if(null!=n){if(this.isTransparentClickEvent(e)){var s=!1,r=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);return!(s=s||e)||e||t.cell!=n&&this.model.isAncestor(t.cell,n)})));null!=r&&(n=r)}}else if(this.isSwimlaneSelectionEnabled()&&!(null==(n=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()))||this.isToggleEvent(e)&&mxEvent.isAltDown(e))){for(var o=n,l=[];null!=o;){o=this.model.getParent(o);var a=this.view.getState(o);this.isSwimlane(o)&&null!=a&&l.push(o)}if(l.length>0){(l=l.reverse()).splice(0,0,n),l.push(n);for(var h=0;h<l.length-1;h++)this.isCellSelected(l[h])&&(n=l[this.isToggleEvent(e)?h:h+1])}}null!=n?this.selectCellForEvent(n,e):this.isToggleEvent(e)||this.clearSelection()}},mxGraph.prototype.isSiblingSelected=function(t){for(var e=this.model,n=e.getParent(t),i=e.getChildCount(n),s=0;s<i;s++){var r=e.getChildAt(n,s);if(t!=r&&this.isCellSelected(r))return!0}return!1},mxGraph.prototype.dblClick=function(t,e){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(n),!this.isEnabled()||mxEvent.isConsumed(t)||n.isConsumed()||null==e||!this.isCellEditable(e)||this.isEditing(e)||(this.startEditingAtCell(e,t),mxEvent.consume(t))},mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent(),n=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());if(this.fireEvent(n),n.isConsumed()&&(this.panningHandler.panningTrigger=!1),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()&&this.connectionHandler.isEnabled()){var i=this.view.getState(this.connectionHandler.marker.getCell(t));null!=i&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=i,this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t),this.connectionHandler.previous=i,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous)))}},mxGraph.prototype.scrollPointToVisible=function(t,e,n,i){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(t+this.panDx,e+this.panDy));else{var s=this.container;if(i=null!=i?i:20,t>=s.scrollLeft&&e>=s.scrollTop&&t<=s.scrollLeft+s.clientWidth&&e<=s.scrollTop+s.clientHeight){var r=s.scrollLeft+s.clientWidth-t;if(r<i){var o=s.scrollLeft;if(s.scrollLeft+=i-r,n&&o==s.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){var l=this.view.getDrawPane().ownerSVGElement,a=this.container.scrollWidth+i-r;l.style.width=a+"px"}else{a=Math.max(s.clientWidth,s.scrollWidth)+i-r;this.view.getCanvas().style.width=a+"px"}s.scrollLeft+=i-r}}else(r=t-s.scrollLeft)<i&&(s.scrollLeft-=i-r);var h=s.scrollTop+s.clientHeight-e;if(h<i){o=s.scrollTop;if(s.scrollTop+=i-h,o==s.scrollTop&&n){if(this.dialect==mxConstants.DIALECT_SVG){l=this.view.getDrawPane().ownerSVGElement;var u=this.container.scrollHeight+i-h;l.style.height=u+"px"}else{u=Math.max(s.clientHeight,s.scrollHeight)+i-h;this.view.getCanvas().style.height=u+"px"}s.scrollTop+=i-h}}else(h=e-s.scrollTop)<i&&(s.scrollTop-=i-h)}}},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)+("none"!=t.borderLeftStyle?mxUtils.parseCssNumber(t.borderLeftWidth):0),mxUtils.parseCssNumber(t.paddingTop)+("none"!=t.borderTopStyle?mxUtils.parseCssNumber(t.borderTopWidth):0),mxUtils.parseCssNumber(t.paddingRight)+("none"!=t.borderRightStyle?mxUtils.parseCssNumber(t.borderRightWidth):0),mxUtils.parseCssNumber(t.paddingBottom)+("none"!=t.borderBottomStyle?mxUtils.parseCssNumber(t.borderBottomWidth):0))},mxGraph.prototype.getPreferredPageSize=function(t,e,n){this.view.scale;var i=this.view.translate,s=this.pageFormat,r=this.pageScale,o=new mxRectangle(0,0,Math.ceil(s.width*r),Math.ceil(s.height*r)),l=this.pageBreaksVisible?Math.ceil(e/o.width):1,a=this.pageBreaksVisible?Math.ceil(n/o.height):1;return new mxRectangle(0,0,l*o.width+2+i.x,a*o.height+2+i.y)},mxGraph.prototype.fit=function(t,e,n,i,s,r,o){if(null!=this.container){t=null!=t?t:this.getBorder(),e=null!=e&&e,n=null!=n?n:0,i=null==i||i,s=null!=s&&s,r=null!=r&&r;var l=this.getBorderSizes(),a=this.container.offsetWidth-l.x-l.width-1,h=null!=o?o:this.container.offsetHeight-l.y-l.height-1,u=this.view.getGraphBounds();if(u.width>0&&u.height>0){e&&null!=u.x&&null!=u.y&&((u=u.clone()).width+=u.x,u.height+=u.y,u.x=0,u.y=0);var d=this.view.scale,p=u.width/d,m=u.height/d;null!=this.backgroundImage&&(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)+n+1;a-=c,h-=c;var x=s?h/m:r?a/p:Math.min(a/p,h/m);if(null!=this.minFitScale&&(x=Math.max(x,this.minFitScale)),null!=this.maxFitScale&&(x=Math.min(x,this.maxFitScale)),!i)return x;if(e)this.view.scale!=x&&this.view.setScale(x);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(x);var g=this.getGraphBounds();null!=g.x&&(this.container.scrollLeft=g.x),null!=g.y&&(this.container.scrollTop=g.y)}else{var y=null!=u.x?Math.floor(this.view.translate.x-u.x/d+t/x+n/2):t,f=null!=u.y?Math.floor(this.view.translate.y-u.y/d+t/x+n/2):t;this.view.scaleAndTranslate(x,y,f)}}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(null!=this.container){var e=this.getBorder(),n=Math.max(0,t.x)+t.width+2*e,i=Math.max(0,t.y)+t.height+2*e;if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),i=Math.max(i,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,i),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var s=this.getPreferredPageSize(t,Math.max(1,n),Math.max(1,i));null!=s&&(n=s.width*this.view.scale,i=s.height*this.view.scale)}if(null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),i=Math.max(i,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n),i=Math.ceil(i),this.dialect==mxConstants.DIALECT_SVG){var r=this.view.getDrawPane().ownerSVGElement;null!=r&&(r.style.minWidth=Math.max(1,n)+"px",r.style.minHeight=Math.max(1,i)+"px",r.style.width="100%",r.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,i)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,i)+"px");this.updatePageBreaks(this.pageBreaksVisible,n,i)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(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,n){var i=this.view.scale,s=this.view.translate,r=this.pageFormat,o=i*this.pageScale,l=new mxRectangle(0,0,r.width*o,r.height*o),a=mxRectangle.fromRectangle(this.getGraphBounds());a.width=Math.max(1,a.width),a.height=Math.max(1,a.height),l.x=Math.floor((a.x-s.x*i)/l.width)*l.width+s.x*i,l.y=Math.floor((a.y-s.y*i)/l.height)*l.height+s.y*i,a.width=Math.ceil((a.width+(a.x-l.x))/l.width)*l.width,a.height=Math.ceil((a.height+(a.y-l.y))/l.height)*l.height;var h=(t=t&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(a.height/l.height)+1:0,u=t?Math.ceil(a.width/l.width)+1:0,d=(u-1)*l.width,p=(h-1)*l.height;null==this.horizontalPageBreaks&&h>0&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&u>0&&(this.verticalPageBreaks=[]);var m=mxUtils.bind(this,(function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:u,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+n*l.height)),new mxPoint(Math.round(l.x+d),Math.round(l.y+n*l.height))]:[new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y)),new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y+p))];if(null!=t[n])t[n].points=i,t[n].redraw();else{var s=new mxPolyline(i,this.pageBreakColor);s.dialect=this.dialect,s.pointerEvents=!1,s.isDashed=this.pageBreakDashed,s.init(this.view.backgroundPane),s.redraw(),t[n]=s}}for(n=e;n<t.length;n++)t[n].destroy();t.splice(e,t.length-e)}}));m(this.horizontalPageBreaks),m(this.verticalPageBreaks)},mxGraph.prototype.getCurrentCellStyle=function(t,e){var n=e?null:this.view.getState(t);return null!=n?n.style:this.getCellStyle(t)},mxGraph.prototype.getCellStyle=function(t){var e=this.model.getStyle(t),n=null;return n=this.model.isEdge(t)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle(),null!=e&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(e,n))),null==n&&(n=new Object),n},mxGraph.prototype.postProcessCellStyle=function(t){if(null!=t){var e=t[mxConstants.STYLE_IMAGE],n=this.getImageFromBundles(e);if(null!=n?t[mxConstants.STYLE_IMAGE]=n:n=e,null!=n&&"data:image/"==n.substring(0,11)){if("data:image/svg+xml,<"==n.substring(0,20))n=n.substring(0,19)+encodeURIComponent(n.substring(19));else if("data:image/svg+xml,%3C"!=n.substring(0,22)){var i=n.indexOf(",");i>0&&";base64,"!=n.substring(i-7,i+1)&&(n=n.substring(0,i)+";base64,"+n.substring(i+1))}t[mxConstants.STYLE_IMAGE]=n}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setStyle(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(t,e,n){return n=n||this.getSelectionCell(),this.toggleCellStyles(t,e,[n])},mxGraph.prototype.toggleCellStyles=function(t,e,n){e=null!=e&&e;var i=null;if(null!=(n=n||this.getSelectionCells())&&n.length>0){var s=this.getCurrentCellStyle(n[0]);i=mxUtils.getValue(s,t,e)?0:1,this.setCellStyles(t,i,n)}return i},mxGraph.prototype.setCellStyles=function(t,e,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,n){this.setCellStyleFlags(t,e,null,n)},mxGraph.prototype.setCellStyleFlags=function(t,e,n,i){if(null!=(i=i||this.getSelectionCells())&&i.length>0){if(null==n){var s=this.getCurrentCellStyle(i[0]);n=!((parseInt(s[t]||0)&e)==e)}mxUtils.setCellStyleFlags(this.model,i,t,e,n)}},mxGraph.prototype.alignCells=function(t,e,n){if(null==e&&(e=this.getSelectionCells()),null!=e&&e.length>1){if(null==n)for(var i=0;i<e.length;i++){if(null!=(r=this.view.getState(e[i]))&&!this.model.isEdge(e[i]))if(null==n){if(t==mxConstants.ALIGN_CENTER){n=r.x+r.width/2;break}if(t==mxConstants.ALIGN_RIGHT)n=r.x+r.width;else if(t==mxConstants.ALIGN_TOP)n=r.y;else{if(t==mxConstants.ALIGN_MIDDLE){n=r.y+r.height/2;break}n=t==mxConstants.ALIGN_BOTTOM?r.y+r.height:r.x}}else n=t==mxConstants.ALIGN_RIGHT?Math.max(n,r.x+r.width):t==mxConstants.ALIGN_TOP?Math.min(n,r.y):t==mxConstants.ALIGN_BOTTOM?Math.max(n,r.y+r.height):Math.min(n,r.x)}if(null!=n){var s=this.view.scale;this.model.beginUpdate();try{for(i=0;i<e.length;i++){var r;if(null!=(r=this.view.getState(e[i]))){var o=this.getCellGeometry(e[i]);null==o||this.model.isEdge(e[i])||(o=o.clone(),t==mxConstants.ALIGN_CENTER?o.x+=(n-r.x-r.width/2)/s:t==mxConstants.ALIGN_RIGHT?o.x+=(n-r.x-r.width)/s:t==mxConstants.ALIGN_TOP?o.y+=(n-r.y)/s:t==mxConstants.ALIGN_MIDDLE?o.y+=(n-r.y-r.height/2)/s:t==mxConstants.ALIGN_BOTTOM?o.y+=(n-r.y-r.height)/s:o.x+=(n-r.x)/s,this.resizeCell(e[i],o))}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",e))}finally{this.model.endUpdate()}}}return e},mxGraph.prototype.flipEdge=function(t){if(null!=t&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var e=this.model.getStyle(t);null==e||0==e.length?this.model.setStyle(t,this.alternateEdgeStyle):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){for(var e=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=t&&e.push(this.imageBundles[n]);this.imageBundles=e},mxGraph.prototype.getImageFromBundles=function(t){if(null!=t)for(var e=0;e<this.imageBundles.length;e++){var n=this.imageBundles[e].getImage(t);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(t,e){null==e&&(e=mxUtils.sortCells(this.getSelectionCells(),!0)),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(null!=t){this.model.beginUpdate();try{for(var n=0;n<t.length;n++){var i=this.model.getParent(t[n]);e?this.model.add(i,t[n],n):this.model.add(i,t[n],this.model.getChildCount(i)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",e,"cells",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(t,e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==t&&(t=this.createGroupCell(n));var i=this.getBoundsForGroup(t,n,e);if(n.length>1&&null!=i){var s=this.model.getParent(t);null==s&&(s=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var r=this.model.getChildCount(s);this.cellsAdded([t],s,r,null,null,!1,!1,!1),r=this.model.getChildCount(t),this.cellsAdded(n,t,r,null,null,!1,!1,!1),this.cellsMoved(n,-i.x,-i.y,!1,!1,!1),this.cellsResized([t],[i],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",n))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&t.length>0){var n=this.model.getParent(t[0]);e.push(t[0]);for(var i=1;i<t.length;i++)this.model.getParent(t[i])==n&&e.push(t[i])}return e},mxGraph.prototype.getBoundsForGroup=function(t,e,n){var i=this.getBoundingBoxFromGeometry(e,!0);if(null!=i){if(this.isSwimlane(t)){var s=this.getStartSize(t);i.x-=s.width,i.y-=s.height,i.width+=s.width,i.height+=s.height}null!=n&&(i.x-=n,i.y-=n,i.width+=2*n,i.height+=2*n)}return i},mxGraph.prototype.createGroupCell=function(t){var e=new mxCell("");return e.setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(t){var e=[];if(null==t&&(t=this.getCellsForUngroup()),null!=t&&t.length>0){this.model.beginUpdate();try{for(var n=0;n<t.length;n++){var i=this.model.getChildren(t[n]);if(null!=i&&i.length>0){i=i.slice();var s=this.model.getParent(t[n]),r=this.model.getChildCount(s);this.cellsAdded(i,s,r,null,null,!0),e=e.concat(i);for(var o=0;o<i.length;o++){var l=this.view.getState(i[o]),a=this.getCellGeometry(i[o]);null!=l&&null!=a&&a.relative&&((a=a.clone()).x=l.origin.x,a.y=l.origin.y,a.relative=!1,this.model.setGeometry(i[o],a))}}}this.removeCellsAfterUngroup(t),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.getCellsForUngroup=function(){for(var t=this.getSelectionCells(),e=[],n=0;n<t.length;n++)this.model.isVertex(t[n])&&this.model.getChildCount(t[n])>0&&e.push(t[n]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),n=this.model.getChildCount(e);this.cellsAdded(t,e,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,n,i,s,r,o){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,n=null!=n&&n,i=null!=i?i:0,s=null!=s?s:0,r=null!=r?r:0,o=null!=o?o:0,this.model.beginUpdate();try{for(var l=t.length-1;l>=0;l--){var a=this.getCellGeometry(t[l]);if(null!=a){var h=this.getChildCells(t[l]);if(null!=h&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,!0);if(null!=u&&u.width>0&&u.height>0){var d=this.isSwimlane(t[l])?this.getActualStartSize(t[l],!0):new mxRectangle;a=a.clone(),n&&(a.x=Math.round(a.x+u.x-e-d.x-o),a.y=Math.round(a.y+u.y-e-d.y-i)),a.width=Math.round(u.width+2*e+d.x+o+s+d.width),a.height=Math.round(u.height+2*e+d.y+i+r+d.height),this.model.setGeometry(t[l],a),this.moveCells(h,e+d.x-u.x+o,e+d.y-u.y+i)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&t.length>0)for(var n=0;n<t.length;n++)if(this.model.isVertex(t[n])||this.model.isEdge(t[n])){var i=this.view.getBoundingBox(this.view.getState(t[n]),!0);null!=i&&(null==e?e=mxRectangle.fromRectangle(i):e.add(i))}return e},mxGraph.prototype.cloneCell=function(t,e,n,i){return this.cloneCells([t],e,n,i)[0]},mxGraph.prototype.cloneCells=function(t,e,n,i){e=null==e||e;var s=null;if(null!=t){for(var r=new mxDictionary,o=[],l=0;l<t.length;l++)r.put(t[l],!0),o.push(t[l]);if(o.length>0){var a=this.view.scale,h=this.view.translate;s=this.model.cloneCells(t,!0,n);for(l=0;l<t.length;l++)if(!e&&this.model.isEdge(s[l])&&null!=this.getEdgeValidationError(s[l],this.model.getTerminal(s[l],!0),this.model.getTerminal(s[l],!1)))s[l]=null;else{var u=this.model.getGeometry(s[l]);if(null!=u){var d=this.view.getState(t[l]),p=this.view.getState(this.model.getParent(t[l]));if(null!=d&&null!=p){var m=i?0:p.origin.x,c=i?0:p.origin.y;if(this.model.isEdge(s[l])){var x=d.absolutePoints;if(null!=x){for(var g=this.model.getTerminal(t[l],!0);null!=g&&!r.get(g);)g=this.model.getParent(g);null==g&&null!=x[0]&&u.setTerminalPoint(new mxPoint(x[0].x/a-h.x,x[0].y/a-h.y),!0);for(var y=this.model.getTerminal(t[l],!1);null!=y&&!r.get(y);)y=this.model.getParent(y);var f=x.length-1;null==y&&null!=x[f]&&u.setTerminalPoint(new mxPoint(x[f].x/a-h.x,x[f].y/a-h.y),!1);var v=u.points;if(null!=v)for(var C=0;C<v.length;C++)v[C].x+=m,v[C].y+=c}}else u.translate(m,c)}}}}else s=[]}return s},mxGraph.prototype.insertVertex=function(t,e,n,i,s,r,o,l,a){var h=this.createVertex(t,e,n,i,s,r,o,l,a);return this.addCell(h,t)},mxGraph.prototype.createVertex=function(t,e,n,i,s,r,o,l,a){var h=new mxGeometry(i,s,r,o);h.relative=null!=a&&a;var u=new mxCell(n,h,l);return u.setId(e),u.setVertex(!0),u.setConnectable(!0),u},mxGraph.prototype.insertEdge=function(t,e,n,i,s,r){var o=this.createEdge(t,e,n,i,s,r);return this.addEdge(o,t,i,s)},mxGraph.prototype.createEdge=function(t,e,n,i,s,r){var o=new mxCell(n,new mxGeometry,r);return o.setId(e),o.setEdge(!0),o.geometry.relative=!0,o},mxGraph.prototype.addEdge=function(t,e,n,i,s){return this.addCell(t,e,s,n,i)},mxGraph.prototype.addCell=function(t,e,n,i,s){return this.addCells([t],e,n,i,s)[0]},mxGraph.prototype.addCells=function(t,e,n,i,s,r){null==e&&(e=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(e)),this.model.beginUpdate();try{this.cellsAdded(t,e,n,i,s,null!=r&&r,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",t,"parent",e,"index",n,"source",i,"target",s))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsAdded=function(t,e,n,i,s,r,o,l){if(null!=t&&null!=e&&null!=n){this.model.beginUpdate();try{for(var a=r?this.view.getState(e):null,h=null!=a?a.origin:null,u=new mxPoint(0,0),d=0;d<t.length;d++)if(null==t[d])n--;else{var p=this.model.getParent(t[d]);if(null!=h&&t[d]!=e&&e!=p){var m=this.view.getState(p),c=null!=m?m.origin:u,x=this.model.getGeometry(t[d]);if(null!=x){var g=c.x-h.x,y=c.y-h.y;(x=x.clone()).translate(g,y),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)}}e==p&&n+d>this.model.getChildCount(e)&&n--,this.model.add(e,t[d],n+d),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[d],!0),(null==l||l)&&this.isExtendParentsOnAdd(t[d])&&this.isExtendParent(t[d])&&this.extendParent(t[d]),(null==o||o)&&this.constrainChild(t[d]),null!=i&&this.cellConnected(t[d],i,!0),null!=s&&this.cellConnected(t[d],s,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",n,"source",i,"target",s,"absolute",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var n=this.model.getChildCount(t),i=0;i<n;i++)this.autoSizeCell(this.model.getChildAt(t,i));this.getModel().isVertex(t)&&this.isAutoSizeCell(t)&&this.updateCellSize(t)},mxGraph.prototype.removeCells=function(t,e){if(e=null==e||e,null==t&&(t=this.getDeletableCells(this.getSelectionCells())),e)t=this.getDeletableCells(this.addAllEdges(t));else{t=t.slice();for(var n=this.getDeletableCells(this.getAllEdges(t)),i=new mxDictionary,s=0;s<t.length;s++)i.put(t[s],!0);for(s=0;s<n.length;s++)null!=this.view.getState(n[s])||i.get(n[s])||(i.put(n[s],!0),t.push(n[s]))}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(null!=t&&t.length>0){var e=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var i=new mxDictionary,s=0;s<t.length;s++)i.put(t[s],!0);for(s=0;s<t.length;s++){for(var r=this.getAllEdges([t[s]]),o=mxUtils.bind(this,(function(i,r){var o=this.model.getGeometry(i);if(null!=o){for(var l=this.model.getTerminal(i,r),a=!1,h=l;null!=h;){if(t[s]==h){a=!0;break}h=this.model.getParent(h)}if(a){o=o.clone();var u=this.view.getState(i);if(null!=u&&null!=u.absolutePoints){var d=u.absolutePoints,p=r?0:d.length-1;o.setTerminalPoint(new mxPoint(d[p].x/e-n.x-u.origin.x,d[p].y/e-n.y-u.origin.y),r)}else{var m=this.view.getState(l);null!=m&&o.setTerminalPoint(new mxPoint(m.getCenterX()/e-n.x,m.getCenterY()/e-n.y),r)}this.model.setGeometry(i,o),this.model.setTerminal(i,null,r)}}})),l=0;l<r.length;l++)i.get(r[l])||(i.put(r[l],!0),o(r[l],!0),o(r[l],!1));this.model.remove(t[s])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(t,e,n,i,s,r,o,l){i=i||0,s=s||0,l=null!=l?l:this.model.getParent(t);var a=this.model.getTerminal(t,!0);this.model.beginUpdate();try{if(null==n){n=this.cloneCell(t);var h=this.view.getState(t),u=this.getCellGeometry(n);if(null!=u&&null!=u.points&&null!=h){var d=this.view.translate,p=this.view.scale,m=mxUtils.findNearestSegment(h,(i+d.x)*p,(s+d.y)*p);u.points=u.points.slice(0,m),null!=(u=this.getCellGeometry(t))&&null!=u.points&&((u=u.clone()).points=u.points.slice(m),this.model.setGeometry(t,u))}}this.cellsMoved(e,i,s,!1,!1),this.cellsAdded(e,l,this.model.getChildCount(l),null,null,!0),this.cellsAdded([n],l,this.model.getChildCount(l),a,e[0],!1),this.cellConnected(t,e[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",t,"cells",e,"newEdge",n,"dx",i,"dy",s))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(t,e,n){null==e&&(e=this.getSelectionCells()),n&&(e=this.addAllEdges(e)),this.model.beginUpdate();try{this.cellsToggled(e,t),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",t,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsToggled=function(t,e){if(null!=t&&t.length>0){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setVisible(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(t,e,n,i,s){e=null!=e&&e,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),t)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,t,e,i),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",t,"recurse",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(t,e,n,i){if(null!=t&&t.length>0){this.model.beginUpdate();try{for(var s=0;s<t.length;s++)if((!i||this.isCellFoldable(t[s],e))&&e!=this.isCellCollapsed(t[s])){if(this.model.setCollapsed(t[s],e),this.swapBounds(t[s],e),this.isExtendParent(t[s])&&this.extendParent(t[s]),n){var r=this.model.getChildren(t[s]);this.cellsFolded(r,e,n)}this.constrainChild(t[s])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",t,"collapse",e,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(t,e){if(null!=t){var n=this.model.getGeometry(t);null!=n&&(n=n.clone(),this.updateAlternateBounds(t,n,e),n.swap(),this.model.setGeometry(t,n))}},mxGraph.prototype.updateAlternateBounds=function(t,e,n){if(null!=t&&null!=e){var i=this.getCurrentCellStyle(t);if(null==e.alternateBounds){var s=e;if(this.collapseToPreferredSize){var r=this.getPreferredSizeForCell(t);if(null!=r){s=r;var o=mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE);o>0&&(s.height=Math.max(s.height,o))}}e.alternateBounds=new mxRectangle(0,0,s.width,s.height)}if(null!=e.alternateBounds){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var l=mxUtils.toRadians(i[mxConstants.STYLE_ROTATION]||0);if(0!=l){var a=e.alternateBounds.getCenterX()-e.getCenterX(),h=e.alternateBounds.getCenterY()-e.getCenterY(),u=Math.cos(l),d=Math.sin(l),p=u*a-d*h,m=d*a+u*h;e.alternateBounds.x+=p-a,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(null!=t)for(var n=0;n<t.length;n++){for(var i=this.model.getEdgeCount(t[n]),s=0;s<i;s++)e.push(this.model.getEdgeAt(t[n],s));var r=this.model.getChildren(t[n]);e=e.concat(this.getAllEdges(r))}return e},mxGraph.prototype.updateCellSize=function(t,e){e=null!=e&&e,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(null!=t){this.model.beginUpdate();try{var n=this.getPreferredSizeForCell(t),i=this.model.getGeometry(t);if(null!=n&&null!=i){var s=this.isCellCollapsed(t);if(i=i.clone(),this.isSwimlane(t)){var r=this.getCellStyle(t),o=this.model.getStyle(t);null==o&&(o=""),mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0)?(o=mxUtils.setStyle(o,mxConstants.STYLE_STARTSIZE,n.height+8),s&&(i.height=n.height+8),i.width=n.width):(o=mxUtils.setStyle(o,mxConstants.STYLE_STARTSIZE,n.width+8),s&&(i.width=n.width+8),i.height=n.height),this.model.setStyle(t,o)}else{var l=this.view.createState(t),a=l.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER;a==mxConstants.ALIGN_RIGHT?i.x+=i.width-n.width:a==mxConstants.ALIGN_CENTER&&(i.x+=Math.round((i.width-n.width)/2));var h=this.getVerticalAlign(l);h==mxConstants.ALIGN_BOTTOM?i.y+=i.height-n.height:h==mxConstants.ALIGN_MIDDLE&&(i.y+=Math.round((i.height-n.height)/2)),i.width=n.width,i.height=n.height}if(!e&&!s){var u=this.view.getBounds(this.model.getChildren(t));if(null!=u){var d=this.view.translate,p=this.view.scale,m=(u.x+u.width)/p-i.x-d.x,c=(u.y+u.height)/p-i.y-d.y;i.width=Math.max(i.width,m),i.height=Math.max(i.height,c)}}this.cellsResized([t],[i],!1)}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(t,e){var n=null;if(null!=t){var i=this.view.createState(t),s=i.style;if(!this.model.isEdge(t)){var r=s[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,o=0,l=0;null==this.getImage(i)&&null==s[mxConstants.STYLE_IMAGE]||s[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(s[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(o+=parseFloat(s[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),s[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(l+=parseFloat(s[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),o+=2*(s[mxConstants.STYLE_SPACING]||0),o+=s[mxConstants.STYLE_SPACING_LEFT]||0,o+=s[mxConstants.STYLE_SPACING_RIGHT]||0,l+=2*(s[mxConstants.STYLE_SPACING]||0),l+=s[mxConstants.STYLE_SPACING_TOP]||0,l+=s[mxConstants.STYLE_SPACING_BOTTOM]||0;var a=this.getFoldingImage(i);null!=a&&(o+=a.width+8);var h=this.cellRenderer.getLabelValue(i);if(null!=h&&h.length>0){this.isHtmlLabel(i.cell)||(h=mxUtils.htmlEntities(h,!1)),h=h.replace(/\n/g,"<br>");var u=mxUtils.getSizeForString(h,r,s[mxConstants.STYLE_FONTFAMILY],e,s[mxConstants.STYLE_FONTSTYLE]),d=u.width+o,p=u.height+l;if(!mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,!0)){var m=p;p=d,d=m}this.gridEnabled&&(d=this.snap(d+this.gridSize/2),p=this.snap(p+this.gridSize/2)),n=new mxRectangle(0,0,d,p)}else{var c=4*this.gridSize;n=new mxRectangle(0,0,c,c)}}}return n},mxGraph.prototype.resizeCell=function(t,e,n){return this.resizeCells([t],[e],n)[0]},mxGraph.prototype.resizeCells=function(t,e,n){n=null!=n?n:this.isRecursiveResize(),this.model.beginUpdate();try{var i=this.cellsResized(t,e,n);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,n){n=null!=n&&n;var i=[];if(null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var s=0;s<t.length;s++)i.push(this.cellResized(t[s],e[s],!1,n)),this.isExtendParent(t[s])&&this.extendParent(t[s]),this.constrainChild(t[s]);this.resetEdgesOnResize&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",t,"bounds",e,"previous",i))}finally{this.model.endUpdate()}}return i},mxGraph.prototype.cellResized=function(t,e,n,i){var s=this.model.getGeometry(t);if(null!=s&&(s.x!=e.x||s.y!=e.y||s.width!=e.width||s.height!=e.height)){var r=s.clone();if(!n&&r.relative){var o=r.offset;null!=o&&(o.x+=e.x-r.x,o.y+=e.y-r.y)}else r.x=e.x,r.y=e.y;r.width=e.width,r.height=e.height,r.relative||!this.model.isVertex(t)||this.isAllowNegativeCoordinates()||(r.x=Math.max(0,r.x),r.y=Math.max(0,r.y)),this.model.beginUpdate();try{i&&this.resizeChildCells(t,r),this.model.setGeometry(t,r),this.constrainChildCells(t)}finally{this.model.endUpdate()}}return s},mxGraph.prototype.resizeChildCells=function(t,e){for(var n=this.model.getGeometry(t),i=0!=n.width?e.width/n.width:1,s=0!=n.height?e.height/n.height:1,r=this.model.getChildCount(t),o=0;o<r;o++)this.scaleCell(this.model.getChildAt(t,o),i,s,!0)},mxGraph.prototype.constrainChildCells=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.constrainChild(this.model.getChildAt(t,n))},mxGraph.prototype.scaleCell=function(t,e,n,i){var s=this.model.getGeometry(t);if(null!=s){var r=this.getCurrentCellStyle(t),o=(s=s.clone()).x,l=s.y,a=s.width,h=s.height;s.scale(e,n,"fixed"==r[mxConstants.STYLE_ASPECT]),"1"==r[mxConstants.STYLE_RESIZE_WIDTH]?s.width=a*e:"0"==r[mxConstants.STYLE_RESIZE_WIDTH]&&(s.width=a),"1"==r[mxConstants.STYLE_RESIZE_HEIGHT]?s.height=h*n:"0"==r[mxConstants.STYLE_RESIZE_HEIGHT]&&(s.height=h),this.isCellMovable(t)||(s.x=o,s.y=l),this.isCellResizable(t)||(s.width=a,s.height=h),this.model.isVertex(t)?this.cellResized(t,s,!0,i):this.model.setGeometry(t,s)}},mxGraph.prototype.extendParent=function(t){if(null!=t){var e=this.model.getParent(t),n=this.getCellGeometry(e);if(null!=e&&null!=n&&!this.isCellCollapsed(e)){var i=this.getCellGeometry(t);null!=i&&!i.relative&&(n.width<i.x+i.width||n.height<i.y+i.height)&&((n=n.clone()).width=Math.max(n.width,i.x+i.width),n.height=Math.max(n.height,i.y+i.height),this.cellsResized([e],[n],!1))}}},mxGraph.prototype.importCells=function(t,e,n,i,s,r){return this.moveCells(t,e,n,!0,i,s,r)},mxGraph.prototype.moveCells=function(t,e,n,i,s,r,o){if(e=null!=e?e:0,n=null!=n?n:0,i=null!=i&&i,null!=t&&(0!=e||0!=n||i||null!=s)){var l=t=this.model.getTopmostCells(t);this.model.beginUpdate();try{for(var a=new mxDictionary,h=0;h<t.length;h++)a.put(t[h],!0);var u=mxUtils.bind(this,(function(t){for(;null!=t;){if(a.get(t))return!0;t=this.model.getParent(t)}return!1})),d=[];for(h=0;h<t.length;h++){var p=this.getCellGeometry(t[h]),m=this.model.getParent(t[h]);null!=p&&p.relative&&this.model.isEdge(m)&&(u(this.model.getTerminal(m,!0))||u(this.model.getTerminal(m,!1)))||d.push(t[h])}t=d,i&&(t=this.cloneCells(t,this.isCloneInvalidEdges(),o),null==s&&(s=this.getDefaultParent()));var c=this.isAllowNegativeCoordinates();if(null!=s&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(t,e,n,!i&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==s,this.isExtendParentsOnMove()&&null==s),this.setAllowNegativeCoordinates(c),null!=s){var x=this.model.getChildCount(s);if(this.cellsAdded(t,s,x,null,null,!0),i)for(h=0;h<t.length;h++){p=this.getCellGeometry(t[h]),m=this.model.getParent(l[h]);null!=p&&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",n,"clone",i,"target",s,"event",r))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.cellsMoved=function(t,e,n,i,s,r){if(null!=t&&(0!=e||0!=n)){r=null!=r&&r,this.model.beginUpdate();try{i&&this.disconnectGraph(t);for(var o=0;o<t.length;o++)this.translateCell(t[o],e,n),r&&this.isExtendParent(t[o])?this.extendParent(t[o]):s&&this.constrainChild(t[o]);this.resetEdgesOnMove&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",t,"dx",e,"dy",n,"disconnect",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(t,e,n){var i=this.model.getGeometry(t);if(null!=i){if(e=parseFloat(e),n=parseFloat(n),(i=i.clone()).translate(e,n),i.relative||!this.model.isVertex(t)||this.isAllowNegativeCoordinates()||(i.x=Math.max(0,parseFloat(i.x)),i.y=Math.max(0,parseFloat(i.y))),i.relative&&!this.model.isEdge(t)){var s=this.model.getParent(t),r=0;if(this.model.isVertex(s)){var o=this.getCurrentCellStyle(s);r=mxUtils.getValue(o,mxConstants.STYLE_ROTATION,0)}if(0!=r){var l=mxUtils.toRadians(-r),a=Math.cos(l),h=Math.sin(l),u=mxUtils.getRotatedPoint(new mxPoint(e,n),a,h,new mxPoint(0,0));e=u.x,n=u.y}null==i.offset?i.offset=new mxPoint(e,n):(i.offset.x=parseFloat(i.offset.x)+e,i.offset.y=parseFloat(i.offset.y)+n)}this.model.setGeometry(t,i)}},mxGraph.prototype.getCellContainmentArea=function(t){if(null!=t&&!this.model.isEdge(t)){var e=this.model.getParent(t);if(null!=e&&e!=this.getDefaultParent()){var n=this.model.getGeometry(e);if(null!=n){var i=0,s=0,r=n.width,o=n.height;if(this.isSwimlane(e)){var l=this.getStartSize(e),a=this.getCurrentCellStyle(e),h=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),u=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,0),d=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,0);if(h==mxConstants.DIRECTION_SOUTH||h==mxConstants.DIRECTION_NORTH){var p=l.width;l.width=l.height,l.height=p}(h==mxConstants.DIRECTION_EAST&&!d||h==mxConstants.DIRECTION_NORTH&&!u||h==mxConstants.DIRECTION_WEST&&d||h==mxConstants.DIRECTION_SOUTH&&u)&&(i=l.width,s=l.height),r-=l.width,o-=l.height}return new mxRectangle(i,s,r,o)}}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(t,e){if(null!=t){var n=this.getCellGeometry(t);if(null!=n&&(this.isConstrainRelativeChildren()||!n.relative)){var i=this.model.getParent(t);this.getCellGeometry(i);var s=this.getMaximumGraphBounds();if(null!=s){var r=this.getBoundingBoxFromGeometry([i],!1);null!=r&&((s=mxRectangle.fromRectangle(s)).x-=r.x,s.y-=r.y)}if(this.isConstrainChild(t)){var o=this.getCellContainmentArea(t);if(null!=o){var l=this.getOverlap(t);l>0&&((o=mxRectangle.fromRectangle(o)).x-=o.width*l,o.y-=o.height*l,o.width+=2*o.width*l,o.height+=2*o.height*l),null==s?s=o:(s=mxRectangle.fromRectangle(s)).intersect(o)}}if(null!=s){var a=[t];if(!this.isCellCollapsed(t))for(var h=this.model.getDescendants(t),u=0;u<h.length;u++)this.isCellVisible(h[u])&&a.push(h[u]);var d=this.getBoundingBoxFromGeometry(a,!1);if(null!=d){var p=0;(n=n.clone()).width>s.width&&(p=n.width-s.width,n.width-=p),d.x+d.width>s.x+s.width&&(p-=d.x+d.width-s.x-s.width-p);var m=0;n.height>s.height&&(m=n.height-s.height,n.height-=m),d.y+d.height>s.y+s.height&&(m-=d.y+d.height-s.y-s.height-m),d.x<s.x&&(p-=d.x-s.x),d.y<s.y&&(m-=d.y-s.y),0==p&&0==m||(n.relative?(null==n.offset&&(n.offset=new mxPoint),n.offset.x+=p,n.offset.y+=m):(n.x+=p,n.y+=m)),this.model.setGeometry(t,n)}}}}},mxGraph.prototype.resetEdges=function(t){if(null!=t){for(var e=new mxDictionary,n=0;n<t.length;n++)e.put(t[n],!0);this.model.beginUpdate();try{for(n=0;n<t.length;n++){var i=this.model.getEdges(t[n]);if(null!=i)for(var s=0;s<i.length;s++){var r=this.view.getState(i[s]),o=null!=r?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[s],!0),l=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[s],!1);e.get(o)&&e.get(l)||this.resetEdge(i[s])}this.resetEdges(this.model.getChildren(t[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(t){var e=this.model.getGeometry(t);return null!=e&&null!=e.points&&e.points.length>0&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,n){if(null!=e.shape){var i=this.view.getPerimeterBounds(e),s=e.style[mxConstants.STYLE_DIRECTION];if(s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){i.x+=i.width/2-i.height/2,i.y+=i.height/2-i.width/2;var r=i.width;i.width=i.height,i.height=r}var o=mxUtils.toRadians(e.shape.getShapeRotation());if(0!=o){var l=Math.cos(-o),a=Math.sin(-o),h=new mxPoint(i.getCenterX(),i.getCenterY());t=mxUtils.getRotatedPoint(t,l,a,h)}var u=1,d=1,p=0,m=0;if(this.getModel().isVertex(e.cell)){var c=e.style[mxConstants.STYLE_FLIPH],x=e.style[mxConstants.STYLE_FLIPV];if(null!=e.shape&&null!=e.shape.stencil&&(c=1==mxUtils.getValue(e.style,"stencilFlipH",0)||c,x=1==mxUtils.getValue(e.style,"stencilFlipV",0)||x),s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){r=c;c=x,x=r}c&&(u=-1,p=-i.width),x&&(d=-1,m=-i.height)}return t=new mxPoint((t.x-i.x)*u-p+i.x,(t.y-i.y)*d-m+i.y),new mxConnectionConstraint(new mxPoint(0==i.width?0:Math.round(1e3*(t.x-i.x)/i.width)/1e3,0==i.height?0:Math.round(1e3*(t.y-i.y)/i.height)/1e3),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,n){var i=null,s=t.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=s){var r=t.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=r&&(i=new mxPoint(parseFloat(s),parseFloat(r)))}var o=!1,l=0,a=0;return null!=i&&(o=mxUtils.getValue(t.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),l=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),a=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),l=isFinite(l)?l:0,a=isFinite(a)?a:0),new mxConnectionConstraint(i,o,null,l,a)},mxGraph.prototype.setConnectionConstraint=function(t,e,n,i){if(null!=i){this.model.beginUpdate();try{null==i||null==i.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=i.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,i.point.x,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,i.point.y,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,i.dx,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,i.dy,[t]),i.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,n){n=null==n||n;var i=null;if(null!=t&&null!=e.point){var s=this.view.getPerimeterBounds(t),r=new mxPoint(s.getCenterX(),s.getCenterY()),o=t.style[mxConstants.STYLE_DIRECTION],l=0;null!=o&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(o==mxConstants.DIRECTION_NORTH?l+=270:o==mxConstants.DIRECTION_WEST?l+=180:o==mxConstants.DIRECTION_SOUTH&&(l+=90),o!=mxConstants.DIRECTION_NORTH&&o!=mxConstants.DIRECTION_SOUTH||s.rotate90());var a=this.view.scale;i=new mxPoint(s.x+e.point.x*s.width+e.dx*a,s.y+e.point.y*s.height+e.dy*a);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(0!=l){var u=0,d=0;90==l?d=1:180==l?u=-1:270==l&&(d=-1),i=mxUtils.getRotatedPoint(i,u,d,r)}i=this.view.getPerimeterPoint(t,i,!1)}else if(h+=l,this.getModel().isVertex(t.cell)){var p=1==t.style[mxConstants.STYLE_FLIPH],m=1==t.style[mxConstants.STYLE_FLIPV];if(null!=t.shape&&null!=t.shape.stencil&&(p=1==mxUtils.getValue(t.style,"stencilFlipH",0)||p,m=1==mxUtils.getValue(t.style,"stencilFlipV",0)||m),o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){var c=p;p=m,m=c}p&&(i.x=2*s.getCenterX()-i.x),m&&(i.y=2*s.getCenterY()-i.y)}if(0!=h&&null!=i){var x=mxUtils.toRadians(h);u=Math.cos(x),d=Math.sin(x);i=mxUtils.getRotatedPoint(i,u,d,r)}}return n&&null!=i&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),i},mxGraph.prototype.connectCell=function(t,e,n,i){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);this.cellConnected(t,e,n,i),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,n,i){if(null!=t){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);if(this.setConnectionConstraint(t,e,n,i),this.isPortsEnabled()){var r=null;this.isPort(e)&&(r=e.getId(),e=this.getTerminalForPort(e,n));var o=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(o,r,[t])}this.model.setTerminal(t,e,n),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,n=this.view.translate,i=new mxDictionary,s=0;s<t.length;s++)i.put(t[s],!0);for(s=0;s<t.length;s++)if(this.model.isEdge(t[s])){var r=this.model.getGeometry(t[s]);if(null!=r){var o=this.view.getState(t[s]),l=this.view.getState(this.model.getParent(t[s]));if(null!=o&&null!=l){r=r.clone();var a=-l.origin.x,h=-l.origin.y,u=o.absolutePoints,d=this.model.getTerminal(t[s],!0);if(null!=d&&this.isCellDisconnectable(t[s],d,!0)){for(;null!=d&&!i.get(d);)d=this.model.getParent(d);null==d&&(r.setTerminalPoint(new mxPoint(u[0].x/e-n.x+a,u[0].y/e-n.y+h),!0),this.model.setTerminal(t[s],null,!0))}var p=this.model.getTerminal(t[s],!1);if(null!=p&&this.isCellDisconnectable(t[s],p,!1)){for(;null!=p&&!i.get(p);)p=this.model.getParent(p);if(null==p){var m=u.length-1;r.setTerminalPoint(new mxPoint(u[m].x/e-n.x+a,u[m].y/e-n.y+h),!1),this.model.setTerminal(t[s],null,!1)}}this.model.setGeometry(t[s],r)}}}}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!1},mxGraph.prototype.getTerminalForPort=function(t,e){return this.model.getParent(t)},mxGraph.prototype.getChildOffsetForCell=function(t){return null},mxGraph.prototype.enterGroup=function(t){null!=(t=t||this.getSelectionCell())&&this.isValidRoot(t)&&(this.view.setCurrentRoot(t),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var t=this.model.getRoot(),e=this.getCurrentRoot();if(null!=e){for(var n=this.model.getParent(e);n!=t&&!this.isValidRoot(n)&&this.model.getParent(n)!=t;)n=this.model.getParent(n);n==t||this.model.getParent(n)==t?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(e)&&this.setSelectionCell(e)}},mxGraph.prototype.home=function(){var t=this.getCurrentRoot();null!=t&&(this.view.setCurrentRoot(null),null!=this.view.getState(t)&&this.setSelectionCell(t))},mxGraph.prototype.isValidRoot=function(t){return null!=t},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(t,e,n){var i=[t];e&&(i=i.concat(this.model.getEdges(t)));var s=this.view.getBounds(i);if(n)for(var r=this.model.getChildCount(t),o=0;o<r;o++){var l=this.getCellBounds(this.model.getChildAt(t,o),e,!0);null!=s?s.add(l):s=l}return s},mxGraph.prototype.getBoundingBoxFromGeometry=function(t,e){e=null!=e&&e;var n=null;if(null!=t)for(var i=0;i<t.length;i++)if(e||this.model.isVertex(t[i])){var s=this.getCellGeometry(t[i]);if(null!=s){var r=null;if(this.model.isEdge(t[i])){var o=function(t){null!=t&&(null==a?a=new mxRectangle(t.x,t.y,0,0):a.add(new mxRectangle(t.x,t.y,0,0)))};null==this.model.getTerminal(t[i],!0)&&o(s.getTerminalPoint(!0)),null==this.model.getTerminal(t[i],!1)&&o(s.getTerminalPoint(!1));var l=s.points;if(null!=l&&l.length>0)for(var a=new mxRectangle(l[0].x,l[0].y,0,0),h=1;h<l.length;h++)o(l[h]);r=a}else{var u=this.model.getParent(t[i]);if(s.relative){if(this.model.isVertex(u)&&u!=this.view.currentRoot)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(r=new mxRectangle(s.x*a.width,s.y*a.height,s.width,s.height),mxUtils.indexOf(t,u)>=0&&(r.x+=a.x,r.y+=a.y))}else if(r=mxRectangle.fromRectangle(s),this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(r.x+=a.x,r.y+=a.y);null!=r&&null!=s.offset&&(r.x+=s.offset.x,r.y+=s.offset.y);var d=this.getCurrentCellStyle(t[i]);if(null!=r){var p=mxUtils.getValue(d,mxConstants.STYLE_ROTATION,0);0!=p&&(r=mxUtils.getBoundingBox(r,p))}}null!=r&&(null==n?n=mxRectangle.fromRectangle(r):n.add(r))}}return n},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,n,i,s){var r=this.view.translate,o=this.view.scale;if(!n&&this.gridEnabled){var l=this.gridSize*o*.5;if(!i){var a=e.x-(this.snap(e.x/o-r.x)+r.x)*o;Math.abs(t.x-a)<l?t.x=0:t.x=this.snap(t.x/o)*o-a}if(!s){var h=e.y-(this.snap(e.y/o-r.y)+r.y)*o;Math.abs(t.y-h)<l?t.y=0:t.y=this.snap(t.y/o)*o-h}}else{l=.5*o;if(!i){a=e.x-(Math.round(e.x/o-r.x)+r.x)*o;Math.abs(t.x-a)<l?t.x=0:t.x=Math.round(t.x/o)*o-a}if(!s){h=e.y-(Math.round(e.y/o-r.y)+r.y)*o;Math.abs(t.y-h)<l?t.y=0:t.y=Math.round(t.y/o)*o-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 n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==t&&0==e){if(mxClient.IS_IE?n.setAttribute("transform","translate("+t+","+e+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var i=this.shiftPreview1.firstChild;null!=i;){var s=i.nextSibling;this.container.appendChild(i),i=s}for(null!=this.shiftPreview1.parentNode&&this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),i=this.shiftPreview2.firstChild;null!=i;){s=i.nextSibling;this.container.appendChild(i),i=s}null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+t+","+e+")"),null==this.shiftPreview1){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 r=this.shiftPreview1;for(i=this.container.firstChild;null!=i;){s=i.nextSibling;i!=n.parentNode?r.appendChild(i):r=this.shiftPreview2,i=s}null!=this.shiftPreview1.firstChild&&this.container.insertBefore(this.shiftPreview1,n.parentNode),null!=this.shiftPreview2.firstChild&&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 n.style.left=t+"px",n.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(){1==this.view.scale?this.view.setTranslate(0,0):(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,n,i){t=null==t||t,e=null==e||e,n=null!=n?n:.5,i=null!=i?i:.5;var s=mxUtils.hasScrollbars(this.container),r=2*this.getBorder(),o=this.container.clientWidth-r,l=this.container.clientHeight-r,a=this.getGraphBounds(),h=this.view.translate,u=this.view.scale,d=t?o-a.width:0,p=e?l-a.height:0;if(s){a.x-=h.x,a.y-=h.y;var m=this.container.scrollWidth,c=this.container.scrollHeight;m>o&&(d=0),c>l&&(p=0),this.view.setTranslate(Math.floor(d/2-a.x),Math.floor(p/2-a.y)),this.container.scrollLeft=(m-o)/2,this.container.scrollTop=(c-l)/2}else this.view.setTranslate(t?Math.floor(h.x-a.x*u+d*n/u):h.x,e?Math.floor(h.y-a.y*u+p*i/u):h.y)},mxGraph.prototype.zoom=function(t,e){e=null!=e?e:this.centerZoom;var n=Math.round(this.view.scale*t*100)/100,i=this.view.getState(this.getSelectionCell());if(t=n/this.view.scale,this.keepSelectionVisibleOnZoom&&null!=i){var s=new mxRectangle(i.x*t,i.y*t,i.width*t,i.height*t);this.view.scale=n,this.scrollRectToVisible(s)||(this.view.revalidate(),this.view.setScale(n))}else{var r=mxUtils.hasScrollbars(this.container);if(e&&!r){var o,l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1)l*=-(o=(t-1)/(2*n)),a*=-o;else l*=o=(1/t-1)/(2*this.view.scale),a*=o;this.view.scaleAndTranslate(n,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x,u=this.view.translate.y,d=this.container.scrollLeft,p=this.container.scrollTop;if(this.view.setScale(n),r){l=0,a=0;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/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var n=Math.min(this.container.scrollWidth,t.x+t.width),i=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=n-t.x,t.height=i-t.y,e<1){var s=t.height/e,r=(s-t.height)/2;t.height=s;var o=Math.min(t.y,r);t.y=t.y-o,i=Math.min(this.container.scrollHeight,t.y+t.height),t.height=i-t.y}else{var l=t.width*e,a=(l-t.width)/2;t.width=l;var h=Math.min(t.x,a);t.x=t.x-h,n=Math.min(this.container.scrollWidth,t.x+t.width),t.width=n-t.x}var u=this.container.clientWidth/t.width,d=this.view.scale*u;mxUtils.hasScrollbars(this.container)?(this.view.setScale(d),this.container.scrollLeft=Math.round(t.x*u),this.container.scrollTop=Math.round(t.y*u)):this.view.scaleAndTranslate(d,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var n=-this.view.translate.x,i=-this.view.translate.y,s=this.view.getState(t);if(null!=s){var r=new mxRectangle(n+s.x,i+s.y,s.width,s.height);if(e&&null!=this.container){var o=this.container.clientWidth,l=this.container.clientHeight;r.x=r.getCenterX()-o/2,r.width=o,r.y=r.getCenterY()-l/2,r.height=l}var a=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(r)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=a.x,this.view.translate.y=a.y,this.view.setTranslate(h.x,h.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(null!=t){var n=this.container.offsetWidth,i=this.container.offsetHeight,s=Math.min(n,t.width),r=Math.min(i,t.height);if(mxUtils.hasScrollbars(this.container)){var o=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var l=o.scrollLeft-t.x,a=Math.max(l-o.scrollLeft,0);l>0?o.scrollLeft-=l+2:(l=t.x+s-o.scrollLeft-o.clientWidth)>0&&(o.scrollLeft+=l+2);var h=o.scrollTop-t.y,u=Math.max(0,h-o.scrollTop);h>0?o.scrollTop-=h+2:(h=t.y+r-o.scrollTop-o.clientHeight)>0&&(o.scrollTop+=h+2),this.useScrollbarsForPanning||0==a&&0==u||this.view.setTranslate(a,u)}else{var d=-this.view.translate.x,p=-this.view.translate.y,m=this.view.scale;t.x+s>d+n&&(this.view.translate.x-=(t.x+s-n-d)/m,e=!0),t.y+r>p+i&&(this.view.translate.y-=(t.y+r-i-p)/m,e=!0),t.x<d&&(this.view.translate.x+=(d-t.x)/m,e=!0),t.y<p&&(this.view.translate.y+=(p-t.y)/m,e=!0),e&&(this.view.refresh(),null!=this.selectionCellsHandler&&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(null!=e)return e;var n=this.view.getEdgeStyle(t);return n==mxEdgeStyle.SegmentConnector||n==mxEdgeStyle.ElbowConnector||n==mxEdgeStyle.SideToSide||n==mxEdgeStyle.TopToBottom||n==mxEdgeStyle.EntityRelation||n==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(t){var e=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1);return null!=e&&e==n},mxGraph.prototype.isCloneEvent=function(t){return mxEvent.isControlDown(t)},mxGraph.prototype.isTransparentClickEvent=function(t){return!1},mxGraph.prototype.isToggleEvent=function(t){return mxClient.IS_MAC?mxEvent.isMetaDown(t):mxEvent.isControlDown(t)},mxGraph.prototype.isGridEnabledEvent=function(t){return null!=t&&!mxEvent.isAltDown(t)},mxGraph.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t)},mxGraph.prototype.isIgnoreTerminalEvent=function(t){return!1},mxGraph.prototype.validationAlert=function(t){mxUtils.alert(t)},mxGraph.prototype.isEdgeValid=function(t,e,n){return null==this.getEdgeValidationError(t,e,n)},mxGraph.prototype.getEdgeValidationError=function(t,e,n){if(null!=t&&!this.isAllowDanglingEdges()&&(null==e||null==n))return"";if(null!=t&&null==this.model.getTerminal(t,!0)&&null==this.model.getTerminal(t,!1))return null;if(!this.allowLoops&&e==n&&null!=e)return"";if(!this.isValidConnection(e,n))return"";if(null!=e&&null!=n){var i="";if(!this.multigraph){var s=this.model.getEdgesBetween(e,n,!0);(s.length>1||1==s.length&&s[0]!=t)&&(i+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n")}var r=this.model.getDirectedEdgeCount(e,!0,t),o=this.model.getDirectedEdgeCount(n,!1,t);if(null!=this.multiplicities)for(var l=0;l<this.multiplicities.length;l++){var a;null!=(a=this.multiplicities[l].check(this,t,e,n,r,o))&&(i+=a)}return null!=(a=this.validateEdge(t,e,n))&&(i+=a),i.length>0?i:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,n){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var n=!0,i=this.model.getChildCount(t),s=0;s<i;s++){var r=this.model.getChildAt(t,s),o=e;this.isValidRoot(r)&&(o=new Object);var l=this.validateGraph(r,o);null!=l?this.setCellWarning(r,l.replace(/\n/g,"<br>")):this.setCellWarning(r,null),n=n&&null==l}var a="";this.isCellCollapsed(t)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?a+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":a+=this.getCellValidationError(t)||"";var h=this.validateCell(t,e);return null!=h&&(a+=h),null==this.model.getParent(t)&&this.view.validate(),a.length>0||!n?a:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),n=this.model.getDirectedEdgeCount(t,!1),i=this.model.getValue(t),s="";if(null!=this.multiplicities)for(var r=0;r<this.multiplicities.length;r++){var o=this.multiplicities[r];(o.source&&mxUtils.isNode(i,o.type,o.attr,o.value)&&(e>o.max||e<o.min)||!o.source&&mxUtils.isNode(i,o.type,o.attr,o.value)&&(n>o.max||n<o.min))&&(s+=o.countError+"\n")}return s.length>0?s: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(null!=t&&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(null!=e){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&null!=t){var n=this.getCurrentCellStyle(t);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(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"wrap"==this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){return"hidden"==this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,e,n,i){var s=null;if(null!=t){if(null==t.control||e!=t.control.node&&e.parentNode!=t.control.node||(s=this.collapseExpandResource,s=mxUtils.htmlEntities(mxResources.get(s)||s).replace(/\\n/g,"<br>")),null==s&&null!=t.overlays&&t.overlays.visit((function(t,n){null!=s||e!=n.node&&e.parentNode!=n.node||(s=n.overlay.toString())})),null==s){var r=this.selectionCellsHandler.getHandler(t.cell);null!=r&&"function"==typeof r.getTooltipForNode&&(s=r.getTooltipForNode(e))}null==s&&(s=this.getTooltipForCell(t.cell))}return s},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},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 n=new mxRectangle,i=this.getCurrentCellStyle(t,e),s=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(i,mxConstants.STYLE_HORIZONTAL,!0)?n.height=s:n.width=s,n},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),n=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0),i=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0),s=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0)?0:3;e==mxConstants.DIRECTION_NORTH?s--:e==mxConstants.DIRECTION_WEST?s+=2:e==mxConstants.DIRECTION_SOUTH&&(s+=1);var r=mxUtils.mod(s,2);return n&&1==r&&(s+=2),i&&0==r&&(s+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var n=new mxRectangle;if(this.isSwimlane(t,e)){var i=this.getCurrentCellStyle(t,e),s=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),r=this.getSwimlaneDirection(i);r==mxConstants.DIRECTION_NORTH?n.y=s:r==mxConstants.DIRECTION_WEST?n.x=s:r==mxConstants.DIRECTION_SOUTH?n.height=s:n.width=s}return n},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(null!=t){var n=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),i=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=n==mxConstants.NONE&&i==mxConstants.NONE&&null==this.getImage(t)}return e},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?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){return null!=t&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)&&this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE},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()||null!=e&&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()&&0!=e[mxConstants.STYLE_CLONEABLE]},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()&&0!=e[mxConstants.STYLE_DELETABLE]},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){return 0!=this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATABLE]},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)&&0!=e[mxConstants.STYLE_MOVABLE]},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)&&"0"!=mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_BENDABLE]},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)&&0!=e[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,n){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 null==t&&this.allowDanglingEdges||null!=t&&(!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(null!=this.cellEditor){var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},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!1},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 n=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,n){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,n)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,n){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var i=this.model.getTerminal(t,!0),s=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],i)&&!this.model.isAncestor(e[0],s)}return!1},mxGraph.prototype.getDropTarget=function(t,e,n,i){if(!this.isSwimlaneNesting())for(var s=0;s<t.length;s++)if(this.isSwimlane(t[s]))return null;var r=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));r.x-=this.panDx,r.y-=this.panDy;var o=this.getSwimlaneAt(r.x,r.y);if(null==n)n=o;else if(null!=o){for(var l=this.model.getParent(o);null!=l&&this.isSwimlane(l)&&l!=n;)l=this.model.getParent(l);l==n&&(n=o)}for(;null!=n&&!this.isValidDropTarget(n,t,e)&&!this.model.isLayer(n);)n=this.model.getParent(n);if(null==i||!i)for(var a=n;null!=a&&mxUtils.indexOf(t,a)<0;)a=this.model.getParent(a);return this.model.isLayer(n)||null!=a?null:n},mxGraph.prototype.getDefaultParent=function(){var t=this.getCurrentRoot();if(null==t&&null==(t=this.defaultParent)){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){for(;null!=t&&!this.isSwimlane(t);)t=this.model.getParent(t);return t},mxGraph.prototype.getSwimlaneAt=function(t,e,n){if(null==n&&null==(n=this.getCurrentRoot())&&(n=this.model.getRoot()),null!=n)for(var i=this.model.getChildCount(n),s=0;s<i;s++){var r=this.model.getChildAt(n,s);if(null!=r){var o=this.getSwimlaneAt(t,e,r);if(null!=o)return o;if(this.isCellVisible(r)&&this.isSwimlane(r)){var l=this.view.getState(r);if(this.intersects(l,t,e))return r}}}return null},mxGraph.prototype.getCellAt=function(t,e,n,i,s,r){if(i=null==i||i,s=null==s||s,null==n&&null==(n=this.getCurrentRoot())&&(n=this.getModel().getRoot()),null!=n)for(var o=this.model.getChildCount(n)-1;o>=0;o--){var l=this.model.getChildAt(n,o),a=this.getCellAt(t,e,l,i,s,r);if(null!=a)return a;if(this.isCellVisible(l)&&(s&&this.model.isEdge(l)||i&&this.model.isVertex(l))){var h=this.view.getState(l);if(null!=h&&(null==r||!r(h,t,e))&&this.intersects(h,t,e))return l}}return null},mxGraph.prototype.intersects=function(t,e,n){if(null!=t){var i=t.absolutePoints;if(null!=i)for(var s=this.tolerance*this.tolerance,r=i[0],o=1;o<i.length;o++){var l=i[o];if(mxUtils.ptSegDistSq(r.x,r.y,l.x,l.y,e,n)<=s)return!0;r=l}else{var a=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=a){var h=Math.cos(-a),u=Math.sin(-a),d=new mxPoint(t.getCenterX(),t.getCenterY());e=(r=mxUtils.getRotatedPoint(new mxPoint(e,n),h,u,d)).x,n=r.y}if(mxUtils.contains(t,e,n))return!0}}return!1},mxGraph.prototype.hitsSwimlaneContent=function(t,e,n){var i=this.getView().getState(t),s=this.getStartSize(t);if(null!=i){var r=this.getView().getScale();if(e-=i.x,n-=i.y,s.width>0&&e>0&&e>s.width*r)return!0;if(s.height>0&&n>0&&n>s.height*r)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,n){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,n=null!=n&&n;for(var i=this.model.getChildCells(t,e,n),s=[],r=0;r<i.length;r++)this.isCellVisible(i[r])&&s.push(i[r]);return s},mxGraph.prototype.getConnections=function(t,e){return this.getEdges(t,e,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(t,e){return this.getEdges(t,e,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(t,e){return this.getEdges(t,e,!1,!0,!1)},mxGraph.prototype.getEdges=function(t,e,n,i,s,r){n=null==n||n,i=null==i||i,s=null==s||s,r=null!=r&&r;for(var o=[],l=this.isCellCollapsed(t),a=this.model.getChildCount(t),h=0;h<a;h++){var u=this.model.getChildAt(t,h);!l&&this.isCellVisible(u)||(o=o.concat(this.model.getEdges(u,n,i)))}o=o.concat(this.model.getEdges(t,n,i));var d=[];for(h=0;h<o.length;h++){var p=this.view.getState(o[h]),m=null!=p?p.getVisibleTerminal(!0):this.view.getVisibleTerminal(o[h],!0),c=null!=p?p.getVisibleTerminal(!1):this.view.getVisibleTerminal(o[h],!1);(s&&m==c||m!=c&&(n&&c==t&&(null==e||this.isValidAncestor(m,e,r))||i&&m==t&&(null==e||this.isValidAncestor(c,e,r))))&&d.push(o[h])}return d},mxGraph.prototype.isValidAncestor=function(t,e,n){return n?this.model.isAncestor(e,t):this.model.getParent(t)==e},mxGraph.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var s=[],r=new mxDictionary;if(null!=t)for(var o=0;o<t.length;o++){var l=this.view.getState(t[o]),a=null!=l?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(t[o],!0),h=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(t[o],!1);a==e&&null!=h&&h!=e&&i?r.get(h)||(r.put(h,!0),s.push(h)):h==e&&null!=a&&a!=e&&n&&(r.get(a)||(r.put(a,!0),s.push(a)))}return s},mxGraph.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),s=[],r=0;r<i.length;r++){var o=this.view.getState(i[r]),l=null!=o?o.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[r],!0),a=null!=o?o.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[r],!1);(l==t&&a==e||!n&&l==e&&a==t)&&s.push(i[r])}return s},mxGraph.prototype.getPointForEvent=function(t,e){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),i=this.view.scale,s=this.view.translate,r=0!=e?this.gridSize/2:0;return n.x=this.snap(n.x/i-s.x-r),n.y=this.snap(n.y/i-s.y-r),n},mxGraph.prototype.getCells=function(t,e,n,i,s,r,o,l,a){if(r=null!=r?r:[],n>0||i>0||null!=o){var h=this.getModel(),u=t+n,d=e+i;if(null==s&&null==(s=this.getCurrentRoot())&&(s=h.getRoot()),null!=s)for(var p=h.getChildCount(s),m=0;m<p;m++){var c=h.getChildAt(s,m),x=this.view.getState(c);if(null!=x&&this.isCellVisible(c)&&(null==l||!l(x))){var g=mxUtils.getValue(x.style,mxConstants.STYLE_ROTATION)||0,y=x;0!=g&&(y=mxUtils.getBoundingBox(y,g));var f=null!=o&&h.isVertex(c)&&mxUtils.intersects(o,y)||null==o&&(h.isEdge(c)||h.isVertex(c))&&y.x>=t&&y.y+y.height<=d&&y.y>=e&&y.x+y.width<=u;f&&r.push(c),f&&!a||this.getCells(t,e,n,i,c,r,o,l,a)}}}return r},mxGraph.prototype.getCellsBeyond=function(t,e,n,i,s){var r=[];if((i||s)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var o=this.model.getChildCount(n),l=0;l<o;l++){var a=this.model.getChildAt(n,l),h=this.view.getState(a);this.isCellVisible(a)&&null!=h&&(!i||h.x>=t)&&(!s||h.y>=e)&&r.push(a)}return r},mxGraph.prototype.findTreeRoots=function(t,e,n){e=null!=e&&e,n=null!=n&&n;var i=[];if(null!=t){for(var s=this.getModel(),r=s.getChildCount(t),o=null,l=0,a=0;a<r;a++){var h=s.getChildAt(t,a);if(this.model.isVertex(h)&&this.isCellVisible(h)){for(var u=this.getConnections(h,e?t:null),d=0,p=0,m=0;m<u.length;m++){this.view.getVisibleTerminal(u[m],!0)==h?d++:p++}(n&&0==d&&p>0||!n&&0==p&&d>0)&&i.push(h);var c=n?p-d:d-p;c>l&&(l=c,o=h)}}0==i.length&&null!=o&&i.push(o)}return i},mxGraph.prototype.traverse=function(t,e,n,i,s,r){if(null!=n&&null!=t&&(e=null==e||e,r=null!=r&&r,!(s=s||new mxDictionary).get(t))){s.put(t,!0);var o=n(t,i);if(null==o||o){var l=this.model.getEdgeCount(t);if(l>0)for(var a=0;a<l;a++){var h=this.model.getEdgeAt(t,a),u=this.model.getTerminal(h,!0)==t;if(!e||!r==u){var d=this.model.getTerminal(h,!u);this.traverse(d,e,n,h,s,r)}}}}},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 n=this.getCells(t.x,t.y,t.width,t.height);return this.selectCellsForEvent(n,e),n},mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)},mxGraph.prototype.selectPreviousCell=function(){this.selectCell()},mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)},mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)},mxGraph.prototype.selectCell=function(t,e,n){var i=this.selectionModel,s=i.cells.length>0?i.cells[0]:null;i.cells.length>1&&i.clear();var r=null!=s?this.model.getParent(s):this.getDefaultParent(),o=this.model.getChildCount(r);if(null==s&&o>0){var l=this.model.getChildAt(r,0);this.setSelectionCell(l)}else if(null!=s&&!e||null==this.view.getState(r)||null==this.model.getGeometry(r)){if(null!=s&&n){if(this.model.getChildCount(s)>0){l=this.model.getChildAt(s,0);this.setSelectionCell(l)}}else if(o>0){var a=r.getIndex(s);if(t){a++;l=this.model.getChildAt(r,a%o);this.setSelectionCell(l)}else{var h=--a<0?o-1:a;l=this.model.getChildAt(r,h);this.setSelectionCell(l)}}}else this.getCurrentRoot()!=r&&this.setSelectionCell(r)},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var n=e?this.model.filterDescendants(mxUtils.bind(this,(function(e){return e!=t&&null!=this.view.getState(e)})),t):this.model.getChildren(t);null!=n&&this.setSelectionCells(n)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,n,i){n=n||this.getDefaultParent();var s=mxUtils.bind(this,(function(n){return null!=this.view.getState(n)&&((i||0==this.model.getChildCount(n))&&this.model.isVertex(n)&&t&&!this.model.isEdge(this.model.getParent(n))||this.model.isEdge(n)&&e)})),r=this.model.filterDescendants(s,n);null!=r&&this.setSelectionCells(r)},mxGraph.prototype.selectCellForEvent=function(t,e){var n=this.isCellSelected(t);this.isToggleEvent(e)?n?this.removeSelectionCell(t):this.addSelectionCell(t):n&&1==this.getSelectionCount()||this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(null!=t)if(this.model.isEdge(t.cell)){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1),s=this.getCellGeometry(t.cell),r=this.view.getEdgeStyle(t,null!=s?s.points:null,n,i);e=this.createEdgeHandler(t,r)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(t):new mxEdgeHandler(t)},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(null!=this.mouseListeners)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(null==t.graphX||null==t.graphY){var n=mxUtils.convertPoint(this.container,t.getX(),t.getY());t.graphX=n.x-this.panDx,t.graphY=n.y-this.panDy,null==t.getCell()&&this.isMouseDown&&e==mxEvent.MOUSE_MOVE&&(t.state=this.view.getState(this.getCellAt(n.x,n.y,null,null,null,(function(t){return null==t.shape||t.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(t.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=t.shape.fill&&t.shape.fill!=mxConstants.NONE}))))}return t},mxGraph.prototype.getStateForTouchEvent=function(t){var e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=mxUtils.convertPoint(this.container,e,n);return this.view.getState(this.getCellAt(i.x,i.y))},mxGraph.prototype.isEventIgnored=function(t,e,n){var i=mxEvent.isMouseEvent(e.getEvent()),s=!1;return e.getEvent()==this.lastEvent?s=!0:this.lastEvent=e.getEvent(),null!=this.eventSource&&t!=mxEvent.MOUSE_MOVE?(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.mouseMoveRedirect=null,this.mouseUpRedirect=null,this.eventSource=null):mxClient.IS_GC||null==this.eventSource||e.getSource()==this.eventSource?!mxClient.IS_TOUCH||t!=mxEvent.MOUSE_DOWN||i||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)):s=!0,this.isSyntheticEventIgnored(t,e,n)&&(s=!0),!mxEvent.isPopupTrigger(this.lastEvent)&&t!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail||(t==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:t!=mxEvent.MOUSE_DOWN||this.isMouseDown?!s&&((!mxClient.IS_FF||t!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=i||t==mxEvent.MOUSE_DOWN&&this.isMouseDown||t==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(s=!0):(this.isMouseDown=!0,this.isMouseTrigger=i),s||t!=mxEvent.MOUSE_DOWN||(this.lastMouseX=e.getX(),this.lastMouseY=e.getY()),s)},mxGraph.prototype.isSyntheticEventIgnored=function(t,e,n){var i=!1,s=mxEvent.isMouseEvent(e.getEvent());return this.ignoreMouseEvents&&s&&t!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=t!=mxEvent.MOUSE_UP,i=!0):mxClient.IS_FF&&!s&&t==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0),i},mxGraph.prototype.isEventSourceIgnored=function(t,e){var n=e.getSource(),i=null!=n.nodeName?n.nodeName.toLowerCase():"",s=!mxEvent.isMouseEvent(e.getEvent())||mxEvent.isLeftMouseButton(e.getEvent());return t==mxEvent.MOUSE_DOWN&&s&&("select"==i||"option"==i||"input"==i&&"checkbox"!=n.type&&"radio"!=n.type&&"button"!=n.type&&"submit"!=n.type&&"file"!=n.type)},mxGraph.prototype.getEventState=function(t){return t},mxGraph.prototype.fireMouseEvent=function(t,e,n){if(this.isEventSourceIgnored(t,e))null!=this.tooltipHandler&&this.tooltipHandler.hide();else{if(null==n&&(n=this),e=this.updateMouseEvent(e,t),!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(e.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))){var i=(new Date).getTime();if(!mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_DOWN||mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_UP&&!this.fireDoubleClick)if(null!=this.lastTouchEvent&&this.lastTouchEvent!=e.getEvent()&&i-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 s=!1;if(t==mxEvent.MOUSE_UP){if(e.getCell()==this.lastTouchCell&&null!=this.lastTouchCell){this.lastTouchTime=0;var r=this.lastTouchCell;this.lastTouchCell=null,mxClient.IS_QUIRKS&&e.getSource().fireEvent("ondblclick"),this.dblClick(e.getEvent(),r),s=!0}}else this.fireDoubleClick=!0,this.lastTouchTime=0;if(!mxClient.IS_QUIRKS||s)return void mxEvent.consume(e.getEvent())}else null!=this.lastTouchEvent&&this.lastTouchEvent==e.getEvent()||(this.lastTouchCell=e.getCell(),this.lastTouchX=e.getX(),this.lastTouchY=e.getY(),this.lastTouchTime=i,this.lastTouchEvent=e.getEvent(),this.doubleClickCounter=0);else if((this.isMouseDown||t==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;r=this.lastTouchCell;return this.lastTouchCell=null,this.isMouseDown=!1,void((null!=r||(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance?this.dblClick(e.getEvent(),r):mxEvent.consume(e.getEvent()))}}if(!this.isEventIgnored(t,e,n)){if(e.state=this.getEventState(e.getState()),this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",t,"event",e)),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&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){var o=this.view.scale,l=this.view.translate;this.view.setTranslate(l.x-this.container.scrollLeft/o,l.y-this.container.scrollTop/o),this.container.scrollLeft=0,this.container.scrollTop=0}if(null!=this.mouseListeners){var a=[n,e];e.getEvent().preventDefault||(e.getEvent().returnValue=!0);for(var h=0;h<this.mouseListeners.length;h++){var u=this.mouseListeners[h];t==mxEvent.MOUSE_DOWN?u.mouseDown.apply(u,a):t==mxEvent.MOUSE_MOVE?u.mouseMove.apply(u,a):t==mxEvent.MOUSE_UP&&u.mouseUp.apply(u,a)}}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=!0,this.initialTouchX=e.getGraphX(),this.initialTouchY=e.getGraphY();this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,(function(){this.tapAndHoldValid&&this.tapAndHold(e),this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1})),this.tapAndHoldDelay),this.tapAndHoldValid=!0}else t==mxEvent.MOUSE_UP?(this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1):this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-e.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-e.getGraphY())<this.tolerance);t==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(e.getEvent())&&this.stopEditing(!this.isInvokesStopCellEditing()),this.consumeMouseEvent(t,e,n)}}},mxGraph.prototype.consumeMouseEvent=function(t,e,n){t==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(e.getEvent())&&e.consume(!1)},mxGraph.prototype.fireGestureEvent=function(t,e){this.lastTouchTime=0,this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",t,"cell",e))},mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)},__mxOutput.mxGraph=void 0!==mxGraph?mxGraph:void 0,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),n=t.view.scale,i=null,s=this.image.width,r=this.image.height;if(e){var o=t.absolutePoints;if(o.length%2==1)i=o[Math.floor(o.length/2)];else{var l=o.length/2,a=o[l-1],h=o[l];i=new mxPoint(a.x+(h.x-a.x)/2,a.y+(h.y-a.y)/2)}}else i=new mxPoint,this.align==mxConstants.ALIGN_LEFT?i.x=t.x:this.align==mxConstants.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==mxConstants.ALIGN_TOP?i.y=t.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height;return new mxRectangle(Math.round(i.x-(s*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(r*this.defaultOverlap-this.offset.y)*n),s*n,r*n)},mxCellOverlay.prototype.toString=function(){return this.tooltip},__mxOutput.mxCellOverlay=void 0!==mxCellOverlay?mxCellOverlay:void 0,mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.labelsVisible=!1,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.minScale=1e-4,mxOutline.prototype.suspended=!1,mxOutline.prototype.forceVmlHandles=8==document.documentMode,mxOutline.prototype.createGraph=function(t){var e=new mxGraph(t,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet());return e.foldingEnabled=!1,e.autoScroll=!1,e},mxOutline.prototype.init=function(t){this.outline=this.createGraph(t);var e=this.outline.graphModelChanged;if(this.outline.graphModelChanged=mxUtils.bind(this,(function(t){this.suspended||null==this.outline||e.apply(this.outline,arguments)})),mxClient.IS_SVG){var n=this.outline.getView().getCanvas().parentNode;n.setAttribute("shape-rendering","optimizeSpeed"),n.setAttribute("image-rendering","optimizeSpeed")}this.outline.labelsVisible=this.labelsVisible,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,(function(t,e){this.suspended||this.active||this.update()})),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this);var i=this.source.getView();i.addListener(mxEvent.SCALE,this.updateHandler),i.addListener(mxEvent.TRANSLATE,this.updateHandler),i.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),i.addListener(mxEvent.DOWN,this.updateHandler),i.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,(function(t){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,this.forceVmlHandles&&(this.selectionBorder.isHtmlAllowed=function(){return!1}),this.selectionBorder.init(this.outline.getView().getOverlayPane());var s=mxUtils.bind(this,(function(t){var e=mxEvent.getSource(t),n=mxUtils.bind(this,(function(t){this.outline.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))})),i=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}));mxEvent.addGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}));mxEvent.addGestureListeners(this.selectionBorder.node,s),this.sizer=this.createSizer(),this.forceVmlHandles&&(this.sizer.isHtmlAllowed=function(){return!1}),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="nwse-resize"),mxEvent.addGestureListeners(this.sizer.node,s),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(!1)},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(!0)},mxOutline.prototype.createSizer=function(){var t;return null!=this.sizerImage?((t=new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src)).dialect=this.outline.dialect,t):((t=new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR)).dialect=this.outline.dialect,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(null!=this.source&&null!=this.source.container&&null!=this.outline&&null!=this.outline.container){var e=this.source.view.scale,n=this.getSourceGraphBounds(),i=new mxRectangle(n.x/e+this.source.panDx,n.y/e+this.source.panDy,n.width/e,n.height/e),s=new mxRectangle(0,0,this.source.container.clientWidth/e,this.source.container.clientHeight/e),r=i.clone();r.add(s);var o=this.getSourceContainerSize(),l=Math.max(o.width/e,r.width),a=Math.max(o.height/e,r.height),h=Math.max(0,this.outline.container.clientWidth-this.border),u=Math.max(0,this.outline.container.clientHeight-this.border),d=Math.min(h/l,u/a),p=isNaN(d)?this.minScale:Math.max(this.minScale,d);if(p>0){this.outline.getView().scale!=p&&(this.outline.getView().scale=p,t=!0);var m=this.outline.getView();m.currentRoot!=this.source.getView().currentRoot&&m.setCurrentRoot(this.source.getView().currentRoot);var c=this.source.view.translate,x=c.x+this.source.panDx,g=c.y+this.source.panDy,y=this.getOutlineOffset(p);null!=y&&(x+=y.x,g+=y.y),i.x<0&&(x-=i.x),i.y<0&&(g-=i.y),m.translate.x==x&&m.translate.y==g||(m.translate.x=x,m.translate.y=g,t=!0);var f=m.translate,v=(p=this.source.getView().scale)/m.scale,C=1/m.scale,E=this.source.container;this.bounds=new mxRectangle((f.x-c.x-this.source.panDx)/C,(f.y-c.y-this.source.panDy)/C,E.clientWidth/v,E.clientHeight/v),this.bounds.x+=this.source.container.scrollLeft*m.scale/p,this.bounds.y+=this.source.container.scrollTop*m.scale/p,(S=this.selectionBorder.bounds).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,T=new mxRectangle(this.bounds.x+this.bounds.width-S.width/2,this.bounds.y+this.bounds.height-S.height/2,S.width,S.height);S.x==T.x&&S.y==T.y&&S.width==T.width&&S.height==T.height||(this.sizer.bounds=T,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var n=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,i=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||n>0)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null;this.zoom=e.isSource(this.sizer)||null!=i&&mxUtils.intersects(shape.bounds,i),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(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 n=this.getTranslateForEvent(e),i=n.x,s=n.y,r=null;if(this.zoom){var o=this.source.container;s=i/(o.clientWidth/o.clientHeight),r=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+i),Math.max(1,this.bounds.height+s)),this.selectionBorder.bounds=r,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;r=new mxRectangle(this.bounds.x+i,this.bounds.y+s,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=r,this.selectionBorder.redraw(),i/=l,i*=this.source.getView().scale,s/=l,s*=this.source.getView().scale,this.source.panGraph(-i-this.dx0,-s-this.dy0)}var a=this.sizer.bounds;this.sizer.bounds=new mxRectangle(r.x+r.width-a.width/2,r.y+r.height-a.height/2,a.width,a.height),"hidden"!=this.sizer.node.style.visibility&&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 n=this.getTranslateForEvent(e),i=n.x,s=n.y;if(Math.abs(i)>0||Math.abs(s)>0){if(this.zoom){var r=this.selectionBorder.bounds.width,o=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,o-i*o/r),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),i/=this.outline.getView().scale,s/=this.outline.getView().scale;var l=this.source.getView().translate;this.source.getView().setTranslate(l.x-i,l.y-s)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(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),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=void 0!==mxOutline?mxOutline:void 0,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=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,n,i,s,r){var o="";(this.source&&this.checkTerminal(t,n,e)||!this.source&&this.checkTerminal(t,i,e))&&(null!=this.countError&&(this.source&&(0==this.max||s>=this.max)||!this.source&&(0==this.max||r>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&this.validNeighbors.length>0&&(this.checkNeighbors(t,e,n,i)||(o+=this.typeError+"\n")));return o.length>0?o:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,n,i){for(var s=t.model.getValue(n),r=t.model.getValue(i),o=!this.validNeighborsAllowed,l=this.validNeighbors,a=0;a<l.length;a++){if(this.source&&this.checkType(t,r,l[a])){o=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(t,s,l[a])){o=this.validNeighborsAllowed;break}}return o},mxMultiplicity.prototype.checkTerminal=function(t,e,n){var i=t.model.getValue(e);return this.checkType(t,i,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(t,e,n,i,s){return null!=e&&(isNaN(e.nodeType)?e==n:mxUtils.isNode(e,n,i,s))},__mxOutput.mxMultiplicity=void 0!==mxMultiplicity?mxMultiplicity:void 0,mxLayoutManager.prototype=new mxEventSource,mxLayoutManager.prototype.constructor=mxLayoutManager,mxLayoutManager.prototype.graph=null,mxLayoutManager.prototype.bubbling=!0,mxLayoutManager.prototype.enabled=!0,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){null!=this.graph&&(this.graph.getModel().removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler),this.graph.removeListener(this.resizeHandler));(this.graph=t,null!=this.graph)&&(this.graph.getModel().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(null!=t&&null!=e)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.getGraph().getModel(),s=0;s<t.length;s++){var r=this.getLayout(i.getParent(t[s]),mxEvent.MOVE_CELLS);null!=r&&r.moveCell(t[s],n.x,n.y)}},mxLayoutManager.prototype.cellsResized=function(t,e,n){if(null!=t&&null!=e)for(var i=this.getGraph().getModel(),s=0;s<t.length;s++){var r=this.getLayout(i.getParent(t[s]),mxEvent.RESIZE_CELLS);null!=r&&r.resizeCell(t[s],e[s],n[s])}},mxLayoutManager.prototype.getCellsForChanges=function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(i instanceof mxRootChange)return[];e=e.concat(this.getCellsForChange(i))}return e},mxLayoutManager.prototype.getCellsForChange=function(t){return t instanceof mxChildChange?this.addCellsWithLayout(t.child,this.addCellsWithLayout(t.previous)):t instanceof mxTerminalChange||t instanceof mxGeometryChange||t instanceof mxVisibleChange||t instanceof mxStyleChange?this.addCellsWithLayout(t.cell):[]},mxLayoutManager.prototype.addCellsWithLayout=function(t,e){return this.addDescendantsWithLayout(t,this.addAncestorsWithLayout(t,e))},mxLayoutManager.prototype.addAncestorsWithLayout=function(t,e){if((e=null!=e?e:[],null!=t)&&(null!=this.hasLayout(t)&&e.push(t),this.isBubbling())){var n=this.getGraph().getModel();this.addAncestorsWithLayout(n.getParent(t),e)}return e},mxLayoutManager.prototype.addDescendantsWithLayout=function(t,e){if(e=null!=e?e:[],null!=t&&this.hasLayout(t))for(var n=this.getGraph().getModel(),i=0;i<n.getChildCount(t);i++){var s=n.getChildAt(t,i);this.hasLayout(s)&&(e.push(s),this.addDescendantsWithLayout(s,e))}return e},mxLayoutManager.prototype.executeLayoutForCells=function(t){var e=mxUtils.sortCells(t,!1);this.layoutCells(e,!0),this.layoutCells(e.reverse(),!1)},mxLayoutManager.prototype.layoutCells=function(t,e){if(t.length>0){var n=this.getGraph().getModel();n.beginUpdate();try{for(var i=null,s=0;s<t.length;s++)t[s]!=n.getRoot()&&t[s]!=i&&(this.executeLayout(t[s],e),i=t[s]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",t))}finally{n.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(t,e){var n=this.getLayout(t,e?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);null!=n&&n.execute(t)},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxLayoutManager=void 0!==mxLayoutManager?mxLayoutManager:void 0,mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,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){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=t,null!=this.graph&&(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 1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)this.isSwimlaneIgnored(t[n])||this.swimlaneAdded(t[n])}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(t){for(var e=this.getGraph().getModel(),n=e.getParent(t),i=e.getChildCount(n),s=null,r=0;r<i;r++){var o=e.getChildAt(n,r);if(o!=t&&!this.isSwimlaneIgnored(o)&&null!=(s=e.getGeometry(o)))break}if(null!=s){var l=null!=n?this.isCellHorizontal(n):this.horizontal;this.resizeSwimlane(t,s.width,s.height,l)}},mxSwimlaneManager.prototype.cellsResized=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)if(!this.isSwimlaneIgnored(t[n])){var i=e.getGeometry(t[n]);if(null!=i){for(var s=new mxRectangle(0,0,i.width,i.height),r=t[n],o=r;null!=o;){r=o,o=e.getParent(o);var l=this.graph.isSwimlane(o)?this.graph.getStartSize(o):new mxRectangle;s.width+=l.width,s.height+=l.height}var a=null!=o?this.isCellHorizontal(o):this.horizontal;this.resizeSwimlane(r,s.width,s.height,a)}}}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(t,e,n,i){var s=this.getGraph().getModel();s.beginUpdate();try{var r=this.isCellHorizontal(t);if(!this.isSwimlaneIgnored(t)){var o=s.getGeometry(t);null!=o&&(i&&o.height!=n||!i&&o.width!=e)&&(o=o.clone(),i?o.height=n:o.width=e,s.setGeometry(t,o))}var l=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;e-=l.width,n-=l.height;for(var a=s.getChildCount(t),h=0;h<a;h++){var u=s.getChildAt(t,h);this.resizeSwimlane(u,e,n,r)}}finally{s.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxSwimlaneManager=void 0!==mxSwimlaneManager?mxSwimlaneManager:void 0,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=void 0!==mxTemporaryCellStates?mxTemporaryCellStates:void 0,mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(t,e,n,i,s){i=null==i||i,s=null==s||s;var r=this.deltas.get(t.cell);return null==r?(r={point:new mxPoint(e,n),state:t},this.deltas.put(t.cell,r),this.count++):i?(r.point.x+=e,r.point.y+=n):(r.point.x=e,r.point.y=n),s&&this.addEdges(t),r.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,n){this.revalidateState(n.state,n.point.x,n.point.y,t)})))},mxCellStatePreview.prototype.translateState=function(t,e,n){if(null!=t){var i=this.graph.getModel();if(i.isVertex(t.cell)){t.view.updateCellState(t);var s=i.getGeometry(t.cell);0==e&&0==n||null==s||s.relative&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n)}for(var r=i.getChildCount(t.cell),o=0;o<r;o++)this.translateState(t.view.getState(i.getChildAt(t.cell,o)),e,n)}},mxCellStatePreview.prototype.revalidateState=function(t,e,n,i){if(null!=t){var s=this.graph.getModel();s.isEdge(t.cell)&&t.view.updateCellState(t);var r=this.graph.getCellGeometry(t.cell),o=t.view.getState(s.getParent(t.cell));0==e&&0==n||null==r||!r.relative||!s.isVertex(t.cell)||null!=o&&!s.isVertex(o.cell)&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n),this.graph.cellRenderer.redraw(t),null!=i&&i(t);for(var l=s.getChildCount(t.cell),a=0;a<l;a++)this.revalidateState(this.graph.view.getState(s.getChildAt(t.cell,a)),e,n,i)}},mxCellStatePreview.prototype.addEdges=function(t){for(var e=this.graph.getModel(),n=e.getEdgeCount(t.cell),i=0;i<n;i++){var s=t.view.getState(e.getEdgeAt(t.cell,i));null!=s&&this.moveState(s,0,0)}},__mxOutput.mxCellStatePreview=void 0!==mxCellStatePreview?mxCellStatePreview:void 0,mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxConnectionConstraint.prototype.name=null,mxConnectionConstraint.prototype.dx=null,mxConnectionConstraint.prototype.dy=null,__mxOutput.mxConnectionConstraint=void 0!==mxConnectionConstraint?mxConnectionConstraint:void 0,mxGraphHandler.prototype.graph=null,mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50,mxGraphHandler.prototype.enabled=!0,mxGraphHandler.prototype.highlightEnabled=!0,mxGraphHandler.prototype.cloneEnabled=!0,mxGraphHandler.prototype.moveEnabled=!0,mxGraphHandler.prototype.guidesEnabled=!1,mxGraphHandler.prototype.handlesVisible=!0,mxGraphHandler.prototype.guide=null,mxGraphHandler.prototype.currentDx=null,mxGraphHandler.prototype.currentDy=null,mxGraphHandler.prototype.updateCursor=!0,mxGraphHandler.prototype.selectEnabled=!0,mxGraphHandler.prototype.removeCellsFromParent=!0,mxGraphHandler.prototype.removeEmptyParents=!1,mxGraphHandler.prototype.connectOnDrop=!1,mxGraphHandler.prototype.scrollOnMove=!0,mxGraphHandler.prototype.minimumSize=6,mxGraphHandler.prototype.previewColor="black",mxGraphHandler.prototype.htmlPreview=!1,mxGraphHandler.prototype.shape=null,mxGraphHandler.prototype.scaleGrid=!1,mxGraphHandler.prototype.rotationEnabled=!0,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,n){var i=this.graph.model.getParent(t);if(e){var s=this.graph.model.isEdge(t)?null:this.graph.getCellGeometry(t);return!this.graph.isSiblingSelected(t)&&(null!=s&&s.relative||!this.graph.isSwimlane(i))}return(!this.graph.isToggleEvent(n.getEvent())||!this.graph.isSiblingSelected(t)&&!this.graph.isCellSelected(t)&&!this.graph.isSwimlane(i)||this.graph.isCellSelected(i))&&(this.graph.isToggleEvent(n.getEvent())||!this.graph.isCellSelected(i))},mxGraphHandler.prototype.getInitialCellForEvent=function(t){var e=t.getState();if(!(this.graph.isToggleEvent(t.getEvent())&&mxEvent.isAltDown(t.getEvent())||null==e||this.graph.isCellSelected(e.cell)))for(var n=this.graph.model,i=this.graph.view.getState(n.getParent(e.cell));null!=i&&!this.graph.isCellSelected(i.cell)&&(n.isVertex(i.cell)||n.isEdge(i.cell))&&this.isPropagateSelectionCell(e.cell,!0,t);)e=i,i=this.graph.view.getState(this.graph.getModel().getParent(e.cell));return null!=e?e.cell:null},mxGraphHandler.prototype.isDelayedSelection=function(t,e){if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent()))for(;null!=t;){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();null==e&&(e=this.cell),this.selectCellForEvent(e,t)}},mxGraphHandler.prototype.selectCellForEvent=function(t,e){var n=this.graph.view.getState(t);if(null!=n)if(e.isSource(n.control))this.graph.selectCellForEvent(t,e.getEvent());else{if(!this.graph.isToggleEvent(e.getEvent())||!mxEvent.isAltDown(e.getEvent()))for(var i=this.graph.getModel(),s=i.getParent(t);null!=this.graph.view.getState(s)&&(i.isVertex(s)||i.isEdge(s))&&this.isPropagateSelectionCell(t,!1,e);)t=s,s=i.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()&&null!=e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())){var n=this.getInitialCellForEvent(e);if(this.delayedSelection=this.isDelayedSelection(n,e),this.cell=null,this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(n,e.getEvent()),this.isMoveEnabled()){var i=this.graph.model,s=i.getGeometry(n);this.graph.isCellMovable(n)&&(!i.isEdge(n)||this.graph.getSelectionCount()>1||null!=s.points&&s.points.length>0||null==i.getTerminal(n,!0)||null==i.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(n,e.getX(),e.getY()):this.delayedSelection&&(this.cell=n),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),n=mxUtils.bind(this,(function(t){return null!=this.graph.view.getState(t)&&e.isVertex(t)&&null!=e.getGeometry(t)&&!e.getGeometry(t).relative}));return this.graph.view.getCellStates(e.filterDescendants(n,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(null!=e){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width<this.minimumSize){var n=this.minimumSize-e.width;e.x-=n/2,e.width=this.minimumSize}else e.x=Math.round(e.x),e.width=Math.ceil(e.width);if(this.graph.view.translate,this.graph.view.scale,e.height<this.minimumSize){var i=this.minimumSize-e.height;e.y-=i/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(null!=t&&t.length>0)for(var n=this.graph.getModel(),i=0;i<t.length;i++)if(n.isVertex(t[i])||n.isEdge(t[i])){var s=this.graph.view.getState(t[i]);if(null!=s){var r=s;n.isVertex(t[i])&&null!=s.shape&&null!=s.shape.boundingBox&&(r=s.shape.boundingBox),null==e?e=mxRectangle.fromRectangle(r):e.add(r)}}return e},mxGraphHandler.prototype.createPreviewShape=function(t){var e=new mxRectangleShape(t,null,this.previewColor);return e.isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1,mxClient.IS_IOS&&(e.getSvgScreenOffset=function(){return 0})),e},mxGraphHandler.prototype.start=function(t,e,n,i){this.cell=t,this.first=mxUtils.convertPoint(this.graph.container,e,n),this.cells=null!=i?i:this.getCells(this.cell),this.bounds=this.graph.getView().getBounds(this.cells),this.pBounds=this.getPreviewBounds(this.cells),this.allCells=new mxDictionary,this.cloning=!1,this.cellCount=0;for(var s=0;s<this.cells.length;s++)this.cellCount+=this.addStates(this.cells[s],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var r=this.graph.model.getParent(t),o=this.graph.model.getChildCount(r)<2,l=new mxDictionary,a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(s=0;s<a.length;s++){var h=this.graph.view.getState(a[s]);null==h||l.get(h)||l.put(h,!0)}this.guide.isStateIgnored=mxUtils.bind(this,(function(t){var e=this.graph.model.getParent(t.cell);return null!=t.cell&&(!this.cloning&&this.isCellMoving(t.cell)||t.cell!=(this.target||r)&&!o&&!l.get(t)&&(null==this.target||this.graph.model.getChildCount(this.target)>=2)&&e!=(this.target||r))}))}},mxGraphHandler.prototype.addStates=function(t,e){var n=this.graph.view.getState(t),i=0;if(null!=n&&null==e.get(t)){e.put(t,n),i++;for(var s=this.graph.model.getChildCount(t),r=0;r<s;r++)i+=this.addStates(this.graph.model.getChildAt(t,r),e)}return i},mxGraphHandler.prototype.isCellMoving=function(t){return null!=this.allCells.get(t)},mxGraphHandler.prototype.useGuidesForEvent=function(t){return null==this.guide||this.guide.isEnabledForEvent(t.getEvent())&&!this.graph.isConstrainedEvent(t.getEvent())},mxGraphHandler.prototype.snap=function(t){var e=this.scaleGrid?this.graph.view.scale:1;return t.x=this.graph.snap(t.x/e)*e,t.y=this.graph.snap(t.y/e)*e,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(100*t)/100};mxGraphHandler.prototype.isValidDropTarget=function(t,e){return this.graph.model.getParent(this.cell)!=t},mxGraphHandler.prototype.checkPreview=function(){this.livePreviewActive&&this.cloning?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?this.cloning&&this.livePreviewActive||(this.livePreviewActive=!0,this.livePreviewUsed=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))},mxGraphHandler.prototype.mouseMove=function(t,e){var n=this.graph;if(e.isConsumed()||!n.isMouseDown||null==this.cell||null==this.first||null==this.bounds||this.suspended){if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(null!=e.getState()||null!=e.sourceState)&&!n.isMouseDown){var i=n.getCursorForMouseEvent(e);null==i&&n.isEnabled()&&n.isCellMovable(e.getCell())&&(i=n.getModel().isEdge(e.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=i&&null!=e.sourceState&&e.sourceState.setCursor(i)}}else{if(mxEvent.isMultiTouchEvent(e.getEvent()))return void this.reset();var s=this.getDelta(e),r=n.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(s.x)>r||Math.abs(s.y)>r){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var o=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),l=n.isGridEnabledEvent(e.getEvent()),a=e.getCell(),h=!0,u=null;this.cloning=o,n.isDropEnabled()&&this.highlightEnabled&&(u=n.getDropTarget(this.cells,e.getEvent(),a,o));var d=n.getView().getState(u),p=!1;if(null!=d&&(o||this.isValidDropTarget(u,e)))this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0;else if(this.target=null,this.connectOnDrop&&null!=a&&1==this.cells.length&&n.getModel().isVertex(a)&&n.isCellConnectable(a)&&null!=(d=n.getView().getState(a))){var m=null==n.getEdgeValidationError(null,this.cell,a)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(m),p=!0}null!=d&&p?this.highlight.highlight(d):this.highlight.hide(),null!=this.guide&&this.useGuidesForEvent(e)?(s=this.guide.move(this.bounds,s,l,o),h=!1):s=this.graph.snapDelta(s,this.bounds,!l,!1,!1),null!=this.guide&&h&&this.guide.hide(),n.isConstrainedEvent(e.getEvent())&&(Math.abs(s.x)>Math.abs(s.y)?s.y=0:s.x=0),this.checkPreview(),this.currentDx==s.x&&this.currentDy==s.y||(this.currentDx=s.x,this.currentDy=s.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(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 n=[];if(null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,(function(i,s){var r=this.graph.view.getState(s.cell);if(r!=s&&(s.destroy(),null!=r?this.allCells.put(s.cell,r):this.allCells.remove(s.cell),s=r),null!=s){var o=s.clone();n.push([s,o]),null!=s.shape&&(null==s.shape.originalPointerEvents&&(s.shape.originalPointerEvents=s.shape.pointerEvents),s.shape.pointerEvents=!1,null!=s.text&&(null==s.text.originalPointerEvents&&(s.text.originalPointerEvents=s.text.pointerEvents),s.text.pointerEvents=!1)),this.graph.model.isVertex(s.cell)&&(s.x+=t,s.y+=e,this.cloning?null!=s.text&&(s.text.updateBoundingBox(),null!=s.text.boundingBox&&(s.text.boundingBox.x+=t,s.text.boundingBox.y+=e),null!=s.text.unrotatedBoundingBox&&(s.text.unrotatedBoundingBox.x+=t,s.text.unrotatedBoundingBox.y+=e)):(s.view.graph.cellRenderer.redraw(s,!0),s.view.invalidate(s.cell),s.invalid=!1,null!=s.control&&null!=s.control.node&&(s.control.node.style.visibility="hidden")))}}))),0==n.length)this.reset();else{for(var i=this.graph.view.scale,s=0;s<n.length;s++){var r=n[s][0];if(this.graph.model.isEdge(r.cell)){var o=this.graph.getCellGeometry(r.cell),l=[];if(null!=o&&null!=o.points)for(var a=0;a<o.points.length;a++)null!=o.points[a]&&l.push(new mxPoint(o.points[a].x+t/i,o.points[a].y+e/i));var h=r.visibleSourceState,u=r.visibleTargetState,d=n[s][1].absolutePoints;if(null!=h&&this.isCellMoving(h.cell))r.view.updateFixedTerminalPoint(r,h,!0,this.graph.getConnectionConstraint(r,h,!0));else{var p=d[0];r.setAbsoluteTerminalPoint(new mxPoint(p.x+t,p.y+e),!0),h=null}if(null!=u&&this.isCellMoving(u.cell))r.view.updateFixedTerminalPoint(r,u,!1,this.graph.getConnectionConstraint(r,u,!1));else{var m=d[d.length-1];r.setAbsoluteTerminalPoint(new mxPoint(m.x+t,m.y+e),!1),u=null}r.view.updatePoints(r,l,h,u),r.view.updateFloatingTerminalPoints(r,h,u),r.view.updateEdgeLabelOffset(r),r.invalid=!1,this.cloning||r.view.graph.cellRenderer.redraw(r,!0)}}this.graph.view.validate(),this.redrawHandles(n),this.resetPreviewStates(n)}}},mxGraphHandler.prototype.redrawHandles=function(t){for(var e=0;e<t.length;e++){var n=this.graph.selectionCellsHandler.getHandler(t[e][0].cell);null!=n&&n.redraw(!0)}},mxGraphHandler.prototype.resetPreviewStates=function(t){for(var e=0;e<t.length;e++)t[e][0].setState(t[e][1])},mxGraphHandler.prototype.suspend=function(){this.suspended||(this.livePreviewUsed&&this.updateLivePreview(0,0),null!=this.shape&&(this.shape.node.style.visibility="hidden"),null!=this.guide&&this.guide.setVisible(!1),this.suspended=!0)},mxGraphHandler.prototype.resume=function(){this.suspended&&(this.suspended=null,this.livePreviewUsed&&(this.livePreviewActive=!0),null!=this.shape&&(this.shape.node.style.visibility="visible"),null!=this.guide&&this.guide.setVisible(!0))},mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.allCells.visit(mxUtils.bind(this,(function(t,e){null!=e.shape&&null!=e.shape.originalPointerEvents&&(e.shape.pointerEvents=e.shape.originalPointerEvents,e.shape.originalPointerEvents=null,e.shape.bounds=null,null!=e.text&&(e.text.pointerEvents=e.text.originalPointerEvents,e.text.originalPointerEvents=null)),null!=e.control&&null!=e.control.node&&"hidden"==e.control.node.style.visibility&&(e.control.node.style.visibility=""),this.cloning||null!=e.text&&e.text.updateBoundingBox(),e.view.invalidate(e.cell)}))),this.graph.view.validate())},mxGraphHandler.prototype.setHandlesVisibleForCells=function(t,e,n){if(n||this.handlesVisible!=e){this.handlesVisible=e;for(var i=0;i<t.length;i++){var s=this.graph.selectionCellsHandler.getHandler(t[i]);null!=s&&(s.setHandlesVisible(e),e&&s.redraw())}}},mxGraphHandler.prototype.setHighlightColor=function(t){null!=this.highlight&&this.highlight.setHighlightColor(t)},mxGraphHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed())if(this.livePreviewUsed&&this.resetLivePreview(),null==this.cell||null==this.first||null==this.shape&&!this.livePreviewUsed||null==this.currentDx||null==this.currentDy)this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(e);else{var n=this.graph,i=e.getCell();if(this.connectOnDrop&&null==this.target&&null!=i&&n.getModel().isVertex(i)&&n.isCellConnectable(i)&&n.isEdgeValid(null,this.cell,i))n.connectionHandler.connect(this.cell,i,e.getEvent());else{var s=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),r=n.getView().scale,o=this.roundLength(this.currentDx/r),l=this.roundLength(this.currentDy/r),a=this.target;n.isSplitEnabled()&&n.isSplitTarget(a,this.cells,e.getEvent())?n.splitEdge(a,this.cells,null,o,l,e.getGraphX(),e.getGraphY()):this.moveCells(this.cells,o,l,s,this.target,e.getEvent())}}this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,e),this.reset()},mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!0)),this.destroyShapes(),this.removeHint(),this.delayedSelection=!1,this.livePreviewActive=null,this.livePreviewUsed=null,this.cellWasClicked=!1,this.suspended=null,this.currentDx=null,this.currentDy=null,this.cellCount=null,this.cloning=!1,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,n){if(this.graph.getModel().isVertex(t)){var i=this.graph.getView().getState(t);if(null!=i){var s=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),r=mxUtils.toRadians(mxUtils.getValue(i.style,mxConstants.STYLE_ROTATION)||0);if(0!=r){var o=Math.cos(-r),l=Math.sin(-r),a=new mxPoint(i.getCenterX(),i.getCenterY());s=mxUtils.getRotatedPoint(s,o,l,a)}return!mxUtils.contains(i,s.x,s.y)}}return!1},mxGraphHandler.prototype.moveCells=function(t,e,n,i,s,r){i&&(t=this.graph.getCloneableCells(t));var o=this.graph.getModel().getParent(this.cell);null==s&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(o,t,r)&&(s=this.graph.getDefaultParent()),i=i&&!this.graph.isCellLocked(s||this.graph.getDefaultParent()),this.graph.getModel().beginUpdate();try{var l=[];if(!i&&null!=s&&this.removeEmptyParents){for(var a=new mxDictionary,h=0;h<t.length;h++)a.put(t[h],!0);for(h=0;h<t.length;h++){var u=this.graph.model.getParent(t[h]);null==u||a.get(u)||(a.put(u,!0),l.push(u))}}t=this.graph.moveCells(t,e,n,i,s,r);var d=[];for(h=0;h<l.length;h++)this.shouldRemoveParent(l[h])&&d.push(l[h]);this.graph.removeCells(d,!1)}finally{this.graph.getModel().endUpdate()}i&&this.graph.setSelectionCells(t),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(t[0])},mxGraphHandler.prototype.shouldRemoveParent=function(t){var e=this.graph.view.getState(t);return null!=e&&(this.graph.model.isEdge(e.cell)||this.graph.model.isVertex(e.cell))&&this.graph.isCellDeletable(e.cell)&&0==this.graph.model.getChildCount(e.cell)&&this.graph.isTransparentState(e)},mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.guide&&(this.guide.destroy(),this.guide=null),null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)},mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.panHandler),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.refreshHandler&&(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=void 0!==mxGraphHandler?mxGraphHandler:void 0,mxPanningHandler.prototype=new mxEventSource,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.pinchEnabled=!0,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||null!=this.initialScale},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&&null==t.getState()&&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,!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=!0},mxPanningHandler.prototype.consumePanningTrigger=function(t){t.consume()},mxPanningHandler.prototype.mouseMove=function(t,e){if(this.dx=e.getX()-this.startX,this.dy=e.getY()-this.startY,this.active)this.previewEnabled&&(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 n=this.active;this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!n&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var n=this.graph.getView().scale,i=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(i.x+this.dx/n,i.y+this.dy/n)}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;null!=this.minScale&&(e=Math.max(this.minScale,e)),null!=this.maxScale&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,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=void 0!==mxPanningHandler?mxPanningHandler:void 0,mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,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){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=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(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=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var n=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var i=mxUtils.getScrollOrigin();this.popup(e.getX()+i.x+1,e.getY()+i.y+1,n,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},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=void 0!==mxPopupMenuHandler?mxPopupMenuHandler:void 0,mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,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 null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,null!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,n){var i=null!=t&&this.isValidState(t);n=null!=n?n:this.getMarkerColor(e.getEvent(),t,i),this.validState=i?t:null,t==this.markedState&&n==this.currentColor||(this.currentColor=n,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var n=this.graph.getView().getState(t);null!=n&&(this.currentColor=null!=e?e:this.validColor,this.markedState=n,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!0},mxCellMarker.prototype.getMarkerColor=function(t,e,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),n=this.getCell(t),i=this.getStateToMark(e.getState(n));return null!=i&&this.intersects(i,t)?i:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return!this.hotspotEnabled||mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=void 0!==mxCellMarker?mxCellMarker:void 0,mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,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 null!=this.getHandler(t)},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;for(var e=mxUtils.sortCells(this.getHandledSelectionCells(),!1),n=0;n<e.length;n++){if(null!=(i=this.graph.view.getState(e[n])))null!=(s=t.remove(e[n]))&&(s.state!=i?(s.destroy(),s=null):this.isHandlerActive(s)||(null!=s.refresh&&s.refresh(),s.redraw())),null!=s&&this.handlers.put(e[n],s)}t.visit(mxUtils.bind(this,(function(t,e){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",e.state)),e.destroy()})));for(n=0;n<e.length;n++){var i,s;if(null!=(i=this.graph.view.getState(e[n])))null==(s=this.handlers.get(e[n]))?(s=this.graph.createHandler(i),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",i)),this.handlers.put(e[n],s)):s.updateParentHighlight()}},mxSelectionCellsHandler.prototype.isHandlerActive=function(t){return null!=t.index},mxSelectionCellsHandler.prototype.updateHandler=function(t){var e=this.handlers.remove(t.cell);if(null!=e){var n=e.index,i=e.startX,s=e.startY;e.destroy(),null!=(e=this.graph.createHandler(t))&&(this.handlers.put(t.cell,e),null!=n&&null!=i&&null!=s&&e.start(i,s,n))}},mxSelectionCellsHandler.prototype.mouseDown=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit((function(t,e){e.mouseDown.apply(e,n)}))}},mxSelectionCellsHandler.prototype.mouseMove=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit((function(t,e){e.mouseMove.apply(e,n)}))}},mxSelectionCellsHandler.prototype.mouseUp=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit((function(t,e){e.mouseUp.apply(e,n)}))}},mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)},__mxOutput.mxSelectionCellsHandler=void 0!==mxSelectionCellsHandler?mxSelectionCellsHandler:void 0,mxUtils.extend(mxConnectionHandler,mxEventSource),mxConnectionHandler.prototype.graph=null,mxConnectionHandler.prototype.factoryMethod=!0,mxConnectionHandler.prototype.moveIconFront=!1,mxConnectionHandler.prototype.moveIconBack=!1,mxConnectionHandler.prototype.connectImage=null,mxConnectionHandler.prototype.targetConnectImage=!1,mxConnectionHandler.prototype.enabled=!0,mxConnectionHandler.prototype.select=!0,mxConnectionHandler.prototype.createTarget=!1,mxConnectionHandler.prototype.marker=null,mxConnectionHandler.prototype.constraintHandler=null,mxConnectionHandler.prototype.error=null,mxConnectionHandler.prototype.waypointsEnabled=!1,mxConnectionHandler.prototype.ignoreMouseDown=!1,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=!1,mxConnectionHandler.prototype.livePreview=!1,mxConnectionHandler.prototype.cursor=null,mxConnectionHandler.prototype.insertBeforeSource=!1,mxConnectionHandler.prototype.isEnabled=function(){return this.enabled},mxConnectionHandler.prototype.setEnabled=function(t){this.enabled=t},mxConnectionHandler.prototype.isInsertBefore=function(t,e,n,i,s){return this.insertBeforeSource&&e!=n},mxConnectionHandler.prototype.isCreateTarget=function(t){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(t){this.createTarget=t},mxConnectionHandler.prototype.createShape=function(){var t=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);return t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.scale=this.graph.view.scale,t.pointerEvents=!1,t.isDashed=!0,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,null),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){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell)),null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&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!0},mxConnectionHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph);return t.hotspotEnabled=!0,t.getCell=mxUtils.bind(this,(function(e){var n=mxCellMarker.prototype.getCell.apply(t,arguments);if(this.error=null,null==n&&null!=this.currentPoint&&(n=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y)),null!=n&&!this.graph.isCellConnectable(n)){var i=this.graph.getModel().getParent(n);this.graph.getModel().isVertex(i)&&this.graph.isCellConnectable(i)&&(n=i)}return(this.graph.isSwimlane(n)&&null!=this.currentPoint&&this.graph.hitsSwimlaneContent(n,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(n))&&(n=null),null!=n?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,n),null!=this.error&&0==this.error.length&&(n=null,this.isCreateTarget(e.getEvent())&&(this.error=null))):this.isValidSource(n,e)||(n=null):!this.isConnecting()||this.isCreateTarget(e.getEvent())||this.graph.allowDanglingEdges||(this.error=""),n})),t.isValidState=mxUtils.bind(this,(function(e){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(t,arguments)})),t.getMarkerColor=mxUtils.bind(this,(function(e,n,i){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(t,arguments):null})),t.intersects=mxUtils.bind(this,(function(e,n){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(t,arguments)})),t},mxConnectionHandler.prototype.start=function(t,e,n,i){this.previous=t,this.first=new mxPoint(e,n),this.edgeState=null!=i?i: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 null!=this.first&&null!=this.shape},mxConnectionHandler.prototype.isValidSource=function(t,e){return this.graph.isValidSource(t)},mxConnectionHandler.prototype.isValidTarget=function(t){return!0},mxConnectionHandler.prototype.validateConnection=function(t,e){return this.isValidTarget(e)?this.graph.getEdgeValidationError(null,t,e):""},mxConnectionHandler.prototype.getConnectImage=function(t){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(t){return null!=t.text&&t.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(t){var e=this.getConnectImage(t);if(null!=e&&null!=t){this.iconState=t;var n=[],i=new mxImageShape(new mxRectangle(0,0,e.width,e.height),e.src,null,null,0);i.preserveImageAspect=!1,this.isMoveIconToFrontForState(t)?(i.dialect=mxConstants.DIALECT_STRICTHTML,i.init(this.graph.container)):(i.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,i.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=i.node.previousSibling&&i.node.parentNode.insertBefore(i.node,i.node.parentNode.firstChild)),i.node.style.cursor=mxConstants.CURSOR_CONNECT;var s=mxUtils.bind(this,(function(){return null!=this.currentState?this.currentState:t})),r=mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.icon=i,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,s())))}));return mxEvent.redirectMouseEvents(i.node,this.graph,s,r),n.push(i),this.redrawIcons(n,this.iconState),n}return null},mxConnectionHandler.prototype.redrawIcons=function(t,e){if(null!=t&&null!=t[0]&&null!=e){var n=this.getIconPosition(t[0],e);t[0].bounds.x=n.x,t[0].bounds.y=n.y,t[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(t,e){var n=this.graph.getView().scale,i=e.getCenterX(),s=e.getCenterY();if(this.graph.isSwimlane(e.cell)){var r=this.graph.getStartSize(e.cell);i=0!=r.width?e.x+r.width*n/2:i,s=0!=r.height?e.y+r.height*n/2:s;var o=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0);if(0!=o){var l=Math.cos(o),a=Math.sin(o),h=new mxPoint(e.getCenterX(),e.getCenterY()),u=mxUtils.getRotatedPoint(new mxPoint(i,s),l,a,h);i=u.x,s=u.y}}return new mxPoint(i-t.bounds.width/2,s-t.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){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 null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)},mxConnectionHandler.prototype.mouseDown=function(t,e){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!e.isConsumed()&&!this.isConnecting()&&this.isStartEvent(e)){if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState){var n=this.graph.getPointForEvent(e.getEvent());this.edgeState.cell.geometry.setTerminalPoint(n,!0)}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),n=t.getEvent(),i=mxEvent.getClientX(n),s=mxEvent.getClientY(n),r=document.documentElement,o=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),l=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-o,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-l;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,s)||(a!=i||h!=s)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxConnectionHandler.prototype.updateCurrentState=function(t,e){if(this.constraintHandler.update(t,null==this.first,!1,null==this.first||t.isSource(this.marker.highlight.shape)?null:e),null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error&&(this.currentState=this.constraintHandler.currentFocus),(null!=this.error||null!=this.currentState&&!this.isCellEnabled(this.currentState.cell))&&this.constraintHandler.reset());else{this.graph.isIgnoreTerminalEvent(t.getEvent())?(this.marker.reset(),this.currentState=null):(this.marker.process(t),this.currentState=this.marker.getValidState()),null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.constraintHandler.reset(),this.marker.reset(),this.currentState=null);var n=this.isOutlineConnectEvent(t);if(null!=this.currentState&&n){t.isSource(this.marker.highlight.shape)&&(e=new mxPoint(t.getGraphX(),t.getGraphY()));var i=this.graph.getOutlineConstraint(e,this.currentState,t);this.constraintHandler.setFocus(t,this.currentState,!1),this.constraintHandler.currentConstraint=i,this.constraintHandler.currentPoint=e}if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var s=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/s/s,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.graph.isCellConnectable(t.getCell())&&this.marker.getValidState()!=t.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/s/s,this.marker.highlight.repaint())}}},mxConnectionHandler.prototype.isCellEnabled=function(t){return!0},mxConnectionHandler.prototype.convertWaypoint=function(t){var e=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();t.x=t.x/e-n.x,t.y=t.y/e-n.y},mxConnectionHandler.prototype.snapToPreview=function(t,e){if(!mxEvent.isAltDown(t.getEvent())&&null!=this.previous){var n=this.graph.gridSize*this.graph.view.scale/2,i=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(i.x-t.getGraphX())<n&&(e.x=i.x),Math.abs(i.y-t.getGraphY())<n&&(e.y=i.y)}},mxConnectionHandler.prototype.mouseMove=function(t,e){if(e.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);var n=this.graph.getView(),i=n.scale,s=n.translate,r=new mxPoint(e.getGraphX(),e.getGraphY());if(this.error=null,this.graph.isGridEnabledEvent(e.getEvent())&&(r=new mxPoint((this.graph.snap(r.x/i-s.x)+s.x)*i,(this.graph.snap(r.y/i-s.y)+s.y)*i)),this.snapToPreview(e,r),this.currentPoint=r,(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(e.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,r),null!=this.first){var o=null,l=r;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(o=this.constraintHandler.currentConstraint,l=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-r.x)<Math.abs(this.previous.getCenterY()-r.y)?r.x=this.previous.getCenterX():r.y=this.previous.getCenterY());var a=this.first;if(null!=this.selectedIcon){var h=this.selectedIcon.bounds.width,u=this.selectedIcon.bounds.height;if(null!=this.currentState&&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(null!=this.edgeState)this.updateEdgeState(l,o),l=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],a=this.edgeState.absolutePoints[0];else{if(null!=this.currentState)if(null==this.constraintHandler.currentConstraint)null!=(c=this.getTargetPerimeterPoint(this.currentState,e))&&(l=c);if(null==this.sourceConstraint&&null!=this.previous){var m=null!=this.waypoints&&this.waypoints.length>0?this.waypoints[0]:l;null!=(c=this.getSourcePerimeterPoint(this.previous,m,e))&&(a=c)}}if(null==this.currentState&&this.movePreviewAway){var c=a;if(null!=this.edgeState&&this.edgeState.absolutePoints.length>=2){var x=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];null!=x&&(c=x)}var g=l.x-c.x,y=l.y-c.y,f=Math.sqrt(g*g+y*y);if(0==f)return;this.originalPoint=l.clone(),l.x-=4*g/f,l.y-=4*y/f}else this.originalPoint=null;if(null==this.shape){g=Math.abs(e.getGraphX()-this.first.x),y=Math.abs(e.getGraphY()-this.first.y);(g>this.graph.tolerance||y>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(e,r))}if(null!=this.shape){if(null!=this.edgeState)this.shape.points=this.edgeState.absolutePoints;else{var v=[a];null!=this.waypoints&&(v=v.concat(this.waypoints)),v.push(l),this.shape.points=v}this.drawPreview()}null!=this.cursor&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||e.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(var C=!1,E=e.getSource(),S=0;S<this.icons.length&&!C;S++)C=E==this.icons[S].node||E.parentNode==this.icons[S].node;C||this.updateIcons(this.currentState,this.icons,e)}}},mxConnectionHandler.prototype.updateEdgeState=function(t,e){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y),null!=e&&null!=e.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=e.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=e.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]),this.edgeState.absolutePoints=[null,null!=this.currentState?null:t],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==e&&(e=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,e));var n=null;if(null!=this.waypoints){n=[];for(var i=0;i<this.waypoints.length;i++){var s=this.waypoints[i].clone();this.convertWaypoint(s),n[i]=s}}this.graph.view.updatePoints(this.edgeState,n,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(t,e){var n=null,i=t.view,s=i.getPerimeterFunction(t);if(null!=s){var r=null!=this.waypoints&&this.waypoints.length>0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),o=s(i.getPerimeterBounds(t),this.edgeState,r,!1);null!=o&&(n=o)}else n=new mxPoint(t.getCenterX(),t.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,n){var i=null,s=t.view,r=s.getPerimeterFunction(t),o=new mxPoint(t.getCenterX(),t.getCenterY());if(null!=r){var l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),a=-l*(Math.PI/180);0!=l&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(a),Math.sin(a),o));var h=r(s.getPerimeterBounds(t),t,e,!1);null!=h&&(0!=l&&(h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-a),Math.sin(-a),o)),i=h)}else i=o;return i},mxConnectionHandler.prototype.updateIcons=function(t,e,n){},mxConnectionHandler.prototype.isStopEvent=function(t){return null!=t.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),n=Math.abs(e.x-this.first.x),i=Math.abs(e.y-this.first.y);if(null!=this.waypoints||this.mouseDownCounter>1&&(n>this.graph.tolerance||i>this.graph.tolerance)){null==this.waypoints&&(this.waypoints=[]);var s=this.graph.view.scale;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 null==t||null==e||null==t.point||null==e.point||!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))return this.addWaypointForEvent(e),void e.consume();var n=this.sourceConstraint,i=this.constraintHandler.currentConstraint,s=null!=this.previous?this.previous.cell:null,r=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(r=this.constraintHandler.currentFocus.cell),null==r&&null!=this.currentState&&(r=this.currentState.cell),null!=this.error||null!=s&&null!=r&&s==r&&!this.checkConstraints(n,i)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),null!=this.error&&this.error.length>0&&this.graph.validationAlert(this.error)):this.connect(s,r,e.getEvent(),e.getCell()),this.destroyIcons(),e.consume()}null!=this.first&&this.reset()},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.cursor&&null!=this.graph.container&&(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(null==this.error),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,n,i){if(null!=e||this.isCreateTarget(n)||this.graph.allowDanglingEdges){var s=this.graph.getModel(),r=!1,o=null;s.beginUpdate();try{if(null!=t&&null==e&&!this.graph.isIgnoreTerminalEvent(n)&&this.isCreateTarget(n)&&null!=(e=this.createTargetVertex(n,t))){if(i=this.graph.getDropTarget([e],n,i),r=!0,null!=i&&this.graph.getModel().isEdge(i))i=this.graph.getDefaultParent();else{var l=this.graph.getView().getState(i);if(null!=l)(d=s.getGeometry(e)).x-=l.origin.x,d.y-=l.origin.y}this.graph.addCell(e,i)}var a=this.graph.getDefaultParent();null!=t&&null!=e&&s.getParent(t)==s.getParent(e)&&s.getParent(s.getParent(t))!=s.getRoot()&&(a=s.getParent(t),null!=t.geometry&&t.geometry.relative&&null!=e.geometry&&e.geometry.relative&&(a=s.getParent(a)));var h=null,u=null;if(null!=this.edgeState&&(h=this.edgeState.cell.value,u=this.edgeState.cell.style),null!=(o=this.insertEdge(a,null,h,t,e,u))){this.graph.setConnectionConstraint(o,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,e,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&s.setGeometry(o,this.edgeState.cell.geometry);a=s.getParent(t);if(this.isInsertBefore(o,t,e,n,i)){for(var d=t;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=o.parent;)d=this.graph.model.getParent(d);null!=d&&null!=d.parent&&d.parent==o.parent&&s.add(a,o,d.parent.getIndex(d))}var p=s.getGeometry(o);if(null==p&&((p=new mxGeometry).relative=!0,s.setGeometry(o,p)),null!=this.waypoints&&this.waypoints.length>0){var m=this.graph.view.scale,c=this.graph.view.translate;p.points=[];for(var x=0;x<this.waypoints.length;x++){var g=this.waypoints[x];p.points.push(new mxPoint(g.x/m-c.x,g.y/m-c.y))}}if(null==e){var y=this.graph.view.translate;m=this.graph.view.scale;(g=null!=this.originalPoint?new mxPoint(this.originalPoint.x/m-y.x,this.originalPoint.y/m-y.y):new mxPoint(this.currentPoint.x/m-y.x,this.currentPoint.y/m-y.y)).x-=this.graph.panDx/this.graph.view.scale,g.y-=this.graph.panDy/this.graph.view.scale,p.setTerminalPoint(g,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",o,"terminal",e,"event",n,"target",i,"terminalInserted",r))}}catch(t){mxLog.show(),mxLog.debug(t.message)}finally{s.endUpdate()}this.select&&this.selectCells(o,r?e:null)}},mxConnectionHandler.prototype.selectCells=function(t,e){this.graph.setSelectionCell(t)},mxConnectionHandler.prototype.insertEdge=function(t,e,n,i,s,r){if(null==this.factoryMethod)return this.graph.insertEdge(t,e,n,i,s,r);var o=this.createEdge(n,i,s,r);return o=this.graph.addEdge(o,t,i,s)},mxConnectionHandler.prototype.createTargetVertex=function(t,e){for(var n=this.graph.getCellGeometry(e);null!=n&&n.relative;)e=this.graph.getModel().getParent(e),n=this.graph.getCellGeometry(e);var i=this.graph.cloneCell(e);if(null!=(n=this.graph.getModel().getGeometry(i))){var s=this.graph.view.translate,r=this.graph.view.scale,o=new mxPoint(this.currentPoint.x/r-s.x,this.currentPoint.y/r-s.y);n.x=Math.round(o.x-n.width/2-this.graph.panDx/r),n.y=Math.round(o.y-n.height/2-this.graph.panDy/r);var l=this.getAlignmentTolerance();if(l>0){var a=this.graph.view.getState(e);if(null!=a){var h=a.x/r-s.x,u=a.y/r-s.y;Math.abs(h-n.x)<=l&&(n.x=Math.round(h)),Math.abs(u-n.y)<=l&&(n.y=Math.round(u))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,n,i){var s=null;if(null!=this.factoryMethod&&(s=this.factoryMethod(e,n,i)),null==s){(s=new mxCell(t||"")).setEdge(!0),s.setStyle(i);var r=new mxGeometry;r.relative=!0,s.setGeometry(r)}return s},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=void 0!==mxConnectionHandler?mxConnectionHandler:void 0,mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,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(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null}null!=this.focusHighlight&&(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,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(t,e){return!1},mxConstraintHandler.prototype.isStateIgnored=function(t,e){return!1},mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null,this.focusPoints=null}},mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)},mxConstraintHandler.prototype.isKeepFocusEvent=function(t){return mxEvent.isShiftDown(t.getEvent())},mxConstraintHandler.prototype.getCellForEvent=function(t,e){var n=t.getCell();if(null!=n||null==e||t.getGraphX()==e.x&&t.getGraphY()==e.y||(n=this.graph.getCellAt(e.x,e.y)),null!=n&&!this.graph.isCellConnectable(n)){var i=this.graph.getModel().getParent(n);this.graph.getModel().isVertex(i)&&this.graph.isCellConnectable(i)&&(n=i)}return this.graph.isCellLocked(n)?null:n},mxConstraintHandler.prototype.update=function(t,e,n,i){if(this.isEnabled()&&!this.isEventIgnored(t)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,(function(){this.reset()})),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var s=this.getTolerance(t),r=new mxRectangle((null!=i?i.x:t.getGraphX())-s,(null!=i?i.y:t.getGraphY())-s,2*s,2*s),o=new mxRectangle(t.getGraphX()-s,t.getGraphY()-s,2*s,2*s),l=this.graph.view.getState(this.getCellForEvent(t,i));this.isKeepFocusEvent(t)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==l&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,o)||l==this.currentFocus||(this.currentFocusArea=null,this.currentFocus=null,this.setFocus(t,l,e)),this.currentConstraint=null,this.currentPoint=null;var a=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==l||this.currentFocus==l))for(var h=o.getCenterX(),u=o.getCenterY(),d=0;d<this.focusIcons.length;d++){var p=h-this.focusIcons[d].bounds.getCenterX(),m=u-this.focusIcons[d].bounds.getCenterY(),c=p*p+m*m;if((this.intersects(this.focusIcons[d],o,e,n)||null!=i&&this.intersects(this.focusIcons[d],r,e,n))&&(null==a||c<a)){if(this.currentConstraint=this.constraints[d],this.currentPoint=this.focusPoints[d],a=c,(c=this.focusIcons[d].bounds.clone()).grow(mxConstants.HIGHLIGHT_SIZE+1),c.width-=1,c.height-=1,null==this.focusHighlight){var x=this.createHighlightShape();x.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,x.pointerEvents=!1,x.init(this.graph.getView().getOverlayPane()),this.focusHighlight=x;var g=mxUtils.bind(this,(function(){return null!=this.currentFocus?this.currentFocus:l}));mxEvent.redirectMouseEvents(x.node,this.graph,g)}this.focusHighlight.bounds=c,this.focusHighlight.redraw()}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentConstraint=null,this.currentFocus=null,this.currentPoint=null},mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){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 n=this.graph.getConnectionPoint(t,this.constraints[e]),i=this.getImageForConstraint(t,this.constraints[e],n),s=new mxRectangle(Math.round(n.x-i.width/2),Math.round(n.y-i.height/2),i.width,i.height);this.focusIcons[e].bounds=s,this.focusIcons[e].redraw(),this.currentFocusArea.add(this.focusIcons[e].bounds),this.focusPoints[e]=n}}},mxConstraintHandler.prototype.setFocus=function(t,e,n){if(this.constraints=null!=e&&!this.isStateIgnored(e,n)&&this.graph.isCellConnectable(e.cell)?this.isEnabled()&&this.graph.getAllConnectionConstraints(e,n)||[]:null,null!=this.constraints){if(this.currentFocus=e,this.currentFocusArea=new mxRectangle(e.x,e.y,e.width,e.height),null!=this.focusIcons){for(var i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusIcons=null,this.focusPoints=null}this.focusPoints=[],this.focusIcons=[];for(i=0;i<this.constraints.length;i++){var s=this.graph.getConnectionPoint(e,this.constraints[i]),r=this.getImageForConstraint(e,this.constraints[i],s),o=r.src,l=new mxImageShape(new mxRectangle(Math.round(s.x-r.width/2),Math.round(s.y-r.height/2),r.width,r.height),o);l.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,l.preserveImageAspect=!1,l.init(this.graph.getView().getDecoratorPane()),(mxClient.IS_QUIRKS||8==document.documentMode)&&mxEvent.addListener(l.node,"dragstart",(function(t){return mxEvent.consume(t),!1})),null!=l.node.previousSibling&&l.node.parentNode.insertBefore(l.node,l.node.parentNode.firstChild);var a=mxUtils.bind(this,(function(){return null!=this.currentFocus?this.currentFocus:e}));l.redraw(),mxEvent.redirectMouseEvents(l.node,this.graph,a),this.currentFocusArea.add(l.bounds),this.focusIcons.push(l),this.focusPoints.push(s)}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);return t.opacity=mxConstants.HIGHLIGHT_OPACITY,t},mxConstraintHandler.prototype.intersects=function(t,e,n,i){return mxUtils.intersects(t.bounds,e)},mxConstraintHandler.prototype.destroy=function(){this.reset(),null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null),null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)},__mxOutput.mxConstraintHandler=void 0!==mxConstraintHandler?mxConstraintHandler:void 0,mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.fadeOut=!1,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()&&null==e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())){var n=mxUtils.getOffset(this.graph.container),i=mxUtils.getScrollOrigin(this.graph.container);i.x-=n.x,i.y-=n.y,this.start(e.getX()+i.x,e.getY()+i.y),e.consume(!1)}},mxRubberband.prototype.start=function(t,e){this.first=new mxPoint(t,e);var n=this.graph.container;function i(t){var e=new mxMouseEvent(t),i=mxUtils.convertPoint(n,e.getX(),e.getY());return e.graphX=i.x,e.graphY=i.y,e}this.dragHandler=mxUtils.bind(this,(function(t){this.mouseMove(this.graph,i(t))})),this.dropHandler=mxUtils.bind(this,(function(t){this.mouseUp(this.graph,i(t))})),mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)},mxRubberband.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),i=mxUtils.getOffset(this.graph.container);n.x-=i.x,n.y-=i.y;var s=e.getX()+n.x,r=e.getY()+n.y,o=this.first.x-s,l=this.first.y-r,a=this.graph.tolerance;(null!=this.div||Math.abs(o)>a||Math.abs(l)>a)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(s,r),e.consume())}},mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(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;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return null!=this.div&&"none"!=this.div.style.display},mxRubberband.prototype.mouseUp=function(t,e){var n=this.isActive();this.reset(),n&&(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(null!=this.div)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(null!=this.div){var t=this.currentX-this.graph.panDx,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 n=mxClient.IS_VML?this.graph.panDx:0,i=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+n+"px",this.div.style.top=this.y+i+"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(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},__mxOutput.mxRubberband=void 0!==mxRubberband?mxRubberband:void 0,mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,n){},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,n=this.graph.view.translate,i=new mxPoint(t.getGraphX()/e-n.x,t.getGraphY()/e-n.y);null!=this.shape&&null!=this.shape.bounds&&(i.x-=this.shape.bounds.width/e/4,i.y-=this.shape.bounds.height/e/4);var s=-mxUtils.toRadians(this.getRotation()),r=-mxUtils.toRadians(this.getTotalRotation())-s;i=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(i,s),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),r)),this.setPosition(this.state.getPaintBounds(),i,t),this.redraw()},mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state),null!=this.state.shape&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):null==this.shape&&(this.shape=this.createShape(t)),this.initShape(t)},mxHandle.prototype.createShape=function(t){return new mxRectangleShape(new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&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(null!=this.shape&&null!=this.state.shape){var t=this.getPosition(this.state.getPaintBounds());if(null!=t){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var n=this.graph.view.scale,i=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+i.x)*n-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+i.y)*n-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var n=this.state.getCellBounds(),i=new mxPoint(n.getCenterX(),n.getCenterY()),s=Math.cos(e),r=Math.sin(e);return mxUtils.getRotatedPoint(t,s,r,i)},mxHandle.prototype.flipPoint=function(t){if(null!=this.state.shape){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=void 0!==mxHandle?mxHandle:void 0,mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.handlesVisible=!0,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.movePreviewToFront=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(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=!1,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),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var t=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],t||this.graph.isLabelMovable(this.state.cell)&&this.state.width>=2&&this.state.height>=2){var e=0;t&&(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 n=this.graph.model.getGeometry(this.state.cell);null==n||n.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 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))}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(),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())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!1},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),null!=this.minBounds)){var e=this.state.view.scale,n=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-n.x,this.y0=this.state.y/e-n.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());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),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,n,i){var s=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),r=this.createSizerShape(s,e,i);return r.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(r.bounds.height-=1,r.bounds.width-=1,r.dialect=mxConstants.DIALECT_STRICTHTML,r.init(this.graph.container)):(r.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,r.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(r.node,this.graph,this.state),this.graph.isEnabled()&&r.setCursor(t),this.isSizerVisible(e)||(r.visible=!1),r},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,n){if(null!=this.handleImage){var i=new mxImageShape(t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height),this.handleImage.src);return i.preserveImageAspect=!1,i}return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,n){null!=t&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(n-t.bounds.height/2),null!=t.node&&"none"!=t.node.style.display&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,i=mxUtils.bind(this,(function(e){var i=null!=e&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null,s=null!=i?new mxRectangle(t.getGraphX()-Math.floor(i/2),t.getGraphY()-Math.floor(i/2),i,i):n;return null!=e&&(t.isSource(e)||null!=s&&mxUtils.intersects(e.bounds,s)&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility)}));if(i(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(i(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var s=0;s<this.sizers.length;s++)if(i(this.sizers[s]))return s;if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(s=this.customHandles.length-1;s>=0;s--)if(i(this.customHandles[s].shape))return mxEvent.CUSTOM_HANDLE-s;return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var n=this.getHandleForEvent(e);null!=n&&(this.start(e.getGraphX(),e.getGraphY(),n),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke},mxVertexHandler.prototype.start=function(t,e,n){if(null!=this.selectionBorder)if(this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=n,this.startX=t,this.startY=e,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{var i=this.state.view.graph.model,s=i.getParent(this.state.cell);if(this.state.view.currentRoot!=s&&(i.isVertex(s)||i.isEdge(s))&&(this.parentState=this.state.view.graph.view.getState(s)),this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.livePreviewActive&&!this.isLivePreviewBorder()||(this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))),n==mxEvent.ROTATION_HANDLE){var r=this.getRotationHandlePosition(),o=r.x-this.state.getCenterX(),l=r.y-this.state.getCenterY();this.startAngle=0!=o?180*Math.atan(l/o)/Math.PI+90:0,this.startDist=Math.sqrt(o*o+l*l)}if(this.livePreviewActive){this.hideSizers(),n==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":n==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&null!=this.sizers[n]?this.sizers[n].node.style.display="":n<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-n].setVisible(!0);var a=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var h=0;h<a.length;h++){var u=this.graph.selectionCellsHandler.getHandler(a[h]);null!=u&&this.edgeHandlers.push(u)}}}},mxVertexHandler.prototype.createGhostPreview=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.init(this.graph.view.getOverlayPane()),t.scale=this.state.view.scale,t.bounds=this.bounds,t.outline=!0,t},mxVertexHandler.prototype.setHandlesVisible=function(t){if(this.handlesVisible=t,null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].node.style.display=t?"":"none";if(null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)},mxVertexHandler.prototype.checkTolerance=function(t){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(t.getEvent())||Math.abs(t.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(10*t)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(100*t)/100},mxVertexHandler.prototype.mouseMove=function(t,e){e.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(e)||e.consume(!1):(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,null!=this.ghostPreview?(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(),null!=this.selectionBounds&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):(this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e))),e.consume())},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()),n=this.graph.view.translate,i=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/i-n.x)+n.x)*i,e.y=(this.graph.snap(e.y/i-n.y)+n.y)*i);var s=null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[s],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.state.x+this.state.width/2-e.x,i=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=0!=n?180*Math.atan(i/n)/Math.PI+90:i<0?180:0,n>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){n=e.x-this.state.getCenterX(),i=e.y-this.state.getCenterY();var s=Math.sqrt(n*n+i*i);s-this.startDist<2?raster=15:s-this.startDist<25?raster=5: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(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),i=new mxPoint(t.getGraphX(),t.getGraphY()),s=this.graph.view.translate,r=this.graph.view.scale,o=Math.cos(-n),l=Math.sin(-n),a=l*(c=i.x-this.startX)+o*(x=i.y-this.startY);c=o*c-l*x,x=a;var h=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(h,c/r,x/r,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!h.relative){var u=this.graph.getMaximumGraphBounds();if(null!=u&&null!=this.parentState&&((u=mxRectangle.fromRectangle(u)).x-=(this.parentState.x-s.x*r)/r,u.y-=(this.parentState.y-s.y*r)/r),this.graph.isConstrainChild(this.state.cell)){var d=this.graph.getCellContainmentArea(this.state.cell);if(null!=d){var p=this.graph.getOverlap(this.state.cell);p>0&&((d=mxRectangle.fromRectangle(d)).x-=d.width*p,d.y-=d.height*p,d.width+=2*d.width*p,d.height+=2*d.height*p),null==u?u=d:(u=mxRectangle.fromRectangle(u)).intersect(d)}}null!=u&&(this.unscaledBounds.x<u.x&&(this.unscaledBounds.width-=u.x-this.unscaledBounds.x,this.unscaledBounds.x=u.x),this.unscaledBounds.y<u.y&&(this.unscaledBounds.height-=u.y-this.unscaledBounds.y,this.unscaledBounds.y=u.y),this.unscaledBounds.x+this.unscaledBounds.width>u.x+u.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-u.x-u.width),this.unscaledBounds.y+this.unscaledBounds.height>u.y+u.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-u.y-u.height))}var m=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:s.x*r)+this.unscaledBounds.x*r,(null!=this.parentState?this.parentState.y:s.y*r)+this.unscaledBounds.y*r,this.unscaledBounds.width*r,this.unscaledBounds.height*r),h.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),o=Math.cos(n),l=Math.sin(n);var c,x,g=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),y=o*(c=g.x-e.x)-l*(x=g.y-e.y)-c,f=l*c+o*x-x,v=this.bounds.x-this.state.x,C=this.bounds.y-this.state.y,E=o*v-l*C,S=l*v+o*C;this.bounds.x+=y,this.bounds.y+=f,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+y/r),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+f/r),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),this.graph.isCellCollapsed(this.state.cell)||0==y&&0==f?(this.childOffsetX=0,this.childOffsetY=0):(this.childOffsetX=this.state.x-this.bounds.x+E,this.childOffsetY=this.state.y-this.bounds.y+S),m.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),null!=this.preview?this.drawPreview():this.updateParentHighlight())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-n.x,this.state.y/e-n.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var s=this.state.absoluteOffset;s=new mxPoint(s.x,s.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var r=this.graph.getCellGeometry(this.state.cell);if(null!=r){var o=r.offset||this.EMPTY_POINT;null==o||r.relative||(this.state.absoluteOffset.x=this.state.view.scale*o.x,this.state.absoluteOffset.y=this.state.view.scale*o.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),this.movePreviewToFront&&this.moveToFront(),null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden"),this.state.setState(i)},mxVertexHandler.prototype.moveToFront=function(){(null!=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||this.state.shape.node.nextSibling!=this.state.text.node))&&(null!=this.state.shape&&null!=this.state.shape.node&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),null!=this.state.text&&null!=this.state.text.node&&this.state.text.node.parentNode.appendChild(this.state.text.node))},mxVertexHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.state){var n=new mxPoint(e.getGraphX(),e.getGraphY()),i=this.index;this.index=null,null==this.ghostPreview&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate()),this.graph.getModel().beginUpdate();try{if(i<=mxEvent.CUSTOM_HANDLE){if(null!=this.customHandles){var s=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-i].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-i].execute(e),null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-i]&&(this.state.style=s,this.customHandles[mxEvent.CUSTOM_HANDLE-i].positionChanged())}}else if(i==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var r=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=r&&this.rotateCell(this.state.cell,r)}else this.rotateClick();else{var o=this.graph.isGridEnabledEvent(e.getEvent()),l=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),a=Math.cos(-l),h=Math.sin(-l),u=n.x-this.startX,d=n.y-this.startY,p=h*u+a*d;u=a*u-h*d,d=p;var m=this.graph.view.scale,c=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(u/m),this.roundLength(d/m),i,o,this.isConstrainedEvent(e),c)}}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,n){if(0!=e){var i=this.graph.getModel();if(i.isVertex(t)||i.isEdge(t)){if(!i.isEdge(t)){var s=(this.graph.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var r=this.graph.getCellGeometry(t);if(null!=r){var o=this.graph.getCellGeometry(n);if(null==o||i.isEdge(n)||((r=r.clone()).rotate(e,new mxPoint(o.width/2,o.height/2)),i.setGeometry(t,r)),i.isVertex(t)&&!r.relative||i.isEdge(t))for(var l=i.getChildCount(t),a=0;a<l;a++)this.rotateCell(i.getChildAt(t,a),e,t)}}}},mxVertexHandler.prototype.reset=function(){if(null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display=""),this.currentAlpha=null,this.inTolerance=null,this.index=null,null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null),this.livePreviewActive&&null!=this.sizers){for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="")}if(null!=this.customHandles)for(t=0;t<this.customHandles.length;t++)this.customHandles[t].active?(this.customHandles[t].active=!1,this.customHandles[t].reset()):this.customHandles[t].setVisible(!0);null!=this.selectionBorder&&(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=!0,this.unscaledBounds=null,this.livePreviewActive=null},mxVertexHandler.prototype.resizeCell=function(t,e,n,i,s,r,o){var l=this.graph.model.getGeometry(t);if(null!=l)if(i==mxEvent.LABEL_HANDLE){var a=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),u=Math.sin(a),d=this.graph.view.scale,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);null==(l=l.clone()).offset?l.offset=p:(l.offset.x+=p.x,l.offset.y+=p.y),this.graph.model.setGeometry(t,l)}else if(null!=this.unscaledBounds){d=this.graph.view.scale;0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(t,Math.round(this.childOffsetX/d),Math.round(this.childOffsetY/d)),this.graph.resizeCell(t,this.unscaledBounds,o)}},mxVertexHandler.prototype.moveChildren=function(t,e,n){for(var i=this.graph.getModel(),s=i.getChildCount(t),r=0;r<s;r++){var o=i.getChildAt(t,r),l=this.graph.getCellGeometry(o);null!=l&&((l=l.clone()).translate(e,n),i.setGeometry(o,l))}},mxVertexHandler.prototype.union=function(t,e,n,i,s,r,o,l,a){if(s=null!=s?s&&this.graph.gridEnabled:this.graph.gridEnabled,this.singleSizer){var h=t.x+t.width+e,u=t.y+t.height+n;s&&(h=this.graph.snap(h/r)*r,u=this.graph.snap(u/r)*r);var d=new mxRectangle(t.x,t.y,0,0);return d.add(new mxRectangle(h,u,0,0)),d}var p=t.width,m=t.height,c=t.x-o.x*r,x=c+p,g=t.y-o.y*r,y=g+m,f=c+p/2,v=g+m/2;i>4?(y+=n,y=s?this.graph.snap(y/r)*r:Math.round(y/r)*r):i<3&&(g+=n,g=s?this.graph.snap(g/r)*r:Math.round(g/r)*r),0==i||3==i||5==i?(c+=e,c=s?this.graph.snap(c/r)*r:Math.round(c/r)*r):2!=i&&4!=i&&7!=i||(x+=e,x=s?this.graph.snap(x/r)*r:Math.round(x/r)*r);var C=x-c,E=y-g;if(l){var S=this.graph.getCellGeometry(this.state.cell);if(null!=S){var T=S.width/S.height;1==i||2==i||7==i||6==i?C=E*T:E=C/T,0==i&&(c=x-C,g=y-E)}}if(a){var b=f-(c+(C+=C-p)/2),w=v-(g+(E+=E-m)/2);c+=b,g+=w,x+=b,y+=w}C<0&&(c+=C,C=Math.abs(C)),E<0&&(g+=E,E=Math.abs(E));var L=new mxRectangle(c+o.x*r,g+o.y*r,C,E);return null!=this.minBounds&&(L.width=Math.max(L.width,this.minBounds.x*r+this.minBounds.width*r+Math.max(0,this.x0*r-L.x)),L.height=Math.max(L.height,this.minBounds.y*r+this.minBounds.height*r+Math.max(0,this.y0*r-L.y))),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(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]&&(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),t},mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds},mxVertexHandler.prototype.redrawHandles=function(){var t=this.getSizerBounds(),e=this.tolerance;if(this.horizontalOffset=0,this.verticalOffset=0,null!=this.customHandles)for(var n=0;n<this.customHandles.length;n++){var i=this.customHandles[n].shape.node.style.display;this.customHandles[n].redraw(),this.customHandles[n].shape.node.style.display=i,this.customHandles[n].shape.node.style.visibility=this.handlesVisible&&this.isCustomHandleVisible(this.customHandles[n])?"":"hidden"}if(null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&this.sizers.length>=8){var s=this.getHandlePadding();this.horizontalOffset=s.x,this.verticalOffset=s.y,0==this.horizontalOffset&&0==this.verticalOffset||((t=new mxRectangle(t.x,t.y,t.width,t.height)).x-=this.horizontalOffset/2,t.width+=this.horizontalOffset,t.y-=this.verticalOffset/2,t.height+=this.verticalOffset),this.sizers.length>=8&&(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"):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 r=t.x+t.width,o=t.y+t.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],r,o);else{var l=t.x+t.width/2,a=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"],u=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=Math.cos(u),p=Math.sin(u),m=Math.round(4*u/Math.PI),c=new mxPoint(t.getCenterX(),t.getCenterY()),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=l,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=r,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=a,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=r,x.y=a,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=o,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=l,x.y=o,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=r,x.y=o,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=l+this.state.absoluteOffset.x,x.y=a+this.state.absoluteOffset.y,x=mxUtils.getRotatedPoint(x,d,p,c),this.moveSizerTo(this.sizers[8],x.x,x.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],l+this.state.absoluteOffset.x,a+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(null!=this.rotationShape){u=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=Math.cos(u),p=Math.sin(u),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),x=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),d,p,c);null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,x.x,x.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":"")}if(null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.edgeHandlers)for(n=0;n<this.edgeHandlers.length;n++)this.edgeHandlers[n].redraw()},mxVertexHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()},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(),e=this.graph.model.getParent(this.state.cell),n=this.graph.view.getState(e);if(null!=this.parentHighlight)if(this.graph.model.isVertex(e)&&t){var i=this.parentHighlight.bounds;null==n||i.x==n.x&&i.y==n.y&&i.width==n.width&&i.height==n.height||(this.parentHighlight.bounds=mxRectangle.fromRectangle(n),this.parentHighlight.redraw())}else null!=n&&n.parentHighlight==this.parentHighlight&&(n.parentHighlight=null),this.parentHighlight.destroy(),this.parentHighlight=null;else this.parentHighlightEnabled&&t&&this.graph.model.isVertex(e)&&null!=n&&null==n.parentHighlight&&(this.parentHighlight=this.createParentHighlightShape(n),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(n.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()),this.parentHighlight.redraw(),n.parentHighlight=this.parentHighlight)}},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,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 null==this.selectionBorder},mxVertexHandler.prototype.destroy=function(){if(null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.parentHighlight){var t=this.graph.model.getParent(this.state.cell),e=this.graph.view.getState(t);null!=e&&e.parentHighlight==this.parentHighlight&&(e.parentHighlight=null),this.parentHighlight.destroy(),this.parentHighlight=null}if(null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.labelShape=null,this.removeHint(),null!=this.sizers){for(var n=0;n<this.sizers.length;n++)this.sizers[n].destroy();this.sizers=null}if(null!=this.customHandles){for(n=0;n<this.customHandles.length;n++)this.customHandles[n].destroy();this.customHandles=null}},__mxOutput.mxVertexHandler=void 0!==mxVertexHandler?mxVertexHandler:void 0,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=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.dblClickRemoveEnabled=!1,mxEdgeHandler.prototype.mergeRemoveEnabled=!1,mxEdgeHandler.prototype.straightRemoveEnabled=!1,mxEdgeHandler.prototype.virtualBendsEnabled=!1,mxEdgeHandler.prototype.virtualBendOpacity=20,mxEdgeHandler.prototype.parentHighlightEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.outlineConnect=!1,mxEdgeHandler.prototype.manageLabelHandle=!1,mxEdgeHandler.prototype.init=function(){if(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=!1,this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var t=this.state.getVisibleTerminalState(!0);if(null!=t&&(this.preferHtml=null!=t.text&&t.text.node.parentNode==this.graph.container),!this.preferHtml){var e=this.state.getVisibleTerminalState(!1);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends(),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&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)},mxEdgeHandler.prototype.isCellEnabled=function(t){return!0},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());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.createSelectionShape=function(t){var e=new this.state.shape.constructor;return e.outline=!0,e.apply(this.state),e.isDashed=this.isSelectionDashed(),e.stroke=this.getSelectionColor(),e.isShadow=!1,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!0},mxEdgeHandler.prototype.getCellAt=function(t,e){return this.outlineConnect?null:this.graph.getCellAt(t,e)},mxEdgeHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph),e=this;return t.getCell=function(t){var n=mxCellMarker.prototype.getCell.apply(this,arguments);if(n!=e.state.cell&&null!=n||null==e.currentPoint||(n=e.graph.getCellAt(e.currentPoint.x,e.currentPoint.y)),null!=n&&!this.graph.isCellConnectable(n)){var i=this.graph.getModel().getParent(n);this.graph.getModel().isVertex(i)&&this.graph.isCellConnectable(i)&&(n=i)}var s=e.graph.getModel();return(this.graph.isSwimlane(n)&&null!=e.currentPoint&&this.graph.hitsSwimlaneContent(n,e.currentPoint.x,e.currentPoint.y)||!e.isConnectableCell(n)||n==e.state.cell||null!=n&&!e.graph.connectableEdges&&s.isEdge(n)||s.isAncestor(e.state.cell,n))&&(n=null),this.graph.isCellConnectable(n)||(n=null),n},t.isValidState=function(t){var n=e.graph.getModel(),i=e.graph.view.getTerminalPort(t,e.graph.view.getState(n.getTerminal(e.state.cell,!e.isSource)),!e.isSource),s=null!=i?i.cell:null,r=e.isSource?t.cell:s,o=e.isSource?s:t.cell;return e.error=e.validateConnection(r,o),null==e.error},t},mxEdgeHandler.prototype.validateConnection=function(t,e){return this.graph.getEdgeValidationError(this.state.cell,t,e)},mxEdgeHandler.prototype.createBends=function(){for(var t=this.state.cell,e=[],n=0;n<this.abspoints.length;n++)if(this.isHandleVisible(n)){var i=0==n,s=n==this.abspoints.length-1,r=i||s;(r||this.graph.isCellBendable(t))&&mxUtils.bind(this,(function(t){var i=this.createHandleShape(t);this.initBend(i,mxUtils.bind(this,mxUtils.bind(this,(function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,t)})))),this.isHandleEnabled(n)&&i.setCursor(r?mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE),e.push(i),r||(this.points.push(new mxPoint(0,0)),i.node.style.visibility="hidden")}))(n)}return e},mxEdgeHandler.prototype.createVirtualBends=function(){var t=this.state.cell;this.abspoints[0];var e=[];if(this.graph.isCellBendable(t))for(var n=1;n<this.abspoints.length;n++)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!0},mxEdgeHandler.prototype.isHandleVisible=function(t){var e=this.state.getVisibleTerminalState(!0),n=this.state.getVisibleTerminalState(!1),i=this.graph.getCellGeometry(this.state.cell);return(null!=i?this.graph.view.getEdgeStyle(this.state,i.points,e,n):null)!=mxEdgeStyle.EntityRelation||0==t||t==this.abspoints.length-1},mxEdgeHandler.prototype.createHandleShape=function(t){if(null!=this.handleImage){var e=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src);return e.preserveImageAspect=!1,e}var n=mxConstants.HANDLE_SIZE;return this.preferHtml&&(n-=1),new mxRectangleShape(new mxRectangle(0,0,n,n),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var t=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);return t.preserveImageAspect=!1,t}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){this.preferHtml?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(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),(mxClient.IS_QUIRKS||8==document.documentMode)&&mxEvent.addListener(t.node,"dragstart",(function(t){return mxEvent.consume(t),!1})),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")},mxEdgeHandler.prototype.getHandleForEvent=function(t){var e=null;if(null!=this.state){var n=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,i=this.allowHandleBoundsCheck&&(mxClient.IS_IE||n>0)?new mxRectangle(t.getGraphX()-n,t.getGraphY()-n,2*n,2*n):null,s=null;function o(e){if(null!=e&&null!=e.node&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility&&(t.isSource(e)||null!=i&&mxUtils.intersects(e.bounds,i))){var n=t.getGraphX()-e.bounds.getCenterX(),r=t.getGraphY()-e.bounds.getCenterY(),o=n*n+r*r;if(null==s||o<=s)return s=o,!0}return!1}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var r=this.customHandles.length-1;r>=0;r--)if(o(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r;if((t.isSource(this.state.text)||o(this.labelShape))&&(e=mxEvent.LABEL_HANDLE),null!=this.bends)for(r=0;r<this.bends.length;r++)o(this.bends[r])&&(e=r);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(t))for(r=0;r<this.virtualBends.length;r++)o(this.virtualBends[r])&&(e=mxEvent.VIRTUAL_HANDLE-r)}return e},mxEdgeHandler.prototype.isAddVirtualBendEvent=function(t){return!0},mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return!0},mxEdgeHandler.prototype.mouseDown=function(t,e){var n=this.getHandleForEvent(e);if(null!=this.bends&&null!=this.bends[n]){var i=this.bends[n].bounds;this.snapPoint=new mxPoint(i.getCenterX(),i.getCenterY())}this.addEnabled&&null==n&&this.isAddPointEvent(e.getEvent())?(this.addPoint(this.state,e.getEvent()),e.consume()):null!=n&&!e.isConsumed()&&this.graph.isEnabled()&&(this.removeEnabled&&this.isRemovePointEvent(e.getEvent())?this.removePoint(this.state,n):(n!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(e.getCell()))&&(n<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-n].node,100),this.start(e.getX(),e.getY(),n)),e.consume())},mxEdgeHandler.prototype.start=function(t,e,n){if(this.startX=t,this.startY=e,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget){var i=this.state.cell,s=this.graph.model.getTerminal(i,this.isSource);(null==s&&this.graph.isTerminalPointMovable(i,this.isSource)||null!=s&&this.graph.isCellDisconnectable(i,s,this.isSource))&&(this.index=n)}else this.index=n;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(var r=0;r<this.customHandles.length;r++)r!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[r].setVisible(!1)},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(),n=e.scale,i=new mxPoint(this.roundLength(t.getGraphX()/n)*n,this.roundLength(t.getGraphY()/n)*n),s=this.getSnapToTerminalTolerance(),r=!1,o=!1;if(s>0&&this.isSnapToTerminalsEvent(t)){function t(t){if(null!=t){var e=t.x;Math.abs(i.x-e)<s&&(i.x=e,r=!0);var n=t.y;Math.abs(i.y-n)<s&&(i.y=n,o=!0)}}function n(n){null!=n&&t.call(this,new mxPoint(e.getRoutingCenterX(n),e.getRoutingCenterY(n)))}if(n.call(this,this.state.getVisibleTerminalState(!0)),n.call(this,this.state.getVisibleTerminalState(!1)),null!=this.state.absolutePoints)for(var l=0;l<this.state.absolutePoints.length;l++)t.call(this,this.state.absolutePoints[l])}if(this.graph.isGridEnabledEvent(t.getEvent())){var a=e.translate;r||(i.x=(this.graph.snap(i.x/n-a.x)+a.x)*n),o||(i.y=(this.graph.snap(i.y/n-a.y)+a.y)*n)}return i},mxEdgeHandler.prototype.getPreviewTerminalState=function(t){if(this.constraintHandler.update(t,this.isSource,!0,t.isSource(this.marker.highlight.shape)?null:this.currentPoint),null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint){null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent");var e=this.graph.getModel(),n=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(e.getTerminal(this.state.cell,!this.isSource)),!this.isSource),i=null!=n?n.cell:null,s=this.isSource?this.constraintHandler.currentFocus.cell:i,r=this.isSource?i:this.constraintHandler.currentFocus.cell;this.error=this.validateConnection(s,r);var o=null;return null==this.error&&(o=this.constraintHandler.currentFocus),(null!=this.error||null!=o&&!this.isCellEnabled(o.cell))&&this.constraintHandler.reset(),o}if(this.graph.isIgnoreTerminalEvent(t.getEvent()))return this.marker.reset(),null;this.marker.process(t);var l=this.marker.getValidState();return null==l||this.isCellEnabled(l.cell)||(this.constraintHandler.reset(),this.marker.reset()),this.marker.getValidState()},mxEdgeHandler.prototype.getPreviewPoints=function(t,e){var n,i,s=this.graph.getCellGeometry(this.state.cell),r=null!=s.points?s.points.slice():null,o=new mxPoint(t.x,t.y),l=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(r=null);else if(this.convertPoint(o,!1),null==r)r=[o];else{if(this.index<=mxEvent.VIRTUAL_HANDLE&&r.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,o),!this.isSource&&!this.isTarget){for(var a=0;a<this.bends.length;a++)if(a!=this.index){var h=this.bends[a];null!=h&&mxUtils.contains(h.bounds,t.x,t.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?r.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):r.splice(this.index-1,1),l=r)}if(null==l&&this.straightRemoveEnabled&&(null==e||!mxEvent.isAltDown(e.getEvent()))){var u=this.graph.tolerance*this.graph.tolerance,d=this.state.absolutePoints.slice();d[this.index]=t;var p=this.state.getVisibleTerminalState(!0);if(null!=p)null!=(m=this.graph.getConnectionConstraint(this.state,p,!0))&&null!=this.graph.getConnectionPoint(p,m)||(d[0]=new mxPoint(p.view.getRoutingCenterX(p),p.view.getRoutingCenterY(p)));var m,c=this.state.getVisibleTerminalState(!1);if(null!=c)null!=(m=this.graph.getConnectionConstraint(this.state,c,!1))&&null!=this.graph.getConnectionPoint(c,m)||(d[d.length-1]=new mxPoint(c.view.getRoutingCenterX(c),c.view.getRoutingCenterY(c)));n=this.index,i=t,n>0&&n<d.length-1&&mxUtils.ptSegDistSq(d[n-1].x,d[n-1].y,d[n+1].x,d[n+1].y,i.x,i.y)<u&&(r.splice(n-1,1),l=r)}}null==l&&this.index>mxEvent.VIRTUAL_HANDLE&&(r[this.index-1]=o)}return null!=l?l:r},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=t.getEvent(),i=mxEvent.getClientX(n),s=mxEvent.getClientY(n),r=document.documentElement,o=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),l=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-o,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-l;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,s)||(a!=i||h!=s)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,n,i,s){var r=this.isSource?n:this.state.getVisibleTerminalState(!0),o=this.isTarget?n:this.state.getVisibleTerminalState(!1),l=this.graph.getConnectionConstraint(t,r,!0),a=this.graph.getConnectionConstraint(t,o,!1),h=this.constraintHandler.currentConstraint;if(null==h&&s&&(null!=n?(i.isSource(this.marker.highlight.shape)&&(e=new mxPoint(i.getGraphX(),i.getGraphY())),h=this.graph.getOutlineConstraint(e,n,i),this.constraintHandler.setFocus(i,n,this.isSource),this.constraintHandler.currentConstraint=h,this.constraintHandler.currentPoint=e):h=new mxConnectionConstraint),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var u=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=s?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(i.getCell())&&this.marker.getValidState()!=i.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint())}this.isSource?l=h:this.isTarget&&(a=h),(this.isSource||this.isTarget)&&(null!=h&&null!=h.point?(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):(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(r,!0),t.setVisibleTerminalState(o,!1),this.isSource&&null==r||t.view.updateFixedTerminalPoint(t,r,!0,l),this.isTarget&&null==o||t.view.updateFixedTerminalPoint(t,o,!1,a),(this.isSource||this.isTarget)&&null==n&&(t.setAbsoluteTerminalPoint(e,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,r,o),t.view.updateFloatingTerminalPoints(t,r,o)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(null!=this.index&&null!=this.marker){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y),this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),null!=this.shape&&null!=this.shape.node&&(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 n=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var i=!(!this.isSource&&!this.isTarget)&&this.isOutlineConnectEvent(e);i?n=this.marker.highlight.state:null!=n&&n!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),n=null)}null==n||this.isCellEnabled(n.cell)||(n=null,this.marker.reset());var s=this.clonePreviewState(this.currentPoint,null!=n?n.cell:null);this.updatePreviewState(s,this.currentPoint,n,e,i);var r=null==this.error?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(r),this.abspoints=s.absolutePoints,this.active=!0,this.updateHint(e,this.currentPoint)}this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(e)&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.marker){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="");var n=this.state.cell,i=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var s=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)this.error.length>0&&this.graph.validationAlert(this.error);else if(i<=mxEvent.CUSTOM_HANDLE&&i>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){(o=this.graph.getModel()).beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-i].execute(e),null!=this.shape&&null!=this.shape.node&&(this.shape.apply(this.state),this.shape.redraw())}finally{o.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var r=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(r=this.constraintHandler.currentFocus.cell),null==r&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(r=this.marker.validState.cell),null!=r){var o,l=(o=this.graph.getModel()).getParent(n);o.beginUpdate();try{if(s){var a=o.getGeometry(n);s=this.graph.cloneCell(n);o.add(l,s,o.getChildCount(l)),null!=a&&(a=a.clone(),o.setGeometry(s,a));var h=o.getTerminal(n,!this.isSource);this.graph.connectCell(s,h,!this.isSource),n=s}n=this.connect(n,r,this.isSource,s,e)}finally{o.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(n));null!=d&&(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,n=this.changeTerminalPoint(n,u,this.isSource,s)}}else this.active?n=this.changePoints(n,this.points,s):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(e.getEvent())&&this.graph.selectCellForEvent(this.state.cell,e.getEvent());null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),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=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&null!=this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");if(null!=this.marker&&this.marker.reset(),null!=this.constraintHandler&&this.constraintHandler.reset(),null!=this.customHandles)for(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){null!=this.shape&&(this.shape.stroke=t)},mxEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate();e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x),t.y=Math.round(t.y/n-i.y);var s=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));return null!=s&&(t.x-=s.origin.x,t.y-=s.origin.y),t},mxEdgeHandler.prototype.moveLabel=function(t,e,n){var i=this.graph.getModel(),s=i.getGeometry(t.cell);if(null!=s){var r=this.graph.getView().scale;if((s=s.clone()).relative){var o=this.graph.getView().getRelativePoint(t,e,n);s.x=Math.round(1e4*o.x)/1e4,s.y=Math.round(o.y),s.offset=new mxPoint(0,0);o=this.graph.view.getPoint(t,s);s.offset=new mxPoint(Math.round((e-o.x)/r),Math.round((n-o.y)/r))}else{var l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=a&&null!=h){var u=a.x+(h.x-a.x)/2,d=a.y+(h.y-a.y)/2;s.offset=new mxPoint(Math.round((e-u)/r),Math.round((n-d)/r)),s.x=0,s.y=0}}i.setGeometry(t.cell,s)}},mxEdgeHandler.prototype.connect=function(t,e,n,i,s){var r=this.graph.getModel();r.getParent(t),r.beginUpdate();try{var o=this.constraintHandler.currentConstraint;null==o&&(o=new mxConnectionConstraint),this.graph.connectCell(t,e,n,o)}finally{r.endUpdate()}return t},mxEdgeHandler.prototype.changeTerminalPoint=function(t,e,n,i){var s=this.graph.getModel();s.beginUpdate();try{if(i){var r=s.getParent(t),o=s.getTerminal(t,!n);t=this.graph.cloneCell(t),s.add(r,t,s.getChildCount(r)),s.setTerminal(t,o,!n)}var l=s.getGeometry(t);null!=l&&((l=l.clone()).setTerminalPoint(e,n),s.setGeometry(t,l),this.graph.connectCell(t,null,n,new mxConnectionConstraint))}finally{s.endUpdate()}return t},mxEdgeHandler.prototype.changePoints=function(t,e,n){var i=this.graph.getModel();i.beginUpdate();try{if(n){var s=i.getParent(t),r=i.getTerminal(t,!0),o=i.getTerminal(t,!1);t=this.graph.cloneCell(t),i.add(s,t,i.getChildCount(s)),i.setTerminal(t,r,!0),i.setTerminal(t,o,!1)}var l=i.getGeometry(t);null!=l&&((l=l.clone()).points=e,i.setGeometry(t,l))}finally{i.endUpdate()}return t},mxEdgeHandler.prototype.addPoint=function(t,e){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.graph.isGridEnabledEvent(e);this.convertPoint(n,i),this.addPointAt(t,n.x,n.y),mxEvent.consume(e)},mxEdgeHandler.prototype.addPointAt=function(t,e,n){var i=this.graph.getCellGeometry(t.cell),s=new mxPoint(e,n);if(null!=i){i=i.clone();var r=this.graph.view.translate,o=this.graph.view.scale,l=new mxPoint(r.x*o,r.y*o),a=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(a)){var h=this.graph.view.getState(a);l=new mxPoint(h.x,h.y)}var u=mxUtils.findNearestSegment(t,s.x*o+l.x,s.y*o+l.y);null==i.points?i.points=[s]:i.points.splice(u,0,s),this.graph.getModel().setGeometry(t.cell,i),this.refresh(),this.redraw()}},mxEdgeHandler.prototype.removePoint=function(t,e){if(e>0&&e<this.abspoints.length-1){var n=this.graph.getCellGeometry(this.state.cell);null!=n&&null!=n.points&&((n=n.clone()).points.splice(e-1,1),this.graph.getModel().setGeometry(t.cell,n),this.refresh(),this.redraw())}},mxEdgeHandler.prototype.getHandleFillColor=function(t){var e=0==t,n=this.state.cell,i=this.graph.getModel().getTerminal(n,e),s=mxConstants.HANDLE_FILLCOLOR;return null!=i&&!this.graph.isCellDisconnectable(n,i,e)||null==i&&!this.graph.isTerminalPointMovable(n,e)?s=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=i&&this.graph.isCellDisconnectable(n,i,e)&&(s=mxConstants.CONNECT_HANDLE_FILLCOLOR),s},mxEdgeHandler.prototype.redraw=function(t){if(null!=this.state){this.abspoints=this.state.absolutePoints.slice();var e=this.graph.getModel().getGeometry(this.state.cell);if(null!=e){var n=e.points;if(null!=this.bends&&this.bends.length>0&&null!=n){null==this.points&&(this.points=[]);for(var i=1;i<this.bends.length-1;i++)null!=this.bends[i]&&null!=this.abspoints[i]&&(this.points[i-1]=n[i-1])}}this.drawPreview(),t||this.redrawHandles()}},mxEdgeHandler.prototype.redrawHandles=function(){var t=this.state.cell,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 n=this.graph.getLabel(t);if(this.labelShape.visible=null!=n&&n.length>0&&this.graph.isLabelMovable(t),null!=this.bends&&this.bends.length>0){var i=this.abspoints.length-1,s=this.abspoints[0],r=s.x,o=s.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(r-e.width/2),Math.floor(o-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var l=this.abspoints[i],a=l.x,h=l.y,u=this.bends.length-1;e=this.bends[u].bounds,this.bends[u].bounds=new mxRectangle(Math.floor(a-e.width/2),Math.floor(h-e.height/2),e.width,e.height),this.bends[u].fill=this.getHandleFillColor(u),this.bends[u].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[u].bounds),this.redrawInnerBends(s,l)}if(null!=this.abspoints&&null!=this.virtualBends&&this.virtualBends.length>0)for(var d=this.abspoints[0],p=0;p<this.virtualBends.length;p++)if(null!=this.virtualBends[p]&&null!=this.abspoints[p+1]){var m=this.abspoints[p+1],c=(e=this.virtualBends[p],d.x+(m.x-d.x)/2),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,this.manageLabelHandle&&this.checkLabelHandle(e.bounds)}if(null!=this.labelShape&&this.labelShape.redraw(),null!=this.customHandles)for(p=0;p<this.customHandles.length;p++){var g=this.customHandles[p].shape.node.style.display;this.customHandles[p].redraw(),this.customHandles[p].shape.node.style.display=g,this.customHandles[p].shape.node.style.visibility=this.isCustomHandleVisible(this.customHandles[p])?"":"hidden"}},mxEdgeHandler.prototype.isCustomHandleVisible=function(t){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()},mxEdgeHandler.prototype.setHandlesVisible=function(t){if(null!=this.bends)for(var e=0;e<this.bends.length;e++)this.bends[e].node.style.display=t?"":"none";if(null!=this.virtualBends)for(e=0;e<this.virtualBends.length;e++)this.virtualBends[e].node.style.display=t?"":"none";if(null!=this.labelShape&&(this.labelShape.node.style.display=t?"":"none"),null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxEdgeHandler.prototype.redrawInnerBends=function(t,e){for(var n=1;n<this.bends.length-1;n++)if(null!=this.bends[n])if(null!=this.abspoints[n]){var i=this.abspoints[n].x,s=this.abspoints[n].y,r=this.bends[n].bounds;this.bends[n].node.style.visibility="visible",this.bends[n].bounds=new mxRectangle(Math.round(i-r.width/2),Math.round(s-r.height/2),r.width,r.height),this.manageLabelHandle?this.checkLabelHandle(this.bends[n].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[n].bounds,this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+3,h=mxConstants.HANDLE_SIZE+3,this.bends[n].bounds=new mxRectangle(Math.round(i-w/2),Math.round(s-h/2),w,h)),this.bends[n].redraw()}else this.bends[n].destroy(),this.bends[n]=null},mxEdgeHandler.prototype.checkLabelHandle=function(t){if(null!=this.labelShape){var e=this.labelShape.bounds;mxUtils.intersects(t,e)&&(t.getCenterY()<e.getCenterY()?e.y=t.y+t.height:e.y=t.y-e.height)}},mxEdgeHandler.prototype.drawPreview=function(){try{if(this.isLabel){var t=this.labelShape.bounds,e=new mxRectangle(Math.round(this.label.x-t.width/2),Math.round(this.label.y-t.height/2),t.width,t.height);this.labelShape.bounds.equals(e)||(this.labelShape.bounds=e,this.labelShape.redraw())}null==this.shape||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=!1,this.shape.redraw()),this.updateParentHighlight()}catch(t){}},mxEdgeHandler.prototype.refresh=function(){null!=this.state&&(this.abspoints=this.getSelectionPoints(this.state),this.points=[],null!=this.bends&&(this.destroyBends(this.bends),this.bends=this.createBends()),null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=this.createVirtualBends()),null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=this.createCustomHandles()),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node))},mxEdgeHandler.prototype.isDestroyed=function(){return null==this.shape},mxEdgeHandler.prototype.destroyBends=function(t){if(null!=t)for(var e=0;e<t.length;e++)null!=t[e]&&t[e].destroy()},mxEdgeHandler.prototype.destroy=function(){if(null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.parentHighlight){var t=this.graph.model.getParent(this.state.cell),e=this.graph.view.getState(t);null!=e&&e.parentHighlight==this.parentHighlight&&(e.parentHighlight=null),this.parentHighlight.destroy(),this.parentHighlight=null}null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(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=void 0!==mxEdgeHandler?mxEdgeHandler:void 0,mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t.push(this.createVirtualBend(mxUtils.bind(this,(function(t){!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),t},mxElbowEdgeHandler.prototype.createVirtualBend=function(t){var e=this.createHandleShape();return this.initBend(e,t),e.setCursor(this.getCursorForBend()),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),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;return null==this.bends||null==this.bends[1]||t!=this.bends[1].node&&t.parentNode!=this.bends[1].node||(e=this.doubleClickOrientationResource,e=mxResources.get(e)||e),e},mxElbowEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate(),s=this.state.origin;return e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x-s.x),t.y=Math.round(t.y/n-i.y-s.y),t},mxElbowEdgeHandler.prototype.redrawInnerBends=function(t,e){var n=this.graph.getModel().getGeometry(this.state.cell),i=this.state.absolutePoints,s=null;i.length>1?(t=i[1],e=i[i.length-2]):null!=n.points&&n.points.length>0&&(s=i[0]),s=null==s?new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):new mxPoint(this.graph.getView().scale*(s.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(s.y+this.graph.getView().translate.y+this.state.origin.y));var r=this.bends[1].bounds,o=r.width,l=r.height,a=new mxRectangle(Math.round(s.x-o/2),Math.round(s.y-l/2),o,l);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(o=mxConstants.HANDLE_SIZE+3,l=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(s.x-o/2),Math.floor(s.y-l/2),o,l)),this.bends[1].bounds=a,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=void 0!==mxElbowEdgeHandler?mxElbowEdgeHandler:void 0,mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(null!=t){var e=Math.max(1,this.graph.view.scale);if(2==t.length||3==t.length&&(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 n=t[0].x+(t[t.length-1].x-t[0].x)/2,i=t[0].y+(t[t.length-1].y-t[0].y)/2;t=[t[0],new mxPoint(n,i),new mxPoint(n,i),t[t.length-1]]}}return t},mxEdgeSegmentHandler.prototype.getPreviewPoints=function(t){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var e=this.getCurrentPoints(),n=this.convertPoint(e[0].clone(),!1);t=this.convertPoint(t.clone(),!1);for(var i=[],s=1;s<e.length;s++){var r=this.convertPoint(e[s].clone(),!1);s==this.index&&(0==Math.round(n.x-r.x)&&(n.x=t.x,r.x=t.x),0==Math.round(n.y-r.y)&&(n.y=t.y,r.y=t.y)),s<e.length-1&&i.push(r),n=r}if(1==i.length){var o=this.state.getVisibleTerminalState(!0),l=this.state.getVisibleTerminalState(!1),a=this.state.view.getScale(),h=this.state.view.getTranslate(),u=i[0].x*a+h.x,d=i[0].y*a+h.y;(null!=o&&mxUtils.contains(o,u,d)||null!=l&&mxUtils.contains(l,u,d))&&(i=[t,t])}return i},mxEdgeSegmentHandler.prototype.updatePreviewState=function(t,e,n,i){if(mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments),!this.isSource&&!this.isTarget){e=this.convertPoint(e.clone(),!1);for(var s=t.absolutePoints,r=s[0],o=s[1],l=[],a=2;a<s.length;a++){var h=s[a];0==Math.round(r.x-o.x)&&0==Math.round(o.x-h.x)||0==Math.round(r.y-o.y)&&0==Math.round(o.y-h.y)||l.push(this.convertPoint(o.clone(),!1)),r=o,o=h}var u=this.state.getVisibleTerminalState(!0),d=this.state.getVisibleTerminalState(!1),p=this.state.absolutePoints;if(0!=l.length||0!=Math.round(s[0].x-s[s.length-1].x)&&0!=Math.round(s[0].y-s[s.length-1].y)){if(5==s.length&&2==l.length&&null!=u&&null!=d&&null!=p&&0==Math.round(p[0].x-p[p.length-1].x)){var m=this.graph.getView(),c=m.getScale(),x=m.getTranslate(),g=m.getRoutingCenterY(u)/c-x.y,y=this.graph.getConnectionConstraint(t,u,!0);if(null!=y)null!=(f=this.graph.getConnectionPoint(u,y))&&(this.convertPoint(f,!1),g=f.y);var f,v=m.getRoutingCenterY(d)/c-x.y,C=this.graph.getConnectionConstraint(t,d,!1);if(C)null!=(f=this.graph.getConnectionPoint(d,C))&&(this.convertPoint(f,!1),v=f.y);l=[new mxPoint(e.x,g),new mxPoint(e.x,v)]}}else l=[e,e];this.points=l,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,n,i,s){var r=this.graph.getModel(),o=null;if(null!=(p=r.getGeometry(t))&&null!=p.points&&p.points.length>0){var l=this.abspoints,a=l[0],h=l[1];o=[];for(var u=2;u<l.length;u++){var d=l[u];0==Math.round(a.x-h.x)&&0==Math.round(h.x-d.x)||0==Math.round(a.y-h.y)&&0==Math.round(h.y-d.y)||o.push(this.convertPoint(h.clone(),!1)),a=h,h=d}}r.beginUpdate();try{var p;if(null!=o)null!=(p=r.getGeometry(t))&&((p=p.clone()).points=o,r.setGeometry(t,p));t=mxEdgeHandler.prototype.connect.apply(this,arguments)}finally{r.endUpdate()}return t},mxEdgeSegmentHandler.prototype.getTooltipForNode=function(t){return null},mxEdgeSegmentHandler.prototype.start=function(t,e,n){mxEdgeHandler.prototype.start.apply(this,arguments),null==this.bends||null==this.bends[n]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[n].node,100)},mxEdgeSegmentHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e);var n=this.getCurrentPoints();if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var i=0;i<n.length-1;i++){e=this.createVirtualBend(),t.push(e);var s=0==Math.round(n[i].x-n[i+1].x);0==Math.round(n[i].y-n[i+1].y)&&i<n.length-2&&(s=0==Math.round(n[i].x-n[i+2].x)),e.setCursor(s?"col-resize":"row-resize"),this.points.push(new mxPoint(0,0))}}e=this.createHandleShape(n.length);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),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 n=this.getCurrentPoints();if(null!=n&&n.length>1){var i=!1;if(4==n.length&&0==Math.round(n[1].x-n[2].x)&&0==Math.round(n[1].y-n[2].y))if(i=!0,0==Math.round(n[0].y-n[n.length-1].y)){var s=n[0].x+(n[n.length-1].x-n[0].x)/2;n[1]=new mxPoint(s,n[1].y),n[2]=new mxPoint(s,n[2].y)}else{var r=n[0].y+(n[n.length-1].y-n[0].y)/2;n[1]=new mxPoint(n[1].x,r),n[2]=new mxPoint(n[2].x,r)}for(var o=0;o<n.length-1;o++)if(null!=this.bends[o+1]){t=n[o],e=n[o+1];var l=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2),a=this.bends[o+1].bounds;this.bends[o+1].bounds=new mxRectangle(Math.floor(l.x-a.width/2),Math.floor(l.y-a.height/2),a.width,a.height),this.bends[o+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[o+1].bounds)}i&&(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity))}}},__mxOutput.mxEdgeSegmentHandler=void 0!==mxEdgeSegmentHandler?mxEdgeSegmentHandler:void 0,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=!0,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){return null==t||mxEvent.isAltDown(t)?null:this.isControlDown(t)?mxEvent.isShiftDown(t)?this.controlShiftKeys[t.keyCode]:this.controlKeys[t.keyCode]:mxEvent.isShiftDown(t)?this.shiftKeys[t.keyCode]:this.normalKeys[t.keyCode]},mxKeyHandler.prototype.isGraphEvent=function(t){var e=mxEvent.getSource(t);return!!(e==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(t))||mxUtils.isAncestorNode(this.graph.container,e)},mxKeyHandler.prototype.keyDown=function(t){if(this.isEnabledForEvent(t))if(27==t.keyCode)this.escape(t);else if(!this.isEventIgnored(t)){var e=this.getFunction(t);null!=e&&(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){this.graph.isEscapeEnabled()&&this.graph.escape(t)},mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null),this.target=null},__mxOutput.mxKeyHandler=void 0!==mxKeyHandler?mxKeyHandler:void 0,mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=null,mxTooltipHandler.prototype.ignoreTouchEvents=!0,mxTooltipHandler.prototype.hideOnHover=!1,mxTooltipHandler.prototype.destroyed=!1,mxTooltipHandler.prototype.enabled=!0,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(){null!=document.body&&(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){"A"!=mxEvent.getSource(t).nodeName&&this.hideTooltip()}))))},mxTooltipHandler.prototype.getStateForEvent=function(t){return t.getState()},mxTooltipHandler.prototype.mouseDown=function(t,e){this.reset(e,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(t,e){if(e.getX()!=this.lastX||e.getY()!=this.lastY){this.reset(e,!0);var n=this.getStateForEvent(e);(this.isHideOnHover()||n!=this.state||e.getSource()!=this.node&&(!this.stateSource||null!=n&&this.stateSource==(e.isSource(n.shape)||!e.isSource(n.text))))&&this.hideTooltip()}this.lastX=e.getX(),this.lastY=e.getY()},mxTooltipHandler.prototype.mouseUp=function(t,e){this.reset(e,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(t,e,n){if((!this.ignoreTouchEvents||mxEvent.isMouseEvent(t.getEvent()))&&(this.resetTimer(),n=null!=n?n:this.getStateForEvent(t),e&&this.isEnabled()&&null!=n&&(null==this.div||"hidden"==this.div.style.visibility))){var i=t.getSource(),s=t.getX(),r=t.getY(),o=t.isSource(n.shape)||t.isSource(n.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(n,i,s,r);this.show(t,s,r),this.state=n,this.node=i,this.stateSource=o}})),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerHTML="")},mxTooltipHandler.prototype.show=function(t,e,n){if(!this.destroyed&&null!=t&&t.length>0){null==this.div&&this.init();var i=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+i.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+i.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"<br>"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=void 0!==mxTooltipHandler?mxTooltipHandler:void 0,mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=void 0!==mxCellTracker?mxCellTracker:void 0,mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=null,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,null!=this.shape&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),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);return 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=!1,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),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(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=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||8==document.documentMode)&&("transparent"==this.shape.stroke?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=t,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var n=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var i=document.elementFromPoint(t,e);null!=i;){if(i==this.shape.node){n=!0;break}i=i.parentNode}return n},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=void 0!==mxCellHighlight?mxCellHighlight:void 0,mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,n){var i=mxUtils.bind(this,(function(){this.editor.execute(e)}));n?this.handler.bindControlKey(t,i):this.handler.bindKey(t,i)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=void 0!==mxDefaultKeyHandler?mxDefaultKeyHandler:void 0,mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,n,i){if(null!=this.config){var s=this.createConditions(t,n,i),r=this.config.firstChild;this.addItems(t,e,n,i,s,r,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,n,i,s,r,o){for(var l=!1;null!=r;){if("add"==r.nodeName){var a=r.getAttribute("if");if(null==a||s[a]){var h=r.getAttribute("as");h=mxResources.get(h)||h;var u=mxUtils.eval(mxUtils.getTextContent(r)),d=r.getAttribute("action"),p=r.getAttribute("icon"),m=r.getAttribute("iconCls"),c=r.getAttribute("enabled-if"),x=null==c||s[c];l&&(e.addSeparator(o),l=!1),null!=p&&this.imageBasePath&&(p=this.imageBasePath+p);var g=this.addAction(e,t,h,p,u,d,n,o,m,x);this.addItems(t,e,n,i,s,r.firstChild,g)}}else"separator"==r.nodeName&&(l=!0);r=r.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,n,i,s,r,o,l,a,h){return t.addItem(n,i,(function(t){"function"==typeof s&&s.call(e,e,o,t),null!=r&&e.execute(r,o,t)}),l,a,h)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,n){var i=t.graph.getModel(),s=i.getChildCount(e),r=[];r.nocell=null==e,r.ncells=t.graph.getSelectionCount()>1,r.notRoot=i.getRoot()!=i.getParent(t.graph.getDefaultParent()),r.cell=null!=e;var o=null!=e&&1==t.graph.getSelectionCount();r.nonEmpty=o&&s>0,r.expandable=o&&t.graph.isCellFoldable(e,!1),r.collapsable=o&&t.graph.isCellFoldable(e,!0),r.validRoot=o&&t.graph.isValidRoot(e),r.emptyValidRoot=r.validRoot&&0==s,r.swimlane=o&&t.graph.isSwimlane(e);for(var l=this.config.getElementsByTagName("condition"),a=0;a<l.length;a++){var h=mxUtils.eval(mxUtils.getTextContent(l[a])),u=l[a].getAttribute("name");null!=u&&"function"==typeof h&&(r[u]=h(t,e,n))}return r},__mxOutput.mxDefaultPopupMenu=void 0!==mxDefaultPopupMenu?mxDefaultPopupMenu:void 0,mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(t){null!=t&&(this.toolbar=new mxToolbar(t),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,(function(t,e){var n=e.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,(function(){n.apply(this,arguments),this.toolbar.resetMode()})):null}))),this.resetHandler=mxUtils.bind(this,(function(){null!=this.toolbar&&this.toolbar.resetMode(!0)})),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(t,e,n,i){var s=mxUtils.bind(this,(function(){null!=n&&n.length>0&&this.editor.execute(n)}));return this.toolbar.addItem(t,e,s,i)},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,n){var i=mxUtils.bind(this,(function(){this.editor.execute(n)}));this.addOption(t,e,i)},mxDefaultToolbar.prototype.addOption=function(t,e,n){return this.toolbar.addOption(t,e,n)},mxDefaultToolbar.prototype.addMode=function(t,e,n,i,s){var r=mxUtils.bind(this,(function(){this.editor.setMode(n),null!=s&&s(this.editor)}));return this.toolbar.addSwitchMode(t,e,r,i)},mxDefaultToolbar.prototype.addPrototype=function(t,e,n,i,s,r){var o=mxUtils.bind(this,(function(){return"function"==typeof n?n():null!=n?this.editor.graph.cloneCell(n):null})),l=mxUtils.bind(this,(function(t,e){"function"==typeof s?s(this.editor,o(),t,e):this.drop(o(),t,e),this.toolbar.resetMode(),mxEvent.consume(t)})),a=this.toolbar.addMode(t,e,l,i,null,r);return this.installDropHandler(a,(function(t,e,n){l(e,n)})),a},mxDefaultToolbar.prototype.drop=function(t,e,n){var i=this.editor.graph,s=i.getModel();if(null!=n&&!s.isEdge(n)&&this.connectOnDrop&&i.isCellConnectable(n))this.connect(t,e,n);else{for(;null!=n&&!i.isValidDropTarget(n,[t],e);)n=s.getParent(n);this.insert(t,e,n)}},mxDefaultToolbar.prototype.insert=function(t,e,n){var i=this.editor.graph;if(i.canImportCell(t)){var s=mxEvent.getClientX(e),r=mxEvent.getClientY(e),o=mxUtils.convertPoint(i.container,s,r);return i.isSplitEnabled()&&i.isSplitTarget(n,[t],e)?i.splitEdge(n,[t],null,o.x,o.y):this.editor.addVertex(n,t,o.x,o.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,n){var i=this.editor.graph,s=i.getModel();if(null!=n&&i.isCellConnectable(t)&&i.isEdgeValid(null,n,t)){var r=null;s.beginUpdate();try{var o=s.getGeometry(n),l=s.getGeometry(t).clone();l.x=o.x+(o.width-l.width)/2,l.y=o.y+(o.height-l.height)/2;var a=this.spacing*i.gridSize,h=20*s.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?l.x+=(l.width+o.width)/2+a+h:l.y+=(l.height+o.height)/2+a+h,t.setGeometry(l);var u=s.getParent(n);if(i.addCell(t,u),i.constrainChild(t),r=this.editor.createEdge(n,t),null==s.getGeometry(r)){var d=new mxGeometry;d.relative=!0,s.setGeometry(r,d)}i.addEdge(r,u,n,t)}finally{s.endUpdate()}i.setSelectionCells([t,r]),i.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var n=document.createElement("img");n.setAttribute("src",t.getAttribute("src"));var i=mxUtils.bind(this,(function(s){n.style.width=2*t.offsetWidth+"px",n.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,n),mxEvent.removeListener(n,"load",i)}));mxClient.IS_IE?i():mxEvent.addListener(n,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=void 0!==mxDefaultToolbar?mxDefaultToolbar:void 0,mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"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=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,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=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,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=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,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){new mxPrintPreview(t.graph,1).open()})),this.addAction("show",(function(t){mxUtils.show(t.graph,null,10,10)})),this.addAction("exportImage",(function(t){var e=t.getUrlImage();if(null==e||mxClient.IS_LOCAL)t.execute("show");else{var n=mxUtils.getViewXml(t.graph,1),i=mxUtils.getXml(n,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(i),document,"_blank")}})),this.addAction("refresh",(function(t){t.graph.refresh()})),this.addAction("cut",(function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)})),this.addAction("copy",(function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)})),this.addAction("paste",(function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)})),this.addAction("delete",(function(t){t.graph.isEnabled()&&t.graph.removeCells()})),this.addAction("group",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())})),this.addAction("ungroup",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())})),this.addAction("removeFromParent",(function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()})),this.addAction("undo",(function(t){t.graph.isEnabled()&&t.undo()})),this.addAction("redo",(function(t){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){t.graph.isEnabled()&&t.graph.selectAll()})),this.addAction("selectNone",(function(t){t.graph.isEnabled()&&t.graph.clearSelection()})),this.addAction("selectVertices",(function(t){t.graph.isEnabled()&&t.graph.selectVertices()})),this.addAction("selectEdges",(function(t){t.graph.isEnabled()&&t.graph.selectEdges()})),this.addAction("edit",(function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)})),this.addAction("toBack",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)})),this.addAction("toFront",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)})),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){t.graph.isEnabled()&&t.graph.selectPreviousCell()})),this.addAction("selectNext",(function(t){t.graph.isEnabled()&&t.graph.selectNextCell()})),this.addAction("selectParent",(function(t){t.graph.isEnabled()&&t.graph.selectParentCell()})),this.addAction("selectChild",(function(t){t.graph.isEnabled()&&t.graph.selectChildCell()})),this.addAction("collapse",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)})),this.addAction("collapseAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}})),this.addAction("expand",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)})),this.addAction("expandAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}})),this.addAction("bold",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)})),this.addAction("italic",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)})),this.addAction("underline",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)})),this.addAction("alignCellsLeft",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)})),this.addAction("alignCellsCenter",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)})),this.addAction("alignCellsRight",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)})),this.addAction("alignCellsTop",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)})),this.addAction("alignCellsMiddle",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)})),this.addAction("alignCellsBottom",(function(t){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){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)})),this.addAction("alignFontRight",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)})),this.addAction("alignFontTop",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)})),this.addAction("alignFontMiddle",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)})),this.addAction("alignFontBottom",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)})),this.addAction("zoom",(function(t){var e=100*t.graph.getView().scale,n=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(n)||t.graph.getView().setScale(n)})),this.addAction("toggleTasks",(function(t){null!=t.tasks?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()})),this.addAction("toggleHelp",(function(t){null!=t.help?t.help.setVisible(!t.help.isVisible()):t.showHelp()})),this.addAction("toggleOutline",(function(t){null==t.outline?t.showOutline():t.outline.setVisible(!t.outline.isVisible())})),this.addAction("toggleConsole",(function(t){mxLog.setVisible(!mxLog.isVisible())}))},mxEditor.prototype.configure=function(t){null!=t&&(new mxCodec(t.ownerDocument).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(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,n){var i=this.actions[t];if(null!=i)try{var s=arguments;s[0]=this,i.apply(this,s)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},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);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,(function(t,e,n){return this.createPopupMenu(t,e,n)})),t.connectionHandler.factoryMethod=mxUtils.bind(this,(function(t,e){return this.createEdge(t,e)})),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,(function(){return this.horizontalFlow})),e.isEnabled=mxUtils.bind(this,(function(){return this.maintainSwimlanes})),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),n=this;return e.getLayout=function(e){var i=null,s=n.graph.getModel();return null!=s.getParent(e)&&(n.layoutSwimlanes&&t.isSwimlane(e)?(null==n.swimlaneLayout&&(n.swimlaneLayout=n.createSwimlaneLayout()),i=n.swimlaneLayout):n.layoutDiagram&&(t.isValidRoot(e)||null==s.getParent(s.getParent(e)))&&(null==n.diagramLayout&&(n.diagramLayout=n.createDiagramLayout()),i=n.diagramLayout)),i},e},mxEditor.prototype.setGraphContainer=function(t){null==this.graph.container&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,(function(e,n){var i=n.getProperty("cell");null!=i&&t.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,i),n.consume())})))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,(function(t,e){var n=e.getProperty("edit");this.undoManager.undoableEditHappened(n)}));t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var n=function(e,n){var i=n.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(i))};this.undoManager.addListener(mxEvent.UNDO,n),this.undoManager.addListener(mxEvent.REDO,n)},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,n){this.setModified(!0),1==this.validating&&t.validateGraph();for(var i=n.getProperty("edit").changes,s=0;s<i.length;s++){var r=i[s];if(r instanceof mxRootChange||r instanceof mxValueChange&&r.cell==this.graph.model.root||r instanceof mxCellAttributeChange&&r.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,n={mouseDown:function(t,n){null==e.insertFunction||n.isPopupTrigger()||!e.forcedInserting&&null!=n.getState()||(e.graph.clearSelection(),e.insertFunction(n.getEvent(),n.getCell()),this.isActive=!0,n.consume())},mouseMove:function(t,e){this.isActive&&e.consume()},mouseUp:function(t,e){this.isActive&&(this.isActive=!1,e.consume())}};t.addMouseListener(n)},mxEditor.prototype.createDiagramLayout=function(){var t=this.graph.gridSize,e=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*t,2*t);return e.isVertexIgnored=function(t){return!e.graph.isSwimlane(t)},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),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.setStatusContainer=function(t){null==this.status&&(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)}))),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.setStatus=function(t){null!=this.status&&null!=t&&(this.status.innerHTML=t)},mxEditor.prototype.setTitleContainer=function(t){this.addListener(mxEvent.ROOT,mxUtils.bind(this,(function(e){t.innerHTML=this.getTitle()}))),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.treeLayout=function(t,e){null!=t&&new mxCompactTreeLayout(this.graph,e).execute(t)},mxEditor.prototype.getTitle=function(){for(var t="",e=this.graph,n=e.getCurrentRoot();null!=n&&null!=e.getModel().getParent(e.getModel().getParent(n));)e.isValidRoot(n)&&(t=" > "+e.convertValueToString(n)+t),n=e.getModel().getParent(n);return this.getRootTitle()+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=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(null!=t){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){new mxCodec(t.ownerDocument).decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(null!=(t=t||this.getUrlPost())&&t.length>0){var n=this.writeGraphModel(e);this.postDiagram(t,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,(function(n){this.fireEvent(new mxEventObject(mxEvent.POST,"request",n,"url",t,"data",e))})))},mxEditor.prototype.writeGraphModel=function(t){t=null!=t?t:this.linefeed;var e=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(e,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var n=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(null==(t=t||this.graph.getSelectionCell())&&null==(t=this.graph.getCurrentRoot())&&(t=this.graph.getModel().getRoot()),null!=t){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),n=e.x+10,i=e.y;if(null==this.properties||this.movePropertiesDialog){var s=this.graph.getCellBounds(t);null!=s&&(n+=s.x+Math.min(200,s.width),i+=s.y)}else n=this.properties.getX(),i=this.properties.getY();this.hideProperties();var r=this.createProperties(t);null!=r&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,r,n,i,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),n=e.getValue(t);if(mxUtils.isNode(n)){var i=new mxForm("properties");i.addText("ID",t.getId()).setAttribute("readonly","true");var s=null,r=null,o=null,l=null,a=null;e.isVertex(t)&&null!=(s=e.getGeometry(t))&&(r=i.addText("top",s.y),o=i.addText("left",s.x),l=i.addText("width",s.width),a=i.addText("height",s.height));for(var h=e.getStyle(t),u=i.addText("Style",h||""),d=n.attributes,p=[],m=0;m<d.length;m++){var c=d[m].value;p[m]=i.addTextarea(d[m].nodeName,c,"label"==d[m].nodeName?4:2)}var x=mxUtils.bind(this,(function(){this.hideProperties(),e.beginUpdate();try{null!=s&&((s=s.clone()).x=parseFloat(o.value),s.y=parseFloat(r.value),s.width=parseFloat(l.value),s.height=parseFloat(a.value),e.setGeometry(t,s)),u.value.length>0?e.setStyle(t,u.value):e.setStyle(t,null);for(var n=0;n<d.length;n++){var i=new mxCellAttributeChange(t,d[n].nodeName,p[n].value);e.execute(i)}this.graph.isAutoSizeCell(t)&&this.graph.updateCellSize(t)}finally{e.endUpdate()}})),g=mxUtils.bind(this,(function(){this.hideProperties()}));return i.addButtons(x,g),i.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var t=document.createElement("div");t.style.padding="4px",t.style.paddingLeft="20px";var e=document.body.clientWidth,n=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,t,e-220,this.tasksTop,200);n.setClosable(!0),n.destroyOnClose=!1;var i=mxUtils.bind(this,(function(e){mxEvent.release(t),t.innerHTML="",this.createTasks(t)}));this.graph.getModel().addListener(mxEvent.CHANGE,i),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,i),this.graph.addListener(mxEvent.ROOT,i),null!=this.tasksWindowImage&&n.setImage(this.tasksWindowImage),this.tasks=n,this.createTasks(t)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(t){if(null!=this.tasks){t=this.tasks.content;mxEvent.release(t),t.innerHTML="",this.createTasks(t)}},mxEditor.prototype.createTasks=function(t){},mxEditor.prototype.showHelp=function(t){if(null==this.help){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 n=document.body.clientWidth,i=document.body.clientHeight||document.documentElement.clientHeight,s=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,e,(n-this.helpWidth)/2,(i-this.helpHeight)/3,this.helpWidth,this.helpHeight);if(s.setMaximizable(!0),s.setClosable(!0),s.destroyOnClose=!1,s.setResizable(!0),null!=this.helpWindowImage&&s.setImage(this.helpWindowImage),mxClient.IS_NS){var r=function(t){var n=s.div.offsetHeight;e.setAttribute("height",n-26+"px")};s.addListener(mxEvent.RESIZE_END,r),s.addListener(mxEvent.MAXIMIZE,r),s.addListener(mxEvent.NORMALIZE,r),s.addListener(mxEvent.SHOW,r)}this.help=s}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var t=document.createElement("div");t.style.overflow="hidden",t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.background="white",t.style.cursor="move",8==document.documentMode&&(t.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=100)");var e=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,t,600,480,200,200,!1),n=new mxOutline(this.graph,t);e.setClosable(!0),e.setResizable(!0),e.destroyOnClose=!1,e.addListener(mxEvent.RESIZE_END,(function(){n.update()})),this.outline=e,this.outline.outline=n}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(t){"select"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==t&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(t,e,n){this.popupHandler.createMenu(this,t,e,n)},mxEditor.prototype.createEdge=function(t,e){var n=null;if(null!=this.defaultEdge){n=this.graph.getModel().cloneCell(this.defaultEdge)}else{(n=new mxCell("")).setEdge(!0);var i=new mxGeometry;i.relative=!0,n.setGeometry(i)}var s=this.getEdgeStyle();return null!=s&&n.setStyle(s),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(t){return null!=this.cycleAttributeValues&&this.cycleAttributeValues.length>0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(null!=this.cycleAttributeName){var e=this.consumeCycleAttribute(t);null!=e&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,n,i){for(var s=this.graph.getModel();null!=t&&!this.graph.isValidDropTarget(t);)t=s.getParent(t);t=null!=t?t:this.graph.getSwimlaneAt(n,i);var r=this.graph.getView().scale,o=s.getGeometry(e),l=s.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(null==t&&this.swimlaneRequired)return null;if(null!=t&&null!=l){var a=this.graph.getView().getState(t);if(null!=a){if(n-=a.origin.x*r,i-=a.origin.y*r,this.graph.isConstrainedMoving){var h=o.width,u=o.height,d=a.x+a.width;n+h>d&&(n-=n+h-d),i+u>(d=a.y+a.height)&&(i-=i+u-d)}}else null!=l&&(n-=l.x*r,i-=l.y*r)}}(o=o.clone()).x=this.graph.snap(n/r-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(i/r-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(o),null==t&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),s.beginUpdate();try{null!=(e=this.graph.addCell(e,t))&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{s.endUpdate()}return null!=e&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=void 0!==mxEditor?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(null!=t){var e=t.getName();mxCodecRegistry.codecs[e]=t;var n=mxUtils.getFunctionName(t.template.constructor);n!=e&&mxCodecRegistry.addAlias(n,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(null!=t){var n=mxUtils.getFunctionName(t),i=mxCodecRegistry.aliases[n];if(null!=i&&(n=i),null==(e=mxCodecRegistry.codecs[n]))try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch(t){}}return e}},codec;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(t,e,n,i){for(var s in this.template=t,this.exclude=null!=e?e:[],this.idrefs=null!=n?n:[],this.mapping=null!=i?i:[],this.reverse=new Object,this.mapping)this.reverse[this.mapping[s]]=s}__mxOutput.mxCodecRegistry=void 0!==mxCodecRegistry?mxCodecRegistry:void 0,mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(null!=t&&null==(e=this.objects[t])&&null==(e=this.lookup(t))){var n=this.getElementById(t);null!=n&&(e=this.decode(n))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=new Object,null!=this.document.documentElement&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(null!=e)if(null==this.elements[e])this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}for(t=t.firstChild;null!=t;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return null!=t&&null==(e=this.reference(t))&&t instanceof mxCell&&null==(e=t.getId())&&0==(e=mxCellPath.create(t)).length&&(e="root"),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(null!=t&&null!=t.constructor){var n=mxCodecRegistry.getCodec(t.constructor);null!=n?e=n.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=null;try{i=window[t.nodeName]}catch(t){}var s=mxCodecRegistry.getCodec(i);null!=s?n=s.decode(this,t,e):(n=t.cloneNode(!0)).removeAttribute("as")}return n},mxCodec.prototype.encodeCell=function(t,e,n){if(e.appendChild(this.encode(t)),null==n||n)for(var i=t.getChildCount(),s=0;s<i;s++)this.encodeCell(t.getChildAt(s),e)},mxCodec.prototype.isCellCodec=function(t){return null!=t&&"function"==typeof t.isCellCodec&&t.isCellCodec()},mxCodec.prototype.decodeCell=function(t,e){e=null==e||e;var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=mxCodecRegistry.getCodec(t.nodeName);if(!this.isCellCodec(i))for(var s=t.firstChild;null!=s&&!this.isCellCodec(i);)i=mxCodecRegistry.getCodec(s.nodeName),s=s.nextSibling;this.isCellCodec(i)||(i=mxCodecRegistry.getCodec(mxCell)),n=i.decode(this,t),e&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(t){var e=t.parent,n=t.getTerminal(!0),i=t.getTerminal(!1);if(t.setTerminal(null,!1),t.setTerminal(null,!0),t.parent=null,null!=e){if(e==t)throw new Error(e.id+": Self Reference");e.insert(t)}null!=n&&n.insertEdge(t,!0),null!=i&&i.insertEdge(t,!1)},mxCodec.prototype.setAttribute=function(t,e,n){null!=e&&null!=n&&t.setAttribute(e,n)},__mxOutput.mxCodec=void 0!==mxCodec?mxCodec:void 0,mxObjectCodec.allowEval=!1,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(null!=t){var e=this.reverse[t];null!=e&&(t=e)}return t},mxObjectCodec.prototype.getAttributeName=function(t){if(null!=t){var e=this.mapping[t];null!=e&&(t=e)}return t},mxObjectCodec.prototype.isExcluded=function(t,e,n,i){return e==mxObjectIdentity.FIELD_NAME||mxUtils.indexOf(this.exclude,e)>=0},mxObjectCodec.prototype.isReference=function(t,e,n,i){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var n=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,n),this.encodeObject(t,e,n),this.afterEncode(t,e,n)},mxObjectCodec.prototype.encodeObject=function(t,e,n){for(var i in t.setAttribute(n,"id",t.getId(e)),e){var s=i,r=e[s];null==r||this.isExcluded(e,s,r,!0)||(mxUtils.isInteger(s)&&(s=null),this.encodeValue(t,e,s,r,n))}},mxObjectCodec.prototype.encodeValue=function(t,e,n,i,s){if(null!=i){if(this.isReference(e,n,i,!0)){var r=t.getId(i);if(null==r)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+i);i=r}var o=this.template[n];(null==n||t.encodeDefaults||o!=i)&&(n=this.getAttributeName(n),this.writeAttribute(t,e,n,i,s))}},mxObjectCodec.prototype.writeAttribute=function(t,e,n,i,s){"object"!=typeof i?this.writePrimitiveAttribute(t,e,n,i,s):this.writeComplexAttribute(t,e,n,i,s)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,n,i,s){if(i=this.convertAttributeToXml(t,e,n,i,s),null==n){var r=t.document.createElement("add");"function"==typeof i?r.appendChild(t.document.createTextNode(i)):t.setAttribute(r,"value",i),s.appendChild(r)}else"function"!=typeof i&&t.setAttribute(s,n,i)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,n,i,s){var r=t.encode(i);null!=r?(null!=n&&r.setAttribute("as",n),s.appendChild(r)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+i)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,n,i){return this.isBooleanAttribute(t,e,n,i)&&(i=1==i?"1":"0"),i},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,n,i){return void 0===i.length&&(1==i||0==i)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,n){var i=e.value;return this.isNumericAttribute(t,e,n)&&(i=parseFloat(i),!isNaN(i)&&isFinite(i)||(i=0)),i},mxObjectCodec.prototype.isNumericAttribute=function(t,e,n){return n.constructor==mxGeometry&&("x"==e.name||"y"==e.name||"width"==e.name||"height"==e.name)||n.constructor==mxPoint&&("x"==e.name||"y"==e.name)||mxUtils.isNumeric(e.value)},mxObjectCodec.prototype.beforeEncode=function(t,e,n){return e},mxObjectCodec.prototype.afterEncode=function(t,e,n){return n},mxObjectCodec.prototype.decode=function(t,e,n){var i=e.getAttribute("id"),s=t.objects[i];return null==s&&(s=n||this.cloneTemplate(),null!=i&&t.putObject(i,s)),e=this.beforeDecode(t,e,s),this.decodeNode(t,e,s),this.afterDecode(t,e,s)},mxObjectCodec.prototype.decodeNode=function(t,e,n){null!=e&&(this.decodeAttributes(t,e,n),this.decodeChildren(t,e,n))},mxObjectCodec.prototype.decodeAttributes=function(t,e,n){var i=e.attributes;if(null!=i)for(var s=0;s<i.length;s++)this.decodeAttribute(t,i[s],n)},mxObjectCodec.prototype.isIgnoredAttribute=function(t,e,n){return"as"==e.nodeName||"id"==e.nodeName},mxObjectCodec.prototype.decodeAttribute=function(t,e,n){if(!this.isIgnoredAttribute(t,e,n)){var i=e.nodeName,s=this.convertAttributeFromXml(t,e,n),r=this.getFieldName(i);if(this.isReference(n,r,s,!1)){var o=t.getObject(s);if(null==o)return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+i+"="+s);s=o}this.isExcluded(n,i,s,!1)||(n[i]=s)}},mxObjectCodec.prototype.decodeChildren=function(t,e,n){for(var i=e.firstChild;null!=i;){var s=i.nextSibling;i.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(t,i,n)||this.decodeChild(t,i,n),i=s}},mxObjectCodec.prototype.decodeChild=function(t,e,n){var i=this.getFieldName(e.getAttribute("as"));if(null==i||!this.isExcluded(n,i,e,!1)){var s=this.getFieldTemplate(n,i,e),r=null;"add"==e.nodeName?null==(r=e.getAttribute("value"))&&mxObjectCodec.allowEval&&(r=mxUtils.eval(mxUtils.getTextContent(e))):r=t.decode(e,s);try{this.addObjectValue(n,i,r,s)}catch(t){throw new Error(t.message+" for "+e.nodeName)}}},mxObjectCodec.prototype.getFieldTemplate=function(t,e,n){var i=t[e];return i instanceof Array&&i.length>0&&(i=null),i},mxObjectCodec.prototype.addObjectValue=function(t,e,n,i){null!=n&&n!=i&&(null!=e&&e.length>0?t[e]=n:t.push(n))},mxObjectCodec.prototype.processInclude=function(t,e,n){if("include"==e.nodeName){var i=e.getAttribute("name");if(null!=i)try{var s=mxUtils.load(i).getDocumentElement();null!=s&&t.decode(s,n)}catch(t){}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,n){return e},mxObjectCodec.prototype.afterDecode=function(t,e,n){return n},__mxOutput.mxObjectCodec=void 0!==mxObjectCodec?mxObjectCodec:void 0,mxCodecRegistry.register((codec=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]),codec.isCellCodec=function(){return!0},codec.isNumericAttribute=function(t,e,n){return"value"!==e.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},codec.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&"value"==e&&n.nodeType==mxConstants.NODETYPE_ELEMENT},codec.afterEncode=function(t,e,n){if(null!=e.value&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var i=n;(n=mxUtils.importNode(t.document,e.value,!0)).appendChild(i);var s=i.getAttribute("id");n.setAttribute("id",s),i.removeAttribute("id")}return n},codec.beforeDecode=function(t,e,n){var i=e.cloneNode(!0),s=this.getName();if(e.nodeName!=s){var r=e.getElementsByTagName(s)[0];null!=r&&r.parentNode==e?(mxUtils.removeWhitespace(r,!0),mxUtils.removeWhitespace(r,!1),r.parentNode.removeChild(r),i=r):i=null,n.value=e.cloneNode(!0);var o=n.value.getAttribute("id");null!=o&&(n.setId(o),n.value.removeAttribute("id"))}else n.setId(e.getAttribute("id"));if(null!=i)for(var l=0;l<this.idrefs.length;l++){var a=this.idrefs[l],h=i.getAttribute(a);if(null!=h){i.removeAttribute(a);var u=t.objects[h]||t.lookup(h);if(null==u){var d=t.getElementById(h);null!=d&&(u=(mxCodecRegistry.codecs[d.nodeName]||this).decode(t,d))}n[a]=u}}return i},codec)),__mxOutput.mxCellCodec="undefined"!=typeof mxCellCodec?mxCellCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphModel);return t.encodeObject=function(t,e,n){var i=t.document.createElement("root");t.encodeCell(e.getRoot(),i),n.appendChild(i)},t.decodeChild=function(t,e,n){"root"==e.nodeName?this.decodeRoot(t,e,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeRoot=function(t,e,n){for(var i=null,s=e.firstChild;null!=s;){var r=t.decodeCell(s);null!=r&&null==r.getParent()&&(i=r),s=s.nextSibling}null!=i&&n.setRoot(i)},t}()),__mxOutput.mxModelCodec="undefined"!=typeof mxModelCodec?mxModelCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return t.afterEncode=function(t,e,n){return t.encodeCell(e.root,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.root=t.decodeCell(i,!1);var s=i.nextSibling;for(i.parentNode.removeChild(i),i=s;null!=i;)s=i.nextSibling,t.decodeCell(i),i.parentNode.removeChild(i),i=s}return e},t.afterDecode=function(t,e,n){return n.previous=n.root,n},t}()),__mxOutput.mxRootChangeCodec="undefined"!=typeof mxRootChangeCodec?mxRootChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return t.isReference=function(t,e,n,i){return!("child"!=e||i&&!t.model.contains(t.previous))||mxUtils.indexOf(this.idrefs,e)>=0},t.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&null!=n&&("previous"==e||"parent"==e)&&!t.model.contains(n)},t.afterEncode=function(t,e,n){return this.isReference(e,"child",e.child,!0)?n.setAttribute("child",t.getId(e.child)):t.encodeCell(e.child,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.child=t.decodeCell(i,!1);var s=i.nextSibling;for(i.parentNode.removeChild(i),i=s;null!=i;){if(s=i.nextSibling,i.nodeType==mxConstants.NODETYPE_ELEMENT){var r=i.getAttribute("id");null==t.lookup(r)&&t.decodeCell(i)}i.parentNode.removeChild(i),i=s}}else{var o=e.getAttribute("child");n.child=t.getObject(o)}return e},t.afterDecode=function(t,e,n){return null!=n.child&&(null!=n.child.parent&&null!=n.previous&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),__mxOutput.mxChildChangeCodec="undefined"!=typeof mxChildChangeCodec?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(t,e,n){return n.previous=n.terminal,n},t}()),__mxOutput.mxTerminalChangeCodec="undefined"!=typeof mxTerminalChangeCodec?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var n=new mxObjectCodec(t,["model","previous"],["cell"]);return n.afterDecode=function(t,n,i){return mxUtils.isNode(i.cell)&&(i.cell=t.decodeCell(i.cell,!1)),i.previous=i[e],i},n};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=void 0!==mxGenericChangeCodec?mxGenericChangeCodec:void 0,mxCodecRegistry.register(new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])),__mxOutput.mxGraphCodec="undefined"!=typeof mxGraphCodec?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())},t.encodeCell=function(t,e,n){var i=e.graph.getModel(),s=e.getState(n),r=i.getParent(n);if(null==r||null!=s){var o=i.getChildCount(n),l=e.graph.getCellGeometry(n),a=null;if(r==i.getRoot()?a="layer":null==r?a="graph":i.isEdge(n)?a="edge":o>0&&null!=l?a="group":i.isVertex(n)&&(a="vertex"),null!=a){var h=t.document.createElement(a);if(null!=e.graph.getLabel(n)&&(h.setAttribute("label",e.graph.getLabel(n)),e.graph.isHtmlLabel(n)&&h.setAttribute("html",!0)),null==r){var u=e.getGraphBounds();null!=u&&(h.setAttribute("x",Math.round(u.x)),h.setAttribute("y",Math.round(u.y)),h.setAttribute("width",Math.round(u.width)),h.setAttribute("height",Math.round(u.height))),h.setAttribute("scale",e.scale)}else if(null!=s&&null!=l){for(var d in s.style){var p=s.style[d];"function"==typeof p&&"object"==typeof p&&(p=mxStyleRegistry.getName(p)),null!=p&&"function"!=typeof p&&"object"!=typeof p&&h.setAttribute(d,p)}var m=s.absolutePoints;if(null!=m&&m.length>0){var c=Math.round(m[0].x)+","+Math.round(m[0].y);for(d=1;d<m.length;d++)c+=" "+Math.round(m[d].x)+","+Math.round(m[d].y);h.setAttribute("points",c)}else h.setAttribute("x",Math.round(s.x)),h.setAttribute("y",Math.round(s.y)),h.setAttribute("width",Math.round(s.width)),h.setAttribute("height",Math.round(s.height));var x=s.absoluteOffset;null!=x&&(0!=x.x&&h.setAttribute("dx",Math.round(x.x)),0!=x.y&&h.setAttribute("dy",Math.round(x.y)))}for(d=0;d<o;d++){var g=this.encodeCell(t,e,i.getChildAt(n,d));null!=g&&h.appendChild(g)}}}return h},t}()),__mxOutput.mxGraphViewCodec="undefined"!=typeof mxGraphViewCodec?mxGraphViewCodec:void 0;var mxStylesheetCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxStylesheet);return t.encode=function(t,e){var n=t.document.createElement(this.getName());for(var i in e.styles){var s=e.styles[i],r=t.document.createElement("add");if(null!=i){for(var o in r.setAttribute("as",i),s){var l=this.getStringValue(o,s[o]);if(null!=l){var a=t.document.createElement("add");a.setAttribute("value",l),a.setAttribute("as",o),r.appendChild(a)}}r.childNodes.length>0&&n.appendChild(r)}}return n},t.getStringValue=function(t,e){var n=typeof e;return"function"==n?e=mxStyleRegistry.getName(e):"object"==n&&(e=null),e},t.decode=function(t,e,n){var i=n||new this.template.constructor,s=e.getAttribute("id");for(null!=s&&(t.objects[s]=i),e=e.firstChild;null!=e;){if(!this.processInclude(t,e,i)&&"add"==e.nodeName){var r=e.getAttribute("as");if(null!=r){var o=e.getAttribute("extend"),l=null!=o?mxUtils.clone(i.styles[o]):null;null==l&&(null!=o&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+o+" not found to extend"),l=new Object);for(var a=e.firstChild;null!=a;){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var h=a.getAttribute("as");if("add"==a.nodeName){var u=mxUtils.getTextContent(a),d=null;null!=u&&u.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(u):(d=a.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),null!=d&&(l[h]=d)}else"remove"==a.nodeName&&delete l[h]}a=a.nextSibling}i.putCellStyle(r,l)}}e=e.nextSibling}return i},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=void 0!==mxStylesheetCodec?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n)for(n.editor,e=e.firstChild;null!=e;){if(!this.processInclude(t,e,n)&&"add"==e.nodeName){var i=e.getAttribute("as"),s=e.getAttribute("action"),r=e.getAttribute("control");n.bindAction(i,s,r)}e=e.nextSibling}return n},t}()),__mxOutput.mxDefaultKeyHandlerCodec="undefined"!=typeof mxDefaultKeyHandlerCodec?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n){var i=n.editor;for(e=e.firstChild;null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,e,n))if("separator"==e.nodeName)n.addSeparator();else if("br"==e.nodeName)n.toolbar.addBreak();else if("hr"==e.nodeName)n.toolbar.addLine();else if("add"==e.nodeName){var s=e.getAttribute("as");s=mxResources.get(s)||s;var r=e.getAttribute("icon"),o=e.getAttribute("pressedIcon"),l=e.getAttribute("action"),a=e.getAttribute("mode"),h=e.getAttribute("template"),u="0"!=e.getAttribute("toggle"),d=mxUtils.getTextContent(e),p=null;if(null!=l)p=n.addItem(s,r,l,o);else if(null!=a){var m=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;p=n.addMode(s,r,a,o,m)}else if(null!=h||null!=d&&d.length>0){var c=i.templates[h],x=e.getAttribute("style");null!=c&&null!=x&&(c=i.graph.cloneCell(c)).setStyle(x);var g=null;null!=d&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(g=mxUtils.eval(d)),p=n.addPrototype(s,r,c,o,g,u)}else{var y=mxUtils.getChildNodes(e);if(y.length>0)if(null==r)for(var f=n.addActionCombo(s),v=0;v<y.length;v++){if("separator"==(b=y[v]).nodeName)n.addOption(f,"---");else if("add"==b.nodeName){var C=b.getAttribute("as"),E=b.getAttribute("action");n.addActionOption(f,C,E)}}else{var S=null,T=n.addPrototype(s,r,(function(){var t=i.templates[S.value];if(null!=t){var e=t.clone(),n=S.options[S.selectedIndex].cellStyle;return null!=n&&e.setStyle(n),e}return mxLog.warn("Template "+t+" not found"),null}),null,null,u);S=n.addCombo(),mxEvent.addListener(S,"change",(function(){n.toolbar.selectMode(T,(function(t){var e=mxUtils.convertPoint(i.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t));return i.addVertex(null,m(),e.x,e.y)})),n.toolbar.noReset=!1}));for(v=0;v<y.length;v++){var b;if("separator"==(b=y[v]).nodeName)n.addOption(S,"---");else if("add"==b.nodeName){C=b.getAttribute("as");var w=b.getAttribute("template");n.addOption(S,C,w||h).cellStyle=b.getAttribute("style")}}}}if(null!=p){var L=e.getAttribute("id");null!=L&&L.length>0&&p.setAttribute("id",L)}}e=e.nextSibling}}return n},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=void 0!==mxDefaultToolbarCodec?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(t,e){return null},t.decode=function(t,e,n){var i=e.getElementsByTagName("include")[0];return null!=i?this.processInclude(t,i,n):null!=n&&(n.config=e),n},t}()),__mxOutput.mxDefaultPopupMenuCodec="undefined"!=typeof mxDefaultPopupMenuCodec?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(t,e,n){var i=e.getAttribute("defaultEdge");null!=i&&(e.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[i]);var s=e.getAttribute("defaultGroup");return null!=s&&(e.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(t,e,n){if("Array"==e.nodeName){var i=e.getAttribute("as");if("templates"==i)return void this.decodeTemplates(t,e,n)}else if("ui"==e.nodeName)return void this.decodeUi(t,e,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(t,e,n){for(var i=e.firstChild;null!=i;){if("add"==i.nodeName){var s=i.getAttribute("as"),r=i.getAttribute("element"),o=i.getAttribute("style"),l=null;if(null!=r)null!=(l=document.getElementById(r))&&null!=o&&(l.style.cssText+=";"+o);else{var a=parseInt(i.getAttribute("x")),h=parseInt(i.getAttribute("y")),u=i.getAttribute("width"),d=i.getAttribute("height");(l=document.createElement("div")).style.cssText=o,new mxWindow(mxResources.get(s)||s,l,a,h,u,d,!1,!0).setVisible(!0)}"graph"==s?n.setGraphContainer(l):"toolbar"==s?n.setToolbarContainer(l):"title"==s?n.setTitleContainer(l):"status"==s?n.setStatusContainer(l):"map"==s&&n.setMapContainer(l)}else"resource"==i.nodeName?mxResources.add(i.getAttribute("basename")):"stylesheet"==i.nodeName&&mxClient.link("stylesheet",i.getAttribute("name"));i=i.nextSibling}},t.decodeTemplates=function(t,e,n){null==n.templates&&(n.templates=[]);for(var i=mxUtils.getChildNodes(e),s=0;s<i.length;s++){for(var r=i[s].getAttribute("as"),o=i[s].firstChild;null!=o&&1!=o.nodeType;)o=o.nextSibling;null!=o&&(n.templates[r]=t.decodeCell(o))}},t}()),__mxOutput.mxEditorCodec="undefined"!=typeof mxEditorCodec?mxEditorCodec:void 0,__mxOutput}}))}));const mxgraph=initialize();function initialize(){return window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxForceIncludes=!1,window.mxResourceExtension=".txt",build({})}class BpmnStyleIdentifier{}BpmnStyleIdentifier.EDGE="bpmn.edge",BpmnStyleIdentifier.EDGE_START_FILL_COLOR="bpmn.edge.startFillColor",BpmnStyleIdentifier.EDGE_END_FILL_COLOR="bpmn.edge.endFillColor",BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND="bpmn.gatewayKind",BpmnStyleIdentifier.EVENT_DEFINITION_KIND="bpmn.eventDefinitionKind",BpmnStyleIdentifier.GLOBAL_TASK_KIND="bpmn.globalTaskKind",BpmnStyleIdentifier.SUB_PROCESS_KIND="bpmn.subProcessKind",BpmnStyleIdentifier.IS_INITIATING="bpmn.isInitiating",BpmnStyleIdentifier.IS_INSTANTIATING="bpmn.isInstantiating",BpmnStyleIdentifier.IS_INTERRUPTING="bpmn.isInterrupting",BpmnStyleIdentifier.EXTRA_CSS_CLASSES="bpmn.extra.css.classes",BpmnStyleIdentifier.MARKERS="bpmn.markers",BpmnStyleIdentifier.MESSAGE_FLOW_ICON="bpmn.messageFlowIcon";class MarkerIdentifier{}var StyleDefault;MarkerIdentifier.ARROW_DASH="bpmn.dash",exports.StyleDefault=void 0,StyleDefault=exports.StyleDefault||(exports.StyleDefault={}),StyleDefault[StyleDefault.STROKE_WIDTH_THIN=2]="STROKE_WIDTH_THIN",StyleDefault[StyleDefault.STROKE_WIDTH_THICK=5]="STROKE_WIDTH_THICK",StyleDefault[StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN=7]="SHAPE_ACTIVITY_BOTTOM_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_TOP_MARGIN=7]="SHAPE_ACTIVITY_TOP_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_LEFT_MARGIN=7]="SHAPE_ACTIVITY_LEFT_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_FROM_CENTER_MARGIN=7]="SHAPE_ACTIVITY_FROM_CENTER_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN=5]="SHAPE_ACTIVITY_MARKER_ICON_MARGIN",StyleDefault[StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE=20]="SHAPE_ACTIVITY_MARKER_ICON_SIZE",StyleDefault[StyleDefault.POOL_LABEL_SIZE=30]="POOL_LABEL_SIZE",StyleDefault.POOL_LABEL_FILL_COLOR="none",StyleDefault[StyleDefault.LANE_LABEL_SIZE=30]="LANE_LABEL_SIZE",StyleDefault.LANE_LABEL_FILL_COLOR="none",StyleDefault[StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH=10]="TEXT_ANNOTATION_BORDER_LENGTH",StyleDefault.TEXT_ANNOTATION_FILL_COLOR="none",StyleDefault.GROUP_FILL_COLOR="none",StyleDefault.DEFAULT_FILL_COLOR="White",StyleDefault.DEFAULT_STROKE_COLOR="Black",StyleDefault.DEFAULT_FONT_FAMILY="Arial, Helvetica, sans-serif",StyleDefault[StyleDefault.DEFAULT_FONT_SIZE=11]="DEFAULT_FONT_SIZE",StyleDefault.DEFAULT_FONT_COLOR="Black",StyleDefault[StyleDefault.DEFAULT_MARGIN=0]="DEFAULT_MARGIN",StyleDefault[StyleDefault.SHAPE_ARC_SIZE=20]="SHAPE_ARC_SIZE",StyleDefault.DEFAULT_OVERLAY_FILL_COLOR="White",StyleDefault[StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY=100]="DEFAULT_OVERLAY_FILL_OPACITY",StyleDefault.DEFAULT_OVERLAY_STROKE_COLOR="Black",StyleDefault[StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH=1]="DEFAULT_OVERLAY_STROKE_WIDTH",StyleDefault[StyleDefault.DEFAULT_OVERLAY_FONT_SIZE=11]="DEFAULT_OVERLAY_FONT_SIZE",StyleDefault.DEFAULT_OVERLAY_FONT_COLOR="Black",StyleDefault.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR="White",StyleDefault.MESSAGE_FLOW_MARKER_START_FILL_COLOR="White",StyleDefault.MESSAGE_FLOW_MARKER_END_FILL_COLOR="White";class StyleUtils{static getFillColor(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_FILLCOLOR,exports.StyleDefault.DEFAULT_FILL_COLOR)}static getStrokeColor(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_STROKECOLOR,exports.StyleDefault.DEFAULT_STROKE_COLOR)}static getStrokeWidth(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_STROKEWIDTH,exports.StyleDefault.STROKE_WIDTH_THIN)}static getMargin(t){return mxgraph.mxUtils.getValue(t,mxgraph.mxConstants.STYLE_MARGIN,exports.StyleDefault.DEFAULT_MARGIN)}static getBpmnEventDefinitionKind(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.EVENT_DEFINITION_KIND,exports.ShapeBpmnEventDefinitionKind.NONE)}static getBpmnSubProcessKind(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.SUB_PROCESS_KIND,void 0)}static getBpmnIsInterrupting(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.IS_INTERRUPTING,void 0)}static getBpmnMarkers(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.MARKERS,void 0)}static getBpmnIsInstantiating(t){return JSON.parse(mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.IS_INSTANTIATING,!1))}static getBpmnIsInitiating(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.IS_INITIATING,void 0)}static getBpmnIsParallelEventBasedGateway(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND,exports.ShapeBpmnEventBasedGatewayKind.Exclusive)==exports.ShapeBpmnEventBasedGatewayKind.Parallel}static getBpmnGlobalTaskKind(t){return mxgraph.mxUtils.getValue(t,BpmnStyleIdentifier.GLOBAL_TASK_KIND,void 0)}}class StyleConfigurator{constructor(t){this.graph=t,this.specificFlowStyles=new MapWithDefault([[exports.FlowKind.SEQUENCE_FLOW,t=>{t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN}],[exports.FlowKind.MESSAGE_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="8 5",t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OVAL,t[mxgraph.mxConstants.STYLE_STARTSIZE]=8,t[mxgraph.mxConstants.STYLE_STARTFILL]=!0,t[BpmnStyleIdentifier.EDGE_START_FILL_COLOR]=exports.StyleDefault.MESSAGE_FLOW_MARKER_START_FILL_COLOR,t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_BLOCK_THIN,t[mxgraph.mxConstants.STYLE_ENDFILL]=!0,t[BpmnStyleIdentifier.EDGE_END_FILL_COLOR]=exports.StyleDefault.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[exports.FlowKind.ASSOCIATION_FLOW,t=>{t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="1 2",t[mxgraph.mxConstants.STYLE_ENDARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_OPEN_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=12}]]),this.specificSequenceFlowStyles=new MapWithDefault([[exports.SequenceFlowKind.DEFAULT,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=MarkerIdentifier.ARROW_DASH}],[exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=mxgraph.mxConstants.ARROW_DIAMOND_THIN,t[mxgraph.mxConstants.STYLE_STARTSIZE]=18,t[mxgraph.mxConstants.STYLE_STARTFILL]=!0,t[BpmnStyleIdentifier.EDGE_START_FILL_COLOR]=exports.StyleDefault.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]),this.specificAssociationFlowStyles=new MapWithDefault([[exports.AssociationDirectionKind.NONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0,t[mxgraph.mxConstants.STYLE_ENDARROW]=void 0}],[exports.AssociationDirectionKind.ONE,t=>{t[mxgraph.mxConstants.STYLE_STARTARROW]=void 0}],[exports.AssociationDirectionKind.BOTH,t=>{}]])}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){StyleConfigurator.configureCommonDefaultStyle(this.getStylesheet().getDefaultVertexStyle())}configurePoolStyle(){const t={};t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_STARTSIZE]=exports.StyleDefault.POOL_LABEL_SIZE,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.POOL,t)}configureLaneStyle(){const t={};t[mxgraph.mxConstants.STYLE_SHAPE]=mxgraph.mxConstants.SHAPE_SWIMLANE,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_SWIMLANE_LINE]=0,t[mxgraph.mxConstants.STYLE_STARTSIZE]=exports.StyleDefault.LANE_LABEL_SIZE,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.LANE,t)}configureEventStyles(){ShapeUtil.eventKinds().forEach((t=>{const e={};e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.EllipsePerimeter,e[mxgraph.mxConstants.STYLE_STROKEWIDTH]=t==exports.ShapeBpmnElementKind.EVENT_END?exports.StyleDefault.STROKE_WIDTH_THICK:exports.StyleDefault.STROKE_WIDTH_THIN,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_BOTTOM,this.putCellStyle(t,e)}))}configureTextAnnotationStyle(){const t={};t[mxgraph.mxConstants.STYLE_SHAPE]=exports.ShapeBpmnElementKind.TEXT_ANNOTATION,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_LEFT,t[mxgraph.mxConstants.STYLE_SPACING_LEFT]=5,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.TEXT_ANNOTATION_FILL_COLOR,t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(exports.ShapeBpmnElementKind.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[mxgraph.mxConstants.STYLE_ROUNDED]=!0,t[mxgraph.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,t[mxgraph.mxConstants.STYLE_ARCSIZE]=exports.StyleDefault.SHAPE_ARC_SIZE,t[mxgraph.mxConstants.STYLE_DASHED]=!0,t[mxgraph.mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.GROUP_FILL_COLOR,t[mxgraph.mxConstants.STYLE_ALIGN]=mxgraph.mxConstants.ALIGN_CENTER,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_TOP,this.putCellStyle(exports.ShapeBpmnElementKind.GROUP,t)}configureActivityStyles(){ShapeUtil.activityKinds().forEach((t=>{const e={};e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_MIDDLE,e[mxgraph.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,e[mxgraph.mxConstants.STYLE_ARCSIZE]=exports.StyleDefault.SHAPE_ARC_SIZE,e[mxgraph.mxConstants.STYLE_STROKEWIDTH]=t==exports.ShapeBpmnElementKind.CALL_ACTIVITY?exports.StyleDefault.STROKE_WIDTH_THICK:exports.StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(t,e)}))}configureGatewayStyles(){ShapeUtil.gatewayKinds().forEach((t=>{const e={};e[mxgraph.mxConstants.STYLE_SHAPE]=t,e[mxgraph.mxConstants.STYLE_PERIMETER]=mxgraph.mxPerimeter.RhombusPerimeter,e[mxgraph.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,e[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_TOP,e[mxgraph.mxConstants.STYLE_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_LEFT,e[mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxgraph.mxConstants.ALIGN_TOP,this.putCellStyle(t,e)}))}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();t[mxgraph.mxConstants.STYLE_SHAPE]=BpmnStyleIdentifier.EDGE,t[mxgraph.mxConstants.STYLE_ENDSIZE]=12,t[mxgraph.mxConstants.STYLE_STROKEWIDTH]=1.5,t[mxgraph.mxConstants.STYLE_ROUNDED]=1,t[mxgraph.mxConstants.STYLE_ARCSIZE]=5,t[mxgraph.mxConstants.STYLE_VERTICAL_ALIGN]=mxgraph.mxConstants.ALIGN_BOTTOM,delete t[mxgraph.mxConstants.STYLE_ENDARROW],StyleConfigurator.configureCommonDefaultStyle(t)}static configureCommonDefaultStyle(t){t[mxgraph.mxConstants.STYLE_FONTFAMILY]=exports.StyleDefault.DEFAULT_FONT_FAMILY,t[mxgraph.mxConstants.STYLE_FONTSIZE]=exports.StyleDefault.DEFAULT_FONT_SIZE,t[mxgraph.mxConstants.STYLE_FONTCOLOR]=exports.StyleDefault.DEFAULT_FONT_COLOR,t[mxgraph.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.DEFAULT_FILL_COLOR,t[mxgraph.mxConstants.STYLE_STROKECOLOR]=exports.StyleDefault.DEFAULT_STROKE_COLOR,t[mxgraph.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=mxgraph.mxConstants.NONE,t[mxgraph.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(t,e){t.forEach((t=>{const n={};e.get(t)(n),this.graph.getStylesheet().putCellStyle(t.toString(),n)}))}configureFlowStyles(){this.configureEdgeStyles(Object.values(exports.FlowKind),this.specificFlowStyles),this.configureEdgeStyles(Object.values(exports.SequenceFlowKind),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(exports.AssociationDirectionKind),this.specificAssociationFlowStyles)}}class MapWithDefault extends Map{get(t){var e;return null!==(e=super.get(t))&&void 0!==e?e:()=>{}}}function computeScaledIconSize(t,e,n,i){let s,r;t.height<t.width||t.height==t.width&&n.width<=n.height?(s=n.width,r=n.width*t.height/t.width):(s=n.height*t.width/t.height,r=n.height);const o=e.strokeWidth?2*(e.strokeWidth-1):0;return{width:s*i-o,height:r*i-o}}class BpmnCanvas{constructor({canvas:t,shapeConfig:e,iconConfig:n}){this.iconPaintingOriginX=0,this.iconPaintingOriginY=0,this.canvas=t,this.shapeConfiguration=e,this.iconOriginalSize=n.originalSize;const i=n.ratioFromParent;if(i){const t=computeScaledIconSize(this.iconOriginalSize,n.styleConfig,this.shapeConfiguration,i);this.scaleX=t.width/this.iconOriginalSize.width,this.scaleY=t.height/this.iconOriginalSize.height}else this.scaleX=1,this.scaleY=1;this.updateCanvasStyle(n.styleConfig),n.setIconOriginFunct(this)}setIconOriginToShapeTopLeftProportionally(t){const e=this.shapeConfiguration;this.iconPaintingOriginX=e.x+e.width/t,this.iconPaintingOriginY=e.y+e.height/t}setIconOriginToShapeTopLeft(t=exports.StyleDefault.SHAPE_ACTIVITY_TOP_MARGIN,e=exports.StyleDefault.SHAPE_ACTIVITY_LEFT_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+e,this.iconPaintingOriginY=n.y+t}setIconOriginForIconCentered(){const t=this.shapeConfiguration;this.iconPaintingOriginX=t.x+(t.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=t.y+(t.height-this.iconOriginalSize.height*this.scaleY)/2}setIconOriginForIconBottomCentered(t=exports.StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN){const e=this.shapeConfiguration;this.iconPaintingOriginX=e.x+(e.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=e.y+(e.height-this.iconOriginalSize.height*this.scaleY-t)}setIconOriginForIconOnBottomLeft(t=exports.StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN,e=exports.StyleDefault.SHAPE_ACTIVITY_FROM_CENTER_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+(n.width-this.iconOriginalSize.width*this.scaleX)/3-e,this.iconPaintingOriginY=n.y+(n.height-this.iconOriginalSize.height*this.scaleY-t)}translateIconOrigin(t,e){this.iconPaintingOriginX+=this.scaleX*t,this.iconPaintingOriginY+=this.scaleY*e}computeScaleFromOriginX(t){return this.iconPaintingOriginX+t*this.scaleX}computeScaleFromOriginY(t){return this.iconPaintingOriginY+t*this.scaleY}updateCanvasStyle({isFilled:t,strokeColor:e,fillColor:n,strokeWidth:i}){t?this.canvas.setFillColor(e):this.canvas.setFillColor(n),this.canvas.setStrokeWidth(i)}arcTo(t,e,n,i,s,r,o){this.canvas.arcTo(t*this.scaleX,e*this.scaleY,n,i,s,this.computeScaleFromOriginX(r),this.computeScaleFromOriginY(o))}begin(){this.canvas.begin()}close(){this.canvas.close()}curveTo(t,e,n,i,s,r){this.canvas.curveTo(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),this.computeScaleFromOriginX(n),this.computeScaleFromOriginY(i),this.computeScaleFromOriginX(s),this.computeScaleFromOriginY(r))}fill(){this.canvas.fill()}fillAndStroke(){this.canvas.fillAndStroke()}setFillColor(t){this.canvas.setFillColor(t)}stroke(){this.canvas.stroke()}setStrokeColor(t){this.canvas.setStrokeColor(t)}setRoundLineJoin(){this.canvas.setLineJoin("round")}lineTo(t,e){this.canvas.lineTo(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e))}moveTo(t,e){this.canvas.moveTo(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e))}rect(t,e,n,i){this.canvas.rect(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),n*this.scaleX,i*this.scaleY)}roundrect(t,e,n,i,s,r){this.canvas.roundrect(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),n*this.scaleX,i*this.scaleY,s,r)}ellipse(t,e,n,i){this.canvas.ellipse(this.computeScaleFromOriginX(t),this.computeScaleFromOriginY(e),n*this.scaleX,i*this.scaleY)}rotateOnIconCenter(t){const e=this.iconPaintingOriginX+this.iconOriginalSize.width/2*this.scaleX,n=this.iconPaintingOriginY+this.iconOriginalSize.height/2*this.scaleY;this.canvas.rotate(t,!1,!1,e,n)}}function buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:r,ratioFromParent:o,isFilled:l,iconStrokeWidth:a}){return null!=o||(o=.25),null!=l||(l=!1),null!=a||(a=0),{canvas:t,ratioFromParent:o,setIconOriginFunct:t=>t.setIconOriginForIconCentered(),shapeConfig:{x:e,y:n,width:i,height:s,strokeWidth:r.strokewidth||StyleUtils.getStrokeWidth(r.style)},iconStyleConfig:{isFilled:l,fillColor:r.fill||StyleUtils.getFillColor(r.style),strokeColor:r.stroke||StyleUtils.getStrokeColor(r.style),strokeWidth:a,margin:StyleUtils.getMargin(r.style)}}}class IconPainter{paintEmptyIcon(){}newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:n,shapeConfig:i,iconStyleConfig:s},r){return new BpmnCanvas({canvas:t,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:s,ratioFromParent:e,setIconOriginFunct:n}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;n.rect(0,0,i,s),n.fillAndStroke();const{iconStyleConfig:r}=t;r.isFilled&&n.setStrokeColor(r.fillColor),n.begin(),n.moveTo(0,0),n.lineTo(.5*i,.6*s),n.lineTo(i,0),n.moveTo(0,s),n.lineTo(i/3,.45*s),n.moveTo(i,s),n.lineTo(2*i/3,.45*s),n.stroke()}paintCircleIcon(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;i>0&&s>0&&n.ellipse(0,0,i,s),t.iconStyleConfig.isFilled?n.fillAndStroke():n.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0})}),{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});IconPainter.paintGearIconBackground(e),e.translateIconOrigin(14,14),IconPainter.paintGearIconForeground(e)}static paintGearIconBackground(t){t.begin(),t.moveTo(2.06,24.62),t.lineTo(10.17,30.95),t.lineTo(9.29,37.73),t.lineTo(0,41.42),t.lineTo(2.95,54.24),t.lineTo(13.41,52.92),t.lineTo(17.39,58.52),t.lineTo(13.56,67.66),t.lineTo(24.47,74.44),t.lineTo(30.81,66.33),t.lineTo(37.88,67.21),t.lineTo(41.57,76.5),t.lineTo(54.24,73.55),t.lineTo(53.06,62.94),t.lineTo(58.52,58.52),t.lineTo(67.21,63.09),t.lineTo(74.58,51.88),t.lineTo(66.03,45.25),t.lineTo(66.92,38.62),t.lineTo(76.5,34.93),t.lineTo(73.7,22.26),t.lineTo(62.64,23.44),t.lineTo(58.81,18.42),t.lineTo(62.79,8.7),t.lineTo(51.74,2.21),t.lineTo(44.81,10.47),t.lineTo(38.03,9.43),t.lineTo(33.75,0),t.lineTo(21.52,3.24),t.lineTo(22.7,13.56),t.lineTo(18.13,17.54),t.lineTo(8.7,13.56),t.close();IconPainter.paintGearInnerCircle(t,24.8,39)}static paintGearIconForeground(t){t.begin(),t.moveTo(16.46,41.42),t.lineTo(24.57,47.75),t.lineTo(23.69,54.53),t.lineTo(14.4,58.22),t.lineTo(17.35,71.04),t.lineTo(27.81,69.72),t.lineTo(31.79,75.32),t.lineTo(27.96,84.46),t.lineTo(38.87,91.24),t.lineTo(45.21,83.13),t.lineTo(52.28,84.01),t.lineTo(55.97,93.3),t.lineTo(68.64,90.35),t.lineTo(67.46,79.74),t.lineTo(72.92,75.32),t.lineTo(81.61,79.89),t.lineTo(88.98,68.68),t.lineTo(80.43,62.05),t.lineTo(81.32,55.42),t.lineTo(90.9,51.73),t.lineTo(88.1,39.06),t.lineTo(77.04,40.24),t.lineTo(73.21,35.22),t.lineTo(77.19,25.5),t.lineTo(66.14,19.01),t.lineTo(59.21,27.27),t.lineTo(52.43,26.23),t.lineTo(48.15,16.8),t.lineTo(35.92,20.04),t.lineTo(37.1,30.36),t.lineTo(32.53,34.34),t.lineTo(23.1,30.36),t.close();IconPainter.paintGearInnerCircle(t,39.2,55.8),t.begin(),IconPainter.paintGearInnerCircle(t,39.2,55.8)}static paintGearInnerCircle(t,e,n){const i=13.5;t.moveTo(e,n),t.arcTo(i,i,0,1,1,e+27,n),t.arcTo(i,i,0,0,1,e,n),t.close(),t.fillAndStroke()}paintExpandIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;n.roundrect(0,0,i,s,2,2),n.stroke(),n.begin(),n.moveTo(i/2,s/4),n.lineTo(i/2,3*s/4),n.close(),n.moveTo(i/4,s/2),n.lineTo(3*i/4,s/2),n.close(),n.fillAndStroke()}paintLoopIcon(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const n=this.newBpmnCanvas(t,{width:22.49,height:21.62});n.begin(),n.moveTo(5.5,19.08),n.arcTo(8,8,0,1,1,10.5,21.08),n.stroke(),n.begin(),n.moveTo(7.5,14.08),n.lineTo(5.75,19.08),n.lineTo(0,17.08),n.close(),n.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:s}=t;i.setFillColor(s.strokeColor);const r=e.width,o=e.height/5;n.rect(0,0,r,o),n.fill(),n.rect(0,2*o,r,o),n.fill(),n.rect(0,4*o,r,o),n.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:s}=t;i.setFillColor(s.strokeColor);const r=e.width/5,o=e.height;n.begin(),n.rect(0,0,r,o),n.fill(),n.rect(2*r,0,r,o),n.fill(),n.rect(4*r,0,r,o),n.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}class IconPainterProvider{static get(){return this.instance}static set(t){this.instance=t}}IconPainterProvider.instance=new IconPainter;class EventShape extends mxgraph.mxEllipse{constructor(){super(void 0,void 0,void 0),this.iconPainter=IconPainterProvider.get(),this.iconPainters=new Map([[exports.ShapeBpmnEventDefinitionKind.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{ratioFromParent:.5}))],[exports.ShapeBpmnEventDefinitionKind.TERMINATE,t=>this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6}))],[exports.ShapeBpmnEventDefinitionKind.TIMER,t=>this.iconPainter.paintClockIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(5)}))],[exports.ShapeBpmnEventDefinitionKind.SIGNAL,t=>this.iconPainter.paintTriangleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:exports.StyleDefault.STROKE_WIDTH_THIN.valueOf()}),setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(4)}))],[exports.ShapeBpmnEventDefinitionKind.LINK,t=>this.iconPainter.paintRightArrowIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.ERROR,t=>this.iconPainter.paintErrorIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon(Object.assign(Object.assign({},t),{ratioFromParent:.7,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.CANCEL,t=>this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{ratioFromParent:.78}))],[exports.ShapeBpmnEventDefinitionKind.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:exports.StyleDefault.STROKE_WIDTH_THIN.valueOf()})}))],[exports.ShapeBpmnEventDefinitionKind.CONDITIONAL,t=>this.iconPainter.paintListIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))]]),this.withFilledIcon=!1}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,isFilled:this.withFilledIcon});EventShape.setDashedOuterShapePattern(r,StyleUtils.getBpmnIsInterrupting(this.style)),this.paintOuterShape(r),EventShape.restoreOriginalOuterShapePattern(r),this.paintInnerShape(r)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s}}){super.paintVertexShape(t,e,n,i,s)}paintInnerShape(t){(this.iconPainters.get(StyleUtils.getBpmnEventDefinitionKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,e){t.canvas.save(),"false"===e&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class EndEventShape extends EventShape{constructor(){super(),this.withFilledIcon=!0}}class IntermediateEventShape extends EventShape{paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s,strokeWidth:r}}){t.ellipse(e,n,i,s),t.fillAndStroke();const o=1.5*r;t.ellipse(.02*i+o+e,.02*s+o+n,.96*i-2*o,.96*s-2*o),t.stroke()}}class ThrowIntermediateEventShape extends IntermediateEventShape{constructor(){super(),this.withFilledIcon=!0}}class GatewayShape extends mxgraph.mxRhombus{constructor(){super(...arguments),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this});this.paintOuterShape(r),this.paintInnerShape(r)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s}}){super.paintVertexShape(t,e,n,i,s)}}class ExclusiveGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class ParallelGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class InclusiveGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.62,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!1,strokeWidth:exports.StyleDefault.STROKE_WIDTH_THICK.valueOf()})}))}}class EventBasedGatewayShape extends GatewayShape{paintInnerShape(t){t=Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1})}),this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55})),StyleUtils.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.45}));const e=Object.assign(Object.assign({},t),{ratioFromParent:.3});StyleUtils.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}const referenceOrderedMarkers=[exports.ShapeBpmnMarkerKind.LOOP,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL,exports.ShapeBpmnMarkerKind.COMPENSATION,exports.ShapeBpmnMarkerKind.EXPAND,exports.ShapeBpmnMarkerKind.ADHOC];function orderActivityMarkers(t){const e=referenceOrderedMarkers.filter((e=>t.includes(e)));return t.filter((t=>!e.includes(t))).forEach((t=>e.push(t))),e}function paintEnvelopeIcon(t,e){IconPainterProvider.get().paintEnvelopeIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:e})}))}class BaseActivityShape extends mxgraph.mxRectangleShape{constructor(){super(void 0,void 0,void 0),this.iconPainter=IconPainterProvider.get(),this.isRounded=!0}paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s),this.paintMarkerIcons(buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const e=StyleUtils.getBpmnMarkers(this.style);e&&orderActivityMarkers(e.split(",")).forEach(((e,n,i)=>{switch((t=Object.assign(Object.assign({},t),{setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,n+1)})).canvas.save(),e){case exports.ShapeBpmnMarkerKind.LOOP:this.iconPainter.paintLoopIcon(t);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case exports.ShapeBpmnMarkerKind.EXPAND:this.iconPainter.paintExpandIcon(t)}t.canvas.restore()}))}getMarkerIconOriginFunction(t,e){let n;return n=1===t?t=>t.setIconOriginForIconBottomCentered():t=>{t.setIconOriginForIconBottomCentered();const n=Math.pow(-1,e)*(exports.StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+exports.StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);t.translateIconOrigin(n,0)},n}}class BaseTaskShape extends BaseActivityShape{paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s),this.paintTaskIcon(buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this}))}}class TaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintEmptyIcon()}}class ServiceTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintGearIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class UserTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ReceiveTaskShape extends BaseTaskShape{paintTaskIcon(t){if(!StyleUtils.getBpmnIsInstantiating(this.style))return void paintEnvelopeIcon(t,!1);const e=Object.assign(Object.assign({},t.shapeConfig),{width:20,height:20});this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:e,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!1}),ratioFromParent:void 0,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(4,4)}),e.x+=4,e.y+=4,this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{shapeConfig:e,ratioFromParent:.65,setIconOriginFunct:t=>t.setIconOriginForIconCentered()}))}}class SendTaskShape extends BaseTaskShape{paintTaskIcon(t){paintEnvelopeIcon(t,!0)}}class ManualTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintHandIcon(Object.assign(Object.assign({},t),{ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ScriptTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},t),{ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class CallActivityShape extends BaseActivityShape{paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s);const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this});switch(StyleUtils.getBpmnGlobalTaskKind(this.style)){case exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon(Object.assign(Object.assign({},r),{ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},r),{ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},r),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon(Object.assign(Object.assign({},r),{ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class SubProcessShape extends BaseActivityShape{paintBackground(t,e,n,i,s){const r=StyleUtils.getBpmnSubProcessKind(this.style);t.save(),r===exports.ShapeBpmnSubProcessKind.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,n,i,s),t.restore()}}class BusinessRuleTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintTableIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)}))}}class TextAnnotationShape extends mxgraph.mxRectangleShape{paintBackground(t,e,n,i,s){t.begin(),t.moveTo(e+exports.StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n),t.lineTo(e,n),t.lineTo(e,n+s),t.lineTo(e+exports.StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n+s),t.fillAndStroke()}}class MessageFlowIconShape extends mxgraph.mxRectangleShape{constructor(t,e,n,i){super(t,e,n,i),this.iconPainter=IconPainterProvider.get()}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,ratioFromParent:1,isFilled:StyleUtils.getBpmnIsInitiating(this.style)===exports.MessageVisibleKind.NON_INITIATING});this.iconPainter.paintEnvelopeIcon(r)}}function computeAllBpmnClassNamesOfCell(t,e){return computeAllBpmnClassNames(t.style,e)}function computeAllBpmnClassNames(t,e){const n=[],i=t.split(";"),s=i[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",ShapeUtil.isActivity(s)),r.set("bpmn-type-container",ShapeUtil.isPoolOrLane(s)),r.set("bpmn-type-event",ShapeUtil.isEvent(s)),r.set("bpmn-type-flow",isFlowKind(s)),r.set("bpmn-type-gateway",ShapeUtil.isGateway(s)),r.set("bpmn-type-task",ShapeUtil.isTask(s)),[...r].filter((([,t])=>t)).forEach((([t])=>n.push(t))),n.push(computeBpmnBaseClassName(s)),i.map((t=>{const e=t.split("=");return[e[0],e[1]]})).forEach((([t,e])=>{switch(t){case BpmnStyleIdentifier.EVENT_DEFINITION_KIND:n.push(`bpmn-event-def-${e}`);break;case BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND:n.push(`bpmn-gateway-kind-${e.toLowerCase()}`);break;case BpmnStyleIdentifier.IS_INITIATING:n.push(e==exports.MessageVisibleKind.NON_INITIATING?"bpmn-icon-non-initiating":"bpmn-icon-initiating");break;case BpmnStyleIdentifier.SUB_PROCESS_KIND:n.push(`bpmn-sub-process-${e.toLowerCase()}`);break;case BpmnStyleIdentifier.GLOBAL_TASK_KIND:n.push(computeBpmnBaseClassName(e))}})),e&&n.push("bpmn-label"),n}function isFlowKind(t){return Object.values(exports.FlowKind).map((t=>t)).includes(t)}function computeBpmnBaseClassName(t){return t?"bpmn-"+t.replace(/([A-Z])/g,(t=>"-"+t[0].toLowerCase())):""}class MxGraphCustomOverlay extends mxgraph.mxCellOverlay{constructor(t,e){super(null,"",e.position.horizontalAlign,e.position.verticalAlign,null,"default"),this.label=t,this.style=e.style}getBounds(t){const e=t.view.graph.getModel().isEdge(t.cell),n=t.view.scale;let i;return e?i=this.computeEdgeBounds(t):(i=new mxgraph.mxPoint,this.align==mxgraph.mxConstants.ALIGN_LEFT?i.x=t.x:this.align==mxgraph.mxConstants.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==mxgraph.mxConstants.ALIGN_TOP?i.y=t.y:this.verticalAlign==mxgraph.mxConstants.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height),new mxgraph.mxRectangle(Math.round(i.x-(0*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(0*this.defaultOverlap-this.offset.y)*n),0*n,0*n)}computeEdgeBounds(t){const e=t.absolutePoints;if(this.align==mxgraph.mxConstants.ALIGN_LEFT)return e[0];if(this.align==mxgraph.mxConstants.ALIGN_CENTER){if(e.length%2==1)return e[Math.floor(e.length/2)];{const t=e.length/2,n=e[t-1],i=e[t];return new mxgraph.mxPoint(n.x+(i.x-n.x)/2,n.y+(i.y-n.y)/2)}}return e[e.length-1]}}class OverlayBadgeShape extends mxgraph.mxText{constructor(t,e,n){super(t,e,void 0,void 0,n.font.color,void 0,n.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,n.fill.color,n.stroke.color),this.fillOpacity=n.fill.opacity,this.strokewidth=n.stroke.width}}class BpmnConnector extends mxgraph.mxConnector{constructor(t,e,n){super(t,e,n)}paintEdgeShape(t,e){const n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),null!=n&&(t.setFillColor(mxgraph.mxUtils.getValue(this.style,BpmnStyleIdentifier.EDGE_START_FILL_COLOR,this.stroke)),n()),null!=i&&(t.setFillColor(mxgraph.mxUtils.getValue(this.style,BpmnStyleIdentifier.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(t,e){const n=getPointerEventsValue(t);setPointerEventsValue(t,"stroke"),this.paintLine(t,e,this.isRounded),setPointerEventsValue(t,n)}}function getPointerEventsValue(t){return t instanceof mxgraph.mxSvgCanvas2D?t.pointerEventsValue:null}function setPointerEventsValue(t,e){t instanceof mxgraph.mxSvgCanvas2D&&(t.pointerEventsValue=e)}class ShapeConfigurator{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_END,EndEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_START,EventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW,ThrowIntermediateEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH,IntermediateEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_BOUNDARY,IntermediateEventShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED,EventBasedGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,ExclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE,InclusiveGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_PARALLEL,ParallelGatewayShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.SUB_PROCESS,SubProcessShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.CALL_ACTIVITY,CallActivityShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK,TaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SERVICE,ServiceTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_USER,UserTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_RECEIVE,ReceiveTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SEND,SendTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_MANUAL,ManualTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SCRIPT,ScriptTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_BUSINESS_RULE,BusinessRuleTaskShape),mxgraph.mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TEXT_ANNOTATION,TextAnnotationShape),mxgraph.mxCellRenderer.registerShape(BpmnStyleIdentifier.EDGE,BpmnConnector),mxgraph.mxCellRenderer.registerShape(BpmnStyleIdentifier.MESSAGE_FLOW_ICON,MessageFlowIconShape)}initMxSvgCanvasPrototype(){mxgraph.mxSvgCanvas2D.prototype.getTextCss=function(){const t=this.state,e=mxgraph.mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxgraph.mxConstants.LINE_HEIGHT+"px":mxgraph.mxConstants.LINE_HEIGHT*this.lineHeightCorrection;let n="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: none; ";(t.fontStyle&mxgraph.mxConstants.FONT_BOLD)==mxgraph.mxConstants.FONT_BOLD&&(n+="font-weight: bold; "),(t.fontStyle&mxgraph.mxConstants.FONT_ITALIC)==mxgraph.mxConstants.FONT_ITALIC&&(n+="font-style: italic; ");const i=[];return(t.fontStyle&mxgraph.mxConstants.FONT_UNDERLINE)==mxgraph.mxConstants.FONT_UNDERLINE&&i.push("underline"),(t.fontStyle&mxgraph.mxConstants.FONT_STRIKETHROUGH)==mxgraph.mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(n+="text-decoration: "+i.join(" ")+"; "),n}}initMxShapePrototype(){mxgraph.mxShape.prototype.createSvgCanvas=function(){const t=new mxgraph.mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;const e=this.getSvgScreenOffset();if(0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),this.state&&this.state.cell){let t=computeAllBpmnClassNamesOfCell(this.state.cell,this.dialect===mxgraph.mxConstants.DIALECT_STRICTHTML);const e=this.state.style[BpmnStyleIdentifier.EXTRA_CSS_CLASSES];e&&(t=t.concat(e)),this.node.setAttribute("class",t.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t}}initMxCellRendererCreateCellOverlays(){mxgraph.mxCellRenderer.prototype.createCellOverlays=function(t){const e=t.view.graph.getCellOverlays(t.cell);let n=null;if(null!=e){n=new mxgraph.mxDictionary;for(const i of e){const e=null!=t.overlays?t.overlays.remove(i):null;if(null!=e){n.put(i,e);continue}let s;i instanceof MxGraphCustomOverlay?s=new OverlayBadgeShape(i.label,new mxgraph.mxRectangle(0,0,0,0),i.style):(s=new mxgraph.mxImageShape(new mxgraph.mxRectangle(0,0,0,0),i.image.src),s.preserveImageAspect=!1),s.dialect=t.view.graph.dialect,s.overlay=i,this.initializeOverlay(t,s),this.installCellOverlayListeners(t,i,s),null!=i.cursor&&(s.node.style.cursor=i.cursor),s instanceof OverlayBadgeShape&&(s.node.classList.add("overlay-badge"),s.node.setAttribute("data-bpmn-id",t.cell.id)),n.put(i,s)}}null!=t.overlays&&t.overlays.visit((function(t,e){e.destroy()})),t.overlays=n}}}class MarkerConfigurator{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){mxgraph.mxMarker.addMarker(MarkerIdentifier.ARROW_DASH,((t,e,n,i,s,r,o,l,a)=>{const h=s*(o+a+4),u=r*(o+a+4);return function(){t.begin(),t.moveTo(i.x-h/2-u/2,i.y-u/2+h/2),t.lineTo(i.x+u/2-3*h/2,i.y-3*u/2-h/2),t.stroke()}}))}}function ensureInRange(t,e,n,i){let s=null==t?i:t;return s=Math.min(Math.max(s,e),n),s}function ensurePositiveValue(t){return Math.max(t||0,0)}function ensureValidZoomConfiguration(t){const e=null!=t?t:{};return e.debounceDelay=ensureInRange(e.debounceDelay,0,100,50),e.throttleDelay=ensureInRange(e.throttleDelay,0,100,50),e}var FUNC_ERROR_TEXT$1="Expected a function",NAN$1=NaN,symbolTag$1="[object Symbol]",reTrim$1=/^\s+|\s+$/g,reIsBadHex$1=/^[-+]0x[0-9a-f]+$/i,reIsBinary$1=/^0b[01]+$/i,reIsOctal$1=/^0o[0-7]+$/i,freeParseInt$1=parseInt,freeGlobal$1="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf$1="object"==typeof self&&self&&self.Object===Object&&self,root$1=freeGlobal$1||freeSelf$1||Function("return this")(),objectProto$1=Object.prototype,objectToString$1=objectProto$1.toString,nativeMax$1=Math.max,nativeMin$1=Math.min,now$1=function(){return root$1.Date.now()};function debounce$1(t,e,n){var i,s,r,o,l,a,h=0,u=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT$1);function m(e){var n=i,r=s;return i=s=void 0,h=e,o=t.apply(r,n)}function c(t){return h=t,l=setTimeout(g,e),u?m(t):o}function x(t){var n=t-a;return void 0===a||n>=e||n<0||d&&t-h>=r}function g(){var t=now$1();if(x(t))return y(t);l=setTimeout(g,function(t){var n=e-(t-a);return d?nativeMin$1(n,r-(t-h)):n}(t))}function y(t){return l=void 0,p&&i?m(t):(i=s=void 0,o)}function f(){var t=now$1(),n=x(t);if(i=arguments,s=this,a=t,n){if(void 0===l)return c(a);if(d)return l=setTimeout(g,e),m(a)}return void 0===l&&(l=setTimeout(g,e)),o}return e=toNumber$2(e)||0,isObject$1(n)&&(u=!!n.leading,r=(d="maxWait"in n)?nativeMax$1(toNumber$2(n.maxWait)||0,e):r,p="trailing"in n?!!n.trailing:p),f.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=a=s=l=void 0},f.flush=function(){return void 0===l?o:y(now$1())},f}function isObject$1(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike$1(t){return!!t&&"object"==typeof t}function isSymbol$1(t){return"symbol"==typeof t||isObjectLike$1(t)&&objectToString$1.call(t)==symbolTag$1}function toNumber$2(t){if("number"==typeof t)return t;if(isSymbol$1(t))return NAN$1;if(isObject$1(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject$1(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim$1,"");var n=reIsBinary$1.test(t);return n||reIsOctal$1.test(t)?freeParseInt$1(t.slice(2),n?2:8):reIsBadHex$1.test(t)?NAN$1:+t}var lodash_debounce=debounce$1,FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(t,e,n){var i,s,r,o,l,a,h=0,u=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);function m(e){var n=i,r=s;return i=s=void 0,h=e,o=t.apply(r,n)}function c(t){return h=t,l=setTimeout(g,e),u?m(t):o}function x(t){var n=t-a;return void 0===a||n>=e||n<0||d&&t-h>=r}function g(){var t=now();if(x(t))return y(t);l=setTimeout(g,function(t){var n=e-(t-a);return d?nativeMin(n,r-(t-h)):n}(t))}function y(t){return l=void 0,p&&i?m(t):(i=s=void 0,o)}function f(){var t=now(),n=x(t);if(i=arguments,s=this,a=t,n){if(void 0===l)return c(a);if(d)return l=setTimeout(g,e),m(a)}return void 0===l&&(l=setTimeout(g,e)),o}return e=toNumber$1(e)||0,isObject(n)&&(u=!!n.leading,r=(d="maxWait"in n)?nativeMax(toNumber$1(n.maxWait)||0,e):r,p="trailing"in n?!!n.trailing:p),f.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=a=s=l=void 0},f.flush=function(){return void 0===l?o:y(now())},f}function throttle(t,e,n){var i=!0,s=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);return isObject(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),debounce(t,e,{leading:i,maxWait:e,trailing:s})}function isObject(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike(t){return!!t&&"object"==typeof t}function isSymbol(t){return"symbol"==typeof t||isObjectLike(t)&&objectToString.call(t)==symbolTag}function toNumber$1(t){if("number"==typeof t)return t;if(isSymbol(t))return NAN;if(isObject(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(reTrim,"");var n=reIsBinary.test(t);return n||reIsOctal.test(t)?freeParseInt(t.slice(2),n?2:8):reIsBadHex.test(t)?NAN:+t}var lodash_throttle=throttle;class BpmnGraph extends mxgraph.mxGraph{constructor(t){super(t),this.cumulativeZoomFactor=1,this.container&&(this.container.style.cursor="default")}createGraphView(){return new BpmnGraphView(this)}fit(t,e,n,i,s,r,o){const l=super.fit(t,e,n,i,s,r,o);return this.cumulativeZoomFactor=l,l}zoomActual(){super.zoomActual(),this.cumulativeZoomFactor=this.view.scale}customFit(t){this.zoomActual();const e=null==t?void 0:t.type;if(null==e||e==exports.FitType.None)return;const n=ensurePositiveValue(null==t?void 0:t.margin);if(e!=exports.FitType.Center){let t=!1,i=!1;switch(e){case exports.FitType.Horizontal:i=!0;break;case exports.FitType.Vertical:t=!0}this.fit(this.border,!1,n,!0,t,i)}else{const t=3,e=this.getGraphBounds(),i=this.container.clientWidth-n,s=this.container.clientHeight-n,r=e.width/this.view.scale,o=e.height/this.view.scale,l=Math.min(t,Math.min(i/r,s/o));this.cumulativeZoomFactor=l,this.view.scaleAndTranslate(l,(n+i-r*l)/(2*l)-e.x/this.view.scale,(n+s-o*l)/(2*l)-e.y/this.view.scale)}}zoomTo(t,e,n,i,s,r){if(null===t){const[t,e,o]=this.getScaleAndTranslationDeltas(n,i,s);r&&this.view.scaleAndTranslate(t,this.view.translate.x+e,this.view.translate.y+o)}else super.zoomTo(t,e)}createMouseWheelZoomExperience(t){t=ensureValidZoomConfiguration(t),mxgraph.mxEvent.addMouseWheelListener(lodash_debounce(this.getZoomHandler(!0),t.debounceDelay),this.container),mxgraph.mxEvent.addMouseWheelListener(lodash_throttle(this.getZoomHandler(!1),t.throttleDelay),this.container)}performZoom(t,e,n){const[i,s]=this.getRelativeEventCoordinates(e);this.zoomTo(null,null,t,i,s,n),n&&mxgraph.mxEvent.consume(e)}getZoomHandler(t){return(e,n)=>{if(mxgraph.mxEvent.isConsumed(e))return;const i=e;i.ctrlKey&&!i.altKey&&!i.shiftKey&&!i.metaKey&&this.performZoom(n,i,t)}}getRelativeEventCoordinates(t){const e=this.container.getBoundingClientRect();return[t.clientX-e.left,t.clientY-e.top]}getScaleAndTranslationDeltas(t,e,n){let i=2*e,s=2*n;const[r,o]=this.calculateFactorAndScale(t);return[i,s]=this.calculateTranslationDeltas(r,o,i,s),[o,i,s]}calculateTranslationDeltas(t,e,n,i){if(t>1){const s=(t-1)/(2*e);n*=-s,i*=-s}else{const e=(1/t-1)/(2*this.view.scale);n*=e,i*=e}return[n,i]}calculateFactorAndScale(t){this.cumulativeZoomFactor*=t?Math.sqrt(1.25):Math.sqrt(.8);let e=this.cumulativeZoomFactor/this.view.scale;const n=Math.round(this.view.scale*e*100)/100;return e=n/this.view.scale,[e,n]}}class BpmnGraphView extends mxgraph.mxGraphView{getFloatingTerminalPoint(t,e,n,i){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,n,i);const s=t.absolutePoints;return i?s[1]:s[s.length-2]}}class GraphConfigurator{constructor(t){this.container=t,this.graph=new BpmnGraph(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new StyleConfigurator(this.graph).configureStyles(),(new ShapeConfigurator).configureShapes(),(new MarkerConfigurator).configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var e,n;const i=this.graph.panningHandler;(null===(e=null==t?void 0:t.navigation)||void 0===e?void 0:e.enabled)?(i.addListener(mxgraph.mxEvent.PAN_START,this.getPanningHandler("grab")),i.addListener(mxgraph.mxEvent.PAN_END,this.getPanningHandler("default")),this.graph.panningHandler.usePopupTrigger=!1,i.isForcePanningEvent=t=>mxgraph.mxEvent.isLeftMouseButton(t.getEvent())||mxgraph.mxEvent.isMultiTouchEvent(t.getEvent()),this.graph.setPanning(!0),this.graph.createMouseWheelZoomExperience(null===(n=null==t?void 0:t.navigation)||void 0===n?void 0:n.zoom)):(this.graph.setPanning(!1),i.setPinchEnabled(!1),i.isForcePanningEvent=t=>!1)}getPanningHandler(t){return this.getPanningHandlerCallback(t).bind(this.graph)}getPanningHandlerCallback(t){return function(){this.isEnabled()&&(this.container.style.cursor=t)}}}class Flow{constructor(t,e,n,i,s){this.id=t,this.name=e,this.kind=n,this.sourceRefId=i,this.targetRefId=s}}class SequenceFlow extends Flow{constructor(t,e,n,i,s=exports.SequenceFlowKind.NORMAL){super(t,e,exports.FlowKind.SEQUENCE_FLOW,n,i),this.sequenceFlowKind=s}}class MessageFlow extends Flow{constructor(t,e,n,i){super(t,e,exports.FlowKind.MESSAGE_FLOW,n,i)}}class AssociationFlow extends Flow{constructor(t,e,n,i,s=exports.AssociationDirectionKind.NONE){super(t,e,exports.FlowKind.ASSOCIATION_FLOW,n,i),this.associationDirectionKind=s}}class CoordinatesTranslator{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const n=this.getTranslateForRoot(t),i=e.x+n.x,s=e.y+n.y;return new mxgraph.mxPoint(i,s)}getTranslateForRoot(t){const e=this.graph.getModel(),n=new mxgraph.mxPoint(0,0);for(;null!=t;){const i=e.getGeometry(t);null!=i&&(n.x-=i.x,n.y-=i.y),t=e.getParent(t)}return n}computeEdgeCenter(t){const e=t.geometry.points,n=e[0],i=e[e.length-1];if(null!=n&&null!=i){const t=i.x-n.x,e=i.y-n.y;return new mxgraph.mxPoint(n.x+t/2,n.y+e/2)}}}class Shape{constructor(t,e,n,i,s){this.id=t,this.bpmnElement=e,this.bounds=n,this.label=i,this.isHorizontal=s}}class ShapeBpmnElement{constructor(t,e,n,i,s=!1){this.id=t,this.name=e,this.kind=n,this.parentId=i,this.instantiate=s}}class ShapeBpmnActivity extends ShapeBpmnElement{constructor(t,e,n,i,s,r=[]){super(t,e,n,i,s),this.markers=r}}class ShapeBpmnCallActivity extends ShapeBpmnActivity{constructor(t,e,n,i,s,r){super(t,e,exports.ShapeBpmnElementKind.CALL_ACTIVITY,i,void 0,s),this.callActivityKind=n,this.globalTaskKind=r}}class ShapeBpmnSubProcess extends ShapeBpmnActivity{constructor(t,e,n,i,s){super(t,e,exports.ShapeBpmnElementKind.SUB_PROCESS,i,void 0,s),this.subProcessKind=n}}class ShapeBpmnEvent extends ShapeBpmnElement{constructor(t,e,n,i,s){super(t,e,n,s),this.eventDefinitionKind=i}}class ShapeBpmnStartEvent extends ShapeBpmnEvent{constructor(t,e,n,i,s){super(t,e,exports.ShapeBpmnElementKind.EVENT_START,n,i),this.isInterrupting=s}}class ShapeBpmnBoundaryEvent extends ShapeBpmnEvent{constructor(t,e,n,i,s=!0){super(t,e,exports.ShapeBpmnElementKind.EVENT_BOUNDARY,n,i),this.isInterrupting=s}}class ShapeBpmnEventBasedGateway extends ShapeBpmnElement{constructor(t,e,n,i,s=exports.ShapeBpmnEventBasedGatewayKind.None){super(t,e,exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED,n,i),this.gatewayKind=s}}class Participant{constructor(t,e,n){this.id=t,this.name=e,this.processRef=n}}class StyleComputer{computeStyle(t,e){const n=[t.bpmnElement.kind];let i;t instanceof Shape?i=StyleComputer.computeShapeStyle(t):(n.push(...StyleComputer.computeEdgeStyle(t)),i=new Map);const s=StyleComputer.computeFontStyleValues(t),r=StyleComputer.computeLabelStyleValues(t,e);return[].concat([...n]).concat([...i,...s,...r].filter((([,t])=>t&&"undefined"!=t)).map((([t,e])=>t+"="+e))).join(";")}static computeShapeStyle(t){const e=new Map,n=t.bpmnElement;return n instanceof ShapeBpmnEvent?this.computeEventShapeStyle(n,e):n instanceof ShapeBpmnActivity?this.computeActivityShapeStyle(n,e):ShapeUtil.isPoolOrLane(n.kind)?e.set(mxgraph.mxConstants.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):n instanceof ShapeBpmnEventBasedGateway&&(e.set(BpmnStyleIdentifier.IS_INSTANTIATING,String(n.instantiate)),e.set(BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND,String(n.gatewayKind))),e}static computeEventShapeStyle(t,e){e.set(BpmnStyleIdentifier.EVENT_DEFINITION_KIND,t.eventDefinitionKind),(t instanceof ShapeBpmnBoundaryEvent||t instanceof ShapeBpmnStartEvent&&void 0!==t.isInterrupting)&&e.set(BpmnStyleIdentifier.IS_INTERRUPTING,String(t.isInterrupting))}static computeActivityShapeStyle(t,e){t instanceof ShapeBpmnSubProcess?e.set(BpmnStyleIdentifier.SUB_PROCESS_KIND,t.subProcessKind):t.kind===exports.ShapeBpmnElementKind.TASK_RECEIVE?e.set(BpmnStyleIdentifier.IS_INSTANTIATING,String(t.instantiate)):t instanceof ShapeBpmnCallActivity&&e.set(BpmnStyleIdentifier.GLOBAL_TASK_KIND,t.globalTaskKind);const n=t.markers;n.length>0&&e.set(BpmnStyleIdentifier.MARKERS,n.join(","))}static computeEdgeStyle(t){const e=[],n=t.bpmnElement;return n instanceof SequenceFlow&&e.push(n.sequenceFlowKind),n instanceof AssociationFlow&&e.push(n.associationDirectionKind),e}static computeFontStyleValues(t){var e;const n=new Map,i=null===(e=t.label)||void 0===e?void 0:e.font;return i&&(n.set(mxgraph.mxConstants.STYLE_FONTFAMILY,i.name),n.set(mxgraph.mxConstants.STYLE_FONTSIZE,i.size),n.set(mxgraph.mxConstants.STYLE_FONTSTYLE,StyleComputer.getFontStyleValue(i))),n}static computeLabelStyleValues(t,e){const n=new Map,i=t.bpmnElement;return e?(n.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),t.bpmnElement.kind!=exports.ShapeBpmnElementKind.TEXT_ANNOTATION&&n.set(mxgraph.mxConstants.STYLE_ALIGN,mxgraph.mxConstants.ALIGN_CENTER),t instanceof Shape&&(n.set(mxgraph.mxConstants.STYLE_LABEL_WIDTH,e.width+1),n.set(mxgraph.mxConstants.STYLE_LABEL_POSITION,mxgraph.mxConstants.ALIGN_TOP),n.set(mxgraph.mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxgraph.mxConstants.ALIGN_LEFT))):t instanceof Shape&&(i instanceof ShapeBpmnSubProcess||i instanceof ShapeBpmnCallActivity&&i.callActivityKind===exports.ShapeBpmnCallActivityKind.CALLING_PROCESS)&&!i.markers.includes(exports.ShapeBpmnMarkerKind.EXPAND)&&n.set(mxgraph.mxConstants.STYLE_VERTICAL_ALIGN,mxgraph.mxConstants.ALIGN_TOP),n}computeMessageFlowIconStyle(t){return`shape=${BpmnStyleIdentifier.MESSAGE_FLOW_ICON};${BpmnStyleIdentifier.IS_INITIATING}=${t.messageVisibleKind}`}static getFontStyleValue(t){let e=0;return t.isBold&&(e+=mxgraph.mxConstants.FONT_BOLD),t.isItalic&&(e+=mxgraph.mxConstants.FONT_ITALIC),t.isStrikeThrough&&(e+=mxgraph.mxConstants.FONT_STRIKETHROUGH),t.isUnderline&&(e+=mxgraph.mxConstants.FONT_UNDERLINE),e}}class BpmnRenderer{constructor(t,e,n){this.graph=t,this.coordinatesTranslator=e,this.styleComputer=n}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(null==e?void 0:e.fit)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:n,otherFlowNodes:i,boundaryEvents:s,edges:r}){const o=this.graph.getModel();o.clear(),o.beginUpdate();try{this.insertShapes(t),this.insertShapes(e),this.insertShapes(n),this.insertShapes(i),this.insertShapes(s),this.insertEdges(r)}finally{o.endUpdate()}}insertShapes(t){t.forEach((t=>this.insertShape(t)))}getParent(t){const e=this.getCell(t.parentId);return null!=e?e:this.graph.getDefaultParent()}insertShape(t){var e;const n=t.bpmnElement,i=this.getParent(n),s=t.bounds;let r=null===(e=t.label)||void 0===e?void 0:e.bounds;r=ShapeUtil.isPoolOrLane(n.kind)?void 0:r;const o=this.styleComputer.computeStyle(t,r);this.insertVertex(i,n.id,n.name,s,r,o)}insertEdges(t){t.forEach((t=>{var e;const n=t.bpmnElement,i=this.graph.getDefaultParent(),s=this.getCell(n.sourceRefId),r=this.getCell(n.targetRefId),o=null===(e=t.label)||void 0===e?void 0:e.bounds,l=this.styleComputer.computeStyle(t,o),a=this.graph.insertEdge(i,n.id,n.name,s,r,l);if(this.insertWaypoints(t.waypoints,a),o){a.geometry.width=o.width,a.geometry.height=o.height;const t=this.coordinatesTranslator.computeEdgeCenter(a);if(t){a.geometry.relative=!1;const e=this.coordinatesTranslator.computeRelativeCoordinates(a.parent,new mxgraph.mxPoint(o.x,o.y)),n=e.x+o.width/2-t.x,i=e.y-t.y;a.geometry.offset=new mxgraph.mxPoint(n,i)}}this.insertMessageFlowIconIfNeeded(t,a)}))}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof MessageFlow&&t.messageVisibleKind!==exports.MessageVisibleKind.NONE){const n=this.graph.insertVertex(e,messageFowIconId(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));n.geometry.relative=!0,n.geometry.offset=new mxgraph.mxPoint(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map((t=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new mxgraph.mxPoint(t.x,t.y)))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,n,i,s,r){const o=this.coordinatesTranslator.computeRelativeCoordinates(t,new mxgraph.mxPoint(i.x,i.y)),l=this.graph.insertVertex(t,e,n,o.x,o.y,i.width,i.height,r);if(s){const t=s.x-i.x,e=s.y-i.y;l.geometry.offset=new mxgraph.mxPoint(t,e)}return l}}function newBpmnRenderer(t){return new BpmnRenderer(t,new CoordinatesTranslator(t),new StyleComputer)}function messageFowIconId(t){return`messageFlowIcon_of_${t}`}var util=createCommonjsModule((function(t,e){const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+i+"$");e.isExist=function(t){return void 0!==t},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.merge=function(t,e,n){if(e){const i=Object.keys(e),s=i.length;for(let r=0;r<s;r++)t[i[r]]="strict"===n?[e[i[r]]]:e[i[r]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(t){const e=s.exec(t);return!(null==e)},e.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n},e.nameRegexp=i}));util.isExist,util.isEmptyObject,util.merge,util.getValue,util.isName,util.getAllMatches,util.nameRegexp;const defaultOptions$2={allowBooleanAttributes:!1,unpairedTags:[]};var validate=function(t,e){e=Object.assign({},defaultOptions$2,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let r=0;r<t.length;r++)if("<"===t[r]&&"?"===t[r+1]){if(r+=2,r=readPI(t,r),r.err)return r}else{if("<"!==t[r]){if(isWhiteSpace(t[r]))continue;return getErrorObject("InvalidChar","char '"+t[r]+"' is not expected.",getLineNumberForPosition(t,r))}{let o=r;if(r++,"!"===t[r]){r=readCommentAndCDATA(t,r);continue}{let l=!1;"/"===t[r]&&(l=!0,r++);let a="";for(;r<t.length&&">"!==t[r]&&" "!==t[r]&&"\t"!==t[r]&&"\n"!==t[r]&&"\r"!==t[r];r++)a+=t[r];if(a=a.trim(),"/"===a[a.length-1]&&(a=a.substring(0,a.length-1),r--),!validateTagName(a)){let e;return e=0===a.trim().length?"Invalid space after '<'.":"Tag '"+a+"' is an invalid name.",getErrorObject("InvalidTag",e,getLineNumberForPosition(t,r))}const h=readAttributeStr(t,r);if(!1===h)return getErrorObject("InvalidAttr","Attributes for '"+a+"' have open quote.",getLineNumberForPosition(t,r));let u=h.value;if(r=h.index,"/"===u[u.length-1]){const n=r-u.length;u=u.substring(0,u.length-1);const s=validateAttributeString(u,e);if(!0!==s)return getErrorObject(s.err.code,s.err.msg,getLineNumberForPosition(t,n+s.err.line));i=!0}else if(l){if(!h.tagClosed)return getErrorObject("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",getLineNumberForPosition(t,r));if(u.trim().length>0)return getErrorObject("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",getLineNumberForPosition(t,o));{const e=n.pop();if(a!==e.tagName){let n=getLineNumberForPosition(t,e.tagStartPos);return getErrorObject("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+a+"'.",getLineNumberForPosition(t,o))}0==n.length&&(s=!0)}}else{const l=validateAttributeString(u,e);if(!0!==l)return getErrorObject(l.err.code,l.err.msg,getLineNumberForPosition(t,r-u.length+l.err.line));if(!0===s)return getErrorObject("InvalidXml","Multiple possible root nodes found.",getLineNumberForPosition(t,r));-1!==e.unpairedTags.indexOf(a)||n.push({tagName:a,tagStartPos:o}),i=!0}for(r++;r<t.length;r++)if("<"===t[r]){if("!"===t[r+1]){r++,r=readCommentAndCDATA(t,r);continue}if("?"!==t[r+1])break;if(r=readPI(t,++r),r.err)return r}else if("&"===t[r]){const e=validateAmpersand(t,r);if(-1==e)return getErrorObject("InvalidChar","char '&' is not expected.",getLineNumberForPosition(t,r));r=e}else if(!0===s&&!isWhiteSpace(t[r]))return getErrorObject("InvalidXml","Extra text at the end",getLineNumberForPosition(t,r));"<"===t[r]&&r--}}}return i?1==n.length?getErrorObject("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",getLineNumberForPosition(t,n[0].tagStartPos)):!(n.length>0)||getErrorObject("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):getErrorObject("InvalidXml","Start tag expected.",1)};function isWhiteSpace(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function readPI(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return getErrorObject("InvalidXml","XML declaration allowed only at the start of the document.",getLineNumberForPosition(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function readCommentAndCDATA(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const doubleQuote='"',singleQuote="'";function readAttributeStr(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]===doubleQuote||t[e]===singleQuote)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const validAttrStrRegxp=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function validateAttributeString(t,e){const n=util.getAllMatches(t,validAttrStrRegxp),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return getErrorObject("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",getPositionFromMatch(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return getErrorObject("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",getPositionFromMatch(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return getErrorObject("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",getPositionFromMatch(n[t]));const s=n[t][2];if(!validateAttrName(s))return getErrorObject("InvalidAttr","Attribute '"+s+"' is an invalid name.",getPositionFromMatch(n[t]));if(i.hasOwnProperty(s))return getErrorObject("InvalidAttr","Attribute '"+s+"' is repeated.",getPositionFromMatch(n[t]));i[s]=1}return!0}function validateNumberAmpersand(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}function validateAmpersand(t,e){if(";"===t[++e])return-1;if("#"===t[e])return validateNumberAmpersand(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function getErrorObject(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function validateAttrName(t){return util.isName(t)}function validateTagName(t){return util.isName(t)}function getLineNumberForPosition(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function getPositionFromMatch(t){return t.startIndex+t[1].length}var validator={validate};const defaultOptions$1={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1},buildOptions$1=function(t){return Object.assign({},defaultOptions$1,t)};var buildOptions_1=buildOptions$1,defaultOptions_1=defaultOptions$1,OptionsBuilder={buildOptions:buildOptions_1,defaultOptions:defaultOptions_1};class XmlNode{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){this.child.push({[t]:e})}addChild(t){t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}var xmlNode=XmlNode;function readDocType(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o=!1,l="";for(;e<t.length;e++)if("<"===t[e]){if(s&&"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7])e+=7,r=!0;else if(s&&"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8])e+=8;else{if("!"!==t[e+1]||"-"!==t[e+2]||"-"!==t[e+3])throw new Error("Invalid DOCTYPE");o=!0}i++,l=""}else if(">"===t[e]){if(o){if("-"!==t[e-1]||"-"!==t[e-2])throw new Error("Invalid XML comment in DOCTYPE");o=!1}else r&&(parseEntityExp(l,n),r=!1);if(i--,0===i)break}else"["===t[e]?s=!0:l+=t[e];if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}const entityRegex=RegExp("^\\s([a-zA-z0-0]+)[ \t](['\"])([^&]+)\\2");function parseEntityExp(t,e){const n=entityRegex.exec(t);n&&(e[n[1]]={regx:RegExp(`&${n[1]};`,"g"),val:n[3]})}var DocTypeReader=readDocType;const hexRegex=/^[-+]?0x[a-fA-F0-9]+$/,numRegex=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const consider={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function toNumber(t,e={}){if(e=Object.assign({},consider,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(e.hex&&hexRegex.test(n))return Number.parseInt(n,16);{const i=numRegex.exec(n);if(i){const s=i[1],r=i[2];let o=trimZeros(i[3]);const l=i[4]||i[6];if(!e.leadingZeros&&r.length>0&&s&&"."!==n[2])return t;if(!e.leadingZeros&&r.length>0&&!s&&"."!==n[1])return t;{const i=Number(n),a=""+i;return-1!==a.search(/[eE]/)||l?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===a&&""===o||a===o||s&&a==="-"+o?i:t:r?o===a||s+o===a?i:t:n===a||n===s+a?i:t}}return t}}function trimZeros(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}var strnum=toNumber;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,util.nameRegexp);class OrderedObjParser{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={amp:{regex:/&(amp|#38|#x26);/g,val:"&"},apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=addExternalEntities,this.parseXml=parseXml,this.parseTextData=parseTextData,this.resolveNameSpace=resolveNameSpace,this.buildAttributesMap=buildAttributesMap,this.isItStopNode=isItStopNode,this.replaceEntitiesValue=replaceEntitiesValue$2,this.readStopNodeData=readStopNodeData,this.saveTextToParentTag=saveTextToParentTag}}function addExternalEntities(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function parseTextData(t,e,n,i,s,r,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return parseValue(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?parseValue(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function resolveNameSpace(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const attrsRegx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function buildAttributesMap(t,e){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=util.getAllMatches(t,attrsRegx),i=n.length,s={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);let r=n[t][4];const o=this.options.attributeNamePrefix+i;if(i.length)if(void 0!==r){this.options.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r);const t=this.options.attributeValueProcessor(i,r,e);s[o]=null==t?r:typeof t!=typeof r||t!==r?t:parseValue(r,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[o]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=s,t}return s}}const parseXml=function(t){t=t.replace(/\r\n?/g,"\n");const e=new xmlNode("!xml");let n=e,i="",s="";for(let r=0;r<t.length;r++){if("<"===t[r])if("/"===t[r+1]){const e=findClosingIndex(t,">",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}n&&(i=this.saveTextToParentTag(i,n,s)),s=s.substr(0,s.lastIndexOf(".")),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=readTagExp(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new xmlNode(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s)),n.addChild(t)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=findClosingIndex(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=DocTypeReader(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=findClosingIndex(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);if(i=this.saveTextToParentTag(i,n,s),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let t=this.parseTextData(o,n.tagname,s,!0,!1,!0);t||(t=""),n.add(this.options.textNodeName,t)}r=e+2}else{let o=readTagExp(t,r,this.options.removeNSPrefix),l=o.tagName,a=o.tagExp,h=o.attrExpPresent,u=o.closeIndex;n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1)),l!==e.tagname&&(s+=s?"."+l:l);const d=n;if(d&&-1!==this.options.unpairedTags.indexOf(d.tagname)&&(n=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,s,l)){let e="";if(a.length>0&&a.lastIndexOf("/")===a.length-1)r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new xmlNode(l);l!==a&&h&&(i[":@"]=this.buildAttributesMap(a,s)),e&&(e=this.parseTextData(e,l,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),n.addChild(i)}else{if(a.length>0&&a.lastIndexOf("/")===a.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),a=l):a=a.substr(0,a.length-1);const t=new xmlNode(l);l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s)),s=s.substr(0,s.lastIndexOf(".")),n.addChild(t)}else{const t=new xmlNode(l);this.tagsNodeStack.push(n),l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s)),n.addChild(t),n=t}i="",r=u}}else i+=t[r]}return e.child},replaceEntitiesValue$2=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}}return t};function saveTextToParentTag(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function isItStopNode(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function tagExpWithClosingIndex(t,e,n=">"){let i,s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}function findClosingIndex(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function readTagExp(t,e,n,i=">"){const s=tagExpWithClosingIndex(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,l=r.search(/\s/);let a=r,h=!0;if(-1!==l&&(a=r.substr(0,l).replace(/\s\s*$/,""),r=r.substr(l+1)),n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),h=a!==s.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:o,attrExpPresent:h}}function readStopNodeData(t,e,n){const i=n;for(;n<t.length;n++)if("<"===t[n]&&"/"===t[n+1]){const s=findClosingIndex(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e)return{tagContent:t.substring(i,n),i:s};n=s}}function parseValue(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&strnum(t,n)}return util.isExist(t)?t:""}var OrderedObjParser_1=OrderedObjParser;function prettify$1(t,e){return compress(t,e)}function compress(t,e,n){let i;const s={};for(let r=0;r<t.length;r++){const o=t[r],l=propName$1(o);let a="";if(a=void 0===n?l:n+"."+l,l===e.textNodeName)void 0===i?i=o[l]:i+=""+o[l];else{if(void 0===l)continue;if(o[l]){let t=compress(o[l],e,a);const n=isLeafTag(t,e);o[":@"]?assignAttributes(t,o[":@"],a,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[l]?(Array.isArray(s[l])||(s[l]=[s[l]]),s[l].push(t)):e.isArray(l,a,n)?s[l]=[t]:s[l]=t}}}return"string"==typeof i?i.length>0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function propName$1(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function assignAttributes(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];i.isArray(r,n+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function isLeafTag(t,e){const n=Object.keys(t).length;return!!(0===n||1===n&&t[e.textNodeName])}var prettify_1=prettify$1,node2json={prettify:prettify_1};const{buildOptions}=OptionsBuilder,{prettify}=node2json;class XMLParser{constructor(t){this.externalEntities={},this.options=buildOptions(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=validator.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new OrderedObjParser_1(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:prettify(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");this.externalEntities[t]=e}}var XMLParser_1=XMLParser;const EOL="\n";function toXml(t,e){return arrToStr(t,e,"",0)}function arrToStr(t,e,n,i){let s="",r="";e.format&&e.indentBy.length>0&&(r=EOL+""+e.indentBy.repeat(i));for(let o=0;o<t.length;o++){const l=t[o],a=propName(l);let h="";if(h=0===n.length?a:`${n}.${a}`,a===e.textNodeName){let t=l[a];isStopNode(h,e)||(t=e.tagValueProcessor(a,t),t=replaceEntitiesValue$1(t,e)),s+=r+t;continue}if(a===e.cdataPropName){s+=r+`<![CDATA[${l[a][0][e.textNodeName]}]]>`;continue}if(a===e.commentPropName){s+=r+`\x3c!--${l[a][0][e.textNodeName]}--\x3e`;continue}if("?"===a[0]){const t=attr_to_str(l[":@"],e),n="?xml"===a?"":r;let i=l[a][0][e.textNodeName];i=0!==i.length?" "+i:"",s+=n+`<${a}${i}${t}?>`;continue}let u=r+`<${a}${attr_to_str(l[":@"],e)}`,d=arrToStr(l[a],e,h,i+1);-1!==e.unpairedTags.indexOf(a)?e.suppressUnpairedNode?s+=u+">":s+=u+"/>":d&&0!==d.length||!e.suppressEmptyNode?s+=u+`>${d}${r}</${a}>`:s+=u+"/>"}return s}function propName(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function attr_to_str(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){let s=e.attributeValueProcessor(i,t[i]);s=replaceEntitiesValue$1(s,e),!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function isStopNode(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function replaceEntitiesValue$1(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}var orderedJs2Xml=toXml;const defaultOptions={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:"  ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[]};function Builder(t){this.options=Object.assign({},defaultOptions,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=isAttribute),this.processTextOrObjNode=processTextOrObjNode,this.options.format?(this.indentate=indentate,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.suppressEmptyNode?(this.buildTextNode=buildEmptyTextNode,this.buildObjNode=buildEmptyObjNode):(this.buildTextNode=buildTextValNode,this.buildObjNode=buildObjectNode),this.buildTextValNode=buildTextValNode,this.buildObjectNode=buildObjectNode,this.replaceEntitiesValue=replaceEntitiesValue,this.buildAttrPairStr=buildAttrPairStr}function buildAttrPairStr(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'}function processTextOrObjNode(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjNode(i.val,e,i.attrStr,n)}function buildObjectNode(t,e,n,i){let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),n&&-1===t.indexOf("<")?this.indentate(i)+"<"+e+n+r+">"+t+s:!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s}function buildEmptyObjNode(t,e,n,i){return""!==t?this.buildObjectNode(t,e,n,i):"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+"/"+this.tagEndChar}function buildTextValNode(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s&&-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode?this.indentate(i)+"<"+e+this.tagEndChar:this.indentate(i)+"<"+e+"/"+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}}function replaceEntitiesValue(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t}function buildEmptyTextNode(t,e,n,i){return""===t&&-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode?this.indentate(i)+"<"+e+this.tagEndChar:this.indentate(i)+"<"+e+"/"+this.tagEndChar:""!==t?this.buildTextValNode(t,e,n,i):"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+"/"+this.tagEndChar}function indentate(t){return this.options.indentBy.repeat(t)}function isAttribute(t){return!!t.startsWith(this.options.attributeNamePrefix)&&t.substr(this.attrPrefixLen)}Builder.prototype.build=function(t){return this.options.preserveOrder?orderedJs2Xml(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},Builder.prototype.j2x=function(t,e){let n="",i="";for(let s in t)if(void 0===t[s]);else if(null===t[s])"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextNode(t[s],s,"",e);else if("object"!=typeof t[s]){const r=this.isAttribute(s);if(r)n+=this.buildAttrPairStr(r,""+t[s]);else if(s===this.options.textNodeName){let e=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const n=t[s].length;for(let r=0;r<n;r++){const n=t[s][r];void 0===n||(null===n?"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar:i+="object"==typeof n?this.processTextOrObjNode(n,s,e):this.buildTextNode(n,s,"",e))}}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const e=Object.keys(t[s]),i=e.length;for(let r=0;r<i;r++)n+=this.buildAttrPairStr(e[r],""+t[s][e[r]])}else i+=this.processTextOrObjNode(t[s],s,e);return{attrStr:n,val:i}};var json2xml=Builder,fxp={XMLParser:XMLParser_1,XMLValidator:validator,XMLBuilder:json2xml},fxp_1=fxp.XMLParser,decodeDataHtml=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=new Uint16Array([14866,60,237,340,721,1312,1562,1654,1838,1957,2183,2239,2301,2958,3037,3893,4123,4298,4330,4801,5191,5395,5752,5903,5943,5972,6050,0,0,0,0,0,0,6135,6565,7422,8183,8738,9242,9503,9938,10189,10573,10637,10715,11950,12246,13539,13950,14445,14533,15364,16514,16980,17390,17763,17849,18036,18125,4096,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,92,100,106,115,122,137,142,151,157,163,167,182,196,204,220,229,108,105,103,33024,198,59,32768,198,80,33024,38,59,32768,38,99,117,116,101,33024,193,59,32768,193,114,101,118,101,59,32768,258,512,105,121,127,134,114,99,33024,194,59,32768,194,59,32768,1040,114,59,32896,55349,56580,114,97,118,101,33024,192,59,32768,192,112,104,97,59,32768,913,97,99,114,59,32768,256,100,59,32768,10835,512,103,112,172,177,111,110,59,32768,260,102,59,32896,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,32768,8289,105,110,103,33024,197,59,32768,197,512,99,115,209,214,114,59,32896,55349,56476,105,103,110,59,32768,8788,105,108,100,101,33024,195,59,32768,195,109,108,33024,196,59,32768,196,2048,97,99,101,102,111,114,115,117,253,278,282,310,315,321,327,332,512,99,114,258,267,107,115,108,97,115,104,59,32768,8726,583,271,274,59,32768,10983,101,100,59,32768,8966,121,59,32768,1041,768,99,114,116,289,296,306,97,117,115,101,59,32768,8757,110,111,117,108,108,105,115,59,32768,8492,97,59,32768,914,114,59,32896,55349,56581,112,102,59,32896,55349,56633,101,118,101,59,32768,728,99,114,59,32768,8492,109,112,101,113,59,32768,8782,3584,72,79,97,99,100,101,102,104,105,108,111,114,115,117,368,373,380,426,461,466,487,491,495,533,593,695,701,707,99,121,59,32768,1063,80,89,33024,169,59,32768,169,768,99,112,121,387,393,419,117,116,101,59,32768,262,512,59,105,398,400,32768,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,32768,8517,108,101,121,115,59,32768,8493,1024,97,101,105,111,435,441,449,454,114,111,110,59,32768,268,100,105,108,33024,199,59,32768,199,114,99,59,32768,264,110,105,110,116,59,32768,8752,111,116,59,32768,266,512,100,110,471,478,105,108,108,97,59,32768,184,116,101,114,68,111,116,59,32768,183,114,59,32768,8493,105,59,32768,935,114,99,108,101,1024,68,77,80,84,508,513,520,526,111,116,59,32768,8857,105,110,117,115,59,32768,8854,108,117,115,59,32768,8853,105,109,101,115,59,32768,8855,111,512,99,115,539,562,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,32768,8754,101,67,117,114,108,121,512,68,81,573,586,111,117,98,108,101,81,117,111,116,101,59,32768,8221,117,111,116,101,59,32768,8217,1024,108,110,112,117,602,614,648,664,111,110,512,59,101,609,611,32768,8759,59,32768,10868,768,103,105,116,621,629,634,114,117,101,110,116,59,32768,8801,110,116,59,32768,8751,111,117,114,73,110,116,101,103,114,97,108,59,32768,8750,512,102,114,653,656,59,32768,8450,111,100,117,99,116,59,32768,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,32768,8755,111,115,115,59,32768,10799,99,114,59,32896,55349,56478,112,512,59,67,713,715,32768,8915,97,112,59,32768,8781,2816,68,74,83,90,97,99,101,102,105,111,115,743,758,763,768,773,795,809,821,826,910,1295,512,59,111,748,750,32768,8517,116,114,97,104,100,59,32768,10513,99,121,59,32768,1026,99,121,59,32768,1029,99,121,59,32768,1039,768,103,114,115,780,786,790,103,101,114,59,32768,8225,114,59,32768,8609,104,118,59,32768,10980,512,97,121,800,806,114,111,110,59,32768,270,59,32768,1044,108,512,59,116,815,817,32768,8711,97,59,32768,916,114,59,32896,55349,56583,512,97,102,831,897,512,99,109,836,891,114,105,116,105,99,97,108,1024,65,68,71,84,852,859,877,884,99,117,116,101,59,32768,180,111,581,864,867,59,32768,729,98,108,101,65,99,117,116,101,59,32768,733,114,97,118,101,59,32768,96,105,108,100,101,59,32768,732,111,110,100,59,32768,8900,102,101,114,101,110,116,105,97,108,68,59,32768,8518,2113,920,0,0,0,925,946,0,1139,102,59,32896,55349,56635,768,59,68,69,931,933,938,32768,168,111,116,59,32768,8412,113,117,97,108,59,32768,8784,98,108,101,1536,67,68,76,82,85,86,961,978,996,1080,1101,1125,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,32768,8751,111,1093,985,0,0,988,59,32768,168,110,65,114,114,111,119,59,32768,8659,512,101,111,1001,1034,102,116,768,65,82,84,1010,1017,1029,114,114,111,119,59,32768,8656,105,103,104,116,65,114,114,111,119,59,32768,8660,101,101,59,32768,10980,110,103,512,76,82,1041,1068,101,102,116,512,65,82,1049,1056,114,114,111,119,59,32768,10232,105,103,104,116,65,114,114,111,119,59,32768,10234,105,103,104,116,65,114,114,111,119,59,32768,10233,105,103,104,116,512,65,84,1089,1096,114,114,111,119,59,32768,8658,101,101,59,32768,8872,112,1042,1108,0,0,1115,114,114,111,119,59,32768,8657,111,119,110,65,114,114,111,119,59,32768,8661,101,114,116,105,99,97,108,66,97,114,59,32768,8741,110,1536,65,66,76,82,84,97,1152,1179,1186,1236,1272,1288,114,114,111,119,768,59,66,85,1163,1165,1170,32768,8595,97,114,59,32768,10515,112,65,114,114,111,119,59,32768,8693,114,101,118,101,59,32768,785,101,102,116,1315,1196,0,1209,0,1220,105,103,104,116,86,101,99,116,111,114,59,32768,10576,101,101,86,101,99,116,111,114,59,32768,10590,101,99,116,111,114,512,59,66,1229,1231,32768,8637,97,114,59,32768,10582,105,103,104,116,805,1245,0,1256,101,101,86,101,99,116,111,114,59,32768,10591,101,99,116,111,114,512,59,66,1265,1267,32768,8641,97,114,59,32768,10583,101,101,512,59,65,1279,1281,32768,8868,114,114,111,119,59,32768,8615,114,114,111,119,59,32768,8659,512,99,116,1300,1305,114,59,32896,55349,56479,114,111,107,59,32768,272,4096,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1344,1348,1354,1363,1386,1391,1396,1405,1413,1460,1475,1483,1514,1527,1531,1538,71,59,32768,330,72,33024,208,59,32768,208,99,117,116,101,33024,201,59,32768,201,768,97,105,121,1370,1376,1383,114,111,110,59,32768,282,114,99,33024,202,59,32768,202,59,32768,1069,111,116,59,32768,278,114,59,32896,55349,56584,114,97,118,101,33024,200,59,32768,200,101,109,101,110,116,59,32768,8712,512,97,112,1418,1423,99,114,59,32768,274,116,121,1060,1431,0,0,1444,109,97,108,108,83,113,117,97,114,101,59,32768,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,32768,9643,512,103,112,1465,1470,111,110,59,32768,280,102,59,32896,55349,56636,115,105,108,111,110,59,32768,917,117,512,97,105,1489,1504,108,512,59,84,1495,1497,32768,10869,105,108,100,101,59,32768,8770,108,105,98,114,105,117,109,59,32768,8652,512,99,105,1519,1523,114,59,32768,8496,109,59,32768,10867,97,59,32768,919,109,108,33024,203,59,32768,203,512,105,112,1543,1549,115,116,115,59,32768,8707,111,110,101,110,116,105,97,108,69,59,32768,8519,1280,99,102,105,111,115,1572,1576,1581,1620,1648,121,59,32768,1060,114,59,32896,55349,56585,108,108,101,100,1060,1591,0,0,1604,109,97,108,108,83,113,117,97,114,101,59,32768,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,32768,9642,1601,1628,0,1633,0,0,1639,102,59,32896,55349,56637,65,108,108,59,32768,8704,114,105,101,114,116,114,102,59,32768,8497,99,114,59,32768,8497,3072,74,84,97,98,99,100,102,103,111,114,115,116,1678,1683,1688,1701,1708,1729,1734,1739,1742,1748,1828,1834,99,121,59,32768,1027,33024,62,59,32768,62,109,109,97,512,59,100,1696,1698,32768,915,59,32768,988,114,101,118,101,59,32768,286,768,101,105,121,1715,1721,1726,100,105,108,59,32768,290,114,99,59,32768,284,59,32768,1043,111,116,59,32768,288,114,59,32896,55349,56586,59,32768,8921,112,102,59,32896,55349,56638,101,97,116,101,114,1536,69,70,71,76,83,84,1766,1783,1794,1803,1809,1821,113,117,97,108,512,59,76,1775,1777,32768,8805,101,115,115,59,32768,8923,117,108,108,69,113,117,97,108,59,32768,8807,114,101,97,116,101,114,59,32768,10914,101,115,115,59,32768,8823,108,97,110,116,69,113,117,97,108,59,32768,10878,105,108,100,101,59,32768,8819,99,114,59,32896,55349,56482,59,32768,8811,2048,65,97,99,102,105,111,115,117,1854,1861,1874,1880,1884,1897,1919,1934,82,68,99,121,59,32768,1066,512,99,116,1866,1871,101,107,59,32768,711,59,32768,94,105,114,99,59,32768,292,114,59,32768,8460,108,98,101,114,116,83,112,97,99,101,59,32768,8459,833,1902,0,1906,102,59,32768,8461,105,122,111,110,116,97,108,76,105,110,101,59,32768,9472,512,99,116,1924,1928,114,59,32768,8459,114,111,107,59,32768,294,109,112,533,1940,1950,111,119,110,72,117,109,112,59,32768,8782,113,117,97,108,59,32768,8783,3584,69,74,79,97,99,100,102,103,109,110,111,115,116,117,1985,1990,1996,2001,2010,2025,2030,2034,2043,2077,2134,2155,2160,2167,99,121,59,32768,1045,108,105,103,59,32768,306,99,121,59,32768,1025,99,117,116,101,33024,205,59,32768,205,512,105,121,2015,2022,114,99,33024,206,59,32768,206,59,32768,1048,111,116,59,32768,304,114,59,32768,8465,114,97,118,101,33024,204,59,32768,204,768,59,97,112,2050,2052,2070,32768,8465,512,99,103,2057,2061,114,59,32768,298,105,110,97,114,121,73,59,32768,8520,108,105,101,115,59,32768,8658,837,2082,0,2110,512,59,101,2086,2088,32768,8748,512,103,114,2093,2099,114,97,108,59,32768,8747,115,101,99,116,105,111,110,59,32768,8898,105,115,105,98,108,101,512,67,84,2120,2127,111,109,109,97,59,32768,8291,105,109,101,115,59,32768,8290,768,103,112,116,2141,2146,2151,111,110,59,32768,302,102,59,32896,55349,56640,97,59,32768,921,99,114,59,32768,8464,105,108,100,101,59,32768,296,828,2172,0,2177,99,121,59,32768,1030,108,33024,207,59,32768,207,1280,99,102,111,115,117,2193,2206,2211,2217,2232,512,105,121,2198,2203,114,99,59,32768,308,59,32768,1049,114,59,32896,55349,56589,112,102,59,32896,55349,56641,820,2222,0,2227,114,59,32896,55349,56485,114,99,121,59,32768,1032,107,99,121,59,32768,1028,1792,72,74,97,99,102,111,115,2253,2258,2263,2269,2283,2288,2294,99,121,59,32768,1061,99,121,59,32768,1036,112,112,97,59,32768,922,512,101,121,2274,2280,100,105,108,59,32768,310,59,32768,1050,114,59,32896,55349,56590,112,102,59,32896,55349,56642,99,114,59,32896,55349,56486,2816,74,84,97,99,101,102,108,109,111,115,116,2323,2328,2333,2374,2396,2775,2780,2797,2804,2934,2954,99,121,59,32768,1033,33024,60,59,32768,60,1280,99,109,110,112,114,2344,2350,2356,2360,2370,117,116,101,59,32768,313,98,100,97,59,32768,923,103,59,32768,10218,108,97,99,101,116,114,102,59,32768,8466,114,59,32768,8606,768,97,101,121,2381,2387,2393,114,111,110,59,32768,317,100,105,108,59,32768,315,59,32768,1051,512,102,115,2401,2702,116,2560,65,67,68,70,82,84,85,86,97,114,2423,2470,2479,2530,2537,2561,2618,2666,2683,2690,512,110,114,2428,2441,103,108,101,66,114,97,99,107,101,116,59,32768,10216,114,111,119,768,59,66,82,2451,2453,2458,32768,8592,97,114,59,32768,8676,105,103,104,116,65,114,114,111,119,59,32768,8646,101,105,108,105,110,103,59,32768,8968,111,838,2485,0,2498,98,108,101,66,114,97,99,107,101,116,59,32768,10214,110,805,2503,0,2514,101,101,86,101,99,116,111,114,59,32768,10593,101,99,116,111,114,512,59,66,2523,2525,32768,8643,97,114,59,32768,10585,108,111,111,114,59,32768,8970,105,103,104,116,512,65,86,2546,2553,114,114,111,119,59,32768,8596,101,99,116,111,114,59,32768,10574,512,101,114,2566,2591,101,768,59,65,86,2574,2576,2583,32768,8867,114,114,111,119,59,32768,8612,101,99,116,111,114,59,32768,10586,105,97,110,103,108,101,768,59,66,69,2604,2606,2611,32768,8882,97,114,59,32768,10703,113,117,97,108,59,32768,8884,112,768,68,84,86,2626,2638,2649,111,119,110,86,101,99,116,111,114,59,32768,10577,101,101,86,101,99,116,111,114,59,32768,10592,101,99,116,111,114,512,59,66,2659,2661,32768,8639,97,114,59,32768,10584,101,99,116,111,114,512,59,66,2676,2678,32768,8636,97,114,59,32768,10578,114,114,111,119,59,32768,8656,105,103,104,116,97,114,114,111,119,59,32768,8660,115,1536,69,70,71,76,83,84,2716,2730,2741,2750,2756,2768,113,117,97,108,71,114,101,97,116,101,114,59,32768,8922,117,108,108,69,113,117,97,108,59,32768,8806,114,101,97,116,101,114,59,32768,8822,101,115,115,59,32768,10913,108,97,110,116,69,113,117,97,108,59,32768,10877,105,108,100,101,59,32768,8818,114,59,32896,55349,56591,512,59,101,2785,2787,32768,8920,102,116,97,114,114,111,119,59,32768,8666,105,100,111,116,59,32768,319,768,110,112,119,2811,2899,2904,103,1024,76,82,108,114,2821,2848,2860,2887,101,102,116,512,65,82,2829,2836,114,114,111,119,59,32768,10229,105,103,104,116,65,114,114,111,119,59,32768,10231,105,103,104,116,65,114,114,111,119,59,32768,10230,101,102,116,512,97,114,2868,2875,114,114,111,119,59,32768,10232,105,103,104,116,97,114,114,111,119,59,32768,10234,105,103,104,116,97,114,114,111,119,59,32768,10233,102,59,32896,55349,56643,101,114,512,76,82,2911,2922,101,102,116,65,114,114,111,119,59,32768,8601,105,103,104,116,65,114,114,111,119,59,32768,8600,768,99,104,116,2941,2945,2948,114,59,32768,8466,59,32768,8624,114,111,107,59,32768,321,59,32768,8810,2048,97,99,101,102,105,111,115,117,2974,2978,2982,3007,3012,3022,3028,3033,112,59,32768,10501,121,59,32768,1052,512,100,108,2987,2998,105,117,109,83,112,97,99,101,59,32768,8287,108,105,110,116,114,102,59,32768,8499,114,59,32896,55349,56592,110,117,115,80,108,117,115,59,32768,8723,112,102,59,32896,55349,56644,99,114,59,32768,8499,59,32768,924,2304,74,97,99,101,102,111,115,116,117,3055,3060,3067,3089,3201,3206,3874,3880,3889,99,121,59,32768,1034,99,117,116,101,59,32768,323,768,97,101,121,3074,3080,3086,114,111,110,59,32768,327,100,105,108,59,32768,325,59,32768,1053,768,103,115,119,3096,3160,3194,97,116,105,118,101,768,77,84,86,3108,3121,3145,101,100,105,117,109,83,112,97,99,101,59,32768,8203,104,105,512,99,110,3128,3137,107,83,112,97,99,101,59,32768,8203,83,112,97,99,101,59,32768,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,32768,8203,116,101,100,512,71,76,3168,3184,114,101,97,116,101,114,71,114,101,97,116,101,114,59,32768,8811,101,115,115,76,101,115,115,59,32768,8810,76,105,110,101,59,32768,10,114,59,32896,55349,56593,1024,66,110,112,116,3215,3222,3238,3242,114,101,97,107,59,32768,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,32768,160,102,59,32768,8469,3328,59,67,68,69,71,72,76,78,80,82,83,84,86,3269,3271,3293,3312,3352,3430,3455,3551,3589,3625,3678,3821,3861,32768,10988,512,111,117,3276,3286,110,103,114,117,101,110,116,59,32768,8802,112,67,97,112,59,32768,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,32768,8742,768,108,113,120,3319,3327,3345,101,109,101,110,116,59,32768,8713,117,97,108,512,59,84,3335,3337,32768,8800,105,108,100,101,59,32896,8770,824,105,115,116,115,59,32768,8708,114,101,97,116,101,114,1792,59,69,70,71,76,83,84,3373,3375,3382,3394,3404,3410,3423,32768,8815,113,117,97,108,59,32768,8817,117,108,108,69,113,117,97,108,59,32896,8807,824,114,101,97,116,101,114,59,32896,8811,824,101,115,115,59,32768,8825,108,97,110,116,69,113,117,97,108,59,32896,10878,824,105,108,100,101,59,32768,8821,117,109,112,533,3437,3448,111,119,110,72,117,109,112,59,32896,8782,824,113,117,97,108,59,32896,8783,824,101,512,102,115,3461,3492,116,84,114,105,97,110,103,108,101,768,59,66,69,3477,3479,3485,32768,8938,97,114,59,32896,10703,824,113,117,97,108,59,32768,8940,115,1536,59,69,71,76,83,84,3506,3508,3515,3524,3531,3544,32768,8814,113,117,97,108,59,32768,8816,114,101,97,116,101,114,59,32768,8824,101,115,115,59,32896,8810,824,108,97,110,116,69,113,117,97,108,59,32896,10877,824,105,108,100,101,59,32768,8820,101,115,116,101,100,512,71,76,3561,3578,114,101,97,116,101,114,71,114,101,97,116,101,114,59,32896,10914,824,101,115,115,76,101,115,115,59,32896,10913,824,114,101,99,101,100,101,115,768,59,69,83,3603,3605,3613,32768,8832,113,117,97,108,59,32896,10927,824,108,97,110,116,69,113,117,97,108,59,32768,8928,512,101,105,3630,3645,118,101,114,115,101,69,108,101,109,101,110,116,59,32768,8716,103,104,116,84,114,105,97,110,103,108,101,768,59,66,69,3663,3665,3671,32768,8939,97,114,59,32896,10704,824,113,117,97,108,59,32768,8941,512,113,117,3683,3732,117,97,114,101,83,117,512,98,112,3694,3712,115,101,116,512,59,69,3702,3705,32896,8847,824,113,117,97,108,59,32768,8930,101,114,115,101,116,512,59,69,3722,3725,32896,8848,824,113,117,97,108,59,32768,8931,768,98,99,112,3739,3757,3801,115,101,116,512,59,69,3747,3750,32896,8834,8402,113,117,97,108,59,32768,8840,99,101,101,100,115,1024,59,69,83,84,3771,3773,3781,3793,32768,8833,113,117,97,108,59,32896,10928,824,108,97,110,116,69,113,117,97,108,59,32768,8929,105,108,100,101,59,32896,8831,824,101,114,115,101,116,512,59,69,3811,3814,32896,8835,8402,113,117,97,108,59,32768,8841,105,108,100,101,1024,59,69,70,84,3834,3836,3843,3854,32768,8769,113,117,97,108,59,32768,8772,117,108,108,69,113,117,97,108,59,32768,8775,105,108,100,101,59,32768,8777,101,114,116,105,99,97,108,66,97,114,59,32768,8740,99,114,59,32896,55349,56489,105,108,100,101,33024,209,59,32768,209,59,32768,925,3584,69,97,99,100,102,103,109,111,112,114,115,116,117,118,3921,3927,3936,3951,3958,3963,3972,3996,4002,4034,4037,4055,4071,4078,108,105,103,59,32768,338,99,117,116,101,33024,211,59,32768,211,512,105,121,3941,3948,114,99,33024,212,59,32768,212,59,32768,1054,98,108,97,99,59,32768,336,114,59,32896,55349,56594,114,97,118,101,33024,210,59,32768,210,768,97,101,105,3979,3984,3989,99,114,59,32768,332,103,97,59,32768,937,99,114,111,110,59,32768,927,112,102,59,32896,55349,56646,101,110,67,117,114,108,121,512,68,81,4014,4027,111,117,98,108,101,81,117,111,116,101,59,32768,8220,117,111,116,101,59,32768,8216,59,32768,10836,512,99,108,4042,4047,114,59,32896,55349,56490,97,115,104,33024,216,59,32768,216,105,573,4060,4067,100,101,33024,213,59,32768,213,101,115,59,32768,10807,109,108,33024,214,59,32768,214,101,114,512,66,80,4085,4109,512,97,114,4090,4094,114,59,32768,8254,97,99,512,101,107,4101,4104,59,32768,9182,101,116,59,32768,9140,97,114,101,110,116,104,101,115,105,115,59,32768,9180,2304,97,99,102,104,105,108,111,114,115,4141,4150,4154,4159,4163,4166,4176,4198,4284,114,116,105,97,108,68,59,32768,8706,121,59,32768,1055,114,59,32896,55349,56595,105,59,32768,934,59,32768,928,117,115,77,105,110,117,115,59,32768,177,512,105,112,4181,4194,110,99,97,114,101,112,108,97,110,101,59,32768,8460,102,59,32768,8473,1024,59,101,105,111,4207,4209,4251,4256,32768,10939,99,101,100,101,115,1024,59,69,83,84,4223,4225,4232,4244,32768,8826,113,117,97,108,59,32768,10927,108,97,110,116,69,113,117,97,108,59,32768,8828,105,108,100,101,59,32768,8830,109,101,59,32768,8243,512,100,112,4261,4267,117,99,116,59,32768,8719,111,114,116,105,111,110,512,59,97,4278,4280,32768,8759,108,59,32768,8733,512,99,105,4289,4294,114,59,32896,55349,56491,59,32768,936,1024,85,102,111,115,4306,4313,4318,4323,79,84,33024,34,59,32768,34,114,59,32896,55349,56596,112,102,59,32768,8474,99,114,59,32896,55349,56492,3072,66,69,97,99,101,102,104,105,111,114,115,117,4354,4360,4366,4395,4417,4473,4477,4481,4743,4764,4776,4788,97,114,114,59,32768,10512,71,33024,174,59,32768,174,768,99,110,114,4373,4379,4383,117,116,101,59,32768,340,103,59,32768,10219,114,512,59,116,4389,4391,32768,8608,108,59,32768,10518,768,97,101,121,4402,4408,4414,114,111,110,59,32768,344,100,105,108,59,32768,342,59,32768,1056,512,59,118,4422,4424,32768,8476,101,114,115,101,512,69,85,4433,4458,512,108,113,4438,4446,101,109,101,110,116,59,32768,8715,117,105,108,105,98,114,105,117,109,59,32768,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,32768,10607,114,59,32768,8476,111,59,32768,929,103,104,116,2048,65,67,68,70,84,85,86,97,4501,4547,4556,4607,4614,4671,4719,4736,512,110,114,4506,4519,103,108,101,66,114,97,99,107,101,116,59,32768,10217,114,111,119,768,59,66,76,4529,4531,4536,32768,8594,97,114,59,32768,8677,101,102,116,65,114,114,111,119,59,32768,8644,101,105,108,105,110,103,59,32768,8969,111,838,4562,0,4575,98,108,101,66,114,97,99,107,101,116,59,32768,10215,110,805,4580,0,4591,101,101,86,101,99,116,111,114,59,32768,10589,101,99,116,111,114,512,59,66,4600,4602,32768,8642,97,114,59,32768,10581,108,111,111,114,59,32768,8971,512,101,114,4619,4644,101,768,59,65,86,4627,4629,4636,32768,8866,114,114,111,119,59,32768,8614,101,99,116,111,114,59,32768,10587,105,97,110,103,108,101,768,59,66,69,4657,4659,4664,32768,8883,97,114,59,32768,10704,113,117,97,108,59,32768,8885,112,768,68,84,86,4679,4691,4702,111,119,110,86,101,99,116,111,114,59,32768,10575,101,101,86,101,99,116,111,114,59,32768,10588,101,99,116,111,114,512,59,66,4712,4714,32768,8638,97,114,59,32768,10580,101,99,116,111,114,512,59,66,4729,4731,32768,8640,97,114,59,32768,10579,114,114,111,119,59,32768,8658,512,112,117,4748,4752,102,59,32768,8477,110,100,73,109,112,108,105,101,115,59,32768,10608,105,103,104,116,97,114,114,111,119,59,32768,8667,512,99,104,4781,4785,114,59,32768,8475,59,32768,8625,108,101,68,101,108,97,121,101,100,59,32768,10740,3328,72,79,97,99,102,104,105,109,111,113,115,116,117,4827,4842,4849,4856,4889,4894,4949,4955,4967,4973,5059,5065,5070,512,67,99,4832,4838,72,99,121,59,32768,1065,121,59,32768,1064,70,84,99,121,59,32768,1068,99,117,116,101,59,32768,346,1280,59,97,101,105,121,4867,4869,4875,4881,4886,32768,10940,114,111,110,59,32768,352,100,105,108,59,32768,350,114,99,59,32768,348,59,32768,1057,114,59,32896,55349,56598,111,114,116,1024,68,76,82,85,4906,4917,4928,4940,111,119,110,65,114,114,111,119,59,32768,8595,101,102,116,65,114,114,111,119,59,32768,8592,105,103,104,116,65,114,114,111,119,59,32768,8594,112,65,114,114,111,119,59,32768,8593,103,109,97,59,32768,931,97,108,108,67,105,114,99,108,101,59,32768,8728,112,102,59,32896,55349,56650,1091,4979,0,0,4983,116,59,32768,8730,97,114,101,1024,59,73,83,85,4994,4996,5010,5052,32768,9633,110,116,101,114,115,101,99,116,105,111,110,59,32768,8851,117,512,98,112,5016,5033,115,101,116,512,59,69,5024,5026,32768,8847,113,117,97,108,59,32768,8849,101,114,115,101,116,512,59,69,5043,5045,32768,8848,113,117,97,108,59,32768,8850,110,105,111,110,59,32768,8852,99,114,59,32896,55349,56494,97,114,59,32768,8902,1024,98,99,109,112,5079,5102,5155,5158,512,59,115,5084,5086,32768,8912,101,116,512,59,69,5093,5095,32768,8912,113,117,97,108,59,32768,8838,512,99,104,5107,5148,101,101,100,115,1024,59,69,83,84,5120,5122,5129,5141,32768,8827,113,117,97,108,59,32768,10928,108,97,110,116,69,113,117,97,108,59,32768,8829,105,108,100,101,59,32768,8831,84,104,97,116,59,32768,8715,59,32768,8721,768,59,101,115,5165,5167,5185,32768,8913,114,115,101,116,512,59,69,5176,5178,32768,8835,113,117,97,108,59,32768,8839,101,116,59,32768,8913,2816,72,82,83,97,99,102,104,105,111,114,115,5213,5221,5227,5241,5252,5274,5279,5323,5362,5368,5378,79,82,78,33024,222,59,32768,222,65,68,69,59,32768,8482,512,72,99,5232,5237,99,121,59,32768,1035,121,59,32768,1062,512,98,117,5246,5249,59,32768,9,59,32768,932,768,97,101,121,5259,5265,5271,114,111,110,59,32768,356,100,105,108,59,32768,354,59,32768,1058,114,59,32896,55349,56599,512,101,105,5284,5300,835,5289,0,5297,101,102,111,114,101,59,32768,8756,97,59,32768,920,512,99,110,5305,5315,107,83,112,97,99,101,59,32896,8287,8202,83,112,97,99,101,59,32768,8201,108,100,101,1024,59,69,70,84,5335,5337,5344,5355,32768,8764,113,117,97,108,59,32768,8771,117,108,108,69,113,117,97,108,59,32768,8773,105,108,100,101,59,32768,8776,112,102,59,32896,55349,56651,105,112,108,101,68,111,116,59,32768,8411,512,99,116,5383,5388,114,59,32896,55349,56495,114,111,107,59,32768,358,5426,5417,5444,5458,5473,0,5480,5485,0,0,0,0,0,5494,5500,5564,5579,0,5726,5732,5738,5745,512,99,114,5421,5429,117,116,101,33024,218,59,32768,218,114,512,59,111,5435,5437,32768,8607,99,105,114,59,32768,10569,114,820,5449,0,5453,121,59,32768,1038,118,101,59,32768,364,512,105,121,5462,5469,114,99,33024,219,59,32768,219,59,32768,1059,98,108,97,99,59,32768,368,114,59,32896,55349,56600,114,97,118,101,33024,217,59,32768,217,97,99,114,59,32768,362,512,100,105,5504,5548,101,114,512,66,80,5511,5535,512,97,114,5516,5520,114,59,32768,95,97,99,512,101,107,5527,5530,59,32768,9183,101,116,59,32768,9141,97,114,101,110,116,104,101,115,105,115,59,32768,9181,111,110,512,59,80,5555,5557,32768,8899,108,117,115,59,32768,8846,512,103,112,5568,5573,111,110,59,32768,370,102,59,32896,55349,56652,2048,65,68,69,84,97,100,112,115,5595,5624,5635,5648,5664,5671,5682,5712,114,114,111,119,768,59,66,68,5606,5608,5613,32768,8593,97,114,59,32768,10514,111,119,110,65,114,114,111,119,59,32768,8645,111,119,110,65,114,114,111,119,59,32768,8597,113,117,105,108,105,98,114,105,117,109,59,32768,10606,101,101,512,59,65,5655,5657,32768,8869,114,114,111,119,59,32768,8613,114,114,111,119,59,32768,8657,111,119,110,97,114,114,111,119,59,32768,8661,101,114,512,76,82,5689,5700,101,102,116,65,114,114,111,119,59,32768,8598,105,103,104,116,65,114,114,111,119,59,32768,8599,105,512,59,108,5718,5720,32768,978,111,110,59,32768,933,105,110,103,59,32768,366,99,114,59,32896,55349,56496,105,108,100,101,59,32768,360,109,108,33024,220,59,32768,220,2304,68,98,99,100,101,102,111,115,118,5770,5776,5781,5785,5798,5878,5883,5889,5895,97,115,104,59,32768,8875,97,114,59,32768,10987,121,59,32768,1042,97,115,104,512,59,108,5793,5795,32768,8873,59,32768,10982,512,101,114,5803,5806,59,32768,8897,768,98,116,121,5813,5818,5866,97,114,59,32768,8214,512,59,105,5823,5825,32768,8214,99,97,108,1024,66,76,83,84,5837,5842,5848,5859,97,114,59,32768,8739,105,110,101,59,32768,124,101,112,97,114,97,116,111,114,59,32768,10072,105,108,100,101,59,32768,8768,84,104,105,110,83,112,97,99,101,59,32768,8202,114,59,32896,55349,56601,112,102,59,32896,55349,56653,99,114,59,32896,55349,56497,100,97,115,104,59,32768,8874,1280,99,101,102,111,115,5913,5919,5925,5930,5936,105,114,99,59,32768,372,100,103,101,59,32768,8896,114,59,32896,55349,56602,112,102,59,32896,55349,56654,99,114,59,32896,55349,56498,1024,102,105,111,115,5951,5956,5959,5965,114,59,32896,55349,56603,59,32768,926,112,102,59,32896,55349,56655,99,114,59,32896,55349,56499,2304,65,73,85,97,99,102,111,115,117,5990,5995,6e3,6005,6014,6027,6032,6038,6044,99,121,59,32768,1071,99,121,59,32768,1031,99,121,59,32768,1070,99,117,116,101,33024,221,59,32768,221,512,105,121,6019,6024,114,99,59,32768,374,59,32768,1067,114,59,32896,55349,56604,112,102,59,32896,55349,56656,99,114,59,32896,55349,56500,109,108,59,32768,376,2048,72,97,99,100,101,102,111,115,6066,6071,6078,6092,6097,6119,6123,6128,99,121,59,32768,1046,99,117,116,101,59,32768,377,512,97,121,6083,6089,114,111,110,59,32768,381,59,32768,1047,111,116,59,32768,379,835,6102,0,6116,111,87,105,100,116,104,83,112,97,99,101,59,32768,8203,97,59,32768,918,114,59,32768,8488,112,102,59,32768,8484,99,114,59,32896,55349,56501,5938,6159,6168,6175,0,6214,6222,6233,0,0,0,0,6242,6267,6290,6429,6444,0,6495,6503,6531,6540,0,6547,99,117,116,101,33024,225,59,32768,225,114,101,118,101,59,32768,259,1536,59,69,100,105,117,121,6187,6189,6193,6196,6203,6210,32768,8766,59,32896,8766,819,59,32768,8767,114,99,33024,226,59,32768,226,116,101,33024,180,59,32768,180,59,32768,1072,108,105,103,33024,230,59,32768,230,512,59,114,6226,6228,32768,8289,59,32896,55349,56606,114,97,118,101,33024,224,59,32768,224,512,101,112,6246,6261,512,102,112,6251,6257,115,121,109,59,32768,8501,104,59,32768,8501,104,97,59,32768,945,512,97,112,6271,6284,512,99,108,6276,6280,114,59,32768,257,103,59,32768,10815,33024,38,59,32768,38,1077,6295,0,0,6326,1280,59,97,100,115,118,6305,6307,6312,6315,6322,32768,8743,110,100,59,32768,10837,59,32768,10844,108,111,112,101,59,32768,10840,59,32768,10842,1792,59,101,108,109,114,115,122,6340,6342,6345,6349,6391,6410,6422,32768,8736,59,32768,10660,101,59,32768,8736,115,100,512,59,97,6356,6358,32768,8737,2098,6368,6371,6374,6377,6380,6383,6386,6389,59,32768,10664,59,32768,10665,59,32768,10666,59,32768,10667,59,32768,10668,59,32768,10669,59,32768,10670,59,32768,10671,116,512,59,118,6397,6399,32768,8735,98,512,59,100,6405,6407,32768,8894,59,32768,10653,512,112,116,6415,6419,104,59,32768,8738,59,32768,197,97,114,114,59,32768,9084,512,103,112,6433,6438,111,110,59,32768,261,102,59,32896,55349,56658,1792,59,69,97,101,105,111,112,6458,6460,6463,6469,6472,6476,6480,32768,8776,59,32768,10864,99,105,114,59,32768,10863,59,32768,8778,100,59,32768,8779,115,59,32768,39,114,111,120,512,59,101,6488,6490,32768,8776,113,59,32768,8778,105,110,103,33024,229,59,32768,229,768,99,116,121,6509,6514,6517,114,59,32896,55349,56502,59,32768,42,109,112,512,59,101,6524,6526,32768,8776,113,59,32768,8781,105,108,100,101,33024,227,59,32768,227,109,108,33024,228,59,32768,228,512,99,105,6551,6559,111,110,105,110,116,59,32768,8755,110,116,59,32768,10769,4096,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,6597,6602,6673,6688,6701,6707,6768,6773,6891,6898,6999,7023,7309,7316,7334,7383,111,116,59,32768,10989,512,99,114,6607,6652,107,1024,99,101,112,115,6617,6623,6632,6639,111,110,103,59,32768,8780,112,115,105,108,111,110,59,32768,1014,114,105,109,101,59,32768,8245,105,109,512,59,101,6646,6648,32768,8765,113,59,32768,8909,583,6656,6661,101,101,59,32768,8893,101,100,512,59,103,6667,6669,32768,8965,101,59,32768,8965,114,107,512,59,116,6680,6682,32768,9141,98,114,107,59,32768,9142,512,111,121,6693,6698,110,103,59,32768,8780,59,32768,1073,113,117,111,59,32768,8222,1280,99,109,112,114,116,6718,6731,6738,6743,6749,97,117,115,512,59,101,6726,6728,32768,8757,59,32768,8757,112,116,121,118,59,32768,10672,115,105,59,32768,1014,110,111,117,59,32768,8492,768,97,104,119,6756,6759,6762,59,32768,946,59,32768,8502,101,101,110,59,32768,8812,114,59,32896,55349,56607,103,1792,99,111,115,116,117,118,119,6789,6809,6834,6850,6872,6879,6884,768,97,105,117,6796,6800,6805,112,59,32768,8898,114,99,59,32768,9711,112,59,32768,8899,768,100,112,116,6816,6821,6827,111,116,59,32768,10752,108,117,115,59,32768,10753,105,109,101,115,59,32768,10754,1090,6840,0,0,6846,99,117,112,59,32768,10758,97,114,59,32768,9733,114,105,97,110,103,108,101,512,100,117,6862,6868,111,119,110,59,32768,9661,112,59,32768,9651,112,108,117,115,59,32768,10756,101,101,59,32768,8897,101,100,103,101,59,32768,8896,97,114,111,119,59,32768,10509,768,97,107,111,6905,6976,6994,512,99,110,6910,6972,107,768,108,115,116,6918,6927,6935,111,122,101,110,103,101,59,32768,10731,113,117,97,114,101,59,32768,9642,114,105,97,110,103,108,101,1024,59,100,108,114,6951,6953,6959,6965,32768,9652,111,119,110,59,32768,9662,101,102,116,59,32768,9666,105,103,104,116,59,32768,9656,107,59,32768,9251,770,6981,0,6991,771,6985,0,6988,59,32768,9618,59,32768,9617,52,59,32768,9619,99,107,59,32768,9608,512,101,111,7004,7019,512,59,113,7009,7012,32896,61,8421,117,105,118,59,32896,8801,8421,116,59,32768,8976,1024,112,116,119,120,7032,7037,7049,7055,102,59,32896,55349,56659,512,59,116,7042,7044,32768,8869,111,109,59,32768,8869,116,105,101,59,32768,8904,3072,68,72,85,86,98,100,104,109,112,116,117,118,7080,7101,7126,7147,7182,7187,7208,7233,7240,7246,7253,7274,1024,76,82,108,114,7089,7092,7095,7098,59,32768,9559,59,32768,9556,59,32768,9558,59,32768,9555,1280,59,68,85,100,117,7112,7114,7117,7120,7123,32768,9552,59,32768,9574,59,32768,9577,59,32768,9572,59,32768,9575,1024,76,82,108,114,7135,7138,7141,7144,59,32768,9565,59,32768,9562,59,32768,9564,59,32768,9561,1792,59,72,76,82,104,108,114,7162,7164,7167,7170,7173,7176,7179,32768,9553,59,32768,9580,59,32768,9571,59,32768,9568,59,32768,9579,59,32768,9570,59,32768,9567,111,120,59,32768,10697,1024,76,82,108,114,7196,7199,7202,7205,59,32768,9557,59,32768,9554,59,32768,9488,59,32768,9484,1280,59,68,85,100,117,7219,7221,7224,7227,7230,32768,9472,59,32768,9573,59,32768,9576,59,32768,9516,59,32768,9524,105,110,117,115,59,32768,8863,108,117,115,59,32768,8862,105,109,101,115,59,32768,8864,1024,76,82,108,114,7262,7265,7268,7271,59,32768,9563,59,32768,9560,59,32768,9496,59,32768,9492,1792,59,72,76,82,104,108,114,7289,7291,7294,7297,7300,7303,7306,32768,9474,59,32768,9578,59,32768,9569,59,32768,9566,59,32768,9532,59,32768,9508,59,32768,9500,114,105,109,101,59,32768,8245,512,101,118,7321,7326,118,101,59,32768,728,98,97,114,33024,166,59,32768,166,1024,99,101,105,111,7343,7348,7353,7364,114,59,32896,55349,56503,109,105,59,32768,8271,109,512,59,101,7359,7361,32768,8765,59,32768,8909,108,768,59,98,104,7372,7374,7377,32768,92,59,32768,10693,115,117,98,59,32768,10184,573,7387,7399,108,512,59,101,7392,7394,32768,8226,116,59,32768,8226,112,768,59,69,101,7406,7408,7411,32768,8782,59,32768,10926,512,59,113,7416,7418,32768,8783,59,32768,8783,6450,7448,0,7523,7571,7576,7613,0,7618,7647,0,0,7764,0,0,7779,0,0,7899,7914,7949,7955,0,8158,0,8176,768,99,112,114,7454,7460,7509,117,116,101,59,32768,263,1536,59,97,98,99,100,115,7473,7475,7480,7487,7500,7505,32768,8745,110,100,59,32768,10820,114,99,117,112,59,32768,10825,512,97,117,7492,7496,112,59,32768,10827,112,59,32768,10823,111,116,59,32768,10816,59,32896,8745,65024,512,101,111,7514,7518,116,59,32768,8257,110,59,32768,711,1024,97,101,105,117,7531,7544,7552,7557,833,7536,0,7540,115,59,32768,10829,111,110,59,32768,269,100,105,108,33024,231,59,32768,231,114,99,59,32768,265,112,115,512,59,115,7564,7566,32768,10828,109,59,32768,10832,111,116,59,32768,267,768,100,109,110,7582,7589,7596,105,108,33024,184,59,32768,184,112,116,121,118,59,32768,10674,116,33280,162,59,101,7603,7605,32768,162,114,100,111,116,59,32768,183,114,59,32896,55349,56608,768,99,101,105,7624,7628,7643,121,59,32768,1095,99,107,512,59,109,7635,7637,32768,10003,97,114,107,59,32768,10003,59,32768,967,114,1792,59,69,99,101,102,109,115,7662,7664,7667,7742,7745,7752,7757,32768,9675,59,32768,10691,768,59,101,108,7674,7676,7680,32768,710,113,59,32768,8791,101,1074,7687,0,0,7709,114,114,111,119,512,108,114,7695,7701,101,102,116,59,32768,8634,105,103,104,116,59,32768,8635,1280,82,83,97,99,100,7719,7722,7725,7730,7736,59,32768,174,59,32768,9416,115,116,59,32768,8859,105,114,99,59,32768,8858,97,115,104,59,32768,8861,59,32768,8791,110,105,110,116,59,32768,10768,105,100,59,32768,10991,99,105,114,59,32768,10690,117,98,115,512,59,117,7771,7773,32768,9827,105,116,59,32768,9827,1341,7785,7804,7850,0,7871,111,110,512,59,101,7791,7793,32768,58,512,59,113,7798,7800,32768,8788,59,32768,8788,1086,7809,0,0,7820,97,512,59,116,7814,7816,32768,44,59,32768,64,768,59,102,108,7826,7828,7832,32768,8705,110,59,32768,8728,101,512,109,120,7838,7844,101,110,116,59,32768,8705,101,115,59,32768,8450,824,7854,0,7866,512,59,100,7858,7860,32768,8773,111,116,59,32768,10861,110,116,59,32768,8750,768,102,114,121,7877,7881,7886,59,32896,55349,56660,111,100,59,32768,8720,33280,169,59,115,7892,7894,32768,169,114,59,32768,8471,512,97,111,7903,7908,114,114,59,32768,8629,115,115,59,32768,10007,512,99,117,7918,7923,114,59,32896,55349,56504,512,98,112,7928,7938,512,59,101,7933,7935,32768,10959,59,32768,10961,512,59,101,7943,7945,32768,10960,59,32768,10962,100,111,116,59,32768,8943,1792,100,101,108,112,114,118,119,7969,7983,7996,8009,8057,8147,8152,97,114,114,512,108,114,7977,7980,59,32768,10552,59,32768,10549,1089,7989,0,0,7993,114,59,32768,8926,99,59,32768,8927,97,114,114,512,59,112,8004,8006,32768,8630,59,32768,10557,1536,59,98,99,100,111,115,8022,8024,8031,8044,8049,8053,32768,8746,114,99,97,112,59,32768,10824,512,97,117,8036,8040,112,59,32768,10822,112,59,32768,10826,111,116,59,32768,8845,114,59,32768,10821,59,32896,8746,65024,1024,97,108,114,118,8066,8078,8116,8123,114,114,512,59,109,8073,8075,32768,8631,59,32768,10556,121,768,101,118,119,8086,8104,8109,113,1089,8093,0,0,8099,114,101,99,59,32768,8926,117,99,99,59,32768,8927,101,101,59,32768,8910,101,100,103,101,59,32768,8911,101,110,33024,164,59,32768,164,101,97,114,114,111,119,512,108,114,8134,8140,101,102,116,59,32768,8630,105,103,104,116,59,32768,8631,101,101,59,32768,8910,101,100,59,32768,8911,512,99,105,8162,8170,111,110,105,110,116,59,32768,8754,110,116,59,32768,8753,108,99,116,121,59,32768,9005,4864,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8221,8226,8231,8267,8282,8296,8327,8351,8366,8379,8466,8471,8487,8621,8647,8676,8697,8712,8720,114,114,59,32768,8659,97,114,59,32768,10597,1024,103,108,114,115,8240,8246,8252,8256,103,101,114,59,32768,8224,101,116,104,59,32768,8504,114,59,32768,8595,104,512,59,118,8262,8264,32768,8208,59,32768,8867,572,8271,8278,97,114,111,119,59,32768,10511,97,99,59,32768,733,512,97,121,8287,8293,114,111,110,59,32768,271,59,32768,1076,768,59,97,111,8303,8305,8320,32768,8518,512,103,114,8310,8316,103,101,114,59,32768,8225,114,59,32768,8650,116,115,101,113,59,32768,10871,768,103,108,109,8334,8339,8344,33024,176,59,32768,176,116,97,59,32768,948,112,116,121,118,59,32768,10673,512,105,114,8356,8362,115,104,116,59,32768,10623,59,32896,55349,56609,97,114,512,108,114,8373,8376,59,32768,8643,59,32768,8642,1280,97,101,103,115,118,8390,8418,8421,8428,8433,109,768,59,111,115,8398,8400,8415,32768,8900,110,100,512,59,115,8407,8409,32768,8900,117,105,116,59,32768,9830,59,32768,9830,59,32768,168,97,109,109,97,59,32768,989,105,110,59,32768,8946,768,59,105,111,8440,8442,8461,32768,247,100,101,33280,247,59,111,8450,8452,32768,247,110,116,105,109,101,115,59,32768,8903,110,120,59,32768,8903,99,121,59,32768,1106,99,1088,8478,0,0,8483,114,110,59,32768,8990,111,112,59,32768,8973,1280,108,112,116,117,119,8498,8504,8509,8556,8570,108,97,114,59,32768,36,102,59,32896,55349,56661,1280,59,101,109,112,115,8520,8522,8535,8542,8548,32768,729,113,512,59,100,8528,8530,32768,8784,111,116,59,32768,8785,105,110,117,115,59,32768,8760,108,117,115,59,32768,8724,113,117,97,114,101,59,32768,8865,98,108,101,98,97,114,119,101,100,103,101,59,32768,8966,110,768,97,100,104,8578,8585,8597,114,114,111,119,59,32768,8595,111,119,110,97,114,114,111,119,115,59,32768,8650,97,114,112,111,111,110,512,108,114,8608,8614,101,102,116,59,32768,8643,105,103,104,116,59,32768,8642,563,8625,8633,107,97,114,111,119,59,32768,10512,1088,8638,0,0,8643,114,110,59,32768,8991,111,112,59,32768,8972,768,99,111,116,8654,8666,8670,512,114,121,8659,8663,59,32896,55349,56505,59,32768,1109,108,59,32768,10742,114,111,107,59,32768,273,512,100,114,8681,8686,111,116,59,32768,8945,105,512,59,102,8692,8694,32768,9663,59,32768,9662,512,97,104,8702,8707,114,114,59,32768,8693,97,114,59,32768,10607,97,110,103,108,101,59,32768,10662,512,99,105,8725,8729,121,59,32768,1119,103,114,97,114,114,59,32768,10239,4608,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,8774,8788,8807,8844,8849,8852,8866,8895,8929,8977,8989,9004,9046,9136,9151,9171,9184,9199,512,68,111,8779,8784,111,116,59,32768,10871,116,59,32768,8785,512,99,115,8793,8801,117,116,101,33024,233,59,32768,233,116,101,114,59,32768,10862,1024,97,105,111,121,8816,8822,8835,8841,114,111,110,59,32768,283,114,512,59,99,8828,8830,32768,8790,33024,234,59,32768,234,108,111,110,59,32768,8789,59,32768,1101,111,116,59,32768,279,59,32768,8519,512,68,114,8857,8862,111,116,59,32768,8786,59,32896,55349,56610,768,59,114,115,8873,8875,8883,32768,10906,97,118,101,33024,232,59,32768,232,512,59,100,8888,8890,32768,10902,111,116,59,32768,10904,1024,59,105,108,115,8904,8906,8914,8917,32768,10905,110,116,101,114,115,59,32768,9191,59,32768,8467,512,59,100,8922,8924,32768,10901,111,116,59,32768,10903,768,97,112,115,8936,8941,8960,99,114,59,32768,275,116,121,768,59,115,118,8950,8952,8957,32768,8709,101,116,59,32768,8709,59,32768,8709,112,512,49,59,8966,8975,516,8970,8973,59,32768,8196,59,32768,8197,32768,8195,512,103,115,8982,8985,59,32768,331,112,59,32768,8194,512,103,112,8994,8999,111,110,59,32768,281,102,59,32896,55349,56662,768,97,108,115,9011,9023,9028,114,512,59,115,9017,9019,32768,8917,108,59,32768,10723,117,115,59,32768,10865,105,768,59,108,118,9036,9038,9043,32768,949,111,110,59,32768,949,59,32768,1013,1024,99,115,117,118,9055,9071,9099,9128,512,105,111,9060,9065,114,99,59,32768,8790,108,111,110,59,32768,8789,1082,9077,0,0,9081,109,59,32768,8770,97,110,116,512,103,108,9088,9093,116,114,59,32768,10902,101,115,115,59,32768,10901,768,97,101,105,9106,9111,9116,108,115,59,32768,61,115,116,59,32768,8799,118,512,59,68,9122,9124,32768,8801,68,59,32768,10872,112,97,114,115,108,59,32768,10725,512,68,97,9141,9146,111,116,59,32768,8787,114,114,59,32768,10609,768,99,100,105,9158,9162,9167,114,59,32768,8495,111,116,59,32768,8784,109,59,32768,8770,512,97,104,9176,9179,59,32768,951,33024,240,59,32768,240,512,109,114,9189,9195,108,33024,235,59,32768,235,111,59,32768,8364,768,99,105,112,9206,9210,9215,108,59,32768,33,115,116,59,32768,8707,512,101,111,9220,9230,99,116,97,116,105,111,110,59,32768,8496,110,101,110,116,105,97,108,101,59,32768,8519,4914,9262,0,9276,0,9280,9287,0,0,9318,9324,0,9331,0,9352,9357,9386,0,9395,9497,108,108,105,110,103,100,111,116,115,101,113,59,32768,8786,121,59,32768,1092,109,97,108,101,59,32768,9792,768,105,108,114,9293,9299,9313,108,105,103,59,32768,64259,1082,9305,0,0,9309,103,59,32768,64256,105,103,59,32768,64260,59,32896,55349,56611,108,105,103,59,32768,64257,108,105,103,59,32896,102,106,768,97,108,116,9337,9341,9346,116,59,32768,9837,105,103,59,32768,64258,110,115,59,32768,9649,111,102,59,32768,402,833,9361,0,9366,102,59,32896,55349,56663,512,97,107,9370,9375,108,108,59,32768,8704,512,59,118,9380,9382,32768,8916,59,32768,10969,97,114,116,105,110,116,59,32768,10765,512,97,111,9399,9491,512,99,115,9404,9487,1794,9413,9443,9453,9470,9474,0,9484,1795,9421,9426,9429,9434,9437,0,9440,33024,189,59,32768,189,59,32768,8531,33024,188,59,32768,188,59,32768,8533,59,32768,8537,59,32768,8539,772,9447,0,9450,59,32768,8532,59,32768,8534,1285,9459,9464,0,0,9467,33024,190,59,32768,190,59,32768,8535,59,32768,8540,53,59,32768,8536,775,9478,0,9481,59,32768,8538,59,32768,8541,56,59,32768,8542,108,59,32768,8260,119,110,59,32768,8994,99,114,59,32896,55349,56507,4352,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,9537,9547,9575,9582,9595,9600,9679,9684,9694,9700,9705,9725,9773,9779,9785,9810,9917,512,59,108,9542,9544,32768,8807,59,32768,10892,768,99,109,112,9554,9560,9572,117,116,101,59,32768,501,109,97,512,59,100,9567,9569,32768,947,59,32768,989,59,32768,10886,114,101,118,101,59,32768,287,512,105,121,9587,9592,114,99,59,32768,285,59,32768,1075,111,116,59,32768,289,1024,59,108,113,115,9609,9611,9614,9633,32768,8805,59,32768,8923,768,59,113,115,9621,9623,9626,32768,8805,59,32768,8807,108,97,110,116,59,32768,10878,1024,59,99,100,108,9642,9644,9648,9667,32768,10878,99,59,32768,10921,111,116,512,59,111,9655,9657,32768,10880,512,59,108,9662,9664,32768,10882,59,32768,10884,512,59,101,9672,9675,32896,8923,65024,115,59,32768,10900,114,59,32896,55349,56612,512,59,103,9689,9691,32768,8811,59,32768,8921,109,101,108,59,32768,8503,99,121,59,32768,1107,1024,59,69,97,106,9714,9716,9719,9722,32768,8823,59,32768,10898,59,32768,10917,59,32768,10916,1024,69,97,101,115,9734,9737,9751,9768,59,32768,8809,112,512,59,112,9743,9745,32768,10890,114,111,120,59,32768,10890,512,59,113,9756,9758,32768,10888,512,59,113,9763,9765,32768,10888,59,32768,8809,105,109,59,32768,8935,112,102,59,32896,55349,56664,97,118,101,59,32768,96,512,99,105,9790,9794,114,59,32768,8458,109,768,59,101,108,9802,9804,9807,32768,8819,59,32768,10894,59,32768,10896,34304,62,59,99,100,108,113,114,9824,9826,9838,9843,9849,9856,32768,62,512,99,105,9831,9834,59,32768,10919,114,59,32768,10874,111,116,59,32768,8919,80,97,114,59,32768,10645,117,101,115,116,59,32768,10876,1280,97,100,101,108,115,9867,9882,9887,9906,9912,833,9872,0,9879,112,114,111,120,59,32768,10886,114,59,32768,10616,111,116,59,32768,8919,113,512,108,113,9893,9899,101,115,115,59,32768,8923,108,101,115,115,59,32768,10892,101,115,115,59,32768,8823,105,109,59,32768,8819,512,101,110,9922,9932,114,116,110,101,113,113,59,32896,8809,65024,69,59,32896,8809,65024,2560,65,97,98,99,101,102,107,111,115,121,9958,9963,10015,10020,10026,10060,10065,10085,10147,10171,114,114,59,32768,8660,1024,105,108,109,114,9972,9978,9982,9988,114,115,112,59,32768,8202,102,59,32768,189,105,108,116,59,32768,8459,512,100,114,9993,9998,99,121,59,32768,1098,768,59,99,119,10005,10007,10012,32768,8596,105,114,59,32768,10568,59,32768,8621,97,114,59,32768,8463,105,114,99,59,32768,293,768,97,108,114,10033,10048,10054,114,116,115,512,59,117,10041,10043,32768,9829,105,116,59,32768,9829,108,105,112,59,32768,8230,99,111,110,59,32768,8889,114,59,32896,55349,56613,115,512,101,119,10071,10078,97,114,111,119,59,32768,10533,97,114,111,119,59,32768,10534,1280,97,109,111,112,114,10096,10101,10107,10136,10141,114,114,59,32768,8703,116,104,116,59,32768,8763,107,512,108,114,10113,10124,101,102,116,97,114,114,111,119,59,32768,8617,105,103,104,116,97,114,114,111,119,59,32768,8618,102,59,32896,55349,56665,98,97,114,59,32768,8213,768,99,108,116,10154,10159,10165,114,59,32896,55349,56509,97,115,104,59,32768,8463,114,111,107,59,32768,295,512,98,112,10176,10182,117,108,108,59,32768,8259,104,101,110,59,32768,8208,5426,10211,0,10220,0,10239,10255,10267,0,10276,10312,0,0,10318,10371,10458,10485,10491,0,10500,10545,10558,99,117,116,101,33024,237,59,32768,237,768,59,105,121,10226,10228,10235,32768,8291,114,99,33024,238,59,32768,238,59,32768,1080,512,99,120,10243,10247,121,59,32768,1077,99,108,33024,161,59,32768,161,512,102,114,10259,10262,59,32768,8660,59,32896,55349,56614,114,97,118,101,33024,236,59,32768,236,1024,59,105,110,111,10284,10286,10300,10306,32768,8520,512,105,110,10291,10296,110,116,59,32768,10764,116,59,32768,8749,102,105,110,59,32768,10716,116,97,59,32768,8489,108,105,103,59,32768,307,768,97,111,112,10324,10361,10365,768,99,103,116,10331,10335,10357,114,59,32768,299,768,101,108,112,10342,10345,10351,59,32768,8465,105,110,101,59,32768,8464,97,114,116,59,32768,8465,104,59,32768,305,102,59,32768,8887,101,100,59,32768,437,1280,59,99,102,111,116,10381,10383,10389,10403,10409,32768,8712,97,114,101,59,32768,8453,105,110,512,59,116,10396,10398,32768,8734,105,101,59,32768,10717,100,111,116,59,32768,305,1280,59,99,101,108,112,10420,10422,10427,10444,10451,32768,8747,97,108,59,32768,8890,512,103,114,10432,10438,101,114,115,59,32768,8484,99,97,108,59,32768,8890,97,114,104,107,59,32768,10775,114,111,100,59,32768,10812,1024,99,103,112,116,10466,10470,10475,10480,121,59,32768,1105,111,110,59,32768,303,102,59,32896,55349,56666,97,59,32768,953,114,111,100,59,32768,10812,117,101,115,116,33024,191,59,32768,191,512,99,105,10504,10509,114,59,32896,55349,56510,110,1280,59,69,100,115,118,10521,10523,10526,10531,10541,32768,8712,59,32768,8953,111,116,59,32768,8949,512,59,118,10536,10538,32768,8948,59,32768,8947,59,32768,8712,512,59,105,10549,10551,32768,8290,108,100,101,59,32768,297,828,10562,0,10567,99,121,59,32768,1110,108,33024,239,59,32768,239,1536,99,102,109,111,115,117,10585,10598,10603,10609,10615,10630,512,105,121,10590,10595,114,99,59,32768,309,59,32768,1081,114,59,32896,55349,56615,97,116,104,59,32768,567,112,102,59,32896,55349,56667,820,10620,0,10625,114,59,32896,55349,56511,114,99,121,59,32768,1112,107,99,121,59,32768,1108,2048,97,99,102,103,104,106,111,115,10653,10666,10680,10685,10692,10697,10702,10708,112,112,97,512,59,118,10661,10663,32768,954,59,32768,1008,512,101,121,10671,10677,100,105,108,59,32768,311,59,32768,1082,114,59,32896,55349,56616,114,101,101,110,59,32768,312,99,121,59,32768,1093,99,121,59,32768,1116,112,102,59,32896,55349,56668,99,114,59,32896,55349,56512,5888,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,10761,10783,10789,10799,10804,10957,11011,11047,11094,11349,11372,11382,11409,11414,11451,11478,11526,11698,11711,11755,11823,11910,11929,768,97,114,116,10768,10773,10777,114,114,59,32768,8666,114,59,32768,8656,97,105,108,59,32768,10523,97,114,114,59,32768,10510,512,59,103,10794,10796,32768,8806,59,32768,10891,97,114,59,32768,10594,4660,10824,0,10830,0,10838,0,0,0,0,0,10844,10850,0,10867,10870,10877,0,10933,117,116,101,59,32768,314,109,112,116,121,118,59,32768,10676,114,97,110,59,32768,8466,98,100,97,59,32768,955,103,768,59,100,108,10857,10859,10862,32768,10216,59,32768,10641,101,59,32768,10216,59,32768,10885,117,111,33024,171,59,32768,171,114,2048,59,98,102,104,108,112,115,116,10894,10896,10907,10911,10915,10919,10923,10928,32768,8592,512,59,102,10901,10903,32768,8676,115,59,32768,10527,115,59,32768,10525,107,59,32768,8617,112,59,32768,8619,108,59,32768,10553,105,109,59,32768,10611,108,59,32768,8610,768,59,97,101,10939,10941,10946,32768,10923,105,108,59,32768,10521,512,59,115,10951,10953,32768,10925,59,32896,10925,65024,768,97,98,114,10964,10969,10974,114,114,59,32768,10508,114,107,59,32768,10098,512,97,107,10979,10991,99,512,101,107,10985,10988,59,32768,123,59,32768,91,512,101,115,10996,10999,59,32768,10635,108,512,100,117,11005,11008,59,32768,10639,59,32768,10637,1024,97,101,117,121,11020,11026,11040,11044,114,111,110,59,32768,318,512,100,105,11031,11036,105,108,59,32768,316,108,59,32768,8968,98,59,32768,123,59,32768,1083,1024,99,113,114,115,11056,11060,11072,11090,97,59,32768,10550,117,111,512,59,114,11067,11069,32768,8220,59,32768,8222,512,100,117,11077,11083,104,97,114,59,32768,10599,115,104,97,114,59,32768,10571,104,59,32768,8626,1280,59,102,103,113,115,11105,11107,11228,11231,11250,32768,8804,116,1280,97,104,108,114,116,11119,11136,11157,11169,11216,114,114,111,119,512,59,116,11128,11130,32768,8592,97,105,108,59,32768,8610,97,114,112,111,111,110,512,100,117,11147,11153,111,119,110,59,32768,8637,112,59,32768,8636,101,102,116,97,114,114,111,119,115,59,32768,8647,105,103,104,116,768,97,104,115,11180,11194,11204,114,114,111,119,512,59,115,11189,11191,32768,8596,59,32768,8646,97,114,112,111,111,110,115,59,32768,8651,113,117,105,103,97,114,114,111,119,59,32768,8621,104,114,101,101,116,105,109,101,115,59,32768,8907,59,32768,8922,768,59,113,115,11238,11240,11243,32768,8804,59,32768,8806,108,97,110,116,59,32768,10877,1280,59,99,100,103,115,11261,11263,11267,11286,11298,32768,10877,99,59,32768,10920,111,116,512,59,111,11274,11276,32768,10879,512,59,114,11281,11283,32768,10881,59,32768,10883,512,59,101,11291,11294,32896,8922,65024,115,59,32768,10899,1280,97,100,101,103,115,11309,11317,11322,11339,11344,112,112,114,111,120,59,32768,10885,111,116,59,32768,8918,113,512,103,113,11328,11333,116,114,59,32768,8922,103,116,114,59,32768,10891,116,114,59,32768,8822,105,109,59,32768,8818,768,105,108,114,11356,11362,11368,115,104,116,59,32768,10620,111,111,114,59,32768,8970,59,32896,55349,56617,512,59,69,11377,11379,32768,8822,59,32768,10897,562,11386,11405,114,512,100,117,11391,11394,59,32768,8637,512,59,108,11399,11401,32768,8636,59,32768,10602,108,107,59,32768,9604,99,121,59,32768,1113,1280,59,97,99,104,116,11425,11427,11432,11440,11446,32768,8810,114,114,59,32768,8647,111,114,110,101,114,59,32768,8990,97,114,100,59,32768,10603,114,105,59,32768,9722,512,105,111,11456,11462,100,111,116,59,32768,320,117,115,116,512,59,97,11470,11472,32768,9136,99,104,101,59,32768,9136,1024,69,97,101,115,11487,11490,11504,11521,59,32768,8808,112,512,59,112,11496,11498,32768,10889,114,111,120,59,32768,10889,512,59,113,11509,11511,32768,10887,512,59,113,11516,11518,32768,10887,59,32768,8808,105,109,59,32768,8934,2048,97,98,110,111,112,116,119,122,11543,11556,11561,11616,11640,11660,11667,11680,512,110,114,11548,11552,103,59,32768,10220,114,59,32768,8701,114,107,59,32768,10214,103,768,108,109,114,11569,11596,11604,101,102,116,512,97,114,11577,11584,114,114,111,119,59,32768,10229,105,103,104,116,97,114,114,111,119,59,32768,10231,97,112,115,116,111,59,32768,10236,105,103,104,116,97,114,114,111,119,59,32768,10230,112,97,114,114,111,119,512,108,114,11627,11633,101,102,116,59,32768,8619,105,103,104,116,59,32768,8620,768,97,102,108,11647,11651,11655,114,59,32768,10629,59,32896,55349,56669,117,115,59,32768,10797,105,109,101,115,59,32768,10804,562,11671,11676,115,116,59,32768,8727,97,114,59,32768,95,768,59,101,102,11687,11689,11695,32768,9674,110,103,101,59,32768,9674,59,32768,10731,97,114,512,59,108,11705,11707,32768,40,116,59,32768,10643,1280,97,99,104,109,116,11722,11727,11735,11747,11750,114,114,59,32768,8646,111,114,110,101,114,59,32768,8991,97,114,512,59,100,11742,11744,32768,8651,59,32768,10605,59,32768,8206,114,105,59,32768,8895,1536,97,99,104,105,113,116,11768,11774,11779,11782,11798,11817,113,117,111,59,32768,8249,114,59,32896,55349,56513,59,32768,8624,109,768,59,101,103,11790,11792,11795,32768,8818,59,32768,10893,59,32768,10895,512,98,117,11803,11806,59,32768,91,111,512,59,114,11812,11814,32768,8216,59,32768,8218,114,111,107,59,32768,322,34816,60,59,99,100,104,105,108,113,114,11841,11843,11855,11860,11866,11872,11878,11885,32768,60,512,99,105,11848,11851,59,32768,10918,114,59,32768,10873,111,116,59,32768,8918,114,101,101,59,32768,8907,109,101,115,59,32768,8905,97,114,114,59,32768,10614,117,101,115,116,59,32768,10875,512,80,105,11890,11895,97,114,59,32768,10646,768,59,101,102,11902,11904,11907,32768,9667,59,32768,8884,59,32768,9666,114,512,100,117,11916,11923,115,104,97,114,59,32768,10570,104,97,114,59,32768,10598,512,101,110,11934,11944,114,116,110,101,113,113,59,32896,8808,65024,69,59,32896,8808,65024,3584,68,97,99,100,101,102,104,105,108,110,111,112,115,117,11978,11984,12061,12075,12081,12095,12100,12104,12170,12181,12188,12204,12207,12223,68,111,116,59,32768,8762,1024,99,108,112,114,11993,11999,12019,12055,114,33024,175,59,32768,175,512,101,116,12004,12007,59,32768,9794,512,59,101,12012,12014,32768,10016,115,101,59,32768,10016,512,59,115,12024,12026,32768,8614,116,111,1024,59,100,108,117,12037,12039,12045,12051,32768,8614,111,119,110,59,32768,8615,101,102,116,59,32768,8612,112,59,32768,8613,107,101,114,59,32768,9646,512,111,121,12066,12072,109,109,97,59,32768,10793,59,32768,1084,97,115,104,59,32768,8212,97,115,117,114,101,100,97,110,103,108,101,59,32768,8737,114,59,32896,55349,56618,111,59,32768,8487,768,99,100,110,12111,12118,12146,114,111,33024,181,59,32768,181,1024,59,97,99,100,12127,12129,12134,12139,32768,8739,115,116,59,32768,42,105,114,59,32768,10992,111,116,33024,183,59,32768,183,117,115,768,59,98,100,12155,12157,12160,32768,8722,59,32768,8863,512,59,117,12165,12167,32768,8760,59,32768,10794,564,12174,12178,112,59,32768,10971,114,59,32768,8230,112,108,117,115,59,32768,8723,512,100,112,12193,12199,101,108,115,59,32768,8871,102,59,32896,55349,56670,59,32768,8723,512,99,116,12212,12217,114,59,32896,55349,56514,112,111,115,59,32768,8766,768,59,108,109,12230,12232,12240,32768,956,116,105,109,97,112,59,32768,8888,97,112,59,32768,8888,6144,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,12294,12315,12364,12376,12393,12472,12496,12547,12553,12636,12641,12703,12725,12747,12752,12876,12881,12957,13033,13089,13294,13359,13384,13499,512,103,116,12299,12303,59,32896,8921,824,512,59,118,12308,12311,32896,8811,8402,59,32896,8811,824,768,101,108,116,12322,12348,12352,102,116,512,97,114,12329,12336,114,114,111,119,59,32768,8653,105,103,104,116,97,114,114,111,119,59,32768,8654,59,32896,8920,824,512,59,118,12357,12360,32896,8810,8402,59,32896,8810,824,105,103,104,116,97,114,114,111,119,59,32768,8655,512,68,100,12381,12387,97,115,104,59,32768,8879,97,115,104,59,32768,8878,1280,98,99,110,112,116,12404,12409,12415,12420,12452,108,97,59,32768,8711,117,116,101,59,32768,324,103,59,32896,8736,8402,1280,59,69,105,111,112,12431,12433,12437,12442,12446,32768,8777,59,32896,10864,824,100,59,32896,8779,824,115,59,32768,329,114,111,120,59,32768,8777,117,114,512,59,97,12459,12461,32768,9838,108,512,59,115,12467,12469,32768,9838,59,32768,8469,836,12477,0,12483,112,33024,160,59,32768,160,109,112,512,59,101,12489,12492,32896,8782,824,59,32896,8783,824,1280,97,101,111,117,121,12507,12519,12525,12540,12544,833,12512,0,12515,59,32768,10819,111,110,59,32768,328,100,105,108,59,32768,326,110,103,512,59,100,12532,12534,32768,8775,111,116,59,32896,10861,824,112,59,32768,10818,59,32768,1085,97,115,104,59,32768,8211,1792,59,65,97,100,113,115,120,12568,12570,12575,12596,12602,12608,12623,32768,8800,114,114,59,32768,8663,114,512,104,114,12581,12585,107,59,32768,10532,512,59,111,12590,12592,32768,8599,119,59,32768,8599,111,116,59,32896,8784,824,117,105,118,59,32768,8802,512,101,105,12613,12618,97,114,59,32768,10536,109,59,32896,8770,824,105,115,116,512,59,115,12631,12633,32768,8708,59,32768,8708,114,59,32896,55349,56619,1024,69,101,115,116,12650,12654,12688,12693,59,32896,8807,824,768,59,113,115,12661,12663,12684,32768,8817,768,59,113,115,12670,12672,12676,32768,8817,59,32896,8807,824,108,97,110,116,59,32896,10878,824,59,32896,10878,824,105,109,59,32768,8821,512,59,114,12698,12700,32768,8815,59,32768,8815,768,65,97,112,12710,12715,12720,114,114,59,32768,8654,114,114,59,32768,8622,97,114,59,32768,10994,768,59,115,118,12732,12734,12744,32768,8715,512,59,100,12739,12741,32768,8956,59,32768,8954,59,32768,8715,99,121,59,32768,1114,1792,65,69,97,100,101,115,116,12767,12772,12776,12781,12785,12853,12858,114,114,59,32768,8653,59,32896,8806,824,114,114,59,32768,8602,114,59,32768,8229,1024,59,102,113,115,12794,12796,12821,12842,32768,8816,116,512,97,114,12802,12809,114,114,111,119,59,32768,8602,105,103,104,116,97,114,114,111,119,59,32768,8622,768,59,113,115,12828,12830,12834,32768,8816,59,32896,8806,824,108,97,110,116,59,32896,10877,824,512,59,115,12847,12850,32896,10877,824,59,32768,8814,105,109,59,32768,8820,512,59,114,12863,12865,32768,8814,105,512,59,101,12871,12873,32768,8938,59,32768,8940,105,100,59,32768,8740,512,112,116,12886,12891,102,59,32896,55349,56671,33536,172,59,105,110,12899,12901,12936,32768,172,110,1024,59,69,100,118,12911,12913,12917,12923,32768,8713,59,32896,8953,824,111,116,59,32896,8949,824,818,12928,12931,12934,59,32768,8713,59,32768,8951,59,32768,8950,105,512,59,118,12942,12944,32768,8716,818,12949,12952,12955,59,32768,8716,59,32768,8958,59,32768,8957,768,97,111,114,12964,12992,12999,114,1024,59,97,115,116,12974,12976,12983,12988,32768,8742,108,108,101,108,59,32768,8742,108,59,32896,11005,8421,59,32896,8706,824,108,105,110,116,59,32768,10772,768,59,99,101,13006,13008,13013,32768,8832,117,101,59,32768,8928,512,59,99,13018,13021,32896,10927,824,512,59,101,13026,13028,32768,8832,113,59,32896,10927,824,1024,65,97,105,116,13042,13047,13066,13077,114,114,59,32768,8655,114,114,768,59,99,119,13056,13058,13062,32768,8603,59,32896,10547,824,59,32896,8605,824,103,104,116,97,114,114,111,119,59,32768,8603,114,105,512,59,101,13084,13086,32768,8939,59,32768,8941,1792,99,104,105,109,112,113,117,13104,13128,13151,13169,13174,13179,13194,1024,59,99,101,114,13113,13115,13120,13124,32768,8833,117,101,59,32768,8929,59,32896,10928,824,59,32896,55349,56515,111,114,116,1086,13137,0,0,13142,105,100,59,32768,8740,97,114,97,108,108,101,108,59,32768,8742,109,512,59,101,13157,13159,32768,8769,512,59,113,13164,13166,32768,8772,59,32768,8772,105,100,59,32768,8740,97,114,59,32768,8742,115,117,512,98,112,13186,13190,101,59,32768,8930,101,59,32768,8931,768,98,99,112,13201,13241,13254,1024,59,69,101,115,13210,13212,13216,13219,32768,8836,59,32896,10949,824,59,32768,8840,101,116,512,59,101,13226,13229,32896,8834,8402,113,512,59,113,13235,13237,32768,8840,59,32896,10949,824,99,512,59,101,13247,13249,32768,8833,113,59,32896,10928,824,1024,59,69,101,115,13263,13265,13269,13272,32768,8837,59,32896,10950,824,59,32768,8841,101,116,512,59,101,13279,13282,32896,8835,8402,113,512,59,113,13288,13290,32768,8841,59,32896,10950,824,1024,103,105,108,114,13303,13307,13315,13319,108,59,32768,8825,108,100,101,33024,241,59,32768,241,103,59,32768,8824,105,97,110,103,108,101,512,108,114,13330,13344,101,102,116,512,59,101,13338,13340,32768,8938,113,59,32768,8940,105,103,104,116,512,59,101,13353,13355,32768,8939,113,59,32768,8941,512,59,109,13364,13366,32768,957,768,59,101,115,13373,13375,13380,32768,35,114,111,59,32768,8470,112,59,32768,8199,2304,68,72,97,100,103,105,108,114,115,13403,13409,13415,13420,13426,13439,13446,13476,13493,97,115,104,59,32768,8877,97,114,114,59,32768,10500,112,59,32896,8781,8402,97,115,104,59,32768,8876,512,101,116,13431,13435,59,32896,8805,8402,59,32896,62,8402,110,102,105,110,59,32768,10718,768,65,101,116,13453,13458,13462,114,114,59,32768,10498,59,32896,8804,8402,512,59,114,13467,13470,32896,60,8402,105,101,59,32896,8884,8402,512,65,116,13481,13486,114,114,59,32768,10499,114,105,101,59,32896,8885,8402,105,109,59,32896,8764,8402,768,65,97,110,13506,13511,13532,114,114,59,32768,8662,114,512,104,114,13517,13521,107,59,32768,10531,512,59,111,13526,13528,32768,8598,119,59,32768,8598,101,97,114,59,32768,10535,9252,13576,0,0,0,0,0,0,0,0,0,0,0,0,0,13579,0,13596,13617,13653,13659,13673,13695,13708,0,0,13713,13750,0,13788,13794,0,13815,13890,13913,13937,13944,59,32768,9416,512,99,115,13583,13591,117,116,101,33024,243,59,32768,243,116,59,32768,8859,512,105,121,13600,13613,114,512,59,99,13606,13608,32768,8858,33024,244,59,32768,244,59,32768,1086,1280,97,98,105,111,115,13627,13632,13638,13642,13646,115,104,59,32768,8861,108,97,99,59,32768,337,118,59,32768,10808,116,59,32768,8857,111,108,100,59,32768,10684,108,105,103,59,32768,339,512,99,114,13663,13668,105,114,59,32768,10687,59,32896,55349,56620,1600,13680,0,0,13684,0,13692,110,59,32768,731,97,118,101,33024,242,59,32768,242,59,32768,10689,512,98,109,13699,13704,97,114,59,32768,10677,59,32768,937,110,116,59,32768,8750,1024,97,99,105,116,13721,13726,13741,13746,114,114,59,32768,8634,512,105,114,13731,13735,114,59,32768,10686,111,115,115,59,32768,10683,110,101,59,32768,8254,59,32768,10688,768,97,101,105,13756,13761,13766,99,114,59,32768,333,103,97,59,32768,969,768,99,100,110,13773,13779,13782,114,111,110,59,32768,959,59,32768,10678,117,115,59,32768,8854,112,102,59,32896,55349,56672,768,97,101,108,13800,13804,13809,114,59,32768,10679,114,112,59,32768,10681,117,115,59,32768,8853,1792,59,97,100,105,111,115,118,13829,13831,13836,13869,13875,13879,13886,32768,8744,114,114,59,32768,8635,1024,59,101,102,109,13845,13847,13859,13864,32768,10845,114,512,59,111,13853,13855,32768,8500,102,59,32768,8500,33024,170,59,32768,170,33024,186,59,32768,186,103,111,102,59,32768,8886,114,59,32768,10838,108,111,112,101,59,32768,10839,59,32768,10843,768,99,108,111,13896,13900,13908,114,59,32768,8500,97,115,104,33024,248,59,32768,248,108,59,32768,8856,105,573,13917,13924,100,101,33024,245,59,32768,245,101,115,512,59,97,13930,13932,32768,8855,115,59,32768,10806,109,108,33024,246,59,32768,246,98,97,114,59,32768,9021,5426,13972,0,14013,0,14017,14053,0,14058,14086,0,0,14107,14199,0,14202,0,0,14229,14425,0,14438,114,1024,59,97,115,116,13981,13983,13997,14009,32768,8741,33280,182,59,108,13989,13991,32768,182,108,101,108,59,32768,8741,1082,14003,0,0,14007,109,59,32768,10995,59,32768,11005,59,32768,8706,121,59,32768,1087,114,1280,99,105,109,112,116,14028,14033,14038,14043,14046,110,116,59,32768,37,111,100,59,32768,46,105,108,59,32768,8240,59,32768,8869,101,110,107,59,32768,8241,114,59,32896,55349,56621,768,105,109,111,14064,14074,14080,512,59,118,14069,14071,32768,966,59,32768,981,109,97,116,59,32768,8499,110,101,59,32768,9742,768,59,116,118,14092,14094,14103,32768,960,99,104,102,111,114,107,59,32768,8916,59,32768,982,512,97,117,14111,14132,110,512,99,107,14117,14128,107,512,59,104,14123,14125,32768,8463,59,32768,8462,118,59,32768,8463,115,2304,59,97,98,99,100,101,109,115,116,14152,14154,14160,14163,14168,14179,14182,14188,14193,32768,43,99,105,114,59,32768,10787,59,32768,8862,105,114,59,32768,10786,512,111,117,14173,14176,59,32768,8724,59,32768,10789,59,32768,10866,110,33024,177,59,32768,177,105,109,59,32768,10790,119,111,59,32768,10791,59,32768,177,768,105,112,117,14208,14216,14221,110,116,105,110,116,59,32768,10773,102,59,32896,55349,56673,110,100,33024,163,59,32768,163,2560,59,69,97,99,101,105,110,111,115,117,14249,14251,14254,14258,14263,14336,14348,14367,14413,14418,32768,8826,59,32768,10931,112,59,32768,10935,117,101,59,32768,8828,512,59,99,14268,14270,32768,10927,1536,59,97,99,101,110,115,14283,14285,14293,14302,14306,14331,32768,8826,112,112,114,111,120,59,32768,10935,117,114,108,121,101,113,59,32768,8828,113,59,32768,10927,768,97,101,115,14313,14321,14326,112,112,114,111,120,59,32768,10937,113,113,59,32768,10933,105,109,59,32768,8936,105,109,59,32768,8830,109,101,512,59,115,14343,14345,32768,8242,59,32768,8473,768,69,97,115,14355,14358,14362,59,32768,10933,112,59,32768,10937,105,109,59,32768,8936,768,100,102,112,14374,14377,14402,59,32768,8719,768,97,108,115,14384,14390,14396,108,97,114,59,32768,9006,105,110,101,59,32768,8978,117,114,102,59,32768,8979,512,59,116,14407,14409,32768,8733,111,59,32768,8733,105,109,59,32768,8830,114,101,108,59,32768,8880,512,99,105,14429,14434,114,59,32896,55349,56517,59,32768,968,110,99,115,112,59,32768,8200,1536,102,105,111,112,115,117,14457,14462,14467,14473,14480,14486,114,59,32896,55349,56622,110,116,59,32768,10764,112,102,59,32896,55349,56674,114,105,109,101,59,32768,8279,99,114,59,32896,55349,56518,768,97,101,111,14493,14513,14526,116,512,101,105,14499,14508,114,110,105,111,110,115,59,32768,8461,110,116,59,32768,10774,115,116,512,59,101,14520,14522,32768,63,113,59,32768,8799,116,33024,34,59,32768,34,5376,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,14575,14597,14603,14608,14775,14829,14865,14901,14943,14966,15e3,15139,15159,15176,15182,15236,15261,15267,15309,15352,15360,768,97,114,116,14582,14587,14591,114,114,59,32768,8667,114,59,32768,8658,97,105,108,59,32768,10524,97,114,114,59,32768,10511,97,114,59,32768,10596,1792,99,100,101,110,113,114,116,14623,14637,14642,14650,14672,14679,14751,512,101,117,14628,14632,59,32896,8765,817,116,101,59,32768,341,105,99,59,32768,8730,109,112,116,121,118,59,32768,10675,103,1024,59,100,101,108,14660,14662,14665,14668,32768,10217,59,32768,10642,59,32768,10661,101,59,32768,10217,117,111,33024,187,59,32768,187,114,2816,59,97,98,99,102,104,108,112,115,116,119,14703,14705,14709,14720,14723,14727,14731,14735,14739,14744,14748,32768,8594,112,59,32768,10613,512,59,102,14714,14716,32768,8677,115,59,32768,10528,59,32768,10547,115,59,32768,10526,107,59,32768,8618,112,59,32768,8620,108,59,32768,10565,105,109,59,32768,10612,108,59,32768,8611,59,32768,8605,512,97,105,14756,14761,105,108,59,32768,10522,111,512,59,110,14767,14769,32768,8758,97,108,115,59,32768,8474,768,97,98,114,14782,14787,14792,114,114,59,32768,10509,114,107,59,32768,10099,512,97,107,14797,14809,99,512,101,107,14803,14806,59,32768,125,59,32768,93,512,101,115,14814,14817,59,32768,10636,108,512,100,117,14823,14826,59,32768,10638,59,32768,10640,1024,97,101,117,121,14838,14844,14858,14862,114,111,110,59,32768,345,512,100,105,14849,14854,105,108,59,32768,343,108,59,32768,8969,98,59,32768,125,59,32768,1088,1024,99,108,113,115,14874,14878,14885,14897,97,59,32768,10551,100,104,97,114,59,32768,10601,117,111,512,59,114,14892,14894,32768,8221,59,32768,8221,104,59,32768,8627,768,97,99,103,14908,14934,14938,108,1024,59,105,112,115,14918,14920,14925,14931,32768,8476,110,101,59,32768,8475,97,114,116,59,32768,8476,59,32768,8477,116,59,32768,9645,33024,174,59,32768,174,768,105,108,114,14950,14956,14962,115,104,116,59,32768,10621,111,111,114,59,32768,8971,59,32896,55349,56623,512,97,111,14971,14990,114,512,100,117,14977,14980,59,32768,8641,512,59,108,14985,14987,32768,8640,59,32768,10604,512,59,118,14995,14997,32768,961,59,32768,1009,768,103,110,115,15007,15123,15127,104,116,1536,97,104,108,114,115,116,15022,15039,15060,15086,15099,15111,114,114,111,119,512,59,116,15031,15033,32768,8594,97,105,108,59,32768,8611,97,114,112,111,111,110,512,100,117,15050,15056,111,119,110,59,32768,8641,112,59,32768,8640,101,102,116,512,97,104,15068,15076,114,114,111,119,115,59,32768,8644,97,114,112,111,111,110,115,59,32768,8652,105,103,104,116,97,114,114,111,119,115,59,32768,8649,113,117,105,103,97,114,114,111,119,59,32768,8605,104,114,101,101,116,105,109,101,115,59,32768,8908,103,59,32768,730,105,110,103,100,111,116,115,101,113,59,32768,8787,768,97,104,109,15146,15151,15156,114,114,59,32768,8644,97,114,59,32768,8652,59,32768,8207,111,117,115,116,512,59,97,15168,15170,32768,9137,99,104,101,59,32768,9137,109,105,100,59,32768,10990,1024,97,98,112,116,15191,15204,15209,15229,512,110,114,15196,15200,103,59,32768,10221,114,59,32768,8702,114,107,59,32768,10215,768,97,102,108,15216,15220,15224,114,59,32768,10630,59,32896,55349,56675,117,115,59,32768,10798,105,109,101,115,59,32768,10805,512,97,112,15241,15253,114,512,59,103,15247,15249,32768,41,116,59,32768,10644,111,108,105,110,116,59,32768,10770,97,114,114,59,32768,8649,1024,97,99,104,113,15276,15282,15287,15290,113,117,111,59,32768,8250,114,59,32896,55349,56519,59,32768,8625,512,98,117,15295,15298,59,32768,93,111,512,59,114,15304,15306,32768,8217,59,32768,8217,768,104,105,114,15316,15322,15328,114,101,101,59,32768,8908,109,101,115,59,32768,8906,105,1024,59,101,102,108,15338,15340,15343,15346,32768,9657,59,32768,8885,59,32768,9656,116,114,105,59,32768,10702,108,117,104,97,114,59,32768,10600,59,32768,8478,6706,15391,15398,15404,15499,15516,15592,0,15606,15660,0,0,15752,15758,0,15827,15863,15886,16e3,16006,16038,16086,0,16467,0,0,16506,99,117,116,101,59,32768,347,113,117,111,59,32768,8218,2560,59,69,97,99,101,105,110,112,115,121,15424,15426,15429,15441,15446,15458,15463,15482,15490,15495,32768,8827,59,32768,10932,833,15434,0,15437,59,32768,10936,111,110,59,32768,353,117,101,59,32768,8829,512,59,100,15451,15453,32768,10928,105,108,59,32768,351,114,99,59,32768,349,768,69,97,115,15470,15473,15477,59,32768,10934,112,59,32768,10938,105,109,59,32768,8937,111,108,105,110,116,59,32768,10771,105,109,59,32768,8831,59,32768,1089,111,116,768,59,98,101,15507,15509,15512,32768,8901,59,32768,8865,59,32768,10854,1792,65,97,99,109,115,116,120,15530,15535,15556,15562,15566,15572,15587,114,114,59,32768,8664,114,512,104,114,15541,15545,107,59,32768,10533,512,59,111,15550,15552,32768,8600,119,59,32768,8600,116,33024,167,59,32768,167,105,59,32768,59,119,97,114,59,32768,10537,109,512,105,110,15578,15584,110,117,115,59,32768,8726,59,32768,8726,116,59,32768,10038,114,512,59,111,15597,15600,32896,55349,56624,119,110,59,32768,8994,1024,97,99,111,121,15614,15619,15632,15654,114,112,59,32768,9839,512,104,121,15624,15629,99,121,59,32768,1097,59,32768,1096,114,116,1086,15640,0,0,15645,105,100,59,32768,8739,97,114,97,108,108,101,108,59,32768,8741,33024,173,59,32768,173,512,103,109,15664,15681,109,97,768,59,102,118,15673,15675,15678,32768,963,59,32768,962,59,32768,962,2048,59,100,101,103,108,110,112,114,15698,15700,15705,15715,15725,15735,15739,15745,32768,8764,111,116,59,32768,10858,512,59,113,15710,15712,32768,8771,59,32768,8771,512,59,69,15720,15722,32768,10910,59,32768,10912,512,59,69,15730,15732,32768,10909,59,32768,10911,101,59,32768,8774,108,117,115,59,32768,10788,97,114,114,59,32768,10610,97,114,114,59,32768,8592,1024,97,101,105,116,15766,15788,15796,15808,512,108,115,15771,15783,108,115,101,116,109,105,110,117,115,59,32768,8726,104,112,59,32768,10803,112,97,114,115,108,59,32768,10724,512,100,108,15801,15804,59,32768,8739,101,59,32768,8995,512,59,101,15813,15815,32768,10922,512,59,115,15820,15822,32768,10924,59,32896,10924,65024,768,102,108,112,15833,15839,15857,116,99,121,59,32768,1100,512,59,98,15844,15846,32768,47,512,59,97,15851,15853,32768,10692,114,59,32768,9023,102,59,32896,55349,56676,97,512,100,114,15868,15882,101,115,512,59,117,15875,15877,32768,9824,105,116,59,32768,9824,59,32768,8741,768,99,115,117,15892,15921,15977,512,97,117,15897,15909,112,512,59,115,15903,15905,32768,8851,59,32896,8851,65024,112,512,59,115,15915,15917,32768,8852,59,32896,8852,65024,117,512,98,112,15927,15952,768,59,101,115,15934,15936,15939,32768,8847,59,32768,8849,101,116,512,59,101,15946,15948,32768,8847,113,59,32768,8849,768,59,101,115,15959,15961,15964,32768,8848,59,32768,8850,101,116,512,59,101,15971,15973,32768,8848,113,59,32768,8850,768,59,97,102,15984,15986,15996,32768,9633,114,566,15991,15994,59,32768,9633,59,32768,9642,59,32768,9642,97,114,114,59,32768,8594,1024,99,101,109,116,16014,16019,16025,16031,114,59,32896,55349,56520,116,109,110,59,32768,8726,105,108,101,59,32768,8995,97,114,102,59,32768,8902,512,97,114,16042,16053,114,512,59,102,16048,16050,32768,9734,59,32768,9733,512,97,110,16058,16081,105,103,104,116,512,101,112,16067,16076,112,115,105,108,111,110,59,32768,1013,104,105,59,32768,981,115,59,32768,175,1280,98,99,109,110,112,16096,16221,16288,16291,16295,2304,59,69,100,101,109,110,112,114,115,16115,16117,16120,16125,16137,16143,16154,16160,16166,32768,8834,59,32768,10949,111,116,59,32768,10941,512,59,100,16130,16132,32768,8838,111,116,59,32768,10947,117,108,116,59,32768,10945,512,69,101,16148,16151,59,32768,10955,59,32768,8842,108,117,115,59,32768,10943,97,114,114,59,32768,10617,768,101,105,117,16173,16206,16210,116,768,59,101,110,16181,16183,16194,32768,8834,113,512,59,113,16189,16191,32768,8838,59,32768,10949,101,113,512,59,113,16201,16203,32768,8842,59,32768,10955,109,59,32768,10951,512,98,112,16215,16218,59,32768,10965,59,32768,10963,99,1536,59,97,99,101,110,115,16235,16237,16245,16254,16258,16283,32768,8827,112,112,114,111,120,59,32768,10936,117,114,108,121,101,113,59,32768,8829,113,59,32768,10928,768,97,101,115,16265,16273,16278,112,112,114,111,120,59,32768,10938,113,113,59,32768,10934,105,109,59,32768,8937,105,109,59,32768,8831,59,32768,8721,103,59,32768,9834,3328,49,50,51,59,69,100,101,104,108,109,110,112,115,16322,16327,16332,16337,16339,16342,16356,16368,16382,16388,16394,16405,16411,33024,185,59,32768,185,33024,178,59,32768,178,33024,179,59,32768,179,32768,8835,59,32768,10950,512,111,115,16347,16351,116,59,32768,10942,117,98,59,32768,10968,512,59,100,16361,16363,32768,8839,111,116,59,32768,10948,115,512,111,117,16374,16378,108,59,32768,10185,98,59,32768,10967,97,114,114,59,32768,10619,117,108,116,59,32768,10946,512,69,101,16399,16402,59,32768,10956,59,32768,8843,108,117,115,59,32768,10944,768,101,105,117,16418,16451,16455,116,768,59,101,110,16426,16428,16439,32768,8835,113,512,59,113,16434,16436,32768,8839,59,32768,10950,101,113,512,59,113,16446,16448,32768,8843,59,32768,10956,109,59,32768,10952,512,98,112,16460,16463,59,32768,10964,59,32768,10966,768,65,97,110,16473,16478,16499,114,114,59,32768,8665,114,512,104,114,16484,16488,107,59,32768,10534,512,59,111,16493,16495,32768,8601,119,59,32768,8601,119,97,114,59,32768,10538,108,105,103,33024,223,59,32768,223,5938,16538,16552,16557,16579,16584,16591,0,16596,16692,0,0,0,0,0,16731,16780,0,16787,16908,0,0,0,16938,1091,16543,0,0,16549,103,101,116,59,32768,8982,59,32768,964,114,107,59,32768,9140,768,97,101,121,16563,16569,16575,114,111,110,59,32768,357,100,105,108,59,32768,355,59,32768,1090,111,116,59,32768,8411,108,114,101,99,59,32768,8981,114,59,32896,55349,56625,1024,101,105,107,111,16604,16641,16670,16684,835,16609,0,16624,101,512,52,102,16614,16617,59,32768,8756,111,114,101,59,32768,8756,97,768,59,115,118,16631,16633,16638,32768,952,121,109,59,32768,977,59,32768,977,512,99,110,16646,16665,107,512,97,115,16652,16660,112,112,114,111,120,59,32768,8776,105,109,59,32768,8764,115,112,59,32768,8201,512,97,115,16675,16679,112,59,32768,8776,105,109,59,32768,8764,114,110,33024,254,59,32768,254,829,16696,16701,16727,100,101,59,32768,732,101,115,33536,215,59,98,100,16710,16712,16723,32768,215,512,59,97,16717,16719,32768,8864,114,59,32768,10801,59,32768,10800,116,59,32768,8749,768,101,112,115,16737,16741,16775,97,59,32768,10536,1024,59,98,99,102,16750,16752,16757,16762,32768,8868,111,116,59,32768,9014,105,114,59,32768,10993,512,59,111,16767,16770,32896,55349,56677,114,107,59,32768,10970,97,59,32768,10537,114,105,109,101,59,32768,8244,768,97,105,112,16793,16798,16899,100,101,59,32768,8482,1792,97,100,101,109,112,115,116,16813,16868,16873,16876,16883,16889,16893,110,103,108,101,1280,59,100,108,113,114,16828,16830,16836,16850,16853,32768,9653,111,119,110,59,32768,9663,101,102,116,512,59,101,16844,16846,32768,9667,113,59,32768,8884,59,32768,8796,105,103,104,116,512,59,101,16862,16864,32768,9657,113,59,32768,8885,111,116,59,32768,9708,59,32768,8796,105,110,117,115,59,32768,10810,108,117,115,59,32768,10809,98,59,32768,10701,105,109,101,59,32768,10811,101,122,105,117,109,59,32768,9186,768,99,104,116,16914,16926,16931,512,114,121,16919,16923,59,32896,55349,56521,59,32768,1094,99,121,59,32768,1115,114,111,107,59,32768,359,512,105,111,16942,16947,120,116,59,32768,8812,104,101,97,100,512,108,114,16956,16967,101,102,116,97,114,114,111,119,59,32768,8606,105,103,104,116,97,114,114,111,119,59,32768,8608,4608,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,17016,17021,17026,17043,17057,17072,17095,17110,17119,17139,17172,17187,17202,17290,17330,17336,17365,17381,114,114,59,32768,8657,97,114,59,32768,10595,512,99,114,17031,17039,117,116,101,33024,250,59,32768,250,114,59,32768,8593,114,820,17049,0,17053,121,59,32768,1118,118,101,59,32768,365,512,105,121,17062,17069,114,99,33024,251,59,32768,251,59,32768,1091,768,97,98,104,17079,17084,17090,114,114,59,32768,8645,108,97,99,59,32768,369,97,114,59,32768,10606,512,105,114,17100,17106,115,104,116,59,32768,10622,59,32896,55349,56626,114,97,118,101,33024,249,59,32768,249,562,17123,17135,114,512,108,114,17128,17131,59,32768,8639,59,32768,8638,108,107,59,32768,9600,512,99,116,17144,17167,1088,17150,0,0,17163,114,110,512,59,101,17156,17158,32768,8988,114,59,32768,8988,111,112,59,32768,8975,114,105,59,32768,9720,512,97,108,17177,17182,99,114,59,32768,363,33024,168,59,32768,168,512,103,112,17192,17197,111,110,59,32768,371,102,59,32896,55349,56678,1536,97,100,104,108,115,117,17215,17222,17233,17257,17262,17280,114,114,111,119,59,32768,8593,111,119,110,97,114,114,111,119,59,32768,8597,97,114,112,111,111,110,512,108,114,17244,17250,101,102,116,59,32768,8639,105,103,104,116,59,32768,8638,117,115,59,32768,8846,105,768,59,104,108,17270,17272,17275,32768,965,59,32768,978,111,110,59,32768,965,112,97,114,114,111,119,115,59,32768,8648,768,99,105,116,17297,17320,17325,1088,17303,0,0,17316,114,110,512,59,101,17309,17311,32768,8989,114,59,32768,8989,111,112,59,32768,8974,110,103,59,32768,367,114,105,59,32768,9721,99,114,59,32896,55349,56522,768,100,105,114,17343,17348,17354,111,116,59,32768,8944,108,100,101,59,32768,361,105,512,59,102,17360,17362,32768,9653,59,32768,9652,512,97,109,17370,17375,114,114,59,32768,8648,108,33024,252,59,32768,252,97,110,103,108,101,59,32768,10663,3840,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,17420,17425,17437,17443,17613,17617,17623,17667,17672,17678,17693,17699,17705,17711,17754,114,114,59,32768,8661,97,114,512,59,118,17432,17434,32768,10984,59,32768,10985,97,115,104,59,32768,8872,512,110,114,17448,17454,103,114,116,59,32768,10652,1792,101,107,110,112,114,115,116,17469,17478,17485,17494,17515,17526,17578,112,115,105,108,111,110,59,32768,1013,97,112,112,97,59,32768,1008,111,116,104,105,110,103,59,32768,8709,768,104,105,114,17501,17505,17508,105,59,32768,981,59,32768,982,111,112,116,111,59,32768,8733,512,59,104,17520,17522,32768,8597,111,59,32768,1009,512,105,117,17531,17537,103,109,97,59,32768,962,512,98,112,17542,17560,115,101,116,110,101,113,512,59,113,17553,17556,32896,8842,65024,59,32896,10955,65024,115,101,116,110,101,113,512,59,113,17571,17574,32896,8843,65024,59,32896,10956,65024,512,104,114,17583,17589,101,116,97,59,32768,977,105,97,110,103,108,101,512,108,114,17600,17606,101,102,116,59,32768,8882,105,103,104,116,59,32768,8883,121,59,32768,1074,97,115,104,59,32768,8866,768,101,108,114,17630,17648,17654,768,59,98,101,17637,17639,17644,32768,8744,97,114,59,32768,8891,113,59,32768,8794,108,105,112,59,32768,8942,512,98,116,17659,17664,97,114,59,32768,124,59,32768,124,114,59,32896,55349,56627,116,114,105,59,32768,8882,115,117,512,98,112,17685,17689,59,32896,8834,8402,59,32896,8835,8402,112,102,59,32896,55349,56679,114,111,112,59,32768,8733,116,114,105,59,32768,8883,512,99,117,17716,17721,114,59,32896,55349,56523,512,98,112,17726,17740,110,512,69,101,17732,17736,59,32896,10955,65024,59,32896,8842,65024,110,512,69,101,17746,17750,59,32896,10956,65024,59,32896,8843,65024,105,103,122,97,103,59,32768,10650,1792,99,101,102,111,112,114,115,17777,17783,17815,17820,17826,17829,17842,105,114,99,59,32768,373,512,100,105,17788,17809,512,98,103,17793,17798,97,114,59,32768,10847,101,512,59,113,17804,17806,32768,8743,59,32768,8793,101,114,112,59,32768,8472,114,59,32896,55349,56628,112,102,59,32896,55349,56680,59,32768,8472,512,59,101,17834,17836,32768,8768,97,116,104,59,32768,8768,99,114,59,32896,55349,56524,5428,17871,17891,0,17897,0,17902,17917,0,0,17920,17935,17940,17945,0,0,17977,17992,0,18008,18024,18029,768,97,105,117,17877,17881,17886,112,59,32768,8898,114,99,59,32768,9711,112,59,32768,8899,116,114,105,59,32768,9661,114,59,32896,55349,56629,512,65,97,17906,17911,114,114,59,32768,10234,114,114,59,32768,10231,59,32768,958,512,65,97,17924,17929,114,114,59,32768,10232,114,114,59,32768,10229,97,112,59,32768,10236,105,115,59,32768,8955,768,100,112,116,17951,17956,17970,111,116,59,32768,10752,512,102,108,17961,17965,59,32896,55349,56681,117,115,59,32768,10753,105,109,101,59,32768,10754,512,65,97,17981,17986,114,114,59,32768,10233,114,114,59,32768,10230,512,99,113,17996,18001,114,59,32896,55349,56525,99,117,112,59,32768,10758,512,112,116,18012,18018,108,117,115,59,32768,10756,114,105,59,32768,9651,101,101,59,32768,8897,101,100,103,101,59,32768,8896,2048,97,99,101,102,105,111,115,117,18052,18068,18081,18087,18092,18097,18103,18109,99,512,117,121,18058,18065,116,101,33024,253,59,32768,253,59,32768,1103,512,105,121,18073,18078,114,99,59,32768,375,59,32768,1099,110,33024,165,59,32768,165,114,59,32896,55349,56630,99,121,59,32768,1111,112,102,59,32896,55349,56682,99,114,59,32896,55349,56526,512,99,109,18114,18118,121,59,32768,1102,108,33024,255,59,32768,255,2560,97,99,100,101,102,104,105,111,115,119,18145,18152,18166,18171,18186,18191,18196,18204,18210,18216,99,117,116,101,59,32768,378,512,97,121,18157,18163,114,111,110,59,32768,382,59,32768,1079,111,116,59,32768,380,512,101,116,18176,18182,116,114,102,59,32768,8488,97,59,32768,950,114,59,32896,55349,56631,99,121,59,32768,1078,103,114,97,114,114,59,32768,8669,112,102,59,32896,55349,56683,99,114,59,32896,55349,56527,512,106,110,18221,18224,59,32768,8205,106,59,32768,8204])}));unwrapExports(decodeDataHtml);var decodeDataXml=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=new Uint16Array([1024,97,103,108,113,9,23,27,31,1086,15,0,0,19,112,59,32768,38,111,115,59,32768,39,116,59,32768,62,116,59,32768,60,117,111,116,59,32768,34])}));unwrapExports(decodeDataXml);var decode_codepoint=createCommonjsModule((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),i=String.fromCodePoint||function(t){var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)};e.default=function(t){var e;return t>=55296&&t<=57343||t>1114111?"�":i(null!==(e=n.get(t))&&void 0!==e?e:t)}}));unwrapExports(decode_codepoint);var require$$0=decodeDataHtml,require$$1=decodeDataXml,require$$2=decode_codepoint,decode=createCommonjsModule((function(t,e){var n=commonjsGlobal&&commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXML=e.decodeHTMLStrict=e.decodeHTML=e.determineBranch=e.JUMP_OFFSET_BASE=e.BinTrieFlags=e.xmlDecodeTree=e.htmlDecodeTree=void 0;var i=n(require$$0);e.htmlDecodeTree=i.default;var s=n(require$$1);e.xmlDecodeTree=s.default;var r,o=n(require$$2);function l(t){return function(e,n){for(var i="",s=0,l=0;(l=e.indexOf("&",l))>=0;)if(i+=e.slice(s,l),s=l,l+=1,35!==e.charCodeAt(l)){for(var h=null,u=1,d=0,p=t[d];l<e.length&&!((d=a(t,p,d+1,e.charCodeAt(l)))<0);l++,u++)(p=t[d])&r.HAS_VALUE&&(n&&59!==e.charCodeAt(l)?d+=1:(h=p&r.MULTI_BYTE?String.fromCharCode(t[++d],t[++d]):String.fromCharCode(t[++d]),u=0));null!=h&&(i+=h,s=l-u+1)}else{var m=l+1,c=10,x=e.charCodeAt(m);for(120==(32|x)&&(c=16,l+=1,m+=1);(x=e.charCodeAt(++l))>=48&&x<=57||16===c&&(32|x)>=97&&(32|x)<=102;);if(m!==l){var g=e.substring(m,l),y=parseInt(g,c);if(59===e.charCodeAt(l))l+=1;else if(n)continue;i+=o.default(y),s=l}}return i+e.slice(s)}}function a(t,n,i,s){if(n<=128)return s===n?i:-1;var o=(n&r.BRANCH_LENGTH)>>8;if(0===o)return-1;if(1===o)return s===t[i]?i+1:-1;var l=n&r.JUMP_TABLE;if(l){var a=s-e.JUMP_OFFSET_BASE-l;return a<0||a>o?-1:t[i+a]-1}for(var h=i,u=h+o-1;h<=u;){var d=h+u>>>1,p=t[d];if(p<s)h=d+1;else{if(!(p>s))return t[d+o];u=d-1}}return-1}!function(t){t[t.HAS_VALUE=32768]="HAS_VALUE",t[t.BRANCH_LENGTH=32512]="BRANCH_LENGTH",t[t.MULTI_BYTE=128]="MULTI_BYTE",t[t.JUMP_TABLE=127]="JUMP_TABLE"}(r=e.BinTrieFlags||(e.BinTrieFlags={})),e.JUMP_OFFSET_BASE=47,e.determineBranch=a;var h=l(i.default),u=l(s.default);e.decodeHTML=function(t){return h(t,!1)},e.decodeHTMLStrict=function(t){return h(t,!0)},e.decodeXML=function(t){return u(t,!0)}}));unwrapExports(decode);var decode_1=decode.decodeXML;decode.decodeHTMLStrict,decode.decodeHTML,decode.determineBranch,decode.JUMP_OFFSET_BASE,decode.BinTrieFlags,decode.xmlDecodeTree,decode.htmlDecodeTree;class BpmnXmlParser{constructor(){this.x2jOptions={attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,attributeValueProcessor:(t,e)=>decode_1(e)},this.xmlParser=new fxp_1(this.x2jOptions)}parse(t){let e;try{e=this.xmlParser.parse(t)}catch(t){throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}}class CollaborationConverter{constructor(t){this.convertedElements=t}deserialize(t){ensureIsArray(t).forEach((t=>this.parseCollaboration(t)))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerParticipant(new Participant(t.id,t.name,t.processRef))))}buildMessageFlows(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerMessageFlow(new MessageFlow(t.id,t.name,t.sourceRef,t.targetRef))))}buildGroups(t){ensureIsArray(t).forEach((t=>{const e=this.convertedElements.buildShapeBpmnGroup(t);e&&this.convertedElements.registerFlowNode(e)}))}}class JsonParsingWarning{}class ParsingMessageCollector{warning(t){const e=t.getMessage();console.warn(e.template,...e.arguments)}}class GroupUnknownCategoryValueWarning extends JsonParsingWarning{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueRef=e}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class ShapeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class EdgeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class LabelStyleMissingFontWarning extends JsonParsingWarning{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class LaneUnknownFlowNodeRefWarning extends JsonParsingWarning{constructor(t,e){super(),this.laneId=t,this.flowNodeRef=e}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class BoundaryEventNotAttachedToActivityWarning extends JsonParsingWarning{constructor(t,e,n){super(),this.bpmnElementId=t,this.attachedToRef=e,this.attachedToKind=n}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToRef,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class ProcessConverter{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e,this.defaultSequenceFlowIds=[]}deserialize(t){ensureIsArray(t).forEach((t=>this.parseProcess(t)))}parseProcess(t){this.convertedElements.registerProcess(new ShapeBpmnElement(t.id,t.name,exports.ShapeBpmnElementKind.POOL)),this.buildProcessInnerElements(t)}buildProcessInnerElements(t){const e=t.id;ShapeUtil.flowNodeKinds().filter((t=>t!=exports.ShapeBpmnElementKind.EVENT_BOUNDARY)).forEach((n=>this.buildFlowNodeBpmnElements(e,t[n],n))),this.buildFlowNodeBpmnElements(e,t.boundaryEvent,exports.ShapeBpmnElementKind.EVENT_BOUNDARY),this.buildLaneBpmnElements(e,t[exports.ShapeBpmnElementKind.LANE]),this.buildLaneSetBpmnElements(e,t.laneSet),this.buildSequenceFlows(t[exports.FlowKind.SEQUENCE_FLOW]),this.buildAssociationFlows(t[exports.FlowKind.ASSOCIATION_FLOW])}buildFlowNodeBpmnElements(t,e,n){ensureIsArray(e).forEach((e=>{let i;if(ShapeUtil.isEvent(n))i=this.buildShapeBpmnEvent(e,n,t);else if(ShapeUtil.isActivity(n))i=this.buildShapeBpmnActivity(e,n,t);else if(n==exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED){const n=e;i=new ShapeBpmnEventBasedGateway(e.id,n.name,t,n.instantiate,exports.ShapeBpmnEventBasedGatewayKind[n.eventGatewayType])}else if(n==exports.ShapeBpmnElementKind.GROUP)i=this.convertedElements.buildShapeBpmnGroup(e,t);else{const s=n===exports.ShapeBpmnElementKind.TEXT_ANNOTATION?e.text:e.name;i=new ShapeBpmnElement(e.id,s,n,t,e.instantiate)}const s=e.default;ShapeUtil.isWithDefaultSequenceFlow(n)&&s&&this.defaultSequenceFlowIds.push(s),i&&this.convertedElements.registerFlowNode(i)}))}buildShapeBpmnActivity(t,e,n){const i=ProcessConverter.buildMarkers(t);return ShapeUtil.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,n,i):ShapeUtil.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,n,i):new ShapeBpmnActivity(t.id,t.name,e,n,t.instantiate,i)}buildShapeBpmnCallActivity(t,e,n){const i=this.convertedElements.findGlobalTask(t.calledElement);return i?new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK,e,n,i):new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_PROCESS,e,n)}static buildMarkers(t){const e=[],n=t.standardLoopCharacteristics,i=ensureIsArray(t.multiInstanceLoopCharacteristics,!0)[0];return n||""===n?e.push(exports.ShapeBpmnMarkerKind.LOOP):i&&i.isSequential?e.push(exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL):(i&&!i.isSequential||""===i)&&e.push(exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL),e}buildShapeBpmnEvent(t,e,n){const i=this.getEventDefinitions(t),s=i.map((t=>t.counter)).reduce(((t,e)=>t+e),0);if(0==s&&ShapeUtil.canHaveNoneEvent(e))return new ShapeBpmnEvent(t.id,t.name,e,exports.ShapeBpmnEventDefinitionKind.NONE,n);if(1==s){const s=i[0].kind;return ShapeUtil.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,s):ShapeUtil.isStartEvent(e)?new ShapeBpmnStartEvent(t.id,t.name,s,n,t.isInterrupting):new ShapeBpmnEvent(t.id,t.name,e,s,n)}}buildShapeBpmnBoundaryEvent(t,e){const n=this.convertedElements.findFlowNode(t.attachedToRef);if(ShapeUtil.isActivity(null==n?void 0:n.kind))return new ShapeBpmnBoundaryEvent(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new BoundaryEventNotAttachedToActivityWarning(t.id,t.attachedToRef,null==n?void 0:n.kind))}getEventDefinitions(t){const e=new Map;return eventDefinitionKinds.forEach((n=>{const i=ensureIsArray(t[n+"EventDefinition"],!0).length;e.set(n,i)})),ensureIsArray(t.eventDefinitionRef).forEach((t=>{const n=this.convertedElements.findEventDefinitionOfDefinition(t);e.set(n,e.get(n)+1)})),Array.from(e.keys()).map((t=>({kind:t,counter:e.get(t)}))).filter((t=>t.counter>0))}buildShapeBpmnSubProcess(t,e,n){return this.buildSubProcessInnerElements(t),t.triggeredByEvent?new ShapeBpmnSubProcess(t.id,t.name,exports.ShapeBpmnSubProcessKind.EVENT,e,n):new ShapeBpmnSubProcess(t.id,t.name,exports.ShapeBpmnSubProcessKind.EMBEDDED,e,n)}buildSubProcessInnerElements(t){this.buildProcessInnerElements(t)}buildLaneSetBpmnElements(t,e){ensureIsArray(e).forEach((e=>this.buildLaneBpmnElements(t,e.lane)))}buildLaneBpmnElements(t,e){ensureIsArray(e).forEach((e=>{var n;this.convertedElements.registerLane(new ShapeBpmnElement(e.id,e.name,exports.ShapeBpmnElementKind.LANE,t)),this.assignParentOfLaneFlowNodes(e),(null===(n=e.childLaneSet)||void 0===n?void 0:n.lane)&&this.buildLaneBpmnElements(e.id,e.childLaneSet.lane)}))}assignParentOfLaneFlowNodes(t){ensureIsArray(t.flowNodeRef).forEach((e=>{const n=this.convertedElements.findFlowNode(e),i=t.id;n?ShapeUtil.isBoundaryEvent(n.kind)||(n.parentId=i):this.parsingMessageCollector.warning(new LaneUnknownFlowNodeRefWarning(i,e))}))}buildSequenceFlows(t){ensureIsArray(t).forEach((t=>{const e=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new SequenceFlow(t.id,t.name,t.sourceRef,t.targetRef,e))}))}buildAssociationFlows(t){ensureIsArray(t).forEach((t=>{const e=t.associationDirection;this.convertedElements.registerAssociationFlow(new AssociationFlow(t.id,void 0,t.sourceRef,t.targetRef,e))}))}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return exports.SequenceFlowKind.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&ShapeUtil.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return ShapeUtil.isActivity(e.kind)?exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY:exports.SequenceFlowKind.CONDITIONAL_FROM_GATEWAY}return exports.SequenceFlowKind.NORMAL}}class Bounds{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}}class Edge{constructor(t,e,n,i,s=exports.MessageVisibleKind.NONE){this.id=t,this.bpmnElement=e,this.waypoints=n,this.label=i,this.messageVisibleKind=s}}class Waypoint{constructor(t,e){this.x=t,this.y=e}}class Label{constructor(t,e){this.font=t,this.bounds=e}}class Font{constructor(t,e,n,i,s,r){this.name=t,this.size=e,this.isBold=n,this.isItalic=i,this.isUnderline=s,this.isStrikeThrough=r}}class DiagramConverter{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e,this.convertedFonts=new Map}deserialize(t){const e=[],n=[],i=[],s=[],r=ensureIsArray(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const t=r.BPMNPlane,o=this.deserializeEdges(t.BPMNEdge),l=this.deserializeShapes(t.BPMNShape);e.push(...l.flowNodes),n.push(...l.lanes),i.push(...l.pools),s.push(...o)}return{flowNodes:e,lanes:n,pools:i,edges:s}}deserializeFonts(t){this.convertedFonts=new Map,ensureIsArray(t).forEach((t=>ensureIsArray(t.Font).forEach((e=>this.convertedFonts.set(t.id,new Font(e.name,e.size,e.isBold,e.isItalic,e.isUnderline,e.isStrikeThrough))))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return ensureIsArray(t).forEach((t=>{this.deserializeShapeAndStoreIfFound(t,e.flowNodes,(t=>this.convertedElements.findFlowNode(t)))||this.deserializeShapeAndStoreIfFound(t,e.lanes,(t=>this.convertedElements.findLane(t)))||this.deserializeShapeAndStoreIfFound(t,e.pools,(t=>this.convertedElements.findProcess(t)))||this.parsingMessageCollector.warning(new ShapeUnknownBpmnElementWarning(t.bpmnElement))})),e}deserializeShapeAndStoreIfFound(t,e,n){const i=this.deserializeShape(t,n);return!!i&&(e.push(i),!0)}deserializeShape(t,e){const n=e(t.bpmnElement);if(n){const e=DiagramConverter.deserializeBounds(t);if(n.parentId){const t=this.convertedElements.findParticipantByProcessRef(n.parentId);t&&(n.parentId=t.id)}let i;(n instanceof ShapeBpmnSubProcess||n instanceof ShapeBpmnCallActivity&&n.callActivityKind===exports.ShapeBpmnCallActivityKind.CALLING_PROCESS)&&!t.isExpanded&&n.markers.push(exports.ShapeBpmnMarkerKind.EXPAND),ShapeUtil.isPoolOrLane(n.kind)&&(i=void 0===t.isHorizontal||t.isHorizontal);const s=this.deserializeLabel(t.BPMNLabel,t.id);return new Shape(t.id,n,e,s,i)}}static deserializeBounds(t){const e=t.Bounds;if(e)return new Bounds(e.x,e.y,e.width,e.height)}deserializeEdges(t){return ensureIsArray(t).map((t=>{const e=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!e)return void this.parsingMessageCollector.warning(new EdgeUnknownBpmnElementWarning(t.bpmnElement));const n=this.deserializeWaypoints(t.waypoint),i=this.deserializeLabel(t.BPMNLabel,t.id),s=t.messageVisibleKind?t.messageVisibleKind:exports.MessageVisibleKind.NONE;return new Edge(t.id,e,n,i,s)})).filter(Boolean)}deserializeWaypoints(t){return ensureIsArray(t).map((t=>new Waypoint(t.x,t.y)))}deserializeLabel(t,e){if(t&&"object"==typeof t){const n=this.findFont(t.labelStyle,e),i=DiagramConverter.deserializeBounds(t);if(n||i)return new Label(n,i)}}findFont(t,e){let n;return t&&(n=this.convertedFonts.get(t),n||this.parsingMessageCollector.warning(new LabelStyleMissingFontWarning(e,t))),n}}class EventDefinitionConverter{constructor(t){this.convertedElements=t}deserialize(t){eventDefinitionKinds.forEach((e=>{ensureIsArray(t[e+"EventDefinition"],!0).forEach((t=>this.convertedElements.registerEventDefinitionsOfDefinition(t.id,e)))}))}}class GlobalTaskConverter{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,exports.ShapeBpmnElementKind.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){ensureIsArray(t).forEach((t=>this.convertedElements.registerGlobalTask(t.id,e)))}}class ConvertedElements{constructor(t){this.parsingMessageCollector=t,this.participantsById=new Map,this.participantsByProcessRef=new Map,this.processes=new Map,this.messageFlows=new Map,this.flowNodes=new Map,this.lanes=new Map,this.sequenceFlows=new Map,this.associationFlows=new Map,this.eventDefinitionsOfDefinitions=new Map,this.globalTasks=new Map,this.categoryValues=new Map}findParticipantById(t){return this.participantsById.get(t)}findParticipantByProcessRef(t){return this.participantsByProcessRef.get(t)}registerParticipant(t){this.participantsById.set(t.id,t),t.processRef&&this.participantsByProcessRef.set(t.processRef,t)}_findProcess(t){return this.processes.get(t)}registerProcess(t){this.processes.set(t.id,t)}findProcess(t){const e=this.findParticipantById(t);if(e){const t=this._findProcess(e.processRef);if(t){const n=e.name||t.name;return new ShapeBpmnElement(e.id,n,t.kind,t.parentId)}return new ShapeBpmnElement(e.id,e.name,exports.ShapeBpmnElementKind.POOL)}}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}registerCategoryValues(t,e){this.categoryValues.set(t,{value:e})}buildShapeBpmnGroup(t,e){const n=this.categoryValues.get(t.categoryValueRef);if(n)return new ShapeBpmnElement(t.id,n.value,exports.ShapeBpmnElementKind.GROUP,e);this.parsingMessageCollector.warning(new GroupUnknownCategoryValueWarning(t.id,t.categoryValueRef))}}class CategoryConverter{constructor(t){this.convertedElements=t}deserialize(t){ensureIsArray(t.category).forEach((t=>ensureIsArray(t.categoryValue).forEach((t=>this.convertedElements.registerCategoryValues(t.id,t.value)))))}}class BpmnJsonParser{constructor(t,e,n,i,s,r){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=n,this.globalTaskConverter=i,this.processConverter=s,this.diagramConverter=r}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function newBpmnJsonParser(t){const e=new ConvertedElements(t);return new BpmnJsonParser(new CategoryConverter(e),new CollaborationConverter(e),new EventDefinitionConverter(e),new GlobalTaskConverter(e),new ProcessConverter(e,t),new DiagramConverter(e,t))}class BpmnParser{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function newBpmnParser(){return new BpmnParser(newBpmnJsonParser(new ParsingMessageCollector),new BpmnXmlParser)}class CssRegistry{constructor(){this.classNamesByBPMNId=new Map}clear(){this.classNamesByBPMNId.clear()}getClassNames(t){var e;return Array.from(null!==(e=this.classNamesByBPMNId.get(t))&&void 0!==e?e:[])}addClassNames(t,e){return this.updateClassNames(t,e,((t,e)=>t.add(e)))}removeClassNames(t,e){return this.updateClassNames(t,e,((t,e)=>t.delete(e)))}toggleClassNames(t,e){return this.updateClassNames(t,e,((t,e)=>t.has(e)?t.delete(e):t.add(e))),e&&e.length>0}updateClassNames(t,e,n){const i=this.getOrInitializeClassNames(t),s=i.size;return ensureIsArray(e).forEach((t=>n(i,t))),i.size!=s}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return null==e&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class OverlayConverter{constructor(){this.overlayPositions=new Map([["start",{horizontalAlign:"left",verticalAlign:"top"}],["middle",{horizontalAlign:"center",verticalAlign:"top"}],["end",{horizontalAlign:"right",verticalAlign:"top"}],["top-left",{horizontalAlign:"left",verticalAlign:"top"}],["top-right",{horizontalAlign:"right",verticalAlign:"top"}],["top-center",{horizontalAlign:"center",verticalAlign:"top"}],["bottom-left",{horizontalAlign:"left",verticalAlign:"bottom"}],["bottom-right",{horizontalAlign:"right",verticalAlign:"bottom"}],["bottom-center",{horizontalAlign:"center",verticalAlign:"bottom"}],["middle-left",{horizontalAlign:"left",verticalAlign:"middle"}],["middle-right",{horizontalAlign:"right",verticalAlign:"middle"}]])}convert(t){return{position:this.convertPosition(t),style:OverlayConverter.convertStyle(t)}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:exports.StyleDefault.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:exports.StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:exports.StyleDefault.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:exports.StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:exports.StyleDefault.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:exports.StyleDefault.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},n=t.style,i=Object.assign({},e);return n?(this.convertFill(i,n.fill),this.convertStroke(i,n.stroke),this.convertFont(i,n.font),i):i}static convertFill(t,e){var n,i;e&&(t.fill.color=null!==(n=e.color)&&void 0!==n?n:t.fill.color,t.fill.opacity=null!==(i=e.opacity)&&void 0!==i?i:t.fill.opacity)}static convertStroke(t,e){var n,i;e&&(t.stroke.color=null!==(n=e.color)&&void 0!==n?n:t.stroke.color,t.stroke.width=null!==(i=e.width)&&void 0!==i?i:t.stroke.width)}static convertFont(t,e){var n,i;e&&(t.font.color=null!==(n=e.color)&&void 0!==n?n:t.font.color,t.font.size=null!==(i=e.size)&&void 0!==i?i:t.font.size)}}function newGraphCellUpdater(t){return new GraphCellUpdater(t,new OverlayConverter)}class GraphCellUpdater{constructor(t,e){this.graph=t,this.overlayConverter=e}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(messageFowIconId(t),e)}updateAndRefreshCssClassesOfElement(t,e){var n;const i=this.graph.getModel().getCell(t);if(!i)return;const s=this.graph.getView().getState(i);s.style[BpmnStyleIdentifier.EXTRA_CSS_CLASSES]=e,s.shape.redraw(),null===(n=s.text)||void 0===n||n.redraw()}addOverlays(t,e){const n=this.graph.getModel().getCell(t);n&&ensureIsArray(e).forEach((t=>{const e=new MxGraphCustomOverlay(t.label,this.overlayConverter.convert(t));this.graph.addCellOverlay(n,e)}))}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);e&&this.graph.removeCellOverlays(e)}}class BpmnQuerySelectors{constructor(t){this.containerId=t}element(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function newBpmnElementsRegistry(t,e){var n;return new BpmnElementsRegistry(t,new HtmlElementRegistry(new BpmnQuerySelectors(null===(n=e.container)||void 0===n?void 0:n.id)),new CssRegistry,newGraphCellUpdater(e))}class BpmnElementsRegistry{constructor(t,e,n,i){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=n,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(this.cssRegistry.clear.bind(this.cssRegistry))}getElementsByIds(t){return ensureIsArray(t).map((t=>this.bpmnModelRegistry.getBpmnSemantic(t))).filter(Boolean).map((t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)})))}getElementsByKinds(t){return ensureIsArray(t).map((t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map((t=>({htmlElement:t,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(t.getAttribute("data-bpmn-id"))}))))).reduce(((t,e)=>(t.push(...e),t)),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,n){const i=ensureIsArray(e);ensureIsArray(t).forEach((t=>this.updateCellIfChanged(n(t,i),t)))}updateCellIfChanged(t,e){if(t){const t=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,t)}}addOverlays(t,e){this.graphCellUpdater.addOverlays(t,e)}removeAllOverlays(t){this.graphCellUpdater.removeAllOverlays(t)}}class HtmlElementRegistry{constructor(t){this.querySelectors=t}getBpmnHtmlElement(t){return document.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(computeBpmnBaseClassName(t));return[...document.querySelectorAll(e)]}}class BpmnModelRegistry{load(t){var e;return this.searchableModel=new SearchableModel(t),null===(e=this.onLoadCallback)||void 0===e||e.call(this),toRenderedModel(t)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const n=e.bpmnElement,i=n instanceof ShapeBpmnElement;return{id:t,name:n.name,isShape:i,kind:n.kind}}}function toRenderedModel(t){const e=t.flowNodes.filter((t=>{const e=t.bpmnElement;return ShapeUtil.isSubProcess(e.kind)&&e.markers.includes(exports.ShapeBpmnMarkerKind.EXPAND)})).map((t=>t.bpmnElement.id)),n=[],i=[],s=[];return t.flowNodes.forEach((t=>{const r=t.bpmnElement.kind;ShapeUtil.isSubProcess(r)?n.push(t):ShapeUtil.isBoundaryEvent(r)?i.push(t):e.includes(t.bpmnElement.parentId)||s.push(t)})),{boundaryEvents:i,edges:t.edges,lanes:t.lanes,otherFlowNodes:s,pools:t.pools,subprocesses:n}}class SearchableModel{constructor(t){this.elements=new Map,[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach((t=>this.elements.set(t.bpmnElement.id,t)))}elementById(t){return this.elements.get(t)}}function htmlElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}const libVersion="0.23.1",version=()=>({lib:libVersion,dependencies:new Map([["mxGraph",mxgraph.mxClient.VERSION]])});class BpmnVisualization{constructor(t){const e=new GraphConfigurator(htmlElement(null==t?void 0:t.container));this.graph=e.configure(t),this.bpmnModelRegistry=new BpmnModelRegistry,this.bpmnElementsRegistry=newBpmnElementsRegistry(this.bpmnModelRegistry,this.graph)}load(t,e){const n=newBpmnParser().parse(t),i=this.bpmnModelRegistry.load(n);newBpmnRenderer(this.graph).render(i,e)}fit(t){this.graph.customFit(t)}getVersion(){return version()}}return exports.BpmnCanvas=BpmnCanvas,exports.BpmnElementsRegistry=BpmnElementsRegistry,exports.BpmnStyleIdentifier=BpmnStyleIdentifier,exports.BpmnVisualization=BpmnVisualization,exports.IconPainter=IconPainter,exports.IconPainterProvider=IconPainterProvider,exports.MarkerIdentifier=MarkerIdentifier,exports.ShapeUtil=ShapeUtil,exports.StyleConfigurator=StyleConfigurator,exports.StyleUtils=StyleUtils,Object.defineProperty(exports,"__esModule",{value:!0}),exports}({});
